Skip to main content

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 gtype;
25extern crate lazy_static;
26extern crate reqwest;
27extern crate rpc;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// Backup runs delete request.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct SqlBackupRunsDeleteRequest {
43    /// The ID of the backup run to delete. To find a backup run ID, use the
44    /// [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/backupRuns/list)
45    /// method.
46    pub id: i64,
47
48    /// Cloud SQL instance ID. This does not include the project ID.
49    pub instance: std::string::String,
50
51    /// Project ID of the project that contains the instance.
52    pub project: std::string::String,
53
54    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
55}
56
57impl SqlBackupRunsDeleteRequest {
58    pub fn new() -> Self {
59        std::default::Default::default()
60    }
61
62    /// Sets the value of [id][crate::model::SqlBackupRunsDeleteRequest::id].
63    ///
64    /// # Example
65    /// ```ignore,no_run
66    /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
67    /// let x = SqlBackupRunsDeleteRequest::new().set_id(42);
68    /// ```
69    pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
70        self.id = v.into();
71        self
72    }
73
74    /// Sets the value of [instance][crate::model::SqlBackupRunsDeleteRequest::instance].
75    ///
76    /// # Example
77    /// ```ignore,no_run
78    /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
79    /// let x = SqlBackupRunsDeleteRequest::new().set_instance("example");
80    /// ```
81    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
82        self.instance = v.into();
83        self
84    }
85
86    /// Sets the value of [project][crate::model::SqlBackupRunsDeleteRequest::project].
87    ///
88    /// # Example
89    /// ```ignore,no_run
90    /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
91    /// let x = SqlBackupRunsDeleteRequest::new().set_project("example");
92    /// ```
93    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
94        self.project = v.into();
95        self
96    }
97}
98
99impl wkt::message::Message for SqlBackupRunsDeleteRequest {
100    fn typename() -> &'static str {
101        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsDeleteRequest"
102    }
103}
104
105/// Backup runs get request.
106#[derive(Clone, Default, PartialEq)]
107#[non_exhaustive]
108pub struct SqlBackupRunsGetRequest {
109    /// The ID of this backup run.
110    pub id: i64,
111
112    /// Cloud SQL instance ID. This does not include the project ID.
113    pub instance: std::string::String,
114
115    /// Project ID of the project that contains the instance.
116    pub project: std::string::String,
117
118    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
119}
120
121impl SqlBackupRunsGetRequest {
122    pub fn new() -> Self {
123        std::default::Default::default()
124    }
125
126    /// Sets the value of [id][crate::model::SqlBackupRunsGetRequest::id].
127    ///
128    /// # Example
129    /// ```ignore,no_run
130    /// # use google_cloud_sql_v1::model::SqlBackupRunsGetRequest;
131    /// let x = SqlBackupRunsGetRequest::new().set_id(42);
132    /// ```
133    pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
134        self.id = v.into();
135        self
136    }
137
138    /// Sets the value of [instance][crate::model::SqlBackupRunsGetRequest::instance].
139    ///
140    /// # Example
141    /// ```ignore,no_run
142    /// # use google_cloud_sql_v1::model::SqlBackupRunsGetRequest;
143    /// let x = SqlBackupRunsGetRequest::new().set_instance("example");
144    /// ```
145    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
146        self.instance = v.into();
147        self
148    }
149
150    /// Sets the value of [project][crate::model::SqlBackupRunsGetRequest::project].
151    ///
152    /// # Example
153    /// ```ignore,no_run
154    /// # use google_cloud_sql_v1::model::SqlBackupRunsGetRequest;
155    /// let x = SqlBackupRunsGetRequest::new().set_project("example");
156    /// ```
157    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
158        self.project = v.into();
159        self
160    }
161}
162
163impl wkt::message::Message for SqlBackupRunsGetRequest {
164    fn typename() -> &'static str {
165        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsGetRequest"
166    }
167}
168
169/// Backup runs insert request.
170#[derive(Clone, Default, PartialEq)]
171#[non_exhaustive]
172pub struct SqlBackupRunsInsertRequest {
173    /// Cloud SQL instance ID. This does not include the project ID.
174    pub instance: std::string::String,
175
176    /// Project ID of the project that contains the instance.
177    pub project: std::string::String,
178
179    pub body: std::option::Option<crate::model::BackupRun>,
180
181    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
182}
183
184impl SqlBackupRunsInsertRequest {
185    pub fn new() -> Self {
186        std::default::Default::default()
187    }
188
189    /// Sets the value of [instance][crate::model::SqlBackupRunsInsertRequest::instance].
190    ///
191    /// # Example
192    /// ```ignore,no_run
193    /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
194    /// let x = SqlBackupRunsInsertRequest::new().set_instance("example");
195    /// ```
196    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
197        self.instance = v.into();
198        self
199    }
200
201    /// Sets the value of [project][crate::model::SqlBackupRunsInsertRequest::project].
202    ///
203    /// # Example
204    /// ```ignore,no_run
205    /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
206    /// let x = SqlBackupRunsInsertRequest::new().set_project("example");
207    /// ```
208    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
209        self.project = v.into();
210        self
211    }
212
213    /// Sets the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
214    ///
215    /// # Example
216    /// ```ignore,no_run
217    /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
218    /// use google_cloud_sql_v1::model::BackupRun;
219    /// let x = SqlBackupRunsInsertRequest::new().set_body(BackupRun::default()/* use setters */);
220    /// ```
221    pub fn set_body<T>(mut self, v: T) -> Self
222    where
223        T: std::convert::Into<crate::model::BackupRun>,
224    {
225        self.body = std::option::Option::Some(v.into());
226        self
227    }
228
229    /// Sets or clears the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
230    ///
231    /// # Example
232    /// ```ignore,no_run
233    /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
234    /// use google_cloud_sql_v1::model::BackupRun;
235    /// let x = SqlBackupRunsInsertRequest::new().set_or_clear_body(Some(BackupRun::default()/* use setters */));
236    /// let x = SqlBackupRunsInsertRequest::new().set_or_clear_body(None::<BackupRun>);
237    /// ```
238    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
239    where
240        T: std::convert::Into<crate::model::BackupRun>,
241    {
242        self.body = v.map(|x| x.into());
243        self
244    }
245}
246
247impl wkt::message::Message for SqlBackupRunsInsertRequest {
248    fn typename() -> &'static str {
249        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsInsertRequest"
250    }
251}
252
253/// Backup runs list request.
254#[derive(Clone, Default, PartialEq)]
255#[non_exhaustive]
256pub struct SqlBackupRunsListRequest {
257    /// Cloud SQL instance ID, or "-" for all instances. This does not include
258    /// the project ID.
259    pub instance: std::string::String,
260
261    /// Maximum number of backup runs per response.
262    pub max_results: i32,
263
264    /// A previously-returned page token representing part of the larger set of
265    /// results to view.
266    pub page_token: std::string::String,
267
268    /// Project ID of the project that contains the instance.
269    pub project: std::string::String,
270
271    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
272}
273
274impl SqlBackupRunsListRequest {
275    pub fn new() -> Self {
276        std::default::Default::default()
277    }
278
279    /// Sets the value of [instance][crate::model::SqlBackupRunsListRequest::instance].
280    ///
281    /// # Example
282    /// ```ignore,no_run
283    /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
284    /// let x = SqlBackupRunsListRequest::new().set_instance("example");
285    /// ```
286    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
287        self.instance = v.into();
288        self
289    }
290
291    /// Sets the value of [max_results][crate::model::SqlBackupRunsListRequest::max_results].
292    ///
293    /// # Example
294    /// ```ignore,no_run
295    /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
296    /// let x = SqlBackupRunsListRequest::new().set_max_results(42);
297    /// ```
298    pub fn set_max_results<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
299        self.max_results = v.into();
300        self
301    }
302
303    /// Sets the value of [page_token][crate::model::SqlBackupRunsListRequest::page_token].
304    ///
305    /// # Example
306    /// ```ignore,no_run
307    /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
308    /// let x = SqlBackupRunsListRequest::new().set_page_token("example");
309    /// ```
310    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
311        self.page_token = v.into();
312        self
313    }
314
315    /// Sets the value of [project][crate::model::SqlBackupRunsListRequest::project].
316    ///
317    /// # Example
318    /// ```ignore,no_run
319    /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
320    /// let x = SqlBackupRunsListRequest::new().set_project("example");
321    /// ```
322    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
323        self.project = v.into();
324        self
325    }
326}
327
328impl wkt::message::Message for SqlBackupRunsListRequest {
329    fn typename() -> &'static str {
330        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsListRequest"
331    }
332}
333
334/// A BackupRun resource.
335#[derive(Clone, Default, PartialEq)]
336#[non_exhaustive]
337pub struct BackupRun {
338    /// This is always `sql#backupRun`.
339    pub kind: std::string::String,
340
341    /// The status of this run.
342    pub status: crate::model::SqlBackupRunStatus,
343
344    /// The time the run was enqueued in UTC timezone in
345    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
346    /// `2012-11-15T16:19:00.094Z`.
347    pub enqueued_time: std::option::Option<wkt::Timestamp>,
348
349    /// The identifier for this backup run. Unique only for a specific Cloud SQL
350    /// instance.
351    pub id: i64,
352
353    /// The time the backup operation actually started in UTC timezone in
354    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
355    /// `2012-11-15T16:19:00.094Z`.
356    pub start_time: std::option::Option<wkt::Timestamp>,
357
358    /// The time the backup operation completed in UTC timezone in
359    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
360    /// `2012-11-15T16:19:00.094Z`.
361    pub end_time: std::option::Option<wkt::Timestamp>,
362
363    /// Information about why the backup operation failed. This is only present if
364    /// the run has the FAILED status.
365    pub error: std::option::Option<crate::model::OperationError>,
366
367    /// The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
368    /// This field defaults to "ON_DEMAND" and is ignored, when specified for
369    /// insert requests.
370    pub r#type: crate::model::SqlBackupRunType,
371
372    /// The description of this run, only applicable to on-demand backups.
373    pub description: std::string::String,
374
375    /// The start time of the backup window during which this the backup was
376    /// attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
377    /// example `2012-11-15T16:19:00.094Z`.
378    pub window_start_time: std::option::Option<wkt::Timestamp>,
379
380    /// Name of the database instance.
381    pub instance: std::string::String,
382
383    /// The URI of this resource.
384    pub self_link: std::string::String,
385
386    /// Location of the backups.
387    pub location: std::string::String,
388
389    /// Output only. The instance database version at the time this backup was
390    /// made.
391    pub database_version: crate::model::SqlDatabaseVersion,
392
393    /// Encryption configuration specific to a backup.
394    pub disk_encryption_configuration:
395        std::option::Option<crate::model::DiskEncryptionConfiguration>,
396
397    /// Encryption status specific to a backup.
398    pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
399
400    /// Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
401    pub backup_kind: crate::model::SqlBackupKind,
402
403    /// Backup time zone to prevent restores to an instance with
404    /// a different time zone. Now relevant only for SQL Server.
405    pub time_zone: std::string::String,
406
407    /// Output only. The maximum chargeable bytes for the backup.
408    pub max_chargeable_bytes: std::option::Option<i64>,
409
410    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
411}
412
413impl BackupRun {
414    pub fn new() -> Self {
415        std::default::Default::default()
416    }
417
418    /// Sets the value of [kind][crate::model::BackupRun::kind].
419    ///
420    /// # Example
421    /// ```ignore,no_run
422    /// # use google_cloud_sql_v1::model::BackupRun;
423    /// let x = BackupRun::new().set_kind("example");
424    /// ```
425    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
426        self.kind = v.into();
427        self
428    }
429
430    /// Sets the value of [status][crate::model::BackupRun::status].
431    ///
432    /// # Example
433    /// ```ignore,no_run
434    /// # use google_cloud_sql_v1::model::BackupRun;
435    /// use google_cloud_sql_v1::model::SqlBackupRunStatus;
436    /// let x0 = BackupRun::new().set_status(SqlBackupRunStatus::Enqueued);
437    /// let x1 = BackupRun::new().set_status(SqlBackupRunStatus::Overdue);
438    /// let x2 = BackupRun::new().set_status(SqlBackupRunStatus::Running);
439    /// ```
440    pub fn set_status<T: std::convert::Into<crate::model::SqlBackupRunStatus>>(
441        mut self,
442        v: T,
443    ) -> Self {
444        self.status = v.into();
445        self
446    }
447
448    /// Sets the value of [enqueued_time][crate::model::BackupRun::enqueued_time].
449    ///
450    /// # Example
451    /// ```ignore,no_run
452    /// # use google_cloud_sql_v1::model::BackupRun;
453    /// use wkt::Timestamp;
454    /// let x = BackupRun::new().set_enqueued_time(Timestamp::default()/* use setters */);
455    /// ```
456    pub fn set_enqueued_time<T>(mut self, v: T) -> Self
457    where
458        T: std::convert::Into<wkt::Timestamp>,
459    {
460        self.enqueued_time = std::option::Option::Some(v.into());
461        self
462    }
463
464    /// Sets or clears the value of [enqueued_time][crate::model::BackupRun::enqueued_time].
465    ///
466    /// # Example
467    /// ```ignore,no_run
468    /// # use google_cloud_sql_v1::model::BackupRun;
469    /// use wkt::Timestamp;
470    /// let x = BackupRun::new().set_or_clear_enqueued_time(Some(Timestamp::default()/* use setters */));
471    /// let x = BackupRun::new().set_or_clear_enqueued_time(None::<Timestamp>);
472    /// ```
473    pub fn set_or_clear_enqueued_time<T>(mut self, v: std::option::Option<T>) -> Self
474    where
475        T: std::convert::Into<wkt::Timestamp>,
476    {
477        self.enqueued_time = v.map(|x| x.into());
478        self
479    }
480
481    /// Sets the value of [id][crate::model::BackupRun::id].
482    ///
483    /// # Example
484    /// ```ignore,no_run
485    /// # use google_cloud_sql_v1::model::BackupRun;
486    /// let x = BackupRun::new().set_id(42);
487    /// ```
488    pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
489        self.id = v.into();
490        self
491    }
492
493    /// Sets the value of [start_time][crate::model::BackupRun::start_time].
494    ///
495    /// # Example
496    /// ```ignore,no_run
497    /// # use google_cloud_sql_v1::model::BackupRun;
498    /// use wkt::Timestamp;
499    /// let x = BackupRun::new().set_start_time(Timestamp::default()/* use setters */);
500    /// ```
501    pub fn set_start_time<T>(mut self, v: T) -> Self
502    where
503        T: std::convert::Into<wkt::Timestamp>,
504    {
505        self.start_time = std::option::Option::Some(v.into());
506        self
507    }
508
509    /// Sets or clears the value of [start_time][crate::model::BackupRun::start_time].
510    ///
511    /// # Example
512    /// ```ignore,no_run
513    /// # use google_cloud_sql_v1::model::BackupRun;
514    /// use wkt::Timestamp;
515    /// let x = BackupRun::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
516    /// let x = BackupRun::new().set_or_clear_start_time(None::<Timestamp>);
517    /// ```
518    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
519    where
520        T: std::convert::Into<wkt::Timestamp>,
521    {
522        self.start_time = v.map(|x| x.into());
523        self
524    }
525
526    /// Sets the value of [end_time][crate::model::BackupRun::end_time].
527    ///
528    /// # Example
529    /// ```ignore,no_run
530    /// # use google_cloud_sql_v1::model::BackupRun;
531    /// use wkt::Timestamp;
532    /// let x = BackupRun::new().set_end_time(Timestamp::default()/* use setters */);
533    /// ```
534    pub fn set_end_time<T>(mut self, v: T) -> Self
535    where
536        T: std::convert::Into<wkt::Timestamp>,
537    {
538        self.end_time = std::option::Option::Some(v.into());
539        self
540    }
541
542    /// Sets or clears the value of [end_time][crate::model::BackupRun::end_time].
543    ///
544    /// # Example
545    /// ```ignore,no_run
546    /// # use google_cloud_sql_v1::model::BackupRun;
547    /// use wkt::Timestamp;
548    /// let x = BackupRun::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
549    /// let x = BackupRun::new().set_or_clear_end_time(None::<Timestamp>);
550    /// ```
551    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
552    where
553        T: std::convert::Into<wkt::Timestamp>,
554    {
555        self.end_time = v.map(|x| x.into());
556        self
557    }
558
559    /// Sets the value of [error][crate::model::BackupRun::error].
560    ///
561    /// # Example
562    /// ```ignore,no_run
563    /// # use google_cloud_sql_v1::model::BackupRun;
564    /// use google_cloud_sql_v1::model::OperationError;
565    /// let x = BackupRun::new().set_error(OperationError::default()/* use setters */);
566    /// ```
567    pub fn set_error<T>(mut self, v: T) -> Self
568    where
569        T: std::convert::Into<crate::model::OperationError>,
570    {
571        self.error = std::option::Option::Some(v.into());
572        self
573    }
574
575    /// Sets or clears the value of [error][crate::model::BackupRun::error].
576    ///
577    /// # Example
578    /// ```ignore,no_run
579    /// # use google_cloud_sql_v1::model::BackupRun;
580    /// use google_cloud_sql_v1::model::OperationError;
581    /// let x = BackupRun::new().set_or_clear_error(Some(OperationError::default()/* use setters */));
582    /// let x = BackupRun::new().set_or_clear_error(None::<OperationError>);
583    /// ```
584    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
585    where
586        T: std::convert::Into<crate::model::OperationError>,
587    {
588        self.error = v.map(|x| x.into());
589        self
590    }
591
592    /// Sets the value of [r#type][crate::model::BackupRun::type].
593    ///
594    /// # Example
595    /// ```ignore,no_run
596    /// # use google_cloud_sql_v1::model::BackupRun;
597    /// use google_cloud_sql_v1::model::SqlBackupRunType;
598    /// let x0 = BackupRun::new().set_type(SqlBackupRunType::Automated);
599    /// let x1 = BackupRun::new().set_type(SqlBackupRunType::OnDemand);
600    /// ```
601    pub fn set_type<T: std::convert::Into<crate::model::SqlBackupRunType>>(mut self, v: T) -> Self {
602        self.r#type = v.into();
603        self
604    }
605
606    /// Sets the value of [description][crate::model::BackupRun::description].
607    ///
608    /// # Example
609    /// ```ignore,no_run
610    /// # use google_cloud_sql_v1::model::BackupRun;
611    /// let x = BackupRun::new().set_description("example");
612    /// ```
613    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
614        self.description = v.into();
615        self
616    }
617
618    /// Sets the value of [window_start_time][crate::model::BackupRun::window_start_time].
619    ///
620    /// # Example
621    /// ```ignore,no_run
622    /// # use google_cloud_sql_v1::model::BackupRun;
623    /// use wkt::Timestamp;
624    /// let x = BackupRun::new().set_window_start_time(Timestamp::default()/* use setters */);
625    /// ```
626    pub fn set_window_start_time<T>(mut self, v: T) -> Self
627    where
628        T: std::convert::Into<wkt::Timestamp>,
629    {
630        self.window_start_time = std::option::Option::Some(v.into());
631        self
632    }
633
634    /// Sets or clears the value of [window_start_time][crate::model::BackupRun::window_start_time].
635    ///
636    /// # Example
637    /// ```ignore,no_run
638    /// # use google_cloud_sql_v1::model::BackupRun;
639    /// use wkt::Timestamp;
640    /// let x = BackupRun::new().set_or_clear_window_start_time(Some(Timestamp::default()/* use setters */));
641    /// let x = BackupRun::new().set_or_clear_window_start_time(None::<Timestamp>);
642    /// ```
643    pub fn set_or_clear_window_start_time<T>(mut self, v: std::option::Option<T>) -> Self
644    where
645        T: std::convert::Into<wkt::Timestamp>,
646    {
647        self.window_start_time = v.map(|x| x.into());
648        self
649    }
650
651    /// Sets the value of [instance][crate::model::BackupRun::instance].
652    ///
653    /// # Example
654    /// ```ignore,no_run
655    /// # use google_cloud_sql_v1::model::BackupRun;
656    /// let x = BackupRun::new().set_instance("example");
657    /// ```
658    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
659        self.instance = v.into();
660        self
661    }
662
663    /// Sets the value of [self_link][crate::model::BackupRun::self_link].
664    ///
665    /// # Example
666    /// ```ignore,no_run
667    /// # use google_cloud_sql_v1::model::BackupRun;
668    /// let x = BackupRun::new().set_self_link("example");
669    /// ```
670    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
671        self.self_link = v.into();
672        self
673    }
674
675    /// Sets the value of [location][crate::model::BackupRun::location].
676    ///
677    /// # Example
678    /// ```ignore,no_run
679    /// # use google_cloud_sql_v1::model::BackupRun;
680    /// let x = BackupRun::new().set_location("example");
681    /// ```
682    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
683        self.location = v.into();
684        self
685    }
686
687    /// Sets the value of [database_version][crate::model::BackupRun::database_version].
688    ///
689    /// # Example
690    /// ```ignore,no_run
691    /// # use google_cloud_sql_v1::model::BackupRun;
692    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
693    /// let x0 = BackupRun::new().set_database_version(SqlDatabaseVersion::Mysql56);
694    /// let x1 = BackupRun::new().set_database_version(SqlDatabaseVersion::Mysql57);
695    /// let x2 = BackupRun::new().set_database_version(SqlDatabaseVersion::Mysql80);
696    /// ```
697    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
698        mut self,
699        v: T,
700    ) -> Self {
701        self.database_version = v.into();
702        self
703    }
704
705    /// Sets the value of [disk_encryption_configuration][crate::model::BackupRun::disk_encryption_configuration].
706    ///
707    /// # Example
708    /// ```ignore,no_run
709    /// # use google_cloud_sql_v1::model::BackupRun;
710    /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
711    /// let x = BackupRun::new().set_disk_encryption_configuration(DiskEncryptionConfiguration::default()/* use setters */);
712    /// ```
713    pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
714    where
715        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
716    {
717        self.disk_encryption_configuration = std::option::Option::Some(v.into());
718        self
719    }
720
721    /// Sets or clears the value of [disk_encryption_configuration][crate::model::BackupRun::disk_encryption_configuration].
722    ///
723    /// # Example
724    /// ```ignore,no_run
725    /// # use google_cloud_sql_v1::model::BackupRun;
726    /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
727    /// let x = BackupRun::new().set_or_clear_disk_encryption_configuration(Some(DiskEncryptionConfiguration::default()/* use setters */));
728    /// let x = BackupRun::new().set_or_clear_disk_encryption_configuration(None::<DiskEncryptionConfiguration>);
729    /// ```
730    pub fn set_or_clear_disk_encryption_configuration<T>(
731        mut self,
732        v: std::option::Option<T>,
733    ) -> Self
734    where
735        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
736    {
737        self.disk_encryption_configuration = v.map(|x| x.into());
738        self
739    }
740
741    /// Sets the value of [disk_encryption_status][crate::model::BackupRun::disk_encryption_status].
742    ///
743    /// # Example
744    /// ```ignore,no_run
745    /// # use google_cloud_sql_v1::model::BackupRun;
746    /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
747    /// let x = BackupRun::new().set_disk_encryption_status(DiskEncryptionStatus::default()/* use setters */);
748    /// ```
749    pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
750    where
751        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
752    {
753        self.disk_encryption_status = std::option::Option::Some(v.into());
754        self
755    }
756
757    /// Sets or clears the value of [disk_encryption_status][crate::model::BackupRun::disk_encryption_status].
758    ///
759    /// # Example
760    /// ```ignore,no_run
761    /// # use google_cloud_sql_v1::model::BackupRun;
762    /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
763    /// let x = BackupRun::new().set_or_clear_disk_encryption_status(Some(DiskEncryptionStatus::default()/* use setters */));
764    /// let x = BackupRun::new().set_or_clear_disk_encryption_status(None::<DiskEncryptionStatus>);
765    /// ```
766    pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
767    where
768        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
769    {
770        self.disk_encryption_status = v.map(|x| x.into());
771        self
772    }
773
774    /// Sets the value of [backup_kind][crate::model::BackupRun::backup_kind].
775    ///
776    /// # Example
777    /// ```ignore,no_run
778    /// # use google_cloud_sql_v1::model::BackupRun;
779    /// use google_cloud_sql_v1::model::SqlBackupKind;
780    /// let x0 = BackupRun::new().set_backup_kind(SqlBackupKind::Snapshot);
781    /// let x1 = BackupRun::new().set_backup_kind(SqlBackupKind::Physical);
782    /// ```
783    pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
784        mut self,
785        v: T,
786    ) -> Self {
787        self.backup_kind = v.into();
788        self
789    }
790
791    /// Sets the value of [time_zone][crate::model::BackupRun::time_zone].
792    ///
793    /// # Example
794    /// ```ignore,no_run
795    /// # use google_cloud_sql_v1::model::BackupRun;
796    /// let x = BackupRun::new().set_time_zone("example");
797    /// ```
798    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
799        self.time_zone = v.into();
800        self
801    }
802
803    /// Sets the value of [max_chargeable_bytes][crate::model::BackupRun::max_chargeable_bytes].
804    ///
805    /// # Example
806    /// ```ignore,no_run
807    /// # use google_cloud_sql_v1::model::BackupRun;
808    /// let x = BackupRun::new().set_max_chargeable_bytes(42);
809    /// ```
810    pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
811    where
812        T: std::convert::Into<i64>,
813    {
814        self.max_chargeable_bytes = std::option::Option::Some(v.into());
815        self
816    }
817
818    /// Sets or clears the value of [max_chargeable_bytes][crate::model::BackupRun::max_chargeable_bytes].
819    ///
820    /// # Example
821    /// ```ignore,no_run
822    /// # use google_cloud_sql_v1::model::BackupRun;
823    /// let x = BackupRun::new().set_or_clear_max_chargeable_bytes(Some(42));
824    /// let x = BackupRun::new().set_or_clear_max_chargeable_bytes(None::<i32>);
825    /// ```
826    pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
827    where
828        T: std::convert::Into<i64>,
829    {
830        self.max_chargeable_bytes = v.map(|x| x.into());
831        self
832    }
833}
834
835impl wkt::message::Message for BackupRun {
836    fn typename() -> &'static str {
837        "type.googleapis.com/google.cloud.sql.v1.BackupRun"
838    }
839}
840
841/// Backup run list results.
842#[derive(Clone, Default, PartialEq)]
843#[non_exhaustive]
844pub struct BackupRunsListResponse {
845    /// This is always `sql#backupRunsList`.
846    pub kind: std::string::String,
847
848    /// A list of backup runs in reverse chronological order of the enqueued time.
849    pub items: std::vec::Vec<crate::model::BackupRun>,
850
851    /// The continuation token, used to page through large result sets. Provide
852    /// this value in a subsequent request to return the next page of results.
853    pub next_page_token: std::string::String,
854
855    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
856}
857
858impl BackupRunsListResponse {
859    pub fn new() -> Self {
860        std::default::Default::default()
861    }
862
863    /// Sets the value of [kind][crate::model::BackupRunsListResponse::kind].
864    ///
865    /// # Example
866    /// ```ignore,no_run
867    /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
868    /// let x = BackupRunsListResponse::new().set_kind("example");
869    /// ```
870    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
871        self.kind = v.into();
872        self
873    }
874
875    /// Sets the value of [items][crate::model::BackupRunsListResponse::items].
876    ///
877    /// # Example
878    /// ```ignore,no_run
879    /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
880    /// use google_cloud_sql_v1::model::BackupRun;
881    /// let x = BackupRunsListResponse::new()
882    ///     .set_items([
883    ///         BackupRun::default()/* use setters */,
884    ///         BackupRun::default()/* use (different) setters */,
885    ///     ]);
886    /// ```
887    pub fn set_items<T, V>(mut self, v: T) -> Self
888    where
889        T: std::iter::IntoIterator<Item = V>,
890        V: std::convert::Into<crate::model::BackupRun>,
891    {
892        use std::iter::Iterator;
893        self.items = v.into_iter().map(|i| i.into()).collect();
894        self
895    }
896
897    /// Sets the value of [next_page_token][crate::model::BackupRunsListResponse::next_page_token].
898    ///
899    /// # Example
900    /// ```ignore,no_run
901    /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
902    /// let x = BackupRunsListResponse::new().set_next_page_token("example");
903    /// ```
904    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
905        self.next_page_token = v.into();
906        self
907    }
908}
909
910impl wkt::message::Message for BackupRunsListResponse {
911    fn typename() -> &'static str {
912        "type.googleapis.com/google.cloud.sql.v1.BackupRunsListResponse"
913    }
914}
915
916#[doc(hidden)]
917impl gax::paginator::internal::PageableResponse for BackupRunsListResponse {
918    type PageItem = crate::model::BackupRun;
919
920    fn items(self) -> std::vec::Vec<Self::PageItem> {
921        self.items
922    }
923
924    fn next_page_token(&self) -> std::string::String {
925        use std::clone::Clone;
926        self.next_page_token.clone()
927    }
928}
929
930/// The request payload to create the backup
931#[derive(Clone, Default, PartialEq)]
932#[non_exhaustive]
933pub struct CreateBackupRequest {
934    /// Required. The parent resource where this backup is created.
935    /// Format: projects/{project}
936    pub parent: std::string::String,
937
938    /// Required. The Backup to create.
939    pub backup: std::option::Option<crate::model::Backup>,
940
941    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
942}
943
944impl CreateBackupRequest {
945    pub fn new() -> Self {
946        std::default::Default::default()
947    }
948
949    /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
950    ///
951    /// # Example
952    /// ```ignore,no_run
953    /// # use google_cloud_sql_v1::model::CreateBackupRequest;
954    /// let x = CreateBackupRequest::new().set_parent("example");
955    /// ```
956    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
957        self.parent = v.into();
958        self
959    }
960
961    /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
962    ///
963    /// # Example
964    /// ```ignore,no_run
965    /// # use google_cloud_sql_v1::model::CreateBackupRequest;
966    /// use google_cloud_sql_v1::model::Backup;
967    /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
968    /// ```
969    pub fn set_backup<T>(mut self, v: T) -> Self
970    where
971        T: std::convert::Into<crate::model::Backup>,
972    {
973        self.backup = std::option::Option::Some(v.into());
974        self
975    }
976
977    /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
978    ///
979    /// # Example
980    /// ```ignore,no_run
981    /// # use google_cloud_sql_v1::model::CreateBackupRequest;
982    /// use google_cloud_sql_v1::model::Backup;
983    /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
984    /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
985    /// ```
986    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
987    where
988        T: std::convert::Into<crate::model::Backup>,
989    {
990        self.backup = v.map(|x| x.into());
991        self
992    }
993}
994
995impl wkt::message::Message for CreateBackupRequest {
996    fn typename() -> &'static str {
997        "type.googleapis.com/google.cloud.sql.v1.CreateBackupRequest"
998    }
999}
1000
1001/// The request payload to get the backup.
1002#[derive(Clone, Default, PartialEq)]
1003#[non_exhaustive]
1004pub struct GetBackupRequest {
1005    /// Required. The name of the backup to retrieve.
1006    /// Format: projects/{project}/backups/{backup}
1007    pub name: std::string::String,
1008
1009    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1010}
1011
1012impl GetBackupRequest {
1013    pub fn new() -> Self {
1014        std::default::Default::default()
1015    }
1016
1017    /// Sets the value of [name][crate::model::GetBackupRequest::name].
1018    ///
1019    /// # Example
1020    /// ```ignore,no_run
1021    /// # use google_cloud_sql_v1::model::GetBackupRequest;
1022    /// let x = GetBackupRequest::new().set_name("example");
1023    /// ```
1024    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1025        self.name = v.into();
1026        self
1027    }
1028}
1029
1030impl wkt::message::Message for GetBackupRequest {
1031    fn typename() -> &'static str {
1032        "type.googleapis.com/google.cloud.sql.v1.GetBackupRequest"
1033    }
1034}
1035
1036/// The request payload to list the backups.
1037#[derive(Clone, Default, PartialEq)]
1038#[non_exhaustive]
1039pub struct ListBackupsRequest {
1040    /// Required. The parent that owns this collection of backups.
1041    /// Format: projects/{project}
1042    pub parent: std::string::String,
1043
1044    /// The maximum number of backups to return per response. The service might
1045    /// return fewer backups than this value. If a value for this parameter isn't
1046    /// specified, then, at most, 500 backups are returned. The maximum value is
1047    /// 2,000. Any values that you set, which are greater than 2,000, are changed
1048    /// to 2,000.
1049    pub page_size: i32,
1050
1051    /// A page token, received from a previous `ListBackups` call.
1052    /// Provide this to retrieve the subsequent page.
1053    ///
1054    /// When paginating, all other parameters provided to `ListBackups` must match
1055    /// the call that provided the page token.
1056    pub page_token: std::string::String,
1057
1058    /// Multiple filter queries are separated by spaces. For example,
1059    /// 'instance:abc AND type:FINAL, 'location:us',
1060    /// 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
1061    /// type, instance, backupInterval.startTime (creation time), or location.
1062    pub filter: std::string::String,
1063
1064    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1065}
1066
1067impl ListBackupsRequest {
1068    pub fn new() -> Self {
1069        std::default::Default::default()
1070    }
1071
1072    /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1073    ///
1074    /// # Example
1075    /// ```ignore,no_run
1076    /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1077    /// let x = ListBackupsRequest::new().set_parent("example");
1078    /// ```
1079    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1080        self.parent = v.into();
1081        self
1082    }
1083
1084    /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1085    ///
1086    /// # Example
1087    /// ```ignore,no_run
1088    /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1089    /// let x = ListBackupsRequest::new().set_page_size(42);
1090    /// ```
1091    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1092        self.page_size = v.into();
1093        self
1094    }
1095
1096    /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1097    ///
1098    /// # Example
1099    /// ```ignore,no_run
1100    /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1101    /// let x = ListBackupsRequest::new().set_page_token("example");
1102    /// ```
1103    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1104        self.page_token = v.into();
1105        self
1106    }
1107
1108    /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1109    ///
1110    /// # Example
1111    /// ```ignore,no_run
1112    /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1113    /// let x = ListBackupsRequest::new().set_filter("example");
1114    /// ```
1115    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1116        self.filter = v.into();
1117        self
1118    }
1119}
1120
1121impl wkt::message::Message for ListBackupsRequest {
1122    fn typename() -> &'static str {
1123        "type.googleapis.com/google.cloud.sql.v1.ListBackupsRequest"
1124    }
1125}
1126
1127/// The response payload containing a list of the backups.
1128#[derive(Clone, Default, PartialEq)]
1129#[non_exhaustive]
1130pub struct ListBackupsResponse {
1131    /// A list of backups.
1132    pub backups: std::vec::Vec<crate::model::Backup>,
1133
1134    /// A token, which can be sent as `page_token` to retrieve the next page.
1135    /// If this field is omitted, then there aren't subsequent pages.
1136    pub next_page_token: std::string::String,
1137
1138    /// If a region isn't unavailable or if an unknown error occurs, then a warning
1139    /// message is returned.
1140    pub warnings: std::vec::Vec<crate::model::ApiWarning>,
1141
1142    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1143}
1144
1145impl ListBackupsResponse {
1146    pub fn new() -> Self {
1147        std::default::Default::default()
1148    }
1149
1150    /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
1151    ///
1152    /// # Example
1153    /// ```ignore,no_run
1154    /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1155    /// use google_cloud_sql_v1::model::Backup;
1156    /// let x = ListBackupsResponse::new()
1157    ///     .set_backups([
1158    ///         Backup::default()/* use setters */,
1159    ///         Backup::default()/* use (different) setters */,
1160    ///     ]);
1161    /// ```
1162    pub fn set_backups<T, V>(mut self, v: T) -> Self
1163    where
1164        T: std::iter::IntoIterator<Item = V>,
1165        V: std::convert::Into<crate::model::Backup>,
1166    {
1167        use std::iter::Iterator;
1168        self.backups = v.into_iter().map(|i| i.into()).collect();
1169        self
1170    }
1171
1172    /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
1173    ///
1174    /// # Example
1175    /// ```ignore,no_run
1176    /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1177    /// let x = ListBackupsResponse::new().set_next_page_token("example");
1178    /// ```
1179    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1180        self.next_page_token = v.into();
1181        self
1182    }
1183
1184    /// Sets the value of [warnings][crate::model::ListBackupsResponse::warnings].
1185    ///
1186    /// # Example
1187    /// ```ignore,no_run
1188    /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1189    /// use google_cloud_sql_v1::model::ApiWarning;
1190    /// let x = ListBackupsResponse::new()
1191    ///     .set_warnings([
1192    ///         ApiWarning::default()/* use setters */,
1193    ///         ApiWarning::default()/* use (different) setters */,
1194    ///     ]);
1195    /// ```
1196    pub fn set_warnings<T, V>(mut self, v: T) -> Self
1197    where
1198        T: std::iter::IntoIterator<Item = V>,
1199        V: std::convert::Into<crate::model::ApiWarning>,
1200    {
1201        use std::iter::Iterator;
1202        self.warnings = v.into_iter().map(|i| i.into()).collect();
1203        self
1204    }
1205}
1206
1207impl wkt::message::Message for ListBackupsResponse {
1208    fn typename() -> &'static str {
1209        "type.googleapis.com/google.cloud.sql.v1.ListBackupsResponse"
1210    }
1211}
1212
1213#[doc(hidden)]
1214impl gax::paginator::internal::PageableResponse for ListBackupsResponse {
1215    type PageItem = crate::model::Backup;
1216
1217    fn items(self) -> std::vec::Vec<Self::PageItem> {
1218        self.backups
1219    }
1220
1221    fn next_page_token(&self) -> std::string::String {
1222        use std::clone::Clone;
1223        self.next_page_token.clone()
1224    }
1225}
1226
1227/// The request payload to update the backup.
1228#[derive(Clone, Default, PartialEq)]
1229#[non_exhaustive]
1230pub struct UpdateBackupRequest {
1231    /// Required. The backup to update.
1232    /// The backup’s `name` field is used to identify the backup to update.
1233    /// Format: projects/{project}/backups/{backup}
1234    pub backup: std::option::Option<crate::model::Backup>,
1235
1236    /// The list of fields that you can update. You can update only the description
1237    /// and retention period of the final backup.
1238    pub update_mask: std::option::Option<wkt::FieldMask>,
1239
1240    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1241}
1242
1243impl UpdateBackupRequest {
1244    pub fn new() -> Self {
1245        std::default::Default::default()
1246    }
1247
1248    /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
1249    ///
1250    /// # Example
1251    /// ```ignore,no_run
1252    /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1253    /// use google_cloud_sql_v1::model::Backup;
1254    /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
1255    /// ```
1256    pub fn set_backup<T>(mut self, v: T) -> Self
1257    where
1258        T: std::convert::Into<crate::model::Backup>,
1259    {
1260        self.backup = std::option::Option::Some(v.into());
1261        self
1262    }
1263
1264    /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
1265    ///
1266    /// # Example
1267    /// ```ignore,no_run
1268    /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1269    /// use google_cloud_sql_v1::model::Backup;
1270    /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
1271    /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
1272    /// ```
1273    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
1274    where
1275        T: std::convert::Into<crate::model::Backup>,
1276    {
1277        self.backup = v.map(|x| x.into());
1278        self
1279    }
1280
1281    /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
1282    ///
1283    /// # Example
1284    /// ```ignore,no_run
1285    /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1286    /// use wkt::FieldMask;
1287    /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1288    /// ```
1289    pub fn set_update_mask<T>(mut self, v: T) -> Self
1290    where
1291        T: std::convert::Into<wkt::FieldMask>,
1292    {
1293        self.update_mask = std::option::Option::Some(v.into());
1294        self
1295    }
1296
1297    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
1298    ///
1299    /// # Example
1300    /// ```ignore,no_run
1301    /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1302    /// use wkt::FieldMask;
1303    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1304    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1305    /// ```
1306    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1307    where
1308        T: std::convert::Into<wkt::FieldMask>,
1309    {
1310        self.update_mask = v.map(|x| x.into());
1311        self
1312    }
1313}
1314
1315impl wkt::message::Message for UpdateBackupRequest {
1316    fn typename() -> &'static str {
1317        "type.googleapis.com/google.cloud.sql.v1.UpdateBackupRequest"
1318    }
1319}
1320
1321/// The request payload to delete the backup.
1322#[derive(Clone, Default, PartialEq)]
1323#[non_exhaustive]
1324pub struct DeleteBackupRequest {
1325    /// Required. The name of the backup to delete.
1326    /// Format: projects/{project}/backups/{backup}
1327    pub name: std::string::String,
1328
1329    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1330}
1331
1332impl DeleteBackupRequest {
1333    pub fn new() -> Self {
1334        std::default::Default::default()
1335    }
1336
1337    /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
1338    ///
1339    /// # Example
1340    /// ```ignore,no_run
1341    /// # use google_cloud_sql_v1::model::DeleteBackupRequest;
1342    /// let x = DeleteBackupRequest::new().set_name("example");
1343    /// ```
1344    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1345        self.name = v.into();
1346        self
1347    }
1348}
1349
1350impl wkt::message::Message for DeleteBackupRequest {
1351    fn typename() -> &'static str {
1352        "type.googleapis.com/google.cloud.sql.v1.DeleteBackupRequest"
1353    }
1354}
1355
1356/// A backup resource.
1357#[derive(Clone, Default, PartialEq)]
1358#[non_exhaustive]
1359pub struct Backup {
1360    /// Output only. The resource name of the backup.
1361    /// Format: projects/{project}/backups/{backup}.
1362    pub name: std::string::String,
1363
1364    /// Output only. This is always `sql#backup`.
1365    pub kind: std::string::String,
1366
1367    /// Output only. The URI of this resource.
1368    pub self_link: std::string::String,
1369
1370    /// Output only. The type of this backup. The type can be "AUTOMATED",
1371    /// "ON_DEMAND" or “FINAL”.
1372    pub r#type: crate::model::backup::SqlBackupType,
1373
1374    /// The description of this backup.
1375    pub description: std::string::String,
1376
1377    /// The name of the source database instance.
1378    pub instance: std::string::String,
1379
1380    /// The storage location of the backups. The location can be multi-regional.
1381    pub location: std::string::String,
1382
1383    /// Output only. This output contains the following values:
1384    /// start_time: All database writes up to this time are available.
1385    /// end_time: Any database writes after this time aren't available.
1386    pub backup_interval: std::option::Option<gtype::model::Interval>,
1387
1388    /// Output only. The status of this backup.
1389    pub state: crate::model::backup::SqlBackupState,
1390
1391    /// Output only. Information about why the backup operation fails (for example,
1392    /// when the backup state fails).
1393    pub error: std::option::Option<crate::model::OperationError>,
1394
1395    /// Output only. This output contains the encryption configuration for a backup
1396    /// and the resource name of the KMS key for disk encryption.
1397    pub kms_key: std::string::String,
1398
1399    /// Output only. This output contains the encryption status for a backup and
1400    /// the version of the KMS key that's used to encrypt the Cloud SQL instance.
1401    pub kms_key_version: std::string::String,
1402
1403    /// Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
1404    pub backup_kind: crate::model::SqlBackupKind,
1405
1406    /// Output only. This output contains a backup time zone. If a Cloud SQL for
1407    /// SQL Server instance has a different time zone from the backup's time zone,
1408    /// then the restore to the instance doesn't happen.
1409    pub time_zone: std::string::String,
1410
1411    /// Output only. The database version of the instance of at the time this
1412    /// backup was made.
1413    pub database_version: crate::model::SqlDatabaseVersion,
1414
1415    /// Output only. The maximum chargeable bytes for the backup.
1416    pub max_chargeable_bytes: std::option::Option<i64>,
1417
1418    /// Optional. Output only. Timestamp in UTC of when the instance associated
1419    /// with this backup is deleted.
1420    pub instance_deletion_time: std::option::Option<wkt::Timestamp>,
1421
1422    /// Optional. Output only. The instance setting of the source instance that's
1423    /// associated with this backup.
1424    pub instance_settings: std::option::Option<crate::model::DatabaseInstance>,
1425
1426    /// Output only. The mapping to backup run resource used for IAM validations.
1427    pub backup_run: std::string::String,
1428
1429    /// Output only. This status indicates whether the backup satisfies PZS.
1430    ///
1431    /// The status is reserved for future use.
1432    pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
1433
1434    /// Output only. This status indicates whether the backup satisfies PZI.
1435    ///
1436    /// The status is reserved for future use.
1437    pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
1438
1439    pub expiration: std::option::Option<crate::model::backup::Expiration>,
1440
1441    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1442}
1443
1444impl Backup {
1445    pub fn new() -> Self {
1446        std::default::Default::default()
1447    }
1448
1449    /// Sets the value of [name][crate::model::Backup::name].
1450    ///
1451    /// # Example
1452    /// ```ignore,no_run
1453    /// # use google_cloud_sql_v1::model::Backup;
1454    /// let x = Backup::new().set_name("example");
1455    /// ```
1456    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1457        self.name = v.into();
1458        self
1459    }
1460
1461    /// Sets the value of [kind][crate::model::Backup::kind].
1462    ///
1463    /// # Example
1464    /// ```ignore,no_run
1465    /// # use google_cloud_sql_v1::model::Backup;
1466    /// let x = Backup::new().set_kind("example");
1467    /// ```
1468    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1469        self.kind = v.into();
1470        self
1471    }
1472
1473    /// Sets the value of [self_link][crate::model::Backup::self_link].
1474    ///
1475    /// # Example
1476    /// ```ignore,no_run
1477    /// # use google_cloud_sql_v1::model::Backup;
1478    /// let x = Backup::new().set_self_link("example");
1479    /// ```
1480    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1481        self.self_link = v.into();
1482        self
1483    }
1484
1485    /// Sets the value of [r#type][crate::model::Backup::type].
1486    ///
1487    /// # Example
1488    /// ```ignore,no_run
1489    /// # use google_cloud_sql_v1::model::Backup;
1490    /// use google_cloud_sql_v1::model::backup::SqlBackupType;
1491    /// let x0 = Backup::new().set_type(SqlBackupType::Automated);
1492    /// let x1 = Backup::new().set_type(SqlBackupType::OnDemand);
1493    /// let x2 = Backup::new().set_type(SqlBackupType::Final);
1494    /// ```
1495    pub fn set_type<T: std::convert::Into<crate::model::backup::SqlBackupType>>(
1496        mut self,
1497        v: T,
1498    ) -> Self {
1499        self.r#type = v.into();
1500        self
1501    }
1502
1503    /// Sets the value of [description][crate::model::Backup::description].
1504    ///
1505    /// # Example
1506    /// ```ignore,no_run
1507    /// # use google_cloud_sql_v1::model::Backup;
1508    /// let x = Backup::new().set_description("example");
1509    /// ```
1510    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1511        self.description = v.into();
1512        self
1513    }
1514
1515    /// Sets the value of [instance][crate::model::Backup::instance].
1516    ///
1517    /// # Example
1518    /// ```ignore,no_run
1519    /// # use google_cloud_sql_v1::model::Backup;
1520    /// let x = Backup::new().set_instance("example");
1521    /// ```
1522    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1523        self.instance = v.into();
1524        self
1525    }
1526
1527    /// Sets the value of [location][crate::model::Backup::location].
1528    ///
1529    /// # Example
1530    /// ```ignore,no_run
1531    /// # use google_cloud_sql_v1::model::Backup;
1532    /// let x = Backup::new().set_location("example");
1533    /// ```
1534    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1535        self.location = v.into();
1536        self
1537    }
1538
1539    /// Sets the value of [backup_interval][crate::model::Backup::backup_interval].
1540    ///
1541    /// # Example
1542    /// ```ignore,no_run
1543    /// # use google_cloud_sql_v1::model::Backup;
1544    /// use gtype::model::Interval;
1545    /// let x = Backup::new().set_backup_interval(Interval::default()/* use setters */);
1546    /// ```
1547    pub fn set_backup_interval<T>(mut self, v: T) -> Self
1548    where
1549        T: std::convert::Into<gtype::model::Interval>,
1550    {
1551        self.backup_interval = std::option::Option::Some(v.into());
1552        self
1553    }
1554
1555    /// Sets or clears the value of [backup_interval][crate::model::Backup::backup_interval].
1556    ///
1557    /// # Example
1558    /// ```ignore,no_run
1559    /// # use google_cloud_sql_v1::model::Backup;
1560    /// use gtype::model::Interval;
1561    /// let x = Backup::new().set_or_clear_backup_interval(Some(Interval::default()/* use setters */));
1562    /// let x = Backup::new().set_or_clear_backup_interval(None::<Interval>);
1563    /// ```
1564    pub fn set_or_clear_backup_interval<T>(mut self, v: std::option::Option<T>) -> Self
1565    where
1566        T: std::convert::Into<gtype::model::Interval>,
1567    {
1568        self.backup_interval = v.map(|x| x.into());
1569        self
1570    }
1571
1572    /// Sets the value of [state][crate::model::Backup::state].
1573    ///
1574    /// # Example
1575    /// ```ignore,no_run
1576    /// # use google_cloud_sql_v1::model::Backup;
1577    /// use google_cloud_sql_v1::model::backup::SqlBackupState;
1578    /// let x0 = Backup::new().set_state(SqlBackupState::Enqueued);
1579    /// let x1 = Backup::new().set_state(SqlBackupState::Running);
1580    /// let x2 = Backup::new().set_state(SqlBackupState::Failed);
1581    /// ```
1582    pub fn set_state<T: std::convert::Into<crate::model::backup::SqlBackupState>>(
1583        mut self,
1584        v: T,
1585    ) -> Self {
1586        self.state = v.into();
1587        self
1588    }
1589
1590    /// Sets the value of [error][crate::model::Backup::error].
1591    ///
1592    /// # Example
1593    /// ```ignore,no_run
1594    /// # use google_cloud_sql_v1::model::Backup;
1595    /// use google_cloud_sql_v1::model::OperationError;
1596    /// let x = Backup::new().set_error(OperationError::default()/* use setters */);
1597    /// ```
1598    pub fn set_error<T>(mut self, v: T) -> Self
1599    where
1600        T: std::convert::Into<crate::model::OperationError>,
1601    {
1602        self.error = std::option::Option::Some(v.into());
1603        self
1604    }
1605
1606    /// Sets or clears the value of [error][crate::model::Backup::error].
1607    ///
1608    /// # Example
1609    /// ```ignore,no_run
1610    /// # use google_cloud_sql_v1::model::Backup;
1611    /// use google_cloud_sql_v1::model::OperationError;
1612    /// let x = Backup::new().set_or_clear_error(Some(OperationError::default()/* use setters */));
1613    /// let x = Backup::new().set_or_clear_error(None::<OperationError>);
1614    /// ```
1615    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1616    where
1617        T: std::convert::Into<crate::model::OperationError>,
1618    {
1619        self.error = v.map(|x| x.into());
1620        self
1621    }
1622
1623    /// Sets the value of [kms_key][crate::model::Backup::kms_key].
1624    ///
1625    /// # Example
1626    /// ```ignore,no_run
1627    /// # use google_cloud_sql_v1::model::Backup;
1628    /// let x = Backup::new().set_kms_key("example");
1629    /// ```
1630    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1631        self.kms_key = v.into();
1632        self
1633    }
1634
1635    /// Sets the value of [kms_key_version][crate::model::Backup::kms_key_version].
1636    ///
1637    /// # Example
1638    /// ```ignore,no_run
1639    /// # use google_cloud_sql_v1::model::Backup;
1640    /// let x = Backup::new().set_kms_key_version("example");
1641    /// ```
1642    pub fn set_kms_key_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1643        self.kms_key_version = v.into();
1644        self
1645    }
1646
1647    /// Sets the value of [backup_kind][crate::model::Backup::backup_kind].
1648    ///
1649    /// # Example
1650    /// ```ignore,no_run
1651    /// # use google_cloud_sql_v1::model::Backup;
1652    /// use google_cloud_sql_v1::model::SqlBackupKind;
1653    /// let x0 = Backup::new().set_backup_kind(SqlBackupKind::Snapshot);
1654    /// let x1 = Backup::new().set_backup_kind(SqlBackupKind::Physical);
1655    /// ```
1656    pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
1657        mut self,
1658        v: T,
1659    ) -> Self {
1660        self.backup_kind = v.into();
1661        self
1662    }
1663
1664    /// Sets the value of [time_zone][crate::model::Backup::time_zone].
1665    ///
1666    /// # Example
1667    /// ```ignore,no_run
1668    /// # use google_cloud_sql_v1::model::Backup;
1669    /// let x = Backup::new().set_time_zone("example");
1670    /// ```
1671    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1672        self.time_zone = v.into();
1673        self
1674    }
1675
1676    /// Sets the value of [database_version][crate::model::Backup::database_version].
1677    ///
1678    /// # Example
1679    /// ```ignore,no_run
1680    /// # use google_cloud_sql_v1::model::Backup;
1681    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
1682    /// let x0 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql56);
1683    /// let x1 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql57);
1684    /// let x2 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql80);
1685    /// ```
1686    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
1687        mut self,
1688        v: T,
1689    ) -> Self {
1690        self.database_version = v.into();
1691        self
1692    }
1693
1694    /// Sets the value of [max_chargeable_bytes][crate::model::Backup::max_chargeable_bytes].
1695    ///
1696    /// # Example
1697    /// ```ignore,no_run
1698    /// # use google_cloud_sql_v1::model::Backup;
1699    /// let x = Backup::new().set_max_chargeable_bytes(42);
1700    /// ```
1701    pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
1702    where
1703        T: std::convert::Into<i64>,
1704    {
1705        self.max_chargeable_bytes = std::option::Option::Some(v.into());
1706        self
1707    }
1708
1709    /// Sets or clears the value of [max_chargeable_bytes][crate::model::Backup::max_chargeable_bytes].
1710    ///
1711    /// # Example
1712    /// ```ignore,no_run
1713    /// # use google_cloud_sql_v1::model::Backup;
1714    /// let x = Backup::new().set_or_clear_max_chargeable_bytes(Some(42));
1715    /// let x = Backup::new().set_or_clear_max_chargeable_bytes(None::<i32>);
1716    /// ```
1717    pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
1718    where
1719        T: std::convert::Into<i64>,
1720    {
1721        self.max_chargeable_bytes = v.map(|x| x.into());
1722        self
1723    }
1724
1725    /// Sets the value of [instance_deletion_time][crate::model::Backup::instance_deletion_time].
1726    ///
1727    /// # Example
1728    /// ```ignore,no_run
1729    /// # use google_cloud_sql_v1::model::Backup;
1730    /// use wkt::Timestamp;
1731    /// let x = Backup::new().set_instance_deletion_time(Timestamp::default()/* use setters */);
1732    /// ```
1733    pub fn set_instance_deletion_time<T>(mut self, v: T) -> Self
1734    where
1735        T: std::convert::Into<wkt::Timestamp>,
1736    {
1737        self.instance_deletion_time = std::option::Option::Some(v.into());
1738        self
1739    }
1740
1741    /// Sets or clears the value of [instance_deletion_time][crate::model::Backup::instance_deletion_time].
1742    ///
1743    /// # Example
1744    /// ```ignore,no_run
1745    /// # use google_cloud_sql_v1::model::Backup;
1746    /// use wkt::Timestamp;
1747    /// let x = Backup::new().set_or_clear_instance_deletion_time(Some(Timestamp::default()/* use setters */));
1748    /// let x = Backup::new().set_or_clear_instance_deletion_time(None::<Timestamp>);
1749    /// ```
1750    pub fn set_or_clear_instance_deletion_time<T>(mut self, v: std::option::Option<T>) -> Self
1751    where
1752        T: std::convert::Into<wkt::Timestamp>,
1753    {
1754        self.instance_deletion_time = v.map(|x| x.into());
1755        self
1756    }
1757
1758    /// Sets the value of [instance_settings][crate::model::Backup::instance_settings].
1759    ///
1760    /// # Example
1761    /// ```ignore,no_run
1762    /// # use google_cloud_sql_v1::model::Backup;
1763    /// use google_cloud_sql_v1::model::DatabaseInstance;
1764    /// let x = Backup::new().set_instance_settings(DatabaseInstance::default()/* use setters */);
1765    /// ```
1766    pub fn set_instance_settings<T>(mut self, v: T) -> Self
1767    where
1768        T: std::convert::Into<crate::model::DatabaseInstance>,
1769    {
1770        self.instance_settings = std::option::Option::Some(v.into());
1771        self
1772    }
1773
1774    /// Sets or clears the value of [instance_settings][crate::model::Backup::instance_settings].
1775    ///
1776    /// # Example
1777    /// ```ignore,no_run
1778    /// # use google_cloud_sql_v1::model::Backup;
1779    /// use google_cloud_sql_v1::model::DatabaseInstance;
1780    /// let x = Backup::new().set_or_clear_instance_settings(Some(DatabaseInstance::default()/* use setters */));
1781    /// let x = Backup::new().set_or_clear_instance_settings(None::<DatabaseInstance>);
1782    /// ```
1783    pub fn set_or_clear_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
1784    where
1785        T: std::convert::Into<crate::model::DatabaseInstance>,
1786    {
1787        self.instance_settings = v.map(|x| x.into());
1788        self
1789    }
1790
1791    /// Sets the value of [backup_run][crate::model::Backup::backup_run].
1792    ///
1793    /// # Example
1794    /// ```ignore,no_run
1795    /// # use google_cloud_sql_v1::model::Backup;
1796    /// let x = Backup::new().set_backup_run("example");
1797    /// ```
1798    pub fn set_backup_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1799        self.backup_run = v.into();
1800        self
1801    }
1802
1803    /// Sets the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1804    ///
1805    /// # Example
1806    /// ```ignore,no_run
1807    /// # use google_cloud_sql_v1::model::Backup;
1808    /// use wkt::BoolValue;
1809    /// let x = Backup::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
1810    /// ```
1811    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
1812    where
1813        T: std::convert::Into<wkt::BoolValue>,
1814    {
1815        self.satisfies_pzs = std::option::Option::Some(v.into());
1816        self
1817    }
1818
1819    /// Sets or clears the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1820    ///
1821    /// # Example
1822    /// ```ignore,no_run
1823    /// # use google_cloud_sql_v1::model::Backup;
1824    /// use wkt::BoolValue;
1825    /// let x = Backup::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
1826    /// let x = Backup::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
1827    /// ```
1828    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
1829    where
1830        T: std::convert::Into<wkt::BoolValue>,
1831    {
1832        self.satisfies_pzs = v.map(|x| x.into());
1833        self
1834    }
1835
1836    /// Sets the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1837    ///
1838    /// # Example
1839    /// ```ignore,no_run
1840    /// # use google_cloud_sql_v1::model::Backup;
1841    /// use wkt::BoolValue;
1842    /// let x = Backup::new().set_satisfies_pzi(BoolValue::default()/* use setters */);
1843    /// ```
1844    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
1845    where
1846        T: std::convert::Into<wkt::BoolValue>,
1847    {
1848        self.satisfies_pzi = std::option::Option::Some(v.into());
1849        self
1850    }
1851
1852    /// Sets or clears the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1853    ///
1854    /// # Example
1855    /// ```ignore,no_run
1856    /// # use google_cloud_sql_v1::model::Backup;
1857    /// use wkt::BoolValue;
1858    /// let x = Backup::new().set_or_clear_satisfies_pzi(Some(BoolValue::default()/* use setters */));
1859    /// let x = Backup::new().set_or_clear_satisfies_pzi(None::<BoolValue>);
1860    /// ```
1861    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
1862    where
1863        T: std::convert::Into<wkt::BoolValue>,
1864    {
1865        self.satisfies_pzi = v.map(|x| x.into());
1866        self
1867    }
1868
1869    /// Sets the value of [expiration][crate::model::Backup::expiration].
1870    ///
1871    /// Note that all the setters affecting `expiration` are mutually
1872    /// exclusive.
1873    ///
1874    /// # Example
1875    /// ```ignore,no_run
1876    /// # use google_cloud_sql_v1::model::Backup;
1877    /// use google_cloud_sql_v1::model::backup::Expiration;
1878    /// let x = Backup::new().set_expiration(Some(Expiration::TtlDays(42)));
1879    /// ```
1880    pub fn set_expiration<
1881        T: std::convert::Into<std::option::Option<crate::model::backup::Expiration>>,
1882    >(
1883        mut self,
1884        v: T,
1885    ) -> Self {
1886        self.expiration = v.into();
1887        self
1888    }
1889
1890    /// The value of [expiration][crate::model::Backup::expiration]
1891    /// if it holds a `TtlDays`, `None` if the field is not set or
1892    /// holds a different branch.
1893    pub fn ttl_days(&self) -> std::option::Option<&i64> {
1894        #[allow(unreachable_patterns)]
1895        self.expiration.as_ref().and_then(|v| match v {
1896            crate::model::backup::Expiration::TtlDays(v) => std::option::Option::Some(v),
1897            _ => std::option::Option::None,
1898        })
1899    }
1900
1901    /// Sets the value of [expiration][crate::model::Backup::expiration]
1902    /// to hold a `TtlDays`.
1903    ///
1904    /// Note that all the setters affecting `expiration` are
1905    /// mutually exclusive.
1906    ///
1907    /// # Example
1908    /// ```ignore,no_run
1909    /// # use google_cloud_sql_v1::model::Backup;
1910    /// let x = Backup::new().set_ttl_days(42);
1911    /// assert!(x.ttl_days().is_some());
1912    /// assert!(x.expiry_time().is_none());
1913    /// ```
1914    pub fn set_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1915        self.expiration =
1916            std::option::Option::Some(crate::model::backup::Expiration::TtlDays(v.into()));
1917        self
1918    }
1919
1920    /// The value of [expiration][crate::model::Backup::expiration]
1921    /// if it holds a `ExpiryTime`, `None` if the field is not set or
1922    /// holds a different branch.
1923    pub fn expiry_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
1924        #[allow(unreachable_patterns)]
1925        self.expiration.as_ref().and_then(|v| match v {
1926            crate::model::backup::Expiration::ExpiryTime(v) => std::option::Option::Some(v),
1927            _ => std::option::Option::None,
1928        })
1929    }
1930
1931    /// Sets the value of [expiration][crate::model::Backup::expiration]
1932    /// to hold a `ExpiryTime`.
1933    ///
1934    /// Note that all the setters affecting `expiration` are
1935    /// mutually exclusive.
1936    ///
1937    /// # Example
1938    /// ```ignore,no_run
1939    /// # use google_cloud_sql_v1::model::Backup;
1940    /// use wkt::Timestamp;
1941    /// let x = Backup::new().set_expiry_time(Timestamp::default()/* use setters */);
1942    /// assert!(x.expiry_time().is_some());
1943    /// assert!(x.ttl_days().is_none());
1944    /// ```
1945    pub fn set_expiry_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
1946        mut self,
1947        v: T,
1948    ) -> Self {
1949        self.expiration =
1950            std::option::Option::Some(crate::model::backup::Expiration::ExpiryTime(v.into()));
1951        self
1952    }
1953}
1954
1955impl wkt::message::Message for Backup {
1956    fn typename() -> &'static str {
1957        "type.googleapis.com/google.cloud.sql.v1.Backup"
1958    }
1959}
1960
1961/// Defines additional types related to [Backup].
1962pub mod backup {
1963    #[allow(unused_imports)]
1964    use super::*;
1965
1966    /// The backup type.
1967    ///
1968    /// # Working with unknown values
1969    ///
1970    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1971    /// additional enum variants at any time. Adding new variants is not considered
1972    /// a breaking change. Applications should write their code in anticipation of:
1973    ///
1974    /// - New values appearing in future releases of the client library, **and**
1975    /// - New values received dynamically, without application changes.
1976    ///
1977    /// Please consult the [Working with enums] section in the user guide for some
1978    /// guidelines.
1979    ///
1980    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1981    #[derive(Clone, Debug, PartialEq)]
1982    #[non_exhaustive]
1983    pub enum SqlBackupType {
1984        /// This is an unknown backup type.
1985        Unspecified,
1986        /// The backup schedule triggers a backup automatically.
1987        Automated,
1988        /// The user triggers a backup manually.
1989        OnDemand,
1990        /// The backup created when instance is deleted.
1991        Final,
1992        /// If set, the enum was initialized with an unknown value.
1993        ///
1994        /// Applications can examine the value using [SqlBackupType::value] or
1995        /// [SqlBackupType::name].
1996        UnknownValue(sql_backup_type::UnknownValue),
1997    }
1998
1999    #[doc(hidden)]
2000    pub mod sql_backup_type {
2001        #[allow(unused_imports)]
2002        use super::*;
2003        #[derive(Clone, Debug, PartialEq)]
2004        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2005    }
2006
2007    impl SqlBackupType {
2008        /// Gets the enum value.
2009        ///
2010        /// Returns `None` if the enum contains an unknown value deserialized from
2011        /// the string representation of enums.
2012        pub fn value(&self) -> std::option::Option<i32> {
2013            match self {
2014                Self::Unspecified => std::option::Option::Some(0),
2015                Self::Automated => std::option::Option::Some(1),
2016                Self::OnDemand => std::option::Option::Some(2),
2017                Self::Final => std::option::Option::Some(3),
2018                Self::UnknownValue(u) => u.0.value(),
2019            }
2020        }
2021
2022        /// Gets the enum value as a string.
2023        ///
2024        /// Returns `None` if the enum contains an unknown value deserialized from
2025        /// the integer representation of enums.
2026        pub fn name(&self) -> std::option::Option<&str> {
2027            match self {
2028                Self::Unspecified => std::option::Option::Some("SQL_BACKUP_TYPE_UNSPECIFIED"),
2029                Self::Automated => std::option::Option::Some("AUTOMATED"),
2030                Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
2031                Self::Final => std::option::Option::Some("FINAL"),
2032                Self::UnknownValue(u) => u.0.name(),
2033            }
2034        }
2035    }
2036
2037    impl std::default::Default for SqlBackupType {
2038        fn default() -> Self {
2039            use std::convert::From;
2040            Self::from(0)
2041        }
2042    }
2043
2044    impl std::fmt::Display for SqlBackupType {
2045        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2046            wkt::internal::display_enum(f, self.name(), self.value())
2047        }
2048    }
2049
2050    impl std::convert::From<i32> for SqlBackupType {
2051        fn from(value: i32) -> Self {
2052            match value {
2053                0 => Self::Unspecified,
2054                1 => Self::Automated,
2055                2 => Self::OnDemand,
2056                3 => Self::Final,
2057                _ => Self::UnknownValue(sql_backup_type::UnknownValue(
2058                    wkt::internal::UnknownEnumValue::Integer(value),
2059                )),
2060            }
2061        }
2062    }
2063
2064    impl std::convert::From<&str> for SqlBackupType {
2065        fn from(value: &str) -> Self {
2066            use std::string::ToString;
2067            match value {
2068                "SQL_BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
2069                "AUTOMATED" => Self::Automated,
2070                "ON_DEMAND" => Self::OnDemand,
2071                "FINAL" => Self::Final,
2072                _ => Self::UnknownValue(sql_backup_type::UnknownValue(
2073                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2074                )),
2075            }
2076        }
2077    }
2078
2079    impl serde::ser::Serialize for SqlBackupType {
2080        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2081        where
2082            S: serde::Serializer,
2083        {
2084            match self {
2085                Self::Unspecified => serializer.serialize_i32(0),
2086                Self::Automated => serializer.serialize_i32(1),
2087                Self::OnDemand => serializer.serialize_i32(2),
2088                Self::Final => serializer.serialize_i32(3),
2089                Self::UnknownValue(u) => u.0.serialize(serializer),
2090            }
2091        }
2092    }
2093
2094    impl<'de> serde::de::Deserialize<'de> for SqlBackupType {
2095        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2096        where
2097            D: serde::Deserializer<'de>,
2098        {
2099            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupType>::new(
2100                ".google.cloud.sql.v1.Backup.SqlBackupType",
2101            ))
2102        }
2103    }
2104
2105    /// The backup's state
2106    ///
2107    /// # Working with unknown values
2108    ///
2109    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2110    /// additional enum variants at any time. Adding new variants is not considered
2111    /// a breaking change. Applications should write their code in anticipation of:
2112    ///
2113    /// - New values appearing in future releases of the client library, **and**
2114    /// - New values received dynamically, without application changes.
2115    ///
2116    /// Please consult the [Working with enums] section in the user guide for some
2117    /// guidelines.
2118    ///
2119    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2120    #[derive(Clone, Debug, PartialEq)]
2121    #[non_exhaustive]
2122    pub enum SqlBackupState {
2123        /// The state of the backup is unknown.
2124        Unspecified,
2125        /// The backup that's added to a queue.
2126        Enqueued,
2127        /// The backup is in progress.
2128        Running,
2129        /// The backup failed.
2130        Failed,
2131        /// The backup is successful.
2132        Successful,
2133        /// The backup is being deleted.
2134        Deleting,
2135        /// Deletion of the backup failed.
2136        DeletionFailed,
2137        /// If set, the enum was initialized with an unknown value.
2138        ///
2139        /// Applications can examine the value using [SqlBackupState::value] or
2140        /// [SqlBackupState::name].
2141        UnknownValue(sql_backup_state::UnknownValue),
2142    }
2143
2144    #[doc(hidden)]
2145    pub mod sql_backup_state {
2146        #[allow(unused_imports)]
2147        use super::*;
2148        #[derive(Clone, Debug, PartialEq)]
2149        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2150    }
2151
2152    impl SqlBackupState {
2153        /// Gets the enum value.
2154        ///
2155        /// Returns `None` if the enum contains an unknown value deserialized from
2156        /// the string representation of enums.
2157        pub fn value(&self) -> std::option::Option<i32> {
2158            match self {
2159                Self::Unspecified => std::option::Option::Some(0),
2160                Self::Enqueued => std::option::Option::Some(1),
2161                Self::Running => std::option::Option::Some(2),
2162                Self::Failed => std::option::Option::Some(3),
2163                Self::Successful => std::option::Option::Some(4),
2164                Self::Deleting => std::option::Option::Some(5),
2165                Self::DeletionFailed => std::option::Option::Some(6),
2166                Self::UnknownValue(u) => u.0.value(),
2167            }
2168        }
2169
2170        /// Gets the enum value as a string.
2171        ///
2172        /// Returns `None` if the enum contains an unknown value deserialized from
2173        /// the integer representation of enums.
2174        pub fn name(&self) -> std::option::Option<&str> {
2175            match self {
2176                Self::Unspecified => std::option::Option::Some("SQL_BACKUP_STATE_UNSPECIFIED"),
2177                Self::Enqueued => std::option::Option::Some("ENQUEUED"),
2178                Self::Running => std::option::Option::Some("RUNNING"),
2179                Self::Failed => std::option::Option::Some("FAILED"),
2180                Self::Successful => std::option::Option::Some("SUCCESSFUL"),
2181                Self::Deleting => std::option::Option::Some("DELETING"),
2182                Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
2183                Self::UnknownValue(u) => u.0.name(),
2184            }
2185        }
2186    }
2187
2188    impl std::default::Default for SqlBackupState {
2189        fn default() -> Self {
2190            use std::convert::From;
2191            Self::from(0)
2192        }
2193    }
2194
2195    impl std::fmt::Display for SqlBackupState {
2196        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2197            wkt::internal::display_enum(f, self.name(), self.value())
2198        }
2199    }
2200
2201    impl std::convert::From<i32> for SqlBackupState {
2202        fn from(value: i32) -> Self {
2203            match value {
2204                0 => Self::Unspecified,
2205                1 => Self::Enqueued,
2206                2 => Self::Running,
2207                3 => Self::Failed,
2208                4 => Self::Successful,
2209                5 => Self::Deleting,
2210                6 => Self::DeletionFailed,
2211                _ => Self::UnknownValue(sql_backup_state::UnknownValue(
2212                    wkt::internal::UnknownEnumValue::Integer(value),
2213                )),
2214            }
2215        }
2216    }
2217
2218    impl std::convert::From<&str> for SqlBackupState {
2219        fn from(value: &str) -> Self {
2220            use std::string::ToString;
2221            match value {
2222                "SQL_BACKUP_STATE_UNSPECIFIED" => Self::Unspecified,
2223                "ENQUEUED" => Self::Enqueued,
2224                "RUNNING" => Self::Running,
2225                "FAILED" => Self::Failed,
2226                "SUCCESSFUL" => Self::Successful,
2227                "DELETING" => Self::Deleting,
2228                "DELETION_FAILED" => Self::DeletionFailed,
2229                _ => Self::UnknownValue(sql_backup_state::UnknownValue(
2230                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2231                )),
2232            }
2233        }
2234    }
2235
2236    impl serde::ser::Serialize for SqlBackupState {
2237        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2238        where
2239            S: serde::Serializer,
2240        {
2241            match self {
2242                Self::Unspecified => serializer.serialize_i32(0),
2243                Self::Enqueued => serializer.serialize_i32(1),
2244                Self::Running => serializer.serialize_i32(2),
2245                Self::Failed => serializer.serialize_i32(3),
2246                Self::Successful => serializer.serialize_i32(4),
2247                Self::Deleting => serializer.serialize_i32(5),
2248                Self::DeletionFailed => serializer.serialize_i32(6),
2249                Self::UnknownValue(u) => u.0.serialize(serializer),
2250            }
2251        }
2252    }
2253
2254    impl<'de> serde::de::Deserialize<'de> for SqlBackupState {
2255        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2256        where
2257            D: serde::Deserializer<'de>,
2258        {
2259            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupState>::new(
2260                ".google.cloud.sql.v1.Backup.SqlBackupState",
2261            ))
2262        }
2263    }
2264
2265    #[derive(Clone, Debug, PartialEq)]
2266    #[non_exhaustive]
2267    pub enum Expiration {
2268        /// Input only. The time-to-live (TTL) interval for this resource (in days).
2269        /// For example: ttlDays:7, means 7 days from the current time. The
2270        /// expiration time can't exceed 365 days from the time that the backup is
2271        /// created.
2272        TtlDays(i64),
2273        /// Backup expiration time.
2274        /// A UTC timestamp of when this backup expired.
2275        ExpiryTime(std::boxed::Box<wkt::Timestamp>),
2276    }
2277}
2278
2279/// Connect settings retrieval request.
2280#[derive(Clone, Default, PartialEq)]
2281#[non_exhaustive]
2282pub struct GetConnectSettingsRequest {
2283    /// Cloud SQL instance ID. This does not include the project ID.
2284    pub instance: std::string::String,
2285
2286    /// Project ID of the project that contains the instance.
2287    pub project: std::string::String,
2288
2289    /// Optional. Optional snapshot read timestamp to trade freshness for
2290    /// performance.
2291    pub read_time: std::option::Option<wkt::Timestamp>,
2292
2293    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2294}
2295
2296impl GetConnectSettingsRequest {
2297    pub fn new() -> Self {
2298        std::default::Default::default()
2299    }
2300
2301    /// Sets the value of [instance][crate::model::GetConnectSettingsRequest::instance].
2302    ///
2303    /// # Example
2304    /// ```ignore,no_run
2305    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2306    /// let x = GetConnectSettingsRequest::new().set_instance("example");
2307    /// ```
2308    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2309        self.instance = v.into();
2310        self
2311    }
2312
2313    /// Sets the value of [project][crate::model::GetConnectSettingsRequest::project].
2314    ///
2315    /// # Example
2316    /// ```ignore,no_run
2317    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2318    /// let x = GetConnectSettingsRequest::new().set_project("example");
2319    /// ```
2320    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2321        self.project = v.into();
2322        self
2323    }
2324
2325    /// Sets the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
2326    ///
2327    /// # Example
2328    /// ```ignore,no_run
2329    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2330    /// use wkt::Timestamp;
2331    /// let x = GetConnectSettingsRequest::new().set_read_time(Timestamp::default()/* use setters */);
2332    /// ```
2333    pub fn set_read_time<T>(mut self, v: T) -> Self
2334    where
2335        T: std::convert::Into<wkt::Timestamp>,
2336    {
2337        self.read_time = std::option::Option::Some(v.into());
2338        self
2339    }
2340
2341    /// Sets or clears the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
2342    ///
2343    /// # Example
2344    /// ```ignore,no_run
2345    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2346    /// use wkt::Timestamp;
2347    /// let x = GetConnectSettingsRequest::new().set_or_clear_read_time(Some(Timestamp::default()/* use setters */));
2348    /// let x = GetConnectSettingsRequest::new().set_or_clear_read_time(None::<Timestamp>);
2349    /// ```
2350    pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
2351    where
2352        T: std::convert::Into<wkt::Timestamp>,
2353    {
2354        self.read_time = v.map(|x| x.into());
2355        self
2356    }
2357}
2358
2359impl wkt::message::Message for GetConnectSettingsRequest {
2360    fn typename() -> &'static str {
2361        "type.googleapis.com/google.cloud.sql.v1.GetConnectSettingsRequest"
2362    }
2363}
2364
2365/// Connect settings retrieval response.
2366#[derive(Clone, Default, PartialEq)]
2367#[non_exhaustive]
2368pub struct ConnectSettings {
2369    /// This is always `sql#connectSettings`.
2370    pub kind: std::string::String,
2371
2372    /// SSL configuration.
2373    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
2374
2375    /// The assigned IP addresses for the instance.
2376    pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
2377
2378    /// The cloud region for the instance. For example, `us-central1`,
2379    /// `europe-west1`. The region cannot be changed after instance creation.
2380    pub region: std::string::String,
2381
2382    /// The database engine type and version. The `databaseVersion`
2383    /// field cannot be changed after instance creation.
2384    /// MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
2385    /// or `MYSQL_5_6`.
2386    /// PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
2387    /// `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
2388    /// SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
2389    /// `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
2390    /// `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
2391    /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
2392    /// `SQLSERVER_2019_WEB`.
2393    pub database_version: crate::model::SqlDatabaseVersion,
2394
2395    /// `SECOND_GEN`: Cloud SQL database instance.
2396    /// `EXTERNAL`: A database server that is not managed by Google.
2397    /// This property is read-only; use the `tier` property in the `settings`
2398    /// object to determine the database type.
2399    pub backend_type: crate::model::SqlBackendType,
2400
2401    /// Whether PSC connectivity is enabled for this instance.
2402    pub psc_enabled: bool,
2403
2404    /// The dns name of the instance.
2405    pub dns_name: std::string::String,
2406
2407    /// Specify what type of CA is used for the server certificate.
2408    pub server_ca_mode: crate::model::connect_settings::CaMode,
2409
2410    /// Custom subject alternative names for the server certificate.
2411    pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
2412
2413    /// Output only. The list of DNS names used by this instance.
2414    pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
2415
2416    /// The number of read pool nodes in a read pool.
2417    pub node_count: std::option::Option<i32>,
2418
2419    /// Output only. Entries containing information about each read pool node of
2420    /// the read pool.
2421    pub nodes: std::vec::Vec<crate::model::connect_settings::ConnectPoolNodeConfig>,
2422
2423    /// Optional. Output only. mdx_protocol_support controls how the client uses
2424    /// metadata exchange when connecting to the instance. The values in the list
2425    /// representing parts of the MDX protocol that are supported by this instance.
2426    /// When the list is empty, the instance does not support MDX, so the client
2427    /// must not send an MDX request. The default is empty.
2428    pub mdx_protocol_support: std::vec::Vec<crate::model::connect_settings::MdxProtocolSupport>,
2429
2430    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2431}
2432
2433impl ConnectSettings {
2434    pub fn new() -> Self {
2435        std::default::Default::default()
2436    }
2437
2438    /// Sets the value of [kind][crate::model::ConnectSettings::kind].
2439    ///
2440    /// # Example
2441    /// ```ignore,no_run
2442    /// # use google_cloud_sql_v1::model::ConnectSettings;
2443    /// let x = ConnectSettings::new().set_kind("example");
2444    /// ```
2445    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2446        self.kind = v.into();
2447        self
2448    }
2449
2450    /// Sets the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
2451    ///
2452    /// # Example
2453    /// ```ignore,no_run
2454    /// # use google_cloud_sql_v1::model::ConnectSettings;
2455    /// use google_cloud_sql_v1::model::SslCert;
2456    /// let x = ConnectSettings::new().set_server_ca_cert(SslCert::default()/* use setters */);
2457    /// ```
2458    pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
2459    where
2460        T: std::convert::Into<crate::model::SslCert>,
2461    {
2462        self.server_ca_cert = std::option::Option::Some(v.into());
2463        self
2464    }
2465
2466    /// Sets or clears the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
2467    ///
2468    /// # Example
2469    /// ```ignore,no_run
2470    /// # use google_cloud_sql_v1::model::ConnectSettings;
2471    /// use google_cloud_sql_v1::model::SslCert;
2472    /// let x = ConnectSettings::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
2473    /// let x = ConnectSettings::new().set_or_clear_server_ca_cert(None::<SslCert>);
2474    /// ```
2475    pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
2476    where
2477        T: std::convert::Into<crate::model::SslCert>,
2478    {
2479        self.server_ca_cert = v.map(|x| x.into());
2480        self
2481    }
2482
2483    /// Sets the value of [ip_addresses][crate::model::ConnectSettings::ip_addresses].
2484    ///
2485    /// # Example
2486    /// ```ignore,no_run
2487    /// # use google_cloud_sql_v1::model::ConnectSettings;
2488    /// use google_cloud_sql_v1::model::IpMapping;
2489    /// let x = ConnectSettings::new()
2490    ///     .set_ip_addresses([
2491    ///         IpMapping::default()/* use setters */,
2492    ///         IpMapping::default()/* use (different) setters */,
2493    ///     ]);
2494    /// ```
2495    pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
2496    where
2497        T: std::iter::IntoIterator<Item = V>,
2498        V: std::convert::Into<crate::model::IpMapping>,
2499    {
2500        use std::iter::Iterator;
2501        self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
2502        self
2503    }
2504
2505    /// Sets the value of [region][crate::model::ConnectSettings::region].
2506    ///
2507    /// # Example
2508    /// ```ignore,no_run
2509    /// # use google_cloud_sql_v1::model::ConnectSettings;
2510    /// let x = ConnectSettings::new().set_region("example");
2511    /// ```
2512    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2513        self.region = v.into();
2514        self
2515    }
2516
2517    /// Sets the value of [database_version][crate::model::ConnectSettings::database_version].
2518    ///
2519    /// # Example
2520    /// ```ignore,no_run
2521    /// # use google_cloud_sql_v1::model::ConnectSettings;
2522    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
2523    /// let x0 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql56);
2524    /// let x1 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql57);
2525    /// let x2 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql80);
2526    /// ```
2527    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
2528        mut self,
2529        v: T,
2530    ) -> Self {
2531        self.database_version = v.into();
2532        self
2533    }
2534
2535    /// Sets the value of [backend_type][crate::model::ConnectSettings::backend_type].
2536    ///
2537    /// # Example
2538    /// ```ignore,no_run
2539    /// # use google_cloud_sql_v1::model::ConnectSettings;
2540    /// use google_cloud_sql_v1::model::SqlBackendType;
2541    /// let x0 = ConnectSettings::new().set_backend_type(SqlBackendType::SecondGen);
2542    /// let x1 = ConnectSettings::new().set_backend_type(SqlBackendType::External);
2543    /// ```
2544    pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
2545        mut self,
2546        v: T,
2547    ) -> Self {
2548        self.backend_type = v.into();
2549        self
2550    }
2551
2552    /// Sets the value of [psc_enabled][crate::model::ConnectSettings::psc_enabled].
2553    ///
2554    /// # Example
2555    /// ```ignore,no_run
2556    /// # use google_cloud_sql_v1::model::ConnectSettings;
2557    /// let x = ConnectSettings::new().set_psc_enabled(true);
2558    /// ```
2559    pub fn set_psc_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2560        self.psc_enabled = v.into();
2561        self
2562    }
2563
2564    /// Sets the value of [dns_name][crate::model::ConnectSettings::dns_name].
2565    ///
2566    /// # Example
2567    /// ```ignore,no_run
2568    /// # use google_cloud_sql_v1::model::ConnectSettings;
2569    /// let x = ConnectSettings::new().set_dns_name("example");
2570    /// ```
2571    pub fn set_dns_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2572        self.dns_name = v.into();
2573        self
2574    }
2575
2576    /// Sets the value of [server_ca_mode][crate::model::ConnectSettings::server_ca_mode].
2577    ///
2578    /// # Example
2579    /// ```ignore,no_run
2580    /// # use google_cloud_sql_v1::model::ConnectSettings;
2581    /// use google_cloud_sql_v1::model::connect_settings::CaMode;
2582    /// let x0 = ConnectSettings::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
2583    /// let x1 = ConnectSettings::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
2584    /// let x2 = ConnectSettings::new().set_server_ca_mode(CaMode::CustomerManagedCasCa);
2585    /// ```
2586    pub fn set_server_ca_mode<T: std::convert::Into<crate::model::connect_settings::CaMode>>(
2587        mut self,
2588        v: T,
2589    ) -> Self {
2590        self.server_ca_mode = v.into();
2591        self
2592    }
2593
2594    /// Sets the value of [custom_subject_alternative_names][crate::model::ConnectSettings::custom_subject_alternative_names].
2595    ///
2596    /// # Example
2597    /// ```ignore,no_run
2598    /// # use google_cloud_sql_v1::model::ConnectSettings;
2599    /// let x = ConnectSettings::new().set_custom_subject_alternative_names(["a", "b", "c"]);
2600    /// ```
2601    pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
2602    where
2603        T: std::iter::IntoIterator<Item = V>,
2604        V: std::convert::Into<std::string::String>,
2605    {
2606        use std::iter::Iterator;
2607        self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
2608        self
2609    }
2610
2611    /// Sets the value of [dns_names][crate::model::ConnectSettings::dns_names].
2612    ///
2613    /// # Example
2614    /// ```ignore,no_run
2615    /// # use google_cloud_sql_v1::model::ConnectSettings;
2616    /// use google_cloud_sql_v1::model::DnsNameMapping;
2617    /// let x = ConnectSettings::new()
2618    ///     .set_dns_names([
2619    ///         DnsNameMapping::default()/* use setters */,
2620    ///         DnsNameMapping::default()/* use (different) setters */,
2621    ///     ]);
2622    /// ```
2623    pub fn set_dns_names<T, V>(mut self, v: T) -> Self
2624    where
2625        T: std::iter::IntoIterator<Item = V>,
2626        V: std::convert::Into<crate::model::DnsNameMapping>,
2627    {
2628        use std::iter::Iterator;
2629        self.dns_names = v.into_iter().map(|i| i.into()).collect();
2630        self
2631    }
2632
2633    /// Sets the value of [node_count][crate::model::ConnectSettings::node_count].
2634    ///
2635    /// # Example
2636    /// ```ignore,no_run
2637    /// # use google_cloud_sql_v1::model::ConnectSettings;
2638    /// let x = ConnectSettings::new().set_node_count(42);
2639    /// ```
2640    pub fn set_node_count<T>(mut self, v: T) -> Self
2641    where
2642        T: std::convert::Into<i32>,
2643    {
2644        self.node_count = std::option::Option::Some(v.into());
2645        self
2646    }
2647
2648    /// Sets or clears the value of [node_count][crate::model::ConnectSettings::node_count].
2649    ///
2650    /// # Example
2651    /// ```ignore,no_run
2652    /// # use google_cloud_sql_v1::model::ConnectSettings;
2653    /// let x = ConnectSettings::new().set_or_clear_node_count(Some(42));
2654    /// let x = ConnectSettings::new().set_or_clear_node_count(None::<i32>);
2655    /// ```
2656    pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
2657    where
2658        T: std::convert::Into<i32>,
2659    {
2660        self.node_count = v.map(|x| x.into());
2661        self
2662    }
2663
2664    /// Sets the value of [nodes][crate::model::ConnectSettings::nodes].
2665    ///
2666    /// # Example
2667    /// ```ignore,no_run
2668    /// # use google_cloud_sql_v1::model::ConnectSettings;
2669    /// use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2670    /// let x = ConnectSettings::new()
2671    ///     .set_nodes([
2672    ///         ConnectPoolNodeConfig::default()/* use setters */,
2673    ///         ConnectPoolNodeConfig::default()/* use (different) setters */,
2674    ///     ]);
2675    /// ```
2676    pub fn set_nodes<T, V>(mut self, v: T) -> Self
2677    where
2678        T: std::iter::IntoIterator<Item = V>,
2679        V: std::convert::Into<crate::model::connect_settings::ConnectPoolNodeConfig>,
2680    {
2681        use std::iter::Iterator;
2682        self.nodes = v.into_iter().map(|i| i.into()).collect();
2683        self
2684    }
2685
2686    /// Sets the value of [mdx_protocol_support][crate::model::ConnectSettings::mdx_protocol_support].
2687    ///
2688    /// # Example
2689    /// ```ignore,no_run
2690    /// # use google_cloud_sql_v1::model::ConnectSettings;
2691    /// use google_cloud_sql_v1::model::connect_settings::MdxProtocolSupport;
2692    /// let x = ConnectSettings::new().set_mdx_protocol_support([
2693    ///     MdxProtocolSupport::ClientProtocolType,
2694    /// ]);
2695    /// ```
2696    pub fn set_mdx_protocol_support<T, V>(mut self, v: T) -> Self
2697    where
2698        T: std::iter::IntoIterator<Item = V>,
2699        V: std::convert::Into<crate::model::connect_settings::MdxProtocolSupport>,
2700    {
2701        use std::iter::Iterator;
2702        self.mdx_protocol_support = v.into_iter().map(|i| i.into()).collect();
2703        self
2704    }
2705}
2706
2707impl wkt::message::Message for ConnectSettings {
2708    fn typename() -> &'static str {
2709        "type.googleapis.com/google.cloud.sql.v1.ConnectSettings"
2710    }
2711}
2712
2713/// Defines additional types related to [ConnectSettings].
2714pub mod connect_settings {
2715    #[allow(unused_imports)]
2716    use super::*;
2717
2718    /// Details of a single read pool node of a read pool.
2719    #[derive(Clone, Default, PartialEq)]
2720    #[non_exhaustive]
2721    pub struct ConnectPoolNodeConfig {
2722        /// Output only. The name of the read pool node. Doesn't include the project
2723        /// ID.
2724        pub name: std::option::Option<std::string::String>,
2725
2726        /// Output only. Mappings containing IP addresses that can be used to connect
2727        /// to the read pool node.
2728        pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
2729
2730        /// Output only. The DNS name of the read pool node.
2731        pub dns_name: std::option::Option<std::string::String>,
2732
2733        /// Output only. The list of DNS names used by this read pool node.
2734        pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
2735
2736        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2737    }
2738
2739    impl ConnectPoolNodeConfig {
2740        pub fn new() -> Self {
2741            std::default::Default::default()
2742        }
2743
2744        /// Sets the value of [name][crate::model::connect_settings::ConnectPoolNodeConfig::name].
2745        ///
2746        /// # Example
2747        /// ```ignore,no_run
2748        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2749        /// let x = ConnectPoolNodeConfig::new().set_name("example");
2750        /// ```
2751        pub fn set_name<T>(mut self, v: T) -> Self
2752        where
2753            T: std::convert::Into<std::string::String>,
2754        {
2755            self.name = std::option::Option::Some(v.into());
2756            self
2757        }
2758
2759        /// Sets or clears the value of [name][crate::model::connect_settings::ConnectPoolNodeConfig::name].
2760        ///
2761        /// # Example
2762        /// ```ignore,no_run
2763        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2764        /// let x = ConnectPoolNodeConfig::new().set_or_clear_name(Some("example"));
2765        /// let x = ConnectPoolNodeConfig::new().set_or_clear_name(None::<String>);
2766        /// ```
2767        pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
2768        where
2769            T: std::convert::Into<std::string::String>,
2770        {
2771            self.name = v.map(|x| x.into());
2772            self
2773        }
2774
2775        /// Sets the value of [ip_addresses][crate::model::connect_settings::ConnectPoolNodeConfig::ip_addresses].
2776        ///
2777        /// # Example
2778        /// ```ignore,no_run
2779        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2780        /// use google_cloud_sql_v1::model::IpMapping;
2781        /// let x = ConnectPoolNodeConfig::new()
2782        ///     .set_ip_addresses([
2783        ///         IpMapping::default()/* use setters */,
2784        ///         IpMapping::default()/* use (different) setters */,
2785        ///     ]);
2786        /// ```
2787        pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
2788        where
2789            T: std::iter::IntoIterator<Item = V>,
2790            V: std::convert::Into<crate::model::IpMapping>,
2791        {
2792            use std::iter::Iterator;
2793            self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
2794            self
2795        }
2796
2797        /// Sets the value of [dns_name][crate::model::connect_settings::ConnectPoolNodeConfig::dns_name].
2798        ///
2799        /// # Example
2800        /// ```ignore,no_run
2801        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2802        /// let x = ConnectPoolNodeConfig::new().set_dns_name("example");
2803        /// ```
2804        pub fn set_dns_name<T>(mut self, v: T) -> Self
2805        where
2806            T: std::convert::Into<std::string::String>,
2807        {
2808            self.dns_name = std::option::Option::Some(v.into());
2809            self
2810        }
2811
2812        /// Sets or clears the value of [dns_name][crate::model::connect_settings::ConnectPoolNodeConfig::dns_name].
2813        ///
2814        /// # Example
2815        /// ```ignore,no_run
2816        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2817        /// let x = ConnectPoolNodeConfig::new().set_or_clear_dns_name(Some("example"));
2818        /// let x = ConnectPoolNodeConfig::new().set_or_clear_dns_name(None::<String>);
2819        /// ```
2820        pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
2821        where
2822            T: std::convert::Into<std::string::String>,
2823        {
2824            self.dns_name = v.map(|x| x.into());
2825            self
2826        }
2827
2828        /// Sets the value of [dns_names][crate::model::connect_settings::ConnectPoolNodeConfig::dns_names].
2829        ///
2830        /// # Example
2831        /// ```ignore,no_run
2832        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2833        /// use google_cloud_sql_v1::model::DnsNameMapping;
2834        /// let x = ConnectPoolNodeConfig::new()
2835        ///     .set_dns_names([
2836        ///         DnsNameMapping::default()/* use setters */,
2837        ///         DnsNameMapping::default()/* use (different) setters */,
2838        ///     ]);
2839        /// ```
2840        pub fn set_dns_names<T, V>(mut self, v: T) -> Self
2841        where
2842            T: std::iter::IntoIterator<Item = V>,
2843            V: std::convert::Into<crate::model::DnsNameMapping>,
2844        {
2845            use std::iter::Iterator;
2846            self.dns_names = v.into_iter().map(|i| i.into()).collect();
2847            self
2848        }
2849    }
2850
2851    impl wkt::message::Message for ConnectPoolNodeConfig {
2852        fn typename() -> &'static str {
2853            "type.googleapis.com/google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig"
2854        }
2855    }
2856
2857    /// Various Certificate Authority (CA) modes for certificate signing.
2858    ///
2859    /// # Working with unknown values
2860    ///
2861    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2862    /// additional enum variants at any time. Adding new variants is not considered
2863    /// a breaking change. Applications should write their code in anticipation of:
2864    ///
2865    /// - New values appearing in future releases of the client library, **and**
2866    /// - New values received dynamically, without application changes.
2867    ///
2868    /// Please consult the [Working with enums] section in the user guide for some
2869    /// guidelines.
2870    ///
2871    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2872    #[derive(Clone, Debug, PartialEq)]
2873    #[non_exhaustive]
2874    pub enum CaMode {
2875        /// CA mode is unknown.
2876        Unspecified,
2877        /// Google-managed self-signed internal CA.
2878        GoogleManagedInternalCa,
2879        /// Google-managed regional CA part of root CA hierarchy hosted on Google
2880        /// Cloud's Certificate Authority Service (CAS).
2881        GoogleManagedCasCa,
2882        /// Customer-managed CA hosted on Google Cloud's Certificate Authority
2883        /// Service (CAS).
2884        CustomerManagedCasCa,
2885        /// If set, the enum was initialized with an unknown value.
2886        ///
2887        /// Applications can examine the value using [CaMode::value] or
2888        /// [CaMode::name].
2889        UnknownValue(ca_mode::UnknownValue),
2890    }
2891
2892    #[doc(hidden)]
2893    pub mod ca_mode {
2894        #[allow(unused_imports)]
2895        use super::*;
2896        #[derive(Clone, Debug, PartialEq)]
2897        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2898    }
2899
2900    impl CaMode {
2901        /// Gets the enum value.
2902        ///
2903        /// Returns `None` if the enum contains an unknown value deserialized from
2904        /// the string representation of enums.
2905        pub fn value(&self) -> std::option::Option<i32> {
2906            match self {
2907                Self::Unspecified => std::option::Option::Some(0),
2908                Self::GoogleManagedInternalCa => std::option::Option::Some(1),
2909                Self::GoogleManagedCasCa => std::option::Option::Some(2),
2910                Self::CustomerManagedCasCa => std::option::Option::Some(3),
2911                Self::UnknownValue(u) => u.0.value(),
2912            }
2913        }
2914
2915        /// Gets the enum value as a string.
2916        ///
2917        /// Returns `None` if the enum contains an unknown value deserialized from
2918        /// the integer representation of enums.
2919        pub fn name(&self) -> std::option::Option<&str> {
2920            match self {
2921                Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
2922                Self::GoogleManagedInternalCa => {
2923                    std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
2924                }
2925                Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
2926                Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
2927                Self::UnknownValue(u) => u.0.name(),
2928            }
2929        }
2930    }
2931
2932    impl std::default::Default for CaMode {
2933        fn default() -> Self {
2934            use std::convert::From;
2935            Self::from(0)
2936        }
2937    }
2938
2939    impl std::fmt::Display for CaMode {
2940        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2941            wkt::internal::display_enum(f, self.name(), self.value())
2942        }
2943    }
2944
2945    impl std::convert::From<i32> for CaMode {
2946        fn from(value: i32) -> Self {
2947            match value {
2948                0 => Self::Unspecified,
2949                1 => Self::GoogleManagedInternalCa,
2950                2 => Self::GoogleManagedCasCa,
2951                3 => Self::CustomerManagedCasCa,
2952                _ => Self::UnknownValue(ca_mode::UnknownValue(
2953                    wkt::internal::UnknownEnumValue::Integer(value),
2954                )),
2955            }
2956        }
2957    }
2958
2959    impl std::convert::From<&str> for CaMode {
2960        fn from(value: &str) -> Self {
2961            use std::string::ToString;
2962            match value {
2963                "CA_MODE_UNSPECIFIED" => Self::Unspecified,
2964                "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
2965                "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
2966                "CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
2967                _ => Self::UnknownValue(ca_mode::UnknownValue(
2968                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2969                )),
2970            }
2971        }
2972    }
2973
2974    impl serde::ser::Serialize for CaMode {
2975        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2976        where
2977            S: serde::Serializer,
2978        {
2979            match self {
2980                Self::Unspecified => serializer.serialize_i32(0),
2981                Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
2982                Self::GoogleManagedCasCa => serializer.serialize_i32(2),
2983                Self::CustomerManagedCasCa => serializer.serialize_i32(3),
2984                Self::UnknownValue(u) => u.0.serialize(serializer),
2985            }
2986        }
2987    }
2988
2989    impl<'de> serde::de::Deserialize<'de> for CaMode {
2990        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2991        where
2992            D: serde::Deserializer<'de>,
2993        {
2994            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
2995                ".google.cloud.sql.v1.ConnectSettings.CaMode",
2996            ))
2997        }
2998    }
2999
3000    /// MdxProtocolSupport describes parts of the MDX protocol supported by this
3001    /// instance.
3002    ///
3003    /// # Working with unknown values
3004    ///
3005    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3006    /// additional enum variants at any time. Adding new variants is not considered
3007    /// a breaking change. Applications should write their code in anticipation of:
3008    ///
3009    /// - New values appearing in future releases of the client library, **and**
3010    /// - New values received dynamically, without application changes.
3011    ///
3012    /// Please consult the [Working with enums] section in the user guide for some
3013    /// guidelines.
3014    ///
3015    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3016    #[derive(Clone, Debug, PartialEq)]
3017    #[non_exhaustive]
3018    pub enum MdxProtocolSupport {
3019        /// Not specified.
3020        Unspecified,
3021        /// Client should send the client protocol type in the MDX request.
3022        ClientProtocolType,
3023        /// If set, the enum was initialized with an unknown value.
3024        ///
3025        /// Applications can examine the value using [MdxProtocolSupport::value] or
3026        /// [MdxProtocolSupport::name].
3027        UnknownValue(mdx_protocol_support::UnknownValue),
3028    }
3029
3030    #[doc(hidden)]
3031    pub mod mdx_protocol_support {
3032        #[allow(unused_imports)]
3033        use super::*;
3034        #[derive(Clone, Debug, PartialEq)]
3035        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3036    }
3037
3038    impl MdxProtocolSupport {
3039        /// Gets the enum value.
3040        ///
3041        /// Returns `None` if the enum contains an unknown value deserialized from
3042        /// the string representation of enums.
3043        pub fn value(&self) -> std::option::Option<i32> {
3044            match self {
3045                Self::Unspecified => std::option::Option::Some(0),
3046                Self::ClientProtocolType => std::option::Option::Some(1),
3047                Self::UnknownValue(u) => u.0.value(),
3048            }
3049        }
3050
3051        /// Gets the enum value as a string.
3052        ///
3053        /// Returns `None` if the enum contains an unknown value deserialized from
3054        /// the integer representation of enums.
3055        pub fn name(&self) -> std::option::Option<&str> {
3056            match self {
3057                Self::Unspecified => std::option::Option::Some("MDX_PROTOCOL_SUPPORT_UNSPECIFIED"),
3058                Self::ClientProtocolType => std::option::Option::Some("CLIENT_PROTOCOL_TYPE"),
3059                Self::UnknownValue(u) => u.0.name(),
3060            }
3061        }
3062    }
3063
3064    impl std::default::Default for MdxProtocolSupport {
3065        fn default() -> Self {
3066            use std::convert::From;
3067            Self::from(0)
3068        }
3069    }
3070
3071    impl std::fmt::Display for MdxProtocolSupport {
3072        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3073            wkt::internal::display_enum(f, self.name(), self.value())
3074        }
3075    }
3076
3077    impl std::convert::From<i32> for MdxProtocolSupport {
3078        fn from(value: i32) -> Self {
3079            match value {
3080                0 => Self::Unspecified,
3081                1 => Self::ClientProtocolType,
3082                _ => Self::UnknownValue(mdx_protocol_support::UnknownValue(
3083                    wkt::internal::UnknownEnumValue::Integer(value),
3084                )),
3085            }
3086        }
3087    }
3088
3089    impl std::convert::From<&str> for MdxProtocolSupport {
3090        fn from(value: &str) -> Self {
3091            use std::string::ToString;
3092            match value {
3093                "MDX_PROTOCOL_SUPPORT_UNSPECIFIED" => Self::Unspecified,
3094                "CLIENT_PROTOCOL_TYPE" => Self::ClientProtocolType,
3095                _ => Self::UnknownValue(mdx_protocol_support::UnknownValue(
3096                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3097                )),
3098            }
3099        }
3100    }
3101
3102    impl serde::ser::Serialize for MdxProtocolSupport {
3103        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3104        where
3105            S: serde::Serializer,
3106        {
3107            match self {
3108                Self::Unspecified => serializer.serialize_i32(0),
3109                Self::ClientProtocolType => serializer.serialize_i32(1),
3110                Self::UnknownValue(u) => u.0.serialize(serializer),
3111            }
3112        }
3113    }
3114
3115    impl<'de> serde::de::Deserialize<'de> for MdxProtocolSupport {
3116        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3117        where
3118            D: serde::Deserializer<'de>,
3119        {
3120            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MdxProtocolSupport>::new(
3121                ".google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport",
3122            ))
3123        }
3124    }
3125}
3126
3127/// Ephemeral certificate creation request.
3128#[derive(Clone, Default, PartialEq)]
3129#[non_exhaustive]
3130pub struct GenerateEphemeralCertRequest {
3131    /// Cloud SQL instance ID. This does not include the project ID.
3132    pub instance: std::string::String,
3133
3134    /// Project ID of the project that contains the instance.
3135    pub project: std::string::String,
3136
3137    /// PEM encoded public key to include in the signed certificate.
3138    pub public_key: std::string::String,
3139
3140    /// Optional. Access token to include in the signed certificate.
3141    pub access_token: std::string::String,
3142
3143    /// Optional. Optional snapshot read timestamp to trade freshness for
3144    /// performance.
3145    pub read_time: std::option::Option<wkt::Timestamp>,
3146
3147    /// Optional. If set, it will contain the cert valid duration.
3148    pub valid_duration: std::option::Option<wkt::Duration>,
3149
3150    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3151}
3152
3153impl GenerateEphemeralCertRequest {
3154    pub fn new() -> Self {
3155        std::default::Default::default()
3156    }
3157
3158    /// Sets the value of [instance][crate::model::GenerateEphemeralCertRequest::instance].
3159    ///
3160    /// # Example
3161    /// ```ignore,no_run
3162    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3163    /// let x = GenerateEphemeralCertRequest::new().set_instance("example");
3164    /// ```
3165    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3166        self.instance = v.into();
3167        self
3168    }
3169
3170    /// Sets the value of [project][crate::model::GenerateEphemeralCertRequest::project].
3171    ///
3172    /// # Example
3173    /// ```ignore,no_run
3174    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3175    /// let x = GenerateEphemeralCertRequest::new().set_project("example");
3176    /// ```
3177    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3178        self.project = v.into();
3179        self
3180    }
3181
3182    /// Sets the value of [public_key][crate::model::GenerateEphemeralCertRequest::public_key].
3183    ///
3184    /// # Example
3185    /// ```ignore,no_run
3186    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3187    /// let x = GenerateEphemeralCertRequest::new().set_public_key("example");
3188    /// ```
3189    pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3190        self.public_key = v.into();
3191        self
3192    }
3193
3194    /// Sets the value of [access_token][crate::model::GenerateEphemeralCertRequest::access_token].
3195    ///
3196    /// # Example
3197    /// ```ignore,no_run
3198    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3199    /// let x = GenerateEphemeralCertRequest::new().set_access_token("example");
3200    /// ```
3201    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3202        self.access_token = v.into();
3203        self
3204    }
3205
3206    /// Sets the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
3207    ///
3208    /// # Example
3209    /// ```ignore,no_run
3210    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3211    /// use wkt::Timestamp;
3212    /// let x = GenerateEphemeralCertRequest::new().set_read_time(Timestamp::default()/* use setters */);
3213    /// ```
3214    pub fn set_read_time<T>(mut self, v: T) -> Self
3215    where
3216        T: std::convert::Into<wkt::Timestamp>,
3217    {
3218        self.read_time = std::option::Option::Some(v.into());
3219        self
3220    }
3221
3222    /// Sets or clears the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
3223    ///
3224    /// # Example
3225    /// ```ignore,no_run
3226    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3227    /// use wkt::Timestamp;
3228    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_read_time(Some(Timestamp::default()/* use setters */));
3229    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_read_time(None::<Timestamp>);
3230    /// ```
3231    pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
3232    where
3233        T: std::convert::Into<wkt::Timestamp>,
3234    {
3235        self.read_time = v.map(|x| x.into());
3236        self
3237    }
3238
3239    /// Sets the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
3240    ///
3241    /// # Example
3242    /// ```ignore,no_run
3243    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3244    /// use wkt::Duration;
3245    /// let x = GenerateEphemeralCertRequest::new().set_valid_duration(Duration::default()/* use setters */);
3246    /// ```
3247    pub fn set_valid_duration<T>(mut self, v: T) -> Self
3248    where
3249        T: std::convert::Into<wkt::Duration>,
3250    {
3251        self.valid_duration = std::option::Option::Some(v.into());
3252        self
3253    }
3254
3255    /// Sets or clears the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
3256    ///
3257    /// # Example
3258    /// ```ignore,no_run
3259    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3260    /// use wkt::Duration;
3261    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_valid_duration(Some(Duration::default()/* use setters */));
3262    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_valid_duration(None::<Duration>);
3263    /// ```
3264    pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
3265    where
3266        T: std::convert::Into<wkt::Duration>,
3267    {
3268        self.valid_duration = v.map(|x| x.into());
3269        self
3270    }
3271}
3272
3273impl wkt::message::Message for GenerateEphemeralCertRequest {
3274    fn typename() -> &'static str {
3275        "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertRequest"
3276    }
3277}
3278
3279/// Ephemeral certificate creation request.
3280#[derive(Clone, Default, PartialEq)]
3281#[non_exhaustive]
3282pub struct GenerateEphemeralCertResponse {
3283    /// Generated cert
3284    pub ephemeral_cert: std::option::Option<crate::model::SslCert>,
3285
3286    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3287}
3288
3289impl GenerateEphemeralCertResponse {
3290    pub fn new() -> Self {
3291        std::default::Default::default()
3292    }
3293
3294    /// Sets the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
3295    ///
3296    /// # Example
3297    /// ```ignore,no_run
3298    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertResponse;
3299    /// use google_cloud_sql_v1::model::SslCert;
3300    /// let x = GenerateEphemeralCertResponse::new().set_ephemeral_cert(SslCert::default()/* use setters */);
3301    /// ```
3302    pub fn set_ephemeral_cert<T>(mut self, v: T) -> Self
3303    where
3304        T: std::convert::Into<crate::model::SslCert>,
3305    {
3306        self.ephemeral_cert = std::option::Option::Some(v.into());
3307        self
3308    }
3309
3310    /// Sets or clears the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
3311    ///
3312    /// # Example
3313    /// ```ignore,no_run
3314    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertResponse;
3315    /// use google_cloud_sql_v1::model::SslCert;
3316    /// let x = GenerateEphemeralCertResponse::new().set_or_clear_ephemeral_cert(Some(SslCert::default()/* use setters */));
3317    /// let x = GenerateEphemeralCertResponse::new().set_or_clear_ephemeral_cert(None::<SslCert>);
3318    /// ```
3319    pub fn set_or_clear_ephemeral_cert<T>(mut self, v: std::option::Option<T>) -> Self
3320    where
3321        T: std::convert::Into<crate::model::SslCert>,
3322    {
3323        self.ephemeral_cert = v.map(|x| x.into());
3324        self
3325    }
3326}
3327
3328impl wkt::message::Message for GenerateEphemeralCertResponse {
3329    fn typename() -> &'static str {
3330        "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertResponse"
3331    }
3332}
3333
3334/// Database delete request.
3335#[derive(Clone, Default, PartialEq)]
3336#[non_exhaustive]
3337pub struct SqlDatabasesDeleteRequest {
3338    /// Name of the database to be deleted in the instance.
3339    pub database: std::string::String,
3340
3341    /// Database instance ID. This does not include the project ID.
3342    pub instance: std::string::String,
3343
3344    /// Project ID of the project that contains the instance.
3345    pub project: std::string::String,
3346
3347    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3348}
3349
3350impl SqlDatabasesDeleteRequest {
3351    pub fn new() -> Self {
3352        std::default::Default::default()
3353    }
3354
3355    /// Sets the value of [database][crate::model::SqlDatabasesDeleteRequest::database].
3356    ///
3357    /// # Example
3358    /// ```ignore,no_run
3359    /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3360    /// let x = SqlDatabasesDeleteRequest::new().set_database("example");
3361    /// ```
3362    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3363        self.database = v.into();
3364        self
3365    }
3366
3367    /// Sets the value of [instance][crate::model::SqlDatabasesDeleteRequest::instance].
3368    ///
3369    /// # Example
3370    /// ```ignore,no_run
3371    /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3372    /// let x = SqlDatabasesDeleteRequest::new().set_instance("example");
3373    /// ```
3374    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3375        self.instance = v.into();
3376        self
3377    }
3378
3379    /// Sets the value of [project][crate::model::SqlDatabasesDeleteRequest::project].
3380    ///
3381    /// # Example
3382    /// ```ignore,no_run
3383    /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3384    /// let x = SqlDatabasesDeleteRequest::new().set_project("example");
3385    /// ```
3386    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3387        self.project = v.into();
3388        self
3389    }
3390}
3391
3392impl wkt::message::Message for SqlDatabasesDeleteRequest {
3393    fn typename() -> &'static str {
3394        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesDeleteRequest"
3395    }
3396}
3397
3398/// Database get request.
3399#[derive(Clone, Default, PartialEq)]
3400#[non_exhaustive]
3401pub struct SqlDatabasesGetRequest {
3402    /// Name of the database in the instance.
3403    pub database: std::string::String,
3404
3405    /// Database instance ID. This does not include the project ID.
3406    pub instance: std::string::String,
3407
3408    /// Project ID of the project that contains the instance.
3409    pub project: std::string::String,
3410
3411    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3412}
3413
3414impl SqlDatabasesGetRequest {
3415    pub fn new() -> Self {
3416        std::default::Default::default()
3417    }
3418
3419    /// Sets the value of [database][crate::model::SqlDatabasesGetRequest::database].
3420    ///
3421    /// # Example
3422    /// ```ignore,no_run
3423    /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3424    /// let x = SqlDatabasesGetRequest::new().set_database("example");
3425    /// ```
3426    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3427        self.database = v.into();
3428        self
3429    }
3430
3431    /// Sets the value of [instance][crate::model::SqlDatabasesGetRequest::instance].
3432    ///
3433    /// # Example
3434    /// ```ignore,no_run
3435    /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3436    /// let x = SqlDatabasesGetRequest::new().set_instance("example");
3437    /// ```
3438    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3439        self.instance = v.into();
3440        self
3441    }
3442
3443    /// Sets the value of [project][crate::model::SqlDatabasesGetRequest::project].
3444    ///
3445    /// # Example
3446    /// ```ignore,no_run
3447    /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3448    /// let x = SqlDatabasesGetRequest::new().set_project("example");
3449    /// ```
3450    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3451        self.project = v.into();
3452        self
3453    }
3454}
3455
3456impl wkt::message::Message for SqlDatabasesGetRequest {
3457    fn typename() -> &'static str {
3458        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesGetRequest"
3459    }
3460}
3461
3462/// Database insert request.
3463#[derive(Clone, Default, PartialEq)]
3464#[non_exhaustive]
3465pub struct SqlDatabasesInsertRequest {
3466    /// Database instance ID. This does not include the project ID.
3467    pub instance: std::string::String,
3468
3469    /// Project ID of the project that contains the instance.
3470    pub project: std::string::String,
3471
3472    pub body: std::option::Option<crate::model::Database>,
3473
3474    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3475}
3476
3477impl SqlDatabasesInsertRequest {
3478    pub fn new() -> Self {
3479        std::default::Default::default()
3480    }
3481
3482    /// Sets the value of [instance][crate::model::SqlDatabasesInsertRequest::instance].
3483    ///
3484    /// # Example
3485    /// ```ignore,no_run
3486    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3487    /// let x = SqlDatabasesInsertRequest::new().set_instance("example");
3488    /// ```
3489    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3490        self.instance = v.into();
3491        self
3492    }
3493
3494    /// Sets the value of [project][crate::model::SqlDatabasesInsertRequest::project].
3495    ///
3496    /// # Example
3497    /// ```ignore,no_run
3498    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3499    /// let x = SqlDatabasesInsertRequest::new().set_project("example");
3500    /// ```
3501    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3502        self.project = v.into();
3503        self
3504    }
3505
3506    /// Sets the value of [body][crate::model::SqlDatabasesInsertRequest::body].
3507    ///
3508    /// # Example
3509    /// ```ignore,no_run
3510    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3511    /// use google_cloud_sql_v1::model::Database;
3512    /// let x = SqlDatabasesInsertRequest::new().set_body(Database::default()/* use setters */);
3513    /// ```
3514    pub fn set_body<T>(mut self, v: T) -> Self
3515    where
3516        T: std::convert::Into<crate::model::Database>,
3517    {
3518        self.body = std::option::Option::Some(v.into());
3519        self
3520    }
3521
3522    /// Sets or clears the value of [body][crate::model::SqlDatabasesInsertRequest::body].
3523    ///
3524    /// # Example
3525    /// ```ignore,no_run
3526    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3527    /// use google_cloud_sql_v1::model::Database;
3528    /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
3529    /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(None::<Database>);
3530    /// ```
3531    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3532    where
3533        T: std::convert::Into<crate::model::Database>,
3534    {
3535        self.body = v.map(|x| x.into());
3536        self
3537    }
3538}
3539
3540impl wkt::message::Message for SqlDatabasesInsertRequest {
3541    fn typename() -> &'static str {
3542        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesInsertRequest"
3543    }
3544}
3545
3546/// Database list request.
3547#[derive(Clone, Default, PartialEq)]
3548#[non_exhaustive]
3549pub struct SqlDatabasesListRequest {
3550    /// Cloud SQL instance ID. This does not include the project ID.
3551    pub instance: std::string::String,
3552
3553    /// Project ID of the project that contains the instance.
3554    pub project: std::string::String,
3555
3556    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3557}
3558
3559impl SqlDatabasesListRequest {
3560    pub fn new() -> Self {
3561        std::default::Default::default()
3562    }
3563
3564    /// Sets the value of [instance][crate::model::SqlDatabasesListRequest::instance].
3565    ///
3566    /// # Example
3567    /// ```ignore,no_run
3568    /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
3569    /// let x = SqlDatabasesListRequest::new().set_instance("example");
3570    /// ```
3571    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3572        self.instance = v.into();
3573        self
3574    }
3575
3576    /// Sets the value of [project][crate::model::SqlDatabasesListRequest::project].
3577    ///
3578    /// # Example
3579    /// ```ignore,no_run
3580    /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
3581    /// let x = SqlDatabasesListRequest::new().set_project("example");
3582    /// ```
3583    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3584        self.project = v.into();
3585        self
3586    }
3587}
3588
3589impl wkt::message::Message for SqlDatabasesListRequest {
3590    fn typename() -> &'static str {
3591        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesListRequest"
3592    }
3593}
3594
3595/// Database update request.
3596#[derive(Clone, Default, PartialEq)]
3597#[non_exhaustive]
3598pub struct SqlDatabasesUpdateRequest {
3599    /// Name of the database to be updated in the instance.
3600    pub database: std::string::String,
3601
3602    /// Database instance ID. This does not include the project ID.
3603    pub instance: std::string::String,
3604
3605    /// Project ID of the project that contains the instance.
3606    pub project: std::string::String,
3607
3608    pub body: std::option::Option<crate::model::Database>,
3609
3610    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3611}
3612
3613impl SqlDatabasesUpdateRequest {
3614    pub fn new() -> Self {
3615        std::default::Default::default()
3616    }
3617
3618    /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
3619    ///
3620    /// # Example
3621    /// ```ignore,no_run
3622    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3623    /// let x = SqlDatabasesUpdateRequest::new().set_database("example");
3624    /// ```
3625    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3626        self.database = v.into();
3627        self
3628    }
3629
3630    /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
3631    ///
3632    /// # Example
3633    /// ```ignore,no_run
3634    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3635    /// let x = SqlDatabasesUpdateRequest::new().set_instance("example");
3636    /// ```
3637    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3638        self.instance = v.into();
3639        self
3640    }
3641
3642    /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
3643    ///
3644    /// # Example
3645    /// ```ignore,no_run
3646    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3647    /// let x = SqlDatabasesUpdateRequest::new().set_project("example");
3648    /// ```
3649    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3650        self.project = v.into();
3651        self
3652    }
3653
3654    /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
3655    ///
3656    /// # Example
3657    /// ```ignore,no_run
3658    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3659    /// use google_cloud_sql_v1::model::Database;
3660    /// let x = SqlDatabasesUpdateRequest::new().set_body(Database::default()/* use setters */);
3661    /// ```
3662    pub fn set_body<T>(mut self, v: T) -> Self
3663    where
3664        T: std::convert::Into<crate::model::Database>,
3665    {
3666        self.body = std::option::Option::Some(v.into());
3667        self
3668    }
3669
3670    /// Sets or clears the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
3671    ///
3672    /// # Example
3673    /// ```ignore,no_run
3674    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3675    /// use google_cloud_sql_v1::model::Database;
3676    /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
3677    /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(None::<Database>);
3678    /// ```
3679    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3680    where
3681        T: std::convert::Into<crate::model::Database>,
3682    {
3683        self.body = v.map(|x| x.into());
3684        self
3685    }
3686}
3687
3688impl wkt::message::Message for SqlDatabasesUpdateRequest {
3689    fn typename() -> &'static str {
3690        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesUpdateRequest"
3691    }
3692}
3693
3694/// Database list response.
3695#[derive(Clone, Default, PartialEq)]
3696#[non_exhaustive]
3697pub struct DatabasesListResponse {
3698    /// This is always `sql#databasesList`.
3699    pub kind: std::string::String,
3700
3701    /// List of database resources in the instance.
3702    pub items: std::vec::Vec<crate::model::Database>,
3703
3704    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3705}
3706
3707impl DatabasesListResponse {
3708    pub fn new() -> Self {
3709        std::default::Default::default()
3710    }
3711
3712    /// Sets the value of [kind][crate::model::DatabasesListResponse::kind].
3713    ///
3714    /// # Example
3715    /// ```ignore,no_run
3716    /// # use google_cloud_sql_v1::model::DatabasesListResponse;
3717    /// let x = DatabasesListResponse::new().set_kind("example");
3718    /// ```
3719    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3720        self.kind = v.into();
3721        self
3722    }
3723
3724    /// Sets the value of [items][crate::model::DatabasesListResponse::items].
3725    ///
3726    /// # Example
3727    /// ```ignore,no_run
3728    /// # use google_cloud_sql_v1::model::DatabasesListResponse;
3729    /// use google_cloud_sql_v1::model::Database;
3730    /// let x = DatabasesListResponse::new()
3731    ///     .set_items([
3732    ///         Database::default()/* use setters */,
3733    ///         Database::default()/* use (different) setters */,
3734    ///     ]);
3735    /// ```
3736    pub fn set_items<T, V>(mut self, v: T) -> Self
3737    where
3738        T: std::iter::IntoIterator<Item = V>,
3739        V: std::convert::Into<crate::model::Database>,
3740    {
3741        use std::iter::Iterator;
3742        self.items = v.into_iter().map(|i| i.into()).collect();
3743        self
3744    }
3745}
3746
3747impl wkt::message::Message for DatabasesListResponse {
3748    fn typename() -> &'static str {
3749        "type.googleapis.com/google.cloud.sql.v1.DatabasesListResponse"
3750    }
3751}
3752
3753/// Flags list request.
3754#[derive(Clone, Default, PartialEq)]
3755#[non_exhaustive]
3756pub struct SqlFlagsListRequest {
3757    /// Database type and version you want to retrieve flags for. By default, this
3758    /// method returns flags for all database types and versions.
3759    pub database_version: std::string::String,
3760
3761    /// Optional. Specify the scope of flags to be returned by SqlFlagsListService.
3762    /// Return list of database flags if unspecified.
3763    pub flag_scope: std::option::Option<crate::model::SqlFlagScope>,
3764
3765    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3766}
3767
3768impl SqlFlagsListRequest {
3769    pub fn new() -> Self {
3770        std::default::Default::default()
3771    }
3772
3773    /// Sets the value of [database_version][crate::model::SqlFlagsListRequest::database_version].
3774    ///
3775    /// # Example
3776    /// ```ignore,no_run
3777    /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3778    /// let x = SqlFlagsListRequest::new().set_database_version("example");
3779    /// ```
3780    pub fn set_database_version<T: std::convert::Into<std::string::String>>(
3781        mut self,
3782        v: T,
3783    ) -> Self {
3784        self.database_version = v.into();
3785        self
3786    }
3787
3788    /// Sets the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
3789    ///
3790    /// # Example
3791    /// ```ignore,no_run
3792    /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3793    /// use google_cloud_sql_v1::model::SqlFlagScope;
3794    /// let x0 = SqlFlagsListRequest::new().set_flag_scope(SqlFlagScope::Database);
3795    /// let x1 = SqlFlagsListRequest::new().set_flag_scope(SqlFlagScope::ConnectionPool);
3796    /// ```
3797    pub fn set_flag_scope<T>(mut self, v: T) -> Self
3798    where
3799        T: std::convert::Into<crate::model::SqlFlagScope>,
3800    {
3801        self.flag_scope = std::option::Option::Some(v.into());
3802        self
3803    }
3804
3805    /// Sets or clears the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
3806    ///
3807    /// # Example
3808    /// ```ignore,no_run
3809    /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3810    /// use google_cloud_sql_v1::model::SqlFlagScope;
3811    /// let x0 = SqlFlagsListRequest::new().set_or_clear_flag_scope(Some(SqlFlagScope::Database));
3812    /// let x1 = SqlFlagsListRequest::new().set_or_clear_flag_scope(Some(SqlFlagScope::ConnectionPool));
3813    /// let x_none = SqlFlagsListRequest::new().set_or_clear_flag_scope(None::<SqlFlagScope>);
3814    /// ```
3815    pub fn set_or_clear_flag_scope<T>(mut self, v: std::option::Option<T>) -> Self
3816    where
3817        T: std::convert::Into<crate::model::SqlFlagScope>,
3818    {
3819        self.flag_scope = v.map(|x| x.into());
3820        self
3821    }
3822}
3823
3824impl wkt::message::Message for SqlFlagsListRequest {
3825    fn typename() -> &'static str {
3826        "type.googleapis.com/google.cloud.sql.v1.SqlFlagsListRequest"
3827    }
3828}
3829
3830/// Flags list response.
3831#[derive(Clone, Default, PartialEq)]
3832#[non_exhaustive]
3833pub struct FlagsListResponse {
3834    /// This is always `sql#flagsList`.
3835    pub kind: std::string::String,
3836
3837    /// List of flags.
3838    pub items: std::vec::Vec<crate::model::Flag>,
3839
3840    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3841}
3842
3843impl FlagsListResponse {
3844    pub fn new() -> Self {
3845        std::default::Default::default()
3846    }
3847
3848    /// Sets the value of [kind][crate::model::FlagsListResponse::kind].
3849    ///
3850    /// # Example
3851    /// ```ignore,no_run
3852    /// # use google_cloud_sql_v1::model::FlagsListResponse;
3853    /// let x = FlagsListResponse::new().set_kind("example");
3854    /// ```
3855    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3856        self.kind = v.into();
3857        self
3858    }
3859
3860    /// Sets the value of [items][crate::model::FlagsListResponse::items].
3861    ///
3862    /// # Example
3863    /// ```ignore,no_run
3864    /// # use google_cloud_sql_v1::model::FlagsListResponse;
3865    /// use google_cloud_sql_v1::model::Flag;
3866    /// let x = FlagsListResponse::new()
3867    ///     .set_items([
3868    ///         Flag::default()/* use setters */,
3869    ///         Flag::default()/* use (different) setters */,
3870    ///     ]);
3871    /// ```
3872    pub fn set_items<T, V>(mut self, v: T) -> Self
3873    where
3874        T: std::iter::IntoIterator<Item = V>,
3875        V: std::convert::Into<crate::model::Flag>,
3876    {
3877        use std::iter::Iterator;
3878        self.items = v.into_iter().map(|i| i.into()).collect();
3879        self
3880    }
3881}
3882
3883impl wkt::message::Message for FlagsListResponse {
3884    fn typename() -> &'static str {
3885        "type.googleapis.com/google.cloud.sql.v1.FlagsListResponse"
3886    }
3887}
3888
3889/// A flag resource.
3890#[derive(Clone, Default, PartialEq)]
3891#[non_exhaustive]
3892pub struct Flag {
3893    /// This is the name of the flag. Flag names always use underscores, not
3894    /// hyphens, for example: `max_allowed_packet`
3895    pub name: std::string::String,
3896
3897    /// The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
3898    /// `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
3899    /// value, such as `skip_grant_tables`.
3900    pub r#type: crate::model::SqlFlagType,
3901
3902    /// The database version this flag applies to. Can be
3903    /// MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
3904    /// or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
3905    /// `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
3906    /// `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
3907    /// `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
3908    /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
3909    /// `SQLSERVER_2019_WEB`.
3910    /// See [the complete
3911    /// list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
3912    pub applies_to: std::vec::Vec<crate::model::SqlDatabaseVersion>,
3913
3914    /// For `STRING` flags, a list of strings that the value can be set to.
3915    pub allowed_string_values: std::vec::Vec<std::string::String>,
3916
3917    /// For `INTEGER` flags, the minimum allowed value.
3918    pub min_value: std::option::Option<wkt::Int64Value>,
3919
3920    /// For `INTEGER` flags, the maximum allowed value.
3921    pub max_value: std::option::Option<wkt::Int64Value>,
3922
3923    /// Indicates whether changing this flag will trigger a database restart. Only
3924    /// applicable to Second Generation instances.
3925    pub requires_restart: std::option::Option<wkt::BoolValue>,
3926
3927    /// This is always `sql#flag`.
3928    pub kind: std::string::String,
3929
3930    /// Whether or not the flag is considered in beta.
3931    pub in_beta: std::option::Option<wkt::BoolValue>,
3932
3933    /// Use this field if only certain integers are accepted. Can be combined
3934    /// with min_value and max_value to add additional values.
3935    pub allowed_int_values: std::vec::Vec<i64>,
3936
3937    /// Scope of flag.
3938    pub flag_scope: crate::model::SqlFlagScope,
3939
3940    /// Recommended flag value for UI display.
3941    pub recommended_value: std::option::Option<crate::model::flag::RecommendedValue>,
3942
3943    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3944}
3945
3946impl Flag {
3947    pub fn new() -> Self {
3948        std::default::Default::default()
3949    }
3950
3951    /// Sets the value of [name][crate::model::Flag::name].
3952    ///
3953    /// # Example
3954    /// ```ignore,no_run
3955    /// # use google_cloud_sql_v1::model::Flag;
3956    /// let x = Flag::new().set_name("example");
3957    /// ```
3958    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3959        self.name = v.into();
3960        self
3961    }
3962
3963    /// Sets the value of [r#type][crate::model::Flag::type].
3964    ///
3965    /// # Example
3966    /// ```ignore,no_run
3967    /// # use google_cloud_sql_v1::model::Flag;
3968    /// use google_cloud_sql_v1::model::SqlFlagType;
3969    /// let x0 = Flag::new().set_type(SqlFlagType::Boolean);
3970    /// let x1 = Flag::new().set_type(SqlFlagType::String);
3971    /// let x2 = Flag::new().set_type(SqlFlagType::Integer);
3972    /// ```
3973    pub fn set_type<T: std::convert::Into<crate::model::SqlFlagType>>(mut self, v: T) -> Self {
3974        self.r#type = v.into();
3975        self
3976    }
3977
3978    /// Sets the value of [applies_to][crate::model::Flag::applies_to].
3979    ///
3980    /// # Example
3981    /// ```ignore,no_run
3982    /// # use google_cloud_sql_v1::model::Flag;
3983    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
3984    /// let x = Flag::new().set_applies_to([
3985    ///     SqlDatabaseVersion::Mysql56,
3986    ///     SqlDatabaseVersion::Mysql57,
3987    ///     SqlDatabaseVersion::Mysql80,
3988    /// ]);
3989    /// ```
3990    pub fn set_applies_to<T, V>(mut self, v: T) -> Self
3991    where
3992        T: std::iter::IntoIterator<Item = V>,
3993        V: std::convert::Into<crate::model::SqlDatabaseVersion>,
3994    {
3995        use std::iter::Iterator;
3996        self.applies_to = v.into_iter().map(|i| i.into()).collect();
3997        self
3998    }
3999
4000    /// Sets the value of [allowed_string_values][crate::model::Flag::allowed_string_values].
4001    ///
4002    /// # Example
4003    /// ```ignore,no_run
4004    /// # use google_cloud_sql_v1::model::Flag;
4005    /// let x = Flag::new().set_allowed_string_values(["a", "b", "c"]);
4006    /// ```
4007    pub fn set_allowed_string_values<T, V>(mut self, v: T) -> Self
4008    where
4009        T: std::iter::IntoIterator<Item = V>,
4010        V: std::convert::Into<std::string::String>,
4011    {
4012        use std::iter::Iterator;
4013        self.allowed_string_values = v.into_iter().map(|i| i.into()).collect();
4014        self
4015    }
4016
4017    /// Sets the value of [min_value][crate::model::Flag::min_value].
4018    ///
4019    /// # Example
4020    /// ```ignore,no_run
4021    /// # use google_cloud_sql_v1::model::Flag;
4022    /// use wkt::Int64Value;
4023    /// let x = Flag::new().set_min_value(Int64Value::default()/* use setters */);
4024    /// ```
4025    pub fn set_min_value<T>(mut self, v: T) -> Self
4026    where
4027        T: std::convert::Into<wkt::Int64Value>,
4028    {
4029        self.min_value = std::option::Option::Some(v.into());
4030        self
4031    }
4032
4033    /// Sets or clears the value of [min_value][crate::model::Flag::min_value].
4034    ///
4035    /// # Example
4036    /// ```ignore,no_run
4037    /// # use google_cloud_sql_v1::model::Flag;
4038    /// use wkt::Int64Value;
4039    /// let x = Flag::new().set_or_clear_min_value(Some(Int64Value::default()/* use setters */));
4040    /// let x = Flag::new().set_or_clear_min_value(None::<Int64Value>);
4041    /// ```
4042    pub fn set_or_clear_min_value<T>(mut self, v: std::option::Option<T>) -> Self
4043    where
4044        T: std::convert::Into<wkt::Int64Value>,
4045    {
4046        self.min_value = v.map(|x| x.into());
4047        self
4048    }
4049
4050    /// Sets the value of [max_value][crate::model::Flag::max_value].
4051    ///
4052    /// # Example
4053    /// ```ignore,no_run
4054    /// # use google_cloud_sql_v1::model::Flag;
4055    /// use wkt::Int64Value;
4056    /// let x = Flag::new().set_max_value(Int64Value::default()/* use setters */);
4057    /// ```
4058    pub fn set_max_value<T>(mut self, v: T) -> Self
4059    where
4060        T: std::convert::Into<wkt::Int64Value>,
4061    {
4062        self.max_value = std::option::Option::Some(v.into());
4063        self
4064    }
4065
4066    /// Sets or clears the value of [max_value][crate::model::Flag::max_value].
4067    ///
4068    /// # Example
4069    /// ```ignore,no_run
4070    /// # use google_cloud_sql_v1::model::Flag;
4071    /// use wkt::Int64Value;
4072    /// let x = Flag::new().set_or_clear_max_value(Some(Int64Value::default()/* use setters */));
4073    /// let x = Flag::new().set_or_clear_max_value(None::<Int64Value>);
4074    /// ```
4075    pub fn set_or_clear_max_value<T>(mut self, v: std::option::Option<T>) -> Self
4076    where
4077        T: std::convert::Into<wkt::Int64Value>,
4078    {
4079        self.max_value = v.map(|x| x.into());
4080        self
4081    }
4082
4083    /// Sets the value of [requires_restart][crate::model::Flag::requires_restart].
4084    ///
4085    /// # Example
4086    /// ```ignore,no_run
4087    /// # use google_cloud_sql_v1::model::Flag;
4088    /// use wkt::BoolValue;
4089    /// let x = Flag::new().set_requires_restart(BoolValue::default()/* use setters */);
4090    /// ```
4091    pub fn set_requires_restart<T>(mut self, v: T) -> Self
4092    where
4093        T: std::convert::Into<wkt::BoolValue>,
4094    {
4095        self.requires_restart = std::option::Option::Some(v.into());
4096        self
4097    }
4098
4099    /// Sets or clears the value of [requires_restart][crate::model::Flag::requires_restart].
4100    ///
4101    /// # Example
4102    /// ```ignore,no_run
4103    /// # use google_cloud_sql_v1::model::Flag;
4104    /// use wkt::BoolValue;
4105    /// let x = Flag::new().set_or_clear_requires_restart(Some(BoolValue::default()/* use setters */));
4106    /// let x = Flag::new().set_or_clear_requires_restart(None::<BoolValue>);
4107    /// ```
4108    pub fn set_or_clear_requires_restart<T>(mut self, v: std::option::Option<T>) -> Self
4109    where
4110        T: std::convert::Into<wkt::BoolValue>,
4111    {
4112        self.requires_restart = v.map(|x| x.into());
4113        self
4114    }
4115
4116    /// Sets the value of [kind][crate::model::Flag::kind].
4117    ///
4118    /// # Example
4119    /// ```ignore,no_run
4120    /// # use google_cloud_sql_v1::model::Flag;
4121    /// let x = Flag::new().set_kind("example");
4122    /// ```
4123    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4124        self.kind = v.into();
4125        self
4126    }
4127
4128    /// Sets the value of [in_beta][crate::model::Flag::in_beta].
4129    ///
4130    /// # Example
4131    /// ```ignore,no_run
4132    /// # use google_cloud_sql_v1::model::Flag;
4133    /// use wkt::BoolValue;
4134    /// let x = Flag::new().set_in_beta(BoolValue::default()/* use setters */);
4135    /// ```
4136    pub fn set_in_beta<T>(mut self, v: T) -> Self
4137    where
4138        T: std::convert::Into<wkt::BoolValue>,
4139    {
4140        self.in_beta = std::option::Option::Some(v.into());
4141        self
4142    }
4143
4144    /// Sets or clears the value of [in_beta][crate::model::Flag::in_beta].
4145    ///
4146    /// # Example
4147    /// ```ignore,no_run
4148    /// # use google_cloud_sql_v1::model::Flag;
4149    /// use wkt::BoolValue;
4150    /// let x = Flag::new().set_or_clear_in_beta(Some(BoolValue::default()/* use setters */));
4151    /// let x = Flag::new().set_or_clear_in_beta(None::<BoolValue>);
4152    /// ```
4153    pub fn set_or_clear_in_beta<T>(mut self, v: std::option::Option<T>) -> Self
4154    where
4155        T: std::convert::Into<wkt::BoolValue>,
4156    {
4157        self.in_beta = v.map(|x| x.into());
4158        self
4159    }
4160
4161    /// Sets the value of [allowed_int_values][crate::model::Flag::allowed_int_values].
4162    ///
4163    /// # Example
4164    /// ```ignore,no_run
4165    /// # use google_cloud_sql_v1::model::Flag;
4166    /// let x = Flag::new().set_allowed_int_values([1, 2, 3]);
4167    /// ```
4168    pub fn set_allowed_int_values<T, V>(mut self, v: T) -> Self
4169    where
4170        T: std::iter::IntoIterator<Item = V>,
4171        V: std::convert::Into<i64>,
4172    {
4173        use std::iter::Iterator;
4174        self.allowed_int_values = v.into_iter().map(|i| i.into()).collect();
4175        self
4176    }
4177
4178    /// Sets the value of [flag_scope][crate::model::Flag::flag_scope].
4179    ///
4180    /// # Example
4181    /// ```ignore,no_run
4182    /// # use google_cloud_sql_v1::model::Flag;
4183    /// use google_cloud_sql_v1::model::SqlFlagScope;
4184    /// let x0 = Flag::new().set_flag_scope(SqlFlagScope::Database);
4185    /// let x1 = Flag::new().set_flag_scope(SqlFlagScope::ConnectionPool);
4186    /// ```
4187    pub fn set_flag_scope<T: std::convert::Into<crate::model::SqlFlagScope>>(
4188        mut self,
4189        v: T,
4190    ) -> Self {
4191        self.flag_scope = v.into();
4192        self
4193    }
4194
4195    /// Sets the value of [recommended_value][crate::model::Flag::recommended_value].
4196    ///
4197    /// Note that all the setters affecting `recommended_value` are mutually
4198    /// exclusive.
4199    ///
4200    /// # Example
4201    /// ```ignore,no_run
4202    /// # use google_cloud_sql_v1::model::Flag;
4203    /// use google_cloud_sql_v1::model::flag::RecommendedValue;
4204    /// let x = Flag::new().set_recommended_value(Some(RecommendedValue::RecommendedStringValue("example".to_string())));
4205    /// ```
4206    pub fn set_recommended_value<
4207        T: std::convert::Into<std::option::Option<crate::model::flag::RecommendedValue>>,
4208    >(
4209        mut self,
4210        v: T,
4211    ) -> Self {
4212        self.recommended_value = v.into();
4213        self
4214    }
4215
4216    /// The value of [recommended_value][crate::model::Flag::recommended_value]
4217    /// if it holds a `RecommendedStringValue`, `None` if the field is not set or
4218    /// holds a different branch.
4219    pub fn recommended_string_value(&self) -> std::option::Option<&std::string::String> {
4220        #[allow(unreachable_patterns)]
4221        self.recommended_value.as_ref().and_then(|v| match v {
4222            crate::model::flag::RecommendedValue::RecommendedStringValue(v) => {
4223                std::option::Option::Some(v)
4224            }
4225            _ => std::option::Option::None,
4226        })
4227    }
4228
4229    /// Sets the value of [recommended_value][crate::model::Flag::recommended_value]
4230    /// to hold a `RecommendedStringValue`.
4231    ///
4232    /// Note that all the setters affecting `recommended_value` are
4233    /// mutually exclusive.
4234    ///
4235    /// # Example
4236    /// ```ignore,no_run
4237    /// # use google_cloud_sql_v1::model::Flag;
4238    /// let x = Flag::new().set_recommended_string_value("example");
4239    /// assert!(x.recommended_string_value().is_some());
4240    /// assert!(x.recommended_int_value().is_none());
4241    /// ```
4242    pub fn set_recommended_string_value<T: std::convert::Into<std::string::String>>(
4243        mut self,
4244        v: T,
4245    ) -> Self {
4246        self.recommended_value = std::option::Option::Some(
4247            crate::model::flag::RecommendedValue::RecommendedStringValue(v.into()),
4248        );
4249        self
4250    }
4251
4252    /// The value of [recommended_value][crate::model::Flag::recommended_value]
4253    /// if it holds a `RecommendedIntValue`, `None` if the field is not set or
4254    /// holds a different branch.
4255    pub fn recommended_int_value(&self) -> std::option::Option<&std::boxed::Box<wkt::Int64Value>> {
4256        #[allow(unreachable_patterns)]
4257        self.recommended_value.as_ref().and_then(|v| match v {
4258            crate::model::flag::RecommendedValue::RecommendedIntValue(v) => {
4259                std::option::Option::Some(v)
4260            }
4261            _ => std::option::Option::None,
4262        })
4263    }
4264
4265    /// Sets the value of [recommended_value][crate::model::Flag::recommended_value]
4266    /// to hold a `RecommendedIntValue`.
4267    ///
4268    /// Note that all the setters affecting `recommended_value` are
4269    /// mutually exclusive.
4270    ///
4271    /// # Example
4272    /// ```ignore,no_run
4273    /// # use google_cloud_sql_v1::model::Flag;
4274    /// use wkt::Int64Value;
4275    /// let x = Flag::new().set_recommended_int_value(Int64Value::default()/* use setters */);
4276    /// assert!(x.recommended_int_value().is_some());
4277    /// assert!(x.recommended_string_value().is_none());
4278    /// ```
4279    pub fn set_recommended_int_value<T: std::convert::Into<std::boxed::Box<wkt::Int64Value>>>(
4280        mut self,
4281        v: T,
4282    ) -> Self {
4283        self.recommended_value = std::option::Option::Some(
4284            crate::model::flag::RecommendedValue::RecommendedIntValue(v.into()),
4285        );
4286        self
4287    }
4288}
4289
4290impl wkt::message::Message for Flag {
4291    fn typename() -> &'static str {
4292        "type.googleapis.com/google.cloud.sql.v1.Flag"
4293    }
4294}
4295
4296/// Defines additional types related to [Flag].
4297pub mod flag {
4298    #[allow(unused_imports)]
4299    use super::*;
4300
4301    /// Recommended flag value for UI display.
4302    #[derive(Clone, Debug, PartialEq)]
4303    #[non_exhaustive]
4304    pub enum RecommendedValue {
4305        /// Recommended string value in string format for UI display.
4306        RecommendedStringValue(std::string::String),
4307        /// Recommended int value in integer format for UI display.
4308        RecommendedIntValue(std::boxed::Box<wkt::Int64Value>),
4309    }
4310}
4311
4312/// Instance add server CA request.
4313#[derive(Clone, Default, PartialEq)]
4314#[non_exhaustive]
4315pub struct SqlInstancesAddServerCaRequest {
4316    /// Cloud SQL instance ID. This does not include the project ID.
4317    pub instance: std::string::String,
4318
4319    /// Project ID of the project that contains the instance.
4320    pub project: std::string::String,
4321
4322    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4323}
4324
4325impl SqlInstancesAddServerCaRequest {
4326    pub fn new() -> Self {
4327        std::default::Default::default()
4328    }
4329
4330    /// Sets the value of [instance][crate::model::SqlInstancesAddServerCaRequest::instance].
4331    ///
4332    /// # Example
4333    /// ```ignore,no_run
4334    /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
4335    /// let x = SqlInstancesAddServerCaRequest::new().set_instance("example");
4336    /// ```
4337    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4338        self.instance = v.into();
4339        self
4340    }
4341
4342    /// Sets the value of [project][crate::model::SqlInstancesAddServerCaRequest::project].
4343    ///
4344    /// # Example
4345    /// ```ignore,no_run
4346    /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
4347    /// let x = SqlInstancesAddServerCaRequest::new().set_project("example");
4348    /// ```
4349    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4350        self.project = v.into();
4351        self
4352    }
4353}
4354
4355impl wkt::message::Message for SqlInstancesAddServerCaRequest {
4356    fn typename() -> &'static str {
4357        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCaRequest"
4358    }
4359}
4360
4361/// Instance add server certificate request.
4362#[derive(Clone, Default, PartialEq)]
4363#[non_exhaustive]
4364pub struct SqlInstancesAddServerCertificateRequest {
4365    /// Cloud SQL instance ID. This does not include the project ID.
4366    pub instance: std::string::String,
4367
4368    /// Project ID of the project that contains the instance.
4369    pub project: std::string::String,
4370
4371    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4372}
4373
4374impl SqlInstancesAddServerCertificateRequest {
4375    pub fn new() -> Self {
4376        std::default::Default::default()
4377    }
4378
4379    /// Sets the value of [instance][crate::model::SqlInstancesAddServerCertificateRequest::instance].
4380    ///
4381    /// # Example
4382    /// ```ignore,no_run
4383    /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCertificateRequest;
4384    /// let x = SqlInstancesAddServerCertificateRequest::new().set_instance("example");
4385    /// ```
4386    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4387        self.instance = v.into();
4388        self
4389    }
4390
4391    /// Sets the value of [project][crate::model::SqlInstancesAddServerCertificateRequest::project].
4392    ///
4393    /// # Example
4394    /// ```ignore,no_run
4395    /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCertificateRequest;
4396    /// let x = SqlInstancesAddServerCertificateRequest::new().set_project("example");
4397    /// ```
4398    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4399        self.project = v.into();
4400        self
4401    }
4402}
4403
4404impl wkt::message::Message for SqlInstancesAddServerCertificateRequest {
4405    fn typename() -> &'static str {
4406        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest"
4407    }
4408}
4409
4410/// Instance add Entra ID certificate request.
4411#[derive(Clone, Default, PartialEq)]
4412#[non_exhaustive]
4413pub struct SqlInstancesAddEntraIdCertificateRequest {
4414    /// Required. Cloud SQL instance ID. This does not include the project ID.
4415    pub instance: std::string::String,
4416
4417    /// Required. Project ID of the project that contains the instance.
4418    pub project: std::string::String,
4419
4420    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4421}
4422
4423impl SqlInstancesAddEntraIdCertificateRequest {
4424    pub fn new() -> Self {
4425        std::default::Default::default()
4426    }
4427
4428    /// Sets the value of [instance][crate::model::SqlInstancesAddEntraIdCertificateRequest::instance].
4429    ///
4430    /// # Example
4431    /// ```ignore,no_run
4432    /// # use google_cloud_sql_v1::model::SqlInstancesAddEntraIdCertificateRequest;
4433    /// let x = SqlInstancesAddEntraIdCertificateRequest::new().set_instance("example");
4434    /// ```
4435    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4436        self.instance = v.into();
4437        self
4438    }
4439
4440    /// Sets the value of [project][crate::model::SqlInstancesAddEntraIdCertificateRequest::project].
4441    ///
4442    /// # Example
4443    /// ```ignore,no_run
4444    /// # use google_cloud_sql_v1::model::SqlInstancesAddEntraIdCertificateRequest;
4445    /// let x = SqlInstancesAddEntraIdCertificateRequest::new().set_project("example");
4446    /// ```
4447    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4448        self.project = v.into();
4449        self
4450    }
4451}
4452
4453impl wkt::message::Message for SqlInstancesAddEntraIdCertificateRequest {
4454    fn typename() -> &'static str {
4455        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest"
4456    }
4457}
4458
4459/// Instance clone request.
4460#[derive(Clone, Default, PartialEq)]
4461#[non_exhaustive]
4462pub struct SqlInstancesCloneRequest {
4463    /// Required. The ID of the Cloud SQL instance to be cloned (source). This does
4464    /// not include the project ID.
4465    pub instance: std::string::String,
4466
4467    /// Required. Project ID of the source as well as the clone Cloud SQL instance.
4468    pub project: std::string::String,
4469
4470    pub body: std::option::Option<crate::model::InstancesCloneRequest>,
4471
4472    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4473}
4474
4475impl SqlInstancesCloneRequest {
4476    pub fn new() -> Self {
4477        std::default::Default::default()
4478    }
4479
4480    /// Sets the value of [instance][crate::model::SqlInstancesCloneRequest::instance].
4481    ///
4482    /// # Example
4483    /// ```ignore,no_run
4484    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4485    /// let x = SqlInstancesCloneRequest::new().set_instance("example");
4486    /// ```
4487    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4488        self.instance = v.into();
4489        self
4490    }
4491
4492    /// Sets the value of [project][crate::model::SqlInstancesCloneRequest::project].
4493    ///
4494    /// # Example
4495    /// ```ignore,no_run
4496    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4497    /// let x = SqlInstancesCloneRequest::new().set_project("example");
4498    /// ```
4499    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4500        self.project = v.into();
4501        self
4502    }
4503
4504    /// Sets the value of [body][crate::model::SqlInstancesCloneRequest::body].
4505    ///
4506    /// # Example
4507    /// ```ignore,no_run
4508    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4509    /// use google_cloud_sql_v1::model::InstancesCloneRequest;
4510    /// let x = SqlInstancesCloneRequest::new().set_body(InstancesCloneRequest::default()/* use setters */);
4511    /// ```
4512    pub fn set_body<T>(mut self, v: T) -> Self
4513    where
4514        T: std::convert::Into<crate::model::InstancesCloneRequest>,
4515    {
4516        self.body = std::option::Option::Some(v.into());
4517        self
4518    }
4519
4520    /// Sets or clears the value of [body][crate::model::SqlInstancesCloneRequest::body].
4521    ///
4522    /// # Example
4523    /// ```ignore,no_run
4524    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4525    /// use google_cloud_sql_v1::model::InstancesCloneRequest;
4526    /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(Some(InstancesCloneRequest::default()/* use setters */));
4527    /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(None::<InstancesCloneRequest>);
4528    /// ```
4529    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4530    where
4531        T: std::convert::Into<crate::model::InstancesCloneRequest>,
4532    {
4533        self.body = v.map(|x| x.into());
4534        self
4535    }
4536}
4537
4538impl wkt::message::Message for SqlInstancesCloneRequest {
4539    fn typename() -> &'static str {
4540        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCloneRequest"
4541    }
4542}
4543
4544/// Instance delete request.
4545#[derive(Clone, Default, PartialEq)]
4546#[non_exhaustive]
4547pub struct SqlInstancesDeleteRequest {
4548    /// Cloud SQL instance ID. This does not include the project ID.
4549    pub instance: std::string::String,
4550
4551    /// Project ID of the project that contains the instance to be deleted.
4552    pub project: std::string::String,
4553
4554    /// Flag to opt-in for final backup. By default, it is turned off.
4555    pub enable_final_backup: std::option::Option<bool>,
4556
4557    /// Optional. The description of the final backup.
4558    pub final_backup_description: std::string::String,
4559
4560    pub expiration: std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
4561
4562    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4563}
4564
4565impl SqlInstancesDeleteRequest {
4566    pub fn new() -> Self {
4567        std::default::Default::default()
4568    }
4569
4570    /// Sets the value of [instance][crate::model::SqlInstancesDeleteRequest::instance].
4571    ///
4572    /// # Example
4573    /// ```ignore,no_run
4574    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4575    /// let x = SqlInstancesDeleteRequest::new().set_instance("example");
4576    /// ```
4577    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4578        self.instance = v.into();
4579        self
4580    }
4581
4582    /// Sets the value of [project][crate::model::SqlInstancesDeleteRequest::project].
4583    ///
4584    /// # Example
4585    /// ```ignore,no_run
4586    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4587    /// let x = SqlInstancesDeleteRequest::new().set_project("example");
4588    /// ```
4589    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4590        self.project = v.into();
4591        self
4592    }
4593
4594    /// Sets the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
4595    ///
4596    /// # Example
4597    /// ```ignore,no_run
4598    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4599    /// let x = SqlInstancesDeleteRequest::new().set_enable_final_backup(true);
4600    /// ```
4601    pub fn set_enable_final_backup<T>(mut self, v: T) -> Self
4602    where
4603        T: std::convert::Into<bool>,
4604    {
4605        self.enable_final_backup = std::option::Option::Some(v.into());
4606        self
4607    }
4608
4609    /// Sets or clears the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
4610    ///
4611    /// # Example
4612    /// ```ignore,no_run
4613    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4614    /// let x = SqlInstancesDeleteRequest::new().set_or_clear_enable_final_backup(Some(false));
4615    /// let x = SqlInstancesDeleteRequest::new().set_or_clear_enable_final_backup(None::<bool>);
4616    /// ```
4617    pub fn set_or_clear_enable_final_backup<T>(mut self, v: std::option::Option<T>) -> Self
4618    where
4619        T: std::convert::Into<bool>,
4620    {
4621        self.enable_final_backup = v.map(|x| x.into());
4622        self
4623    }
4624
4625    /// Sets the value of [final_backup_description][crate::model::SqlInstancesDeleteRequest::final_backup_description].
4626    ///
4627    /// # Example
4628    /// ```ignore,no_run
4629    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4630    /// let x = SqlInstancesDeleteRequest::new().set_final_backup_description("example");
4631    /// ```
4632    pub fn set_final_backup_description<T: std::convert::Into<std::string::String>>(
4633        mut self,
4634        v: T,
4635    ) -> Self {
4636        self.final_backup_description = v.into();
4637        self
4638    }
4639
4640    /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration].
4641    ///
4642    /// Note that all the setters affecting `expiration` are mutually
4643    /// exclusive.
4644    ///
4645    /// # Example
4646    /// ```ignore,no_run
4647    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4648    /// use google_cloud_sql_v1::model::sql_instances_delete_request::Expiration;
4649    /// let x = SqlInstancesDeleteRequest::new().set_expiration(Some(Expiration::FinalBackupTtlDays(42)));
4650    /// ```
4651    pub fn set_expiration<
4652        T: std::convert::Into<
4653                std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
4654            >,
4655    >(
4656        mut self,
4657        v: T,
4658    ) -> Self {
4659        self.expiration = v.into();
4660        self
4661    }
4662
4663    /// The value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4664    /// if it holds a `FinalBackupTtlDays`, `None` if the field is not set or
4665    /// holds a different branch.
4666    pub fn final_backup_ttl_days(&self) -> std::option::Option<&i64> {
4667        #[allow(unreachable_patterns)]
4668        self.expiration.as_ref().and_then(|v| match v {
4669            crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v) => {
4670                std::option::Option::Some(v)
4671            }
4672            _ => std::option::Option::None,
4673        })
4674    }
4675
4676    /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4677    /// to hold a `FinalBackupTtlDays`.
4678    ///
4679    /// Note that all the setters affecting `expiration` are
4680    /// mutually exclusive.
4681    ///
4682    /// # Example
4683    /// ```ignore,no_run
4684    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4685    /// let x = SqlInstancesDeleteRequest::new().set_final_backup_ttl_days(42);
4686    /// assert!(x.final_backup_ttl_days().is_some());
4687    /// assert!(x.final_backup_expiry_time().is_none());
4688    /// ```
4689    pub fn set_final_backup_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4690        self.expiration = std::option::Option::Some(
4691            crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v.into()),
4692        );
4693        self
4694    }
4695
4696    /// The value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4697    /// if it holds a `FinalBackupExpiryTime`, `None` if the field is not set or
4698    /// holds a different branch.
4699    pub fn final_backup_expiry_time(
4700        &self,
4701    ) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
4702        #[allow(unreachable_patterns)]
4703        self.expiration.as_ref().and_then(|v| match v {
4704            crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v) => {
4705                std::option::Option::Some(v)
4706            }
4707            _ => std::option::Option::None,
4708        })
4709    }
4710
4711    /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4712    /// to hold a `FinalBackupExpiryTime`.
4713    ///
4714    /// Note that all the setters affecting `expiration` are
4715    /// mutually exclusive.
4716    ///
4717    /// # Example
4718    /// ```ignore,no_run
4719    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4720    /// use wkt::Timestamp;
4721    /// let x = SqlInstancesDeleteRequest::new().set_final_backup_expiry_time(Timestamp::default()/* use setters */);
4722    /// assert!(x.final_backup_expiry_time().is_some());
4723    /// assert!(x.final_backup_ttl_days().is_none());
4724    /// ```
4725    pub fn set_final_backup_expiry_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
4726        mut self,
4727        v: T,
4728    ) -> Self {
4729        self.expiration = std::option::Option::Some(
4730            crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v.into()),
4731        );
4732        self
4733    }
4734}
4735
4736impl wkt::message::Message for SqlInstancesDeleteRequest {
4737    fn typename() -> &'static str {
4738        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDeleteRequest"
4739    }
4740}
4741
4742/// Defines additional types related to [SqlInstancesDeleteRequest].
4743pub mod sql_instances_delete_request {
4744    #[allow(unused_imports)]
4745    use super::*;
4746
4747    #[derive(Clone, Debug, PartialEq)]
4748    #[non_exhaustive]
4749    pub enum Expiration {
4750        /// Optional. Retention period of the final backup.
4751        FinalBackupTtlDays(i64),
4752        /// Optional. Final Backup expiration time.
4753        /// Timestamp in UTC of when this resource is considered expired.
4754        FinalBackupExpiryTime(std::boxed::Box<wkt::Timestamp>),
4755    }
4756}
4757
4758/// Instance demote master request.
4759#[derive(Clone, Default, PartialEq)]
4760#[non_exhaustive]
4761pub struct SqlInstancesDemoteMasterRequest {
4762    /// Cloud SQL instance name.
4763    pub instance: std::string::String,
4764
4765    /// ID of the project that contains the instance.
4766    pub project: std::string::String,
4767
4768    pub body: std::option::Option<crate::model::InstancesDemoteMasterRequest>,
4769
4770    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4771}
4772
4773impl SqlInstancesDemoteMasterRequest {
4774    pub fn new() -> Self {
4775        std::default::Default::default()
4776    }
4777
4778    /// Sets the value of [instance][crate::model::SqlInstancesDemoteMasterRequest::instance].
4779    ///
4780    /// # Example
4781    /// ```ignore,no_run
4782    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4783    /// let x = SqlInstancesDemoteMasterRequest::new().set_instance("example");
4784    /// ```
4785    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4786        self.instance = v.into();
4787        self
4788    }
4789
4790    /// Sets the value of [project][crate::model::SqlInstancesDemoteMasterRequest::project].
4791    ///
4792    /// # Example
4793    /// ```ignore,no_run
4794    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4795    /// let x = SqlInstancesDemoteMasterRequest::new().set_project("example");
4796    /// ```
4797    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4798        self.project = v.into();
4799        self
4800    }
4801
4802    /// Sets the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
4803    ///
4804    /// # Example
4805    /// ```ignore,no_run
4806    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4807    /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
4808    /// let x = SqlInstancesDemoteMasterRequest::new().set_body(InstancesDemoteMasterRequest::default()/* use setters */);
4809    /// ```
4810    pub fn set_body<T>(mut self, v: T) -> Self
4811    where
4812        T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
4813    {
4814        self.body = std::option::Option::Some(v.into());
4815        self
4816    }
4817
4818    /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
4819    ///
4820    /// # Example
4821    /// ```ignore,no_run
4822    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4823    /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
4824    /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(Some(InstancesDemoteMasterRequest::default()/* use setters */));
4825    /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(None::<InstancesDemoteMasterRequest>);
4826    /// ```
4827    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4828    where
4829        T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
4830    {
4831        self.body = v.map(|x| x.into());
4832        self
4833    }
4834}
4835
4836impl wkt::message::Message for SqlInstancesDemoteMasterRequest {
4837    fn typename() -> &'static str {
4838        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteMasterRequest"
4839    }
4840}
4841
4842/// Instance demote request.
4843#[derive(Clone, Default, PartialEq)]
4844#[non_exhaustive]
4845pub struct SqlInstancesDemoteRequest {
4846    /// Required. Cloud SQL instance name.
4847    pub instance: std::string::String,
4848
4849    /// Required. ID of the project that contains the instance.
4850    pub project: std::string::String,
4851
4852    /// Required. The request body.
4853    pub body: std::option::Option<crate::model::InstancesDemoteRequest>,
4854
4855    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4856}
4857
4858impl SqlInstancesDemoteRequest {
4859    pub fn new() -> Self {
4860        std::default::Default::default()
4861    }
4862
4863    /// Sets the value of [instance][crate::model::SqlInstancesDemoteRequest::instance].
4864    ///
4865    /// # Example
4866    /// ```ignore,no_run
4867    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4868    /// let x = SqlInstancesDemoteRequest::new().set_instance("example");
4869    /// ```
4870    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4871        self.instance = v.into();
4872        self
4873    }
4874
4875    /// Sets the value of [project][crate::model::SqlInstancesDemoteRequest::project].
4876    ///
4877    /// # Example
4878    /// ```ignore,no_run
4879    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4880    /// let x = SqlInstancesDemoteRequest::new().set_project("example");
4881    /// ```
4882    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4883        self.project = v.into();
4884        self
4885    }
4886
4887    /// Sets the value of [body][crate::model::SqlInstancesDemoteRequest::body].
4888    ///
4889    /// # Example
4890    /// ```ignore,no_run
4891    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4892    /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
4893    /// let x = SqlInstancesDemoteRequest::new().set_body(InstancesDemoteRequest::default()/* use setters */);
4894    /// ```
4895    pub fn set_body<T>(mut self, v: T) -> Self
4896    where
4897        T: std::convert::Into<crate::model::InstancesDemoteRequest>,
4898    {
4899        self.body = std::option::Option::Some(v.into());
4900        self
4901    }
4902
4903    /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteRequest::body].
4904    ///
4905    /// # Example
4906    /// ```ignore,no_run
4907    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4908    /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
4909    /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(Some(InstancesDemoteRequest::default()/* use setters */));
4910    /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(None::<InstancesDemoteRequest>);
4911    /// ```
4912    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4913    where
4914        T: std::convert::Into<crate::model::InstancesDemoteRequest>,
4915    {
4916        self.body = v.map(|x| x.into());
4917        self
4918    }
4919}
4920
4921impl wkt::message::Message for SqlInstancesDemoteRequest {
4922    fn typename() -> &'static str {
4923        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteRequest"
4924    }
4925}
4926
4927/// Instance export request.
4928#[derive(Clone, Default, PartialEq)]
4929#[non_exhaustive]
4930pub struct SqlInstancesExportRequest {
4931    /// Cloud SQL instance ID. This does not include the project ID.
4932    pub instance: std::string::String,
4933
4934    /// Project ID of the project that contains the instance to be exported.
4935    pub project: std::string::String,
4936
4937    pub body: std::option::Option<crate::model::InstancesExportRequest>,
4938
4939    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4940}
4941
4942impl SqlInstancesExportRequest {
4943    pub fn new() -> Self {
4944        std::default::Default::default()
4945    }
4946
4947    /// Sets the value of [instance][crate::model::SqlInstancesExportRequest::instance].
4948    ///
4949    /// # Example
4950    /// ```ignore,no_run
4951    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
4952    /// let x = SqlInstancesExportRequest::new().set_instance("example");
4953    /// ```
4954    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4955        self.instance = v.into();
4956        self
4957    }
4958
4959    /// Sets the value of [project][crate::model::SqlInstancesExportRequest::project].
4960    ///
4961    /// # Example
4962    /// ```ignore,no_run
4963    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
4964    /// let x = SqlInstancesExportRequest::new().set_project("example");
4965    /// ```
4966    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4967        self.project = v.into();
4968        self
4969    }
4970
4971    /// Sets the value of [body][crate::model::SqlInstancesExportRequest::body].
4972    ///
4973    /// # Example
4974    /// ```ignore,no_run
4975    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
4976    /// use google_cloud_sql_v1::model::InstancesExportRequest;
4977    /// let x = SqlInstancesExportRequest::new().set_body(InstancesExportRequest::default()/* use setters */);
4978    /// ```
4979    pub fn set_body<T>(mut self, v: T) -> Self
4980    where
4981        T: std::convert::Into<crate::model::InstancesExportRequest>,
4982    {
4983        self.body = std::option::Option::Some(v.into());
4984        self
4985    }
4986
4987    /// Sets or clears the value of [body][crate::model::SqlInstancesExportRequest::body].
4988    ///
4989    /// # Example
4990    /// ```ignore,no_run
4991    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
4992    /// use google_cloud_sql_v1::model::InstancesExportRequest;
4993    /// let x = SqlInstancesExportRequest::new().set_or_clear_body(Some(InstancesExportRequest::default()/* use setters */));
4994    /// let x = SqlInstancesExportRequest::new().set_or_clear_body(None::<InstancesExportRequest>);
4995    /// ```
4996    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4997    where
4998        T: std::convert::Into<crate::model::InstancesExportRequest>,
4999    {
5000        self.body = v.map(|x| x.into());
5001        self
5002    }
5003}
5004
5005impl wkt::message::Message for SqlInstancesExportRequest {
5006    fn typename() -> &'static str {
5007        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExportRequest"
5008    }
5009}
5010
5011/// Instance failover request.
5012#[derive(Clone, Default, PartialEq)]
5013#[non_exhaustive]
5014pub struct SqlInstancesFailoverRequest {
5015    /// Cloud SQL instance ID. This does not include the project ID.
5016    pub instance: std::string::String,
5017
5018    /// ID of the project that contains the read replica.
5019    pub project: std::string::String,
5020
5021    pub body: std::option::Option<crate::model::InstancesFailoverRequest>,
5022
5023    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5024}
5025
5026impl SqlInstancesFailoverRequest {
5027    pub fn new() -> Self {
5028        std::default::Default::default()
5029    }
5030
5031    /// Sets the value of [instance][crate::model::SqlInstancesFailoverRequest::instance].
5032    ///
5033    /// # Example
5034    /// ```ignore,no_run
5035    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5036    /// let x = SqlInstancesFailoverRequest::new().set_instance("example");
5037    /// ```
5038    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5039        self.instance = v.into();
5040        self
5041    }
5042
5043    /// Sets the value of [project][crate::model::SqlInstancesFailoverRequest::project].
5044    ///
5045    /// # Example
5046    /// ```ignore,no_run
5047    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5048    /// let x = SqlInstancesFailoverRequest::new().set_project("example");
5049    /// ```
5050    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5051        self.project = v.into();
5052        self
5053    }
5054
5055    /// Sets the value of [body][crate::model::SqlInstancesFailoverRequest::body].
5056    ///
5057    /// # Example
5058    /// ```ignore,no_run
5059    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5060    /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
5061    /// let x = SqlInstancesFailoverRequest::new().set_body(InstancesFailoverRequest::default()/* use setters */);
5062    /// ```
5063    pub fn set_body<T>(mut self, v: T) -> Self
5064    where
5065        T: std::convert::Into<crate::model::InstancesFailoverRequest>,
5066    {
5067        self.body = std::option::Option::Some(v.into());
5068        self
5069    }
5070
5071    /// Sets or clears the value of [body][crate::model::SqlInstancesFailoverRequest::body].
5072    ///
5073    /// # Example
5074    /// ```ignore,no_run
5075    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5076    /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
5077    /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(Some(InstancesFailoverRequest::default()/* use setters */));
5078    /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(None::<InstancesFailoverRequest>);
5079    /// ```
5080    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5081    where
5082        T: std::convert::Into<crate::model::InstancesFailoverRequest>,
5083    {
5084        self.body = v.map(|x| x.into());
5085        self
5086    }
5087}
5088
5089impl wkt::message::Message for SqlInstancesFailoverRequest {
5090    fn typename() -> &'static str {
5091        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesFailoverRequest"
5092    }
5093}
5094
5095/// Instance get request.
5096#[derive(Clone, Default, PartialEq)]
5097#[non_exhaustive]
5098pub struct SqlInstancesGetRequest {
5099    /// Required. Database instance ID. This does not include the project ID.
5100    pub instance: std::string::String,
5101
5102    /// Required. Project ID of the project that contains the instance.
5103    pub project: std::string::String,
5104
5105    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5106}
5107
5108impl SqlInstancesGetRequest {
5109    pub fn new() -> Self {
5110        std::default::Default::default()
5111    }
5112
5113    /// Sets the value of [instance][crate::model::SqlInstancesGetRequest::instance].
5114    ///
5115    /// # Example
5116    /// ```ignore,no_run
5117    /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
5118    /// let x = SqlInstancesGetRequest::new().set_instance("example");
5119    /// ```
5120    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5121        self.instance = v.into();
5122        self
5123    }
5124
5125    /// Sets the value of [project][crate::model::SqlInstancesGetRequest::project].
5126    ///
5127    /// # Example
5128    /// ```ignore,no_run
5129    /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
5130    /// let x = SqlInstancesGetRequest::new().set_project("example");
5131    /// ```
5132    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5133        self.project = v.into();
5134        self
5135    }
5136}
5137
5138impl wkt::message::Message for SqlInstancesGetRequest {
5139    fn typename() -> &'static str {
5140        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetRequest"
5141    }
5142}
5143
5144/// Instance import request.
5145#[derive(Clone, Default, PartialEq)]
5146#[non_exhaustive]
5147pub struct SqlInstancesImportRequest {
5148    /// Cloud SQL instance ID. This does not include the project ID.
5149    pub instance: std::string::String,
5150
5151    /// Project ID of the project that contains the instance.
5152    pub project: std::string::String,
5153
5154    pub body: std::option::Option<crate::model::InstancesImportRequest>,
5155
5156    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5157}
5158
5159impl SqlInstancesImportRequest {
5160    pub fn new() -> Self {
5161        std::default::Default::default()
5162    }
5163
5164    /// Sets the value of [instance][crate::model::SqlInstancesImportRequest::instance].
5165    ///
5166    /// # Example
5167    /// ```ignore,no_run
5168    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5169    /// let x = SqlInstancesImportRequest::new().set_instance("example");
5170    /// ```
5171    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5172        self.instance = v.into();
5173        self
5174    }
5175
5176    /// Sets the value of [project][crate::model::SqlInstancesImportRequest::project].
5177    ///
5178    /// # Example
5179    /// ```ignore,no_run
5180    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5181    /// let x = SqlInstancesImportRequest::new().set_project("example");
5182    /// ```
5183    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5184        self.project = v.into();
5185        self
5186    }
5187
5188    /// Sets the value of [body][crate::model::SqlInstancesImportRequest::body].
5189    ///
5190    /// # Example
5191    /// ```ignore,no_run
5192    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5193    /// use google_cloud_sql_v1::model::InstancesImportRequest;
5194    /// let x = SqlInstancesImportRequest::new().set_body(InstancesImportRequest::default()/* use setters */);
5195    /// ```
5196    pub fn set_body<T>(mut self, v: T) -> Self
5197    where
5198        T: std::convert::Into<crate::model::InstancesImportRequest>,
5199    {
5200        self.body = std::option::Option::Some(v.into());
5201        self
5202    }
5203
5204    /// Sets or clears the value of [body][crate::model::SqlInstancesImportRequest::body].
5205    ///
5206    /// # Example
5207    /// ```ignore,no_run
5208    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5209    /// use google_cloud_sql_v1::model::InstancesImportRequest;
5210    /// let x = SqlInstancesImportRequest::new().set_or_clear_body(Some(InstancesImportRequest::default()/* use setters */));
5211    /// let x = SqlInstancesImportRequest::new().set_or_clear_body(None::<InstancesImportRequest>);
5212    /// ```
5213    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5214    where
5215        T: std::convert::Into<crate::model::InstancesImportRequest>,
5216    {
5217        self.body = v.map(|x| x.into());
5218        self
5219    }
5220}
5221
5222impl wkt::message::Message for SqlInstancesImportRequest {
5223    fn typename() -> &'static str {
5224        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesImportRequest"
5225    }
5226}
5227
5228/// Instance insert request.
5229#[derive(Clone, Default, PartialEq)]
5230#[non_exhaustive]
5231pub struct SqlInstancesInsertRequest {
5232    /// Project ID of the project to which the newly created Cloud SQL instances
5233    /// should belong.
5234    pub project: std::string::String,
5235
5236    pub body: std::option::Option<crate::model::DatabaseInstance>,
5237
5238    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5239}
5240
5241impl SqlInstancesInsertRequest {
5242    pub fn new() -> Self {
5243        std::default::Default::default()
5244    }
5245
5246    /// Sets the value of [project][crate::model::SqlInstancesInsertRequest::project].
5247    ///
5248    /// # Example
5249    /// ```ignore,no_run
5250    /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5251    /// let x = SqlInstancesInsertRequest::new().set_project("example");
5252    /// ```
5253    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5254        self.project = v.into();
5255        self
5256    }
5257
5258    /// Sets the value of [body][crate::model::SqlInstancesInsertRequest::body].
5259    ///
5260    /// # Example
5261    /// ```ignore,no_run
5262    /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5263    /// use google_cloud_sql_v1::model::DatabaseInstance;
5264    /// let x = SqlInstancesInsertRequest::new().set_body(DatabaseInstance::default()/* use setters */);
5265    /// ```
5266    pub fn set_body<T>(mut self, v: T) -> Self
5267    where
5268        T: std::convert::Into<crate::model::DatabaseInstance>,
5269    {
5270        self.body = std::option::Option::Some(v.into());
5271        self
5272    }
5273
5274    /// Sets or clears the value of [body][crate::model::SqlInstancesInsertRequest::body].
5275    ///
5276    /// # Example
5277    /// ```ignore,no_run
5278    /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5279    /// use google_cloud_sql_v1::model::DatabaseInstance;
5280    /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
5281    /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(None::<DatabaseInstance>);
5282    /// ```
5283    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5284    where
5285        T: std::convert::Into<crate::model::DatabaseInstance>,
5286    {
5287        self.body = v.map(|x| x.into());
5288        self
5289    }
5290}
5291
5292impl wkt::message::Message for SqlInstancesInsertRequest {
5293    fn typename() -> &'static str {
5294        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesInsertRequest"
5295    }
5296}
5297
5298/// Instance list request.
5299#[derive(Clone, Default, PartialEq)]
5300#[non_exhaustive]
5301pub struct SqlInstancesListRequest {
5302    /// A filter expression that filters resources listed in the response.
5303    /// The expression is in the form of field:value. For example,
5304    /// 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
5305    /// their JSON representation, such as 'settings.userLabels.auto_start:true'.
5306    ///
5307    /// Multiple filter queries are space-separated. For example.
5308    /// 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
5309    /// expression is an AND expression. However, you can include AND and OR
5310    /// expressions explicitly.
5311    pub filter: std::string::String,
5312
5313    /// The maximum number of instances to return. The service may return fewer
5314    /// than this value.
5315    /// If unspecified, at most 500 instances are returned.
5316    /// The maximum value is 1000; values above 1000 are coerced to 1000.
5317    pub max_results: u32,
5318
5319    /// A previously-returned page token representing part of the larger set of
5320    /// results to view.
5321    pub page_token: std::string::String,
5322
5323    /// Project ID of the project for which to list Cloud SQL instances.
5324    pub project: std::string::String,
5325
5326    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5327}
5328
5329impl SqlInstancesListRequest {
5330    pub fn new() -> Self {
5331        std::default::Default::default()
5332    }
5333
5334    /// Sets the value of [filter][crate::model::SqlInstancesListRequest::filter].
5335    ///
5336    /// # Example
5337    /// ```ignore,no_run
5338    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5339    /// let x = SqlInstancesListRequest::new().set_filter("example");
5340    /// ```
5341    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5342        self.filter = v.into();
5343        self
5344    }
5345
5346    /// Sets the value of [max_results][crate::model::SqlInstancesListRequest::max_results].
5347    ///
5348    /// # Example
5349    /// ```ignore,no_run
5350    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5351    /// let x = SqlInstancesListRequest::new().set_max_results(42_u32);
5352    /// ```
5353    pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
5354        self.max_results = v.into();
5355        self
5356    }
5357
5358    /// Sets the value of [page_token][crate::model::SqlInstancesListRequest::page_token].
5359    ///
5360    /// # Example
5361    /// ```ignore,no_run
5362    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5363    /// let x = SqlInstancesListRequest::new().set_page_token("example");
5364    /// ```
5365    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5366        self.page_token = v.into();
5367        self
5368    }
5369
5370    /// Sets the value of [project][crate::model::SqlInstancesListRequest::project].
5371    ///
5372    /// # Example
5373    /// ```ignore,no_run
5374    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5375    /// let x = SqlInstancesListRequest::new().set_project("example");
5376    /// ```
5377    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5378        self.project = v.into();
5379        self
5380    }
5381}
5382
5383impl wkt::message::Message for SqlInstancesListRequest {
5384    fn typename() -> &'static str {
5385        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListRequest"
5386    }
5387}
5388
5389/// Instance list server CAs request.
5390#[derive(Clone, Default, PartialEq)]
5391#[non_exhaustive]
5392pub struct SqlInstancesListServerCasRequest {
5393    /// Cloud SQL instance ID. This does not include the project ID.
5394    pub instance: std::string::String,
5395
5396    /// Project ID of the project that contains the instance.
5397    pub project: std::string::String,
5398
5399    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5400}
5401
5402impl SqlInstancesListServerCasRequest {
5403    pub fn new() -> Self {
5404        std::default::Default::default()
5405    }
5406
5407    /// Sets the value of [instance][crate::model::SqlInstancesListServerCasRequest::instance].
5408    ///
5409    /// # Example
5410    /// ```ignore,no_run
5411    /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
5412    /// let x = SqlInstancesListServerCasRequest::new().set_instance("example");
5413    /// ```
5414    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5415        self.instance = v.into();
5416        self
5417    }
5418
5419    /// Sets the value of [project][crate::model::SqlInstancesListServerCasRequest::project].
5420    ///
5421    /// # Example
5422    /// ```ignore,no_run
5423    /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
5424    /// let x = SqlInstancesListServerCasRequest::new().set_project("example");
5425    /// ```
5426    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5427        self.project = v.into();
5428        self
5429    }
5430}
5431
5432impl wkt::message::Message for SqlInstancesListServerCasRequest {
5433    fn typename() -> &'static str {
5434        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCasRequest"
5435    }
5436}
5437
5438/// Instance list server certificates request.
5439#[derive(Clone, Default, PartialEq)]
5440#[non_exhaustive]
5441pub struct SqlInstancesListServerCertificatesRequest {
5442    /// Required. Cloud SQL instance ID. This does not include the project ID.
5443    pub instance: std::string::String,
5444
5445    /// Required. Project ID of the project that contains the instance.
5446    pub project: std::string::String,
5447
5448    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5449}
5450
5451impl SqlInstancesListServerCertificatesRequest {
5452    pub fn new() -> Self {
5453        std::default::Default::default()
5454    }
5455
5456    /// Sets the value of [instance][crate::model::SqlInstancesListServerCertificatesRequest::instance].
5457    ///
5458    /// # Example
5459    /// ```ignore,no_run
5460    /// # use google_cloud_sql_v1::model::SqlInstancesListServerCertificatesRequest;
5461    /// let x = SqlInstancesListServerCertificatesRequest::new().set_instance("example");
5462    /// ```
5463    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5464        self.instance = v.into();
5465        self
5466    }
5467
5468    /// Sets the value of [project][crate::model::SqlInstancesListServerCertificatesRequest::project].
5469    ///
5470    /// # Example
5471    /// ```ignore,no_run
5472    /// # use google_cloud_sql_v1::model::SqlInstancesListServerCertificatesRequest;
5473    /// let x = SqlInstancesListServerCertificatesRequest::new().set_project("example");
5474    /// ```
5475    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5476        self.project = v.into();
5477        self
5478    }
5479}
5480
5481impl wkt::message::Message for SqlInstancesListServerCertificatesRequest {
5482    fn typename() -> &'static str {
5483        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest"
5484    }
5485}
5486
5487/// Instance list Entra ID certificates request.
5488#[derive(Clone, Default, PartialEq)]
5489#[non_exhaustive]
5490pub struct SqlInstancesListEntraIdCertificatesRequest {
5491    /// Required. Cloud SQL instance ID. This does not include the project ID.
5492    pub instance: std::string::String,
5493
5494    /// Required. Project ID of the project that contains the instance.
5495    pub project: std::string::String,
5496
5497    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5498}
5499
5500impl SqlInstancesListEntraIdCertificatesRequest {
5501    pub fn new() -> Self {
5502        std::default::Default::default()
5503    }
5504
5505    /// Sets the value of [instance][crate::model::SqlInstancesListEntraIdCertificatesRequest::instance].
5506    ///
5507    /// # Example
5508    /// ```ignore,no_run
5509    /// # use google_cloud_sql_v1::model::SqlInstancesListEntraIdCertificatesRequest;
5510    /// let x = SqlInstancesListEntraIdCertificatesRequest::new().set_instance("example");
5511    /// ```
5512    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5513        self.instance = v.into();
5514        self
5515    }
5516
5517    /// Sets the value of [project][crate::model::SqlInstancesListEntraIdCertificatesRequest::project].
5518    ///
5519    /// # Example
5520    /// ```ignore,no_run
5521    /// # use google_cloud_sql_v1::model::SqlInstancesListEntraIdCertificatesRequest;
5522    /// let x = SqlInstancesListEntraIdCertificatesRequest::new().set_project("example");
5523    /// ```
5524    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5525        self.project = v.into();
5526        self
5527    }
5528}
5529
5530impl wkt::message::Message for SqlInstancesListEntraIdCertificatesRequest {
5531    fn typename() -> &'static str {
5532        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest"
5533    }
5534}
5535
5536/// Instance patch request.
5537#[derive(Clone, Default, PartialEq)]
5538#[non_exhaustive]
5539pub struct SqlInstancesPatchRequest {
5540    /// Cloud SQL instance ID. This does not include the project ID.
5541    pub instance: std::string::String,
5542
5543    /// Project ID of the project that contains the instance.
5544    pub project: std::string::String,
5545
5546    pub body: std::option::Option<crate::model::DatabaseInstance>,
5547
5548    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5549}
5550
5551impl SqlInstancesPatchRequest {
5552    pub fn new() -> Self {
5553        std::default::Default::default()
5554    }
5555
5556    /// Sets the value of [instance][crate::model::SqlInstancesPatchRequest::instance].
5557    ///
5558    /// # Example
5559    /// ```ignore,no_run
5560    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5561    /// let x = SqlInstancesPatchRequest::new().set_instance("example");
5562    /// ```
5563    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5564        self.instance = v.into();
5565        self
5566    }
5567
5568    /// Sets the value of [project][crate::model::SqlInstancesPatchRequest::project].
5569    ///
5570    /// # Example
5571    /// ```ignore,no_run
5572    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5573    /// let x = SqlInstancesPatchRequest::new().set_project("example");
5574    /// ```
5575    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5576        self.project = v.into();
5577        self
5578    }
5579
5580    /// Sets the value of [body][crate::model::SqlInstancesPatchRequest::body].
5581    ///
5582    /// # Example
5583    /// ```ignore,no_run
5584    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5585    /// use google_cloud_sql_v1::model::DatabaseInstance;
5586    /// let x = SqlInstancesPatchRequest::new().set_body(DatabaseInstance::default()/* use setters */);
5587    /// ```
5588    pub fn set_body<T>(mut self, v: T) -> Self
5589    where
5590        T: std::convert::Into<crate::model::DatabaseInstance>,
5591    {
5592        self.body = std::option::Option::Some(v.into());
5593        self
5594    }
5595
5596    /// Sets or clears the value of [body][crate::model::SqlInstancesPatchRequest::body].
5597    ///
5598    /// # Example
5599    /// ```ignore,no_run
5600    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5601    /// use google_cloud_sql_v1::model::DatabaseInstance;
5602    /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
5603    /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(None::<DatabaseInstance>);
5604    /// ```
5605    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5606    where
5607        T: std::convert::Into<crate::model::DatabaseInstance>,
5608    {
5609        self.body = v.map(|x| x.into());
5610        self
5611    }
5612}
5613
5614impl wkt::message::Message for SqlInstancesPatchRequest {
5615    fn typename() -> &'static str {
5616        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPatchRequest"
5617    }
5618}
5619
5620/// Instance promote replica request.
5621#[derive(Clone, Default, PartialEq)]
5622#[non_exhaustive]
5623pub struct SqlInstancesPromoteReplicaRequest {
5624    /// Cloud SQL read replica instance name.
5625    pub instance: std::string::String,
5626
5627    /// ID of the project that contains the read replica.
5628    pub project: std::string::String,
5629
5630    /// Set to true to invoke a replica failover to the DR
5631    /// replica. As part of replica failover, the promote operation attempts
5632    /// to add the original primary instance as a replica of the promoted
5633    /// DR replica when the original primary instance comes back online.
5634    /// If set to false or not specified, then the original primary
5635    /// instance becomes an independent Cloud SQL primary instance.
5636    pub failover: bool,
5637
5638    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5639}
5640
5641impl SqlInstancesPromoteReplicaRequest {
5642    pub fn new() -> Self {
5643        std::default::Default::default()
5644    }
5645
5646    /// Sets the value of [instance][crate::model::SqlInstancesPromoteReplicaRequest::instance].
5647    ///
5648    /// # Example
5649    /// ```ignore,no_run
5650    /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5651    /// let x = SqlInstancesPromoteReplicaRequest::new().set_instance("example");
5652    /// ```
5653    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5654        self.instance = v.into();
5655        self
5656    }
5657
5658    /// Sets the value of [project][crate::model::SqlInstancesPromoteReplicaRequest::project].
5659    ///
5660    /// # Example
5661    /// ```ignore,no_run
5662    /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5663    /// let x = SqlInstancesPromoteReplicaRequest::new().set_project("example");
5664    /// ```
5665    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5666        self.project = v.into();
5667        self
5668    }
5669
5670    /// Sets the value of [failover][crate::model::SqlInstancesPromoteReplicaRequest::failover].
5671    ///
5672    /// # Example
5673    /// ```ignore,no_run
5674    /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5675    /// let x = SqlInstancesPromoteReplicaRequest::new().set_failover(true);
5676    /// ```
5677    pub fn set_failover<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5678        self.failover = v.into();
5679        self
5680    }
5681}
5682
5683impl wkt::message::Message for SqlInstancesPromoteReplicaRequest {
5684    fn typename() -> &'static str {
5685        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest"
5686    }
5687}
5688
5689/// Instance switchover request.
5690#[derive(Clone, Default, PartialEq)]
5691#[non_exhaustive]
5692pub struct SqlInstancesSwitchoverRequest {
5693    /// Cloud SQL read replica instance name.
5694    pub instance: std::string::String,
5695
5696    /// ID of the project that contains the replica.
5697    pub project: std::string::String,
5698
5699    /// Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
5700    /// timeout, which is a sum of all database operations. Default value is 10
5701    /// minutes and can be modified to a maximum value of 24 hours.
5702    pub db_timeout: std::option::Option<wkt::Duration>,
5703
5704    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5705}
5706
5707impl SqlInstancesSwitchoverRequest {
5708    pub fn new() -> Self {
5709        std::default::Default::default()
5710    }
5711
5712    /// Sets the value of [instance][crate::model::SqlInstancesSwitchoverRequest::instance].
5713    ///
5714    /// # Example
5715    /// ```ignore,no_run
5716    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5717    /// let x = SqlInstancesSwitchoverRequest::new().set_instance("example");
5718    /// ```
5719    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5720        self.instance = v.into();
5721        self
5722    }
5723
5724    /// Sets the value of [project][crate::model::SqlInstancesSwitchoverRequest::project].
5725    ///
5726    /// # Example
5727    /// ```ignore,no_run
5728    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5729    /// let x = SqlInstancesSwitchoverRequest::new().set_project("example");
5730    /// ```
5731    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5732        self.project = v.into();
5733        self
5734    }
5735
5736    /// Sets the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
5737    ///
5738    /// # Example
5739    /// ```ignore,no_run
5740    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5741    /// use wkt::Duration;
5742    /// let x = SqlInstancesSwitchoverRequest::new().set_db_timeout(Duration::default()/* use setters */);
5743    /// ```
5744    pub fn set_db_timeout<T>(mut self, v: T) -> Self
5745    where
5746        T: std::convert::Into<wkt::Duration>,
5747    {
5748        self.db_timeout = std::option::Option::Some(v.into());
5749        self
5750    }
5751
5752    /// Sets or clears the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
5753    ///
5754    /// # Example
5755    /// ```ignore,no_run
5756    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5757    /// use wkt::Duration;
5758    /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(Some(Duration::default()/* use setters */));
5759    /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(None::<Duration>);
5760    /// ```
5761    pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
5762    where
5763        T: std::convert::Into<wkt::Duration>,
5764    {
5765        self.db_timeout = v.map(|x| x.into());
5766        self
5767    }
5768}
5769
5770impl wkt::message::Message for SqlInstancesSwitchoverRequest {
5771    fn typename() -> &'static str {
5772        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesSwitchoverRequest"
5773    }
5774}
5775
5776/// Instance reset SSL config request.
5777#[derive(Clone, Default, PartialEq)]
5778#[non_exhaustive]
5779pub struct SqlInstancesResetSslConfigRequest {
5780    /// Cloud SQL instance ID. This does not include the project ID.
5781    pub instance: std::string::String,
5782
5783    /// Project ID of the project that contains the instance.
5784    pub project: std::string::String,
5785
5786    /// Optional. Reset SSL mode to use.
5787    pub mode: crate::model::sql_instances_reset_ssl_config_request::ResetSslMode,
5788
5789    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5790}
5791
5792impl SqlInstancesResetSslConfigRequest {
5793    pub fn new() -> Self {
5794        std::default::Default::default()
5795    }
5796
5797    /// Sets the value of [instance][crate::model::SqlInstancesResetSslConfigRequest::instance].
5798    ///
5799    /// # Example
5800    /// ```ignore,no_run
5801    /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
5802    /// let x = SqlInstancesResetSslConfigRequest::new().set_instance("example");
5803    /// ```
5804    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5805        self.instance = v.into();
5806        self
5807    }
5808
5809    /// Sets the value of [project][crate::model::SqlInstancesResetSslConfigRequest::project].
5810    ///
5811    /// # Example
5812    /// ```ignore,no_run
5813    /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
5814    /// let x = SqlInstancesResetSslConfigRequest::new().set_project("example");
5815    /// ```
5816    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5817        self.project = v.into();
5818        self
5819    }
5820
5821    /// Sets the value of [mode][crate::model::SqlInstancesResetSslConfigRequest::mode].
5822    ///
5823    /// # Example
5824    /// ```ignore,no_run
5825    /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
5826    /// use google_cloud_sql_v1::model::sql_instances_reset_ssl_config_request::ResetSslMode;
5827    /// let x0 = SqlInstancesResetSslConfigRequest::new().set_mode(ResetSslMode::All);
5828    /// let x1 = SqlInstancesResetSslConfigRequest::new().set_mode(ResetSslMode::SyncFromPrimary);
5829    /// ```
5830    pub fn set_mode<
5831        T: std::convert::Into<crate::model::sql_instances_reset_ssl_config_request::ResetSslMode>,
5832    >(
5833        mut self,
5834        v: T,
5835    ) -> Self {
5836        self.mode = v.into();
5837        self
5838    }
5839}
5840
5841impl wkt::message::Message for SqlInstancesResetSslConfigRequest {
5842    fn typename() -> &'static str {
5843        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetSslConfigRequest"
5844    }
5845}
5846
5847/// Defines additional types related to [SqlInstancesResetSslConfigRequest].
5848pub mod sql_instances_reset_ssl_config_request {
5849    #[allow(unused_imports)]
5850    use super::*;
5851
5852    /// Reset SSL mode to selectively refresh the SSL materials.
5853    ///
5854    /// # Working with unknown values
5855    ///
5856    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5857    /// additional enum variants at any time. Adding new variants is not considered
5858    /// a breaking change. Applications should write their code in anticipation of:
5859    ///
5860    /// - New values appearing in future releases of the client library, **and**
5861    /// - New values received dynamically, without application changes.
5862    ///
5863    /// Please consult the [Working with enums] section in the user guide for some
5864    /// guidelines.
5865    ///
5866    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5867    #[derive(Clone, Debug, PartialEq)]
5868    #[non_exhaustive]
5869    pub enum ResetSslMode {
5870        /// Reset SSL mode is not specified.
5871        Unspecified,
5872        /// Refresh all TLS configs. This is the default behaviour.
5873        All,
5874        /// Refreshes the replication-related TLS configuration settings provided by
5875        /// the primary instance.
5876        /// Not applicable to on-premises replication instances.
5877        SyncFromPrimary,
5878        /// If set, the enum was initialized with an unknown value.
5879        ///
5880        /// Applications can examine the value using [ResetSslMode::value] or
5881        /// [ResetSslMode::name].
5882        UnknownValue(reset_ssl_mode::UnknownValue),
5883    }
5884
5885    #[doc(hidden)]
5886    pub mod reset_ssl_mode {
5887        #[allow(unused_imports)]
5888        use super::*;
5889        #[derive(Clone, Debug, PartialEq)]
5890        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5891    }
5892
5893    impl ResetSslMode {
5894        /// Gets the enum value.
5895        ///
5896        /// Returns `None` if the enum contains an unknown value deserialized from
5897        /// the string representation of enums.
5898        pub fn value(&self) -> std::option::Option<i32> {
5899            match self {
5900                Self::Unspecified => std::option::Option::Some(0),
5901                Self::All => std::option::Option::Some(1),
5902                Self::SyncFromPrimary => std::option::Option::Some(2),
5903                Self::UnknownValue(u) => u.0.value(),
5904            }
5905        }
5906
5907        /// Gets the enum value as a string.
5908        ///
5909        /// Returns `None` if the enum contains an unknown value deserialized from
5910        /// the integer representation of enums.
5911        pub fn name(&self) -> std::option::Option<&str> {
5912            match self {
5913                Self::Unspecified => std::option::Option::Some("RESET_SSL_MODE_UNSPECIFIED"),
5914                Self::All => std::option::Option::Some("ALL"),
5915                Self::SyncFromPrimary => std::option::Option::Some("SYNC_FROM_PRIMARY"),
5916                Self::UnknownValue(u) => u.0.name(),
5917            }
5918        }
5919    }
5920
5921    impl std::default::Default for ResetSslMode {
5922        fn default() -> Self {
5923            use std::convert::From;
5924            Self::from(0)
5925        }
5926    }
5927
5928    impl std::fmt::Display for ResetSslMode {
5929        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5930            wkt::internal::display_enum(f, self.name(), self.value())
5931        }
5932    }
5933
5934    impl std::convert::From<i32> for ResetSslMode {
5935        fn from(value: i32) -> Self {
5936            match value {
5937                0 => Self::Unspecified,
5938                1 => Self::All,
5939                2 => Self::SyncFromPrimary,
5940                _ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
5941                    wkt::internal::UnknownEnumValue::Integer(value),
5942                )),
5943            }
5944        }
5945    }
5946
5947    impl std::convert::From<&str> for ResetSslMode {
5948        fn from(value: &str) -> Self {
5949            use std::string::ToString;
5950            match value {
5951                "RESET_SSL_MODE_UNSPECIFIED" => Self::Unspecified,
5952                "ALL" => Self::All,
5953                "SYNC_FROM_PRIMARY" => Self::SyncFromPrimary,
5954                _ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
5955                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5956                )),
5957            }
5958        }
5959    }
5960
5961    impl serde::ser::Serialize for ResetSslMode {
5962        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5963        where
5964            S: serde::Serializer,
5965        {
5966            match self {
5967                Self::Unspecified => serializer.serialize_i32(0),
5968                Self::All => serializer.serialize_i32(1),
5969                Self::SyncFromPrimary => serializer.serialize_i32(2),
5970                Self::UnknownValue(u) => u.0.serialize(serializer),
5971            }
5972        }
5973    }
5974
5975    impl<'de> serde::de::Deserialize<'de> for ResetSslMode {
5976        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5977        where
5978            D: serde::Deserializer<'de>,
5979        {
5980            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResetSslMode>::new(
5981                ".google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode",
5982            ))
5983        }
5984    }
5985}
5986
5987/// Instance restart request.
5988#[derive(Clone, Default, PartialEq)]
5989#[non_exhaustive]
5990pub struct SqlInstancesRestartRequest {
5991    /// Cloud SQL instance ID. This does not include the project ID.
5992    pub instance: std::string::String,
5993
5994    /// Project ID of the project that contains the instance to be restarted.
5995    pub project: std::string::String,
5996
5997    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5998}
5999
6000impl SqlInstancesRestartRequest {
6001    pub fn new() -> Self {
6002        std::default::Default::default()
6003    }
6004
6005    /// Sets the value of [instance][crate::model::SqlInstancesRestartRequest::instance].
6006    ///
6007    /// # Example
6008    /// ```ignore,no_run
6009    /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
6010    /// let x = SqlInstancesRestartRequest::new().set_instance("example");
6011    /// ```
6012    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6013        self.instance = v.into();
6014        self
6015    }
6016
6017    /// Sets the value of [project][crate::model::SqlInstancesRestartRequest::project].
6018    ///
6019    /// # Example
6020    /// ```ignore,no_run
6021    /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
6022    /// let x = SqlInstancesRestartRequest::new().set_project("example");
6023    /// ```
6024    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6025        self.project = v.into();
6026        self
6027    }
6028}
6029
6030impl wkt::message::Message for SqlInstancesRestartRequest {
6031    fn typename() -> &'static str {
6032        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestartRequest"
6033    }
6034}
6035
6036/// Instance restore backup request.
6037#[derive(Clone, Default, PartialEq)]
6038#[non_exhaustive]
6039pub struct SqlInstancesRestoreBackupRequest {
6040    /// Cloud SQL instance ID. This does not include the project ID.
6041    pub instance: std::string::String,
6042
6043    /// Project ID of the project that contains the instance.
6044    pub project: std::string::String,
6045
6046    pub body: std::option::Option<crate::model::InstancesRestoreBackupRequest>,
6047
6048    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6049}
6050
6051impl SqlInstancesRestoreBackupRequest {
6052    pub fn new() -> Self {
6053        std::default::Default::default()
6054    }
6055
6056    /// Sets the value of [instance][crate::model::SqlInstancesRestoreBackupRequest::instance].
6057    ///
6058    /// # Example
6059    /// ```ignore,no_run
6060    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6061    /// let x = SqlInstancesRestoreBackupRequest::new().set_instance("example");
6062    /// ```
6063    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6064        self.instance = v.into();
6065        self
6066    }
6067
6068    /// Sets the value of [project][crate::model::SqlInstancesRestoreBackupRequest::project].
6069    ///
6070    /// # Example
6071    /// ```ignore,no_run
6072    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6073    /// let x = SqlInstancesRestoreBackupRequest::new().set_project("example");
6074    /// ```
6075    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6076        self.project = v.into();
6077        self
6078    }
6079
6080    /// Sets the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
6081    ///
6082    /// # Example
6083    /// ```ignore,no_run
6084    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6085    /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6086    /// let x = SqlInstancesRestoreBackupRequest::new().set_body(InstancesRestoreBackupRequest::default()/* use setters */);
6087    /// ```
6088    pub fn set_body<T>(mut self, v: T) -> Self
6089    where
6090        T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
6091    {
6092        self.body = std::option::Option::Some(v.into());
6093        self
6094    }
6095
6096    /// Sets or clears the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
6097    ///
6098    /// # Example
6099    /// ```ignore,no_run
6100    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6101    /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6102    /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(Some(InstancesRestoreBackupRequest::default()/* use setters */));
6103    /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(None::<InstancesRestoreBackupRequest>);
6104    /// ```
6105    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6106    where
6107        T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
6108    {
6109        self.body = v.map(|x| x.into());
6110        self
6111    }
6112}
6113
6114impl wkt::message::Message for SqlInstancesRestoreBackupRequest {
6115    fn typename() -> &'static str {
6116        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestoreBackupRequest"
6117    }
6118}
6119
6120/// Instance rotate server CA request.
6121#[derive(Clone, Default, PartialEq)]
6122#[non_exhaustive]
6123pub struct SqlInstancesRotateServerCaRequest {
6124    /// Cloud SQL instance ID. This does not include the project ID.
6125    pub instance: std::string::String,
6126
6127    /// Project ID of the project that contains the instance.
6128    pub project: std::string::String,
6129
6130    pub body: std::option::Option<crate::model::InstancesRotateServerCaRequest>,
6131
6132    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6133}
6134
6135impl SqlInstancesRotateServerCaRequest {
6136    pub fn new() -> Self {
6137        std::default::Default::default()
6138    }
6139
6140    /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCaRequest::instance].
6141    ///
6142    /// # Example
6143    /// ```ignore,no_run
6144    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6145    /// let x = SqlInstancesRotateServerCaRequest::new().set_instance("example");
6146    /// ```
6147    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6148        self.instance = v.into();
6149        self
6150    }
6151
6152    /// Sets the value of [project][crate::model::SqlInstancesRotateServerCaRequest::project].
6153    ///
6154    /// # Example
6155    /// ```ignore,no_run
6156    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6157    /// let x = SqlInstancesRotateServerCaRequest::new().set_project("example");
6158    /// ```
6159    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6160        self.project = v.into();
6161        self
6162    }
6163
6164    /// Sets the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
6165    ///
6166    /// # Example
6167    /// ```ignore,no_run
6168    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6169    /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6170    /// let x = SqlInstancesRotateServerCaRequest::new().set_body(InstancesRotateServerCaRequest::default()/* use setters */);
6171    /// ```
6172    pub fn set_body<T>(mut self, v: T) -> Self
6173    where
6174        T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
6175    {
6176        self.body = std::option::Option::Some(v.into());
6177        self
6178    }
6179
6180    /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
6181    ///
6182    /// # Example
6183    /// ```ignore,no_run
6184    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6185    /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6186    /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(Some(InstancesRotateServerCaRequest::default()/* use setters */));
6187    /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(None::<InstancesRotateServerCaRequest>);
6188    /// ```
6189    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6190    where
6191        T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
6192    {
6193        self.body = v.map(|x| x.into());
6194        self
6195    }
6196}
6197
6198impl wkt::message::Message for SqlInstancesRotateServerCaRequest {
6199    fn typename() -> &'static str {
6200        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCaRequest"
6201    }
6202}
6203
6204/// Instance rotate server certificate request.
6205#[derive(Clone, Default, PartialEq)]
6206#[non_exhaustive]
6207pub struct SqlInstancesRotateServerCertificateRequest {
6208    /// Required. Cloud SQL instance ID. This does not include the project ID.
6209    pub instance: std::string::String,
6210
6211    /// Required. Project ID of the project that contains the instance.
6212    pub project: std::string::String,
6213
6214    /// Optional. Rotate server certificate request body.
6215    pub body: std::option::Option<crate::model::InstancesRotateServerCertificateRequest>,
6216
6217    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6218}
6219
6220impl SqlInstancesRotateServerCertificateRequest {
6221    pub fn new() -> Self {
6222        std::default::Default::default()
6223    }
6224
6225    /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCertificateRequest::instance].
6226    ///
6227    /// # Example
6228    /// ```ignore,no_run
6229    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6230    /// let x = SqlInstancesRotateServerCertificateRequest::new().set_instance("example");
6231    /// ```
6232    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6233        self.instance = v.into();
6234        self
6235    }
6236
6237    /// Sets the value of [project][crate::model::SqlInstancesRotateServerCertificateRequest::project].
6238    ///
6239    /// # Example
6240    /// ```ignore,no_run
6241    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6242    /// let x = SqlInstancesRotateServerCertificateRequest::new().set_project("example");
6243    /// ```
6244    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6245        self.project = v.into();
6246        self
6247    }
6248
6249    /// Sets the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
6250    ///
6251    /// # Example
6252    /// ```ignore,no_run
6253    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6254    /// use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
6255    /// let x = SqlInstancesRotateServerCertificateRequest::new().set_body(InstancesRotateServerCertificateRequest::default()/* use setters */);
6256    /// ```
6257    pub fn set_body<T>(mut self, v: T) -> Self
6258    where
6259        T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
6260    {
6261        self.body = std::option::Option::Some(v.into());
6262        self
6263    }
6264
6265    /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
6266    ///
6267    /// # Example
6268    /// ```ignore,no_run
6269    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6270    /// use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
6271    /// let x = SqlInstancesRotateServerCertificateRequest::new().set_or_clear_body(Some(InstancesRotateServerCertificateRequest::default()/* use setters */));
6272    /// let x = SqlInstancesRotateServerCertificateRequest::new().set_or_clear_body(None::<InstancesRotateServerCertificateRequest>);
6273    /// ```
6274    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6275    where
6276        T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
6277    {
6278        self.body = v.map(|x| x.into());
6279        self
6280    }
6281}
6282
6283impl wkt::message::Message for SqlInstancesRotateServerCertificateRequest {
6284    fn typename() -> &'static str {
6285        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest"
6286    }
6287}
6288
6289/// Instance rotate server certificate request.
6290#[derive(Clone, Default, PartialEq)]
6291#[non_exhaustive]
6292pub struct SqlInstancesRotateEntraIdCertificateRequest {
6293    /// Required. Cloud SQL instance ID. This does not include the project ID.
6294    pub instance: std::string::String,
6295
6296    /// Required. Project ID of the project that contains the instance.
6297    pub project: std::string::String,
6298
6299    /// Optional. Rotate Entra ID certificate request body.
6300    pub body: std::option::Option<crate::model::InstancesRotateEntraIdCertificateRequest>,
6301
6302    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6303}
6304
6305impl SqlInstancesRotateEntraIdCertificateRequest {
6306    pub fn new() -> Self {
6307        std::default::Default::default()
6308    }
6309
6310    /// Sets the value of [instance][crate::model::SqlInstancesRotateEntraIdCertificateRequest::instance].
6311    ///
6312    /// # Example
6313    /// ```ignore,no_run
6314    /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6315    /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_instance("example");
6316    /// ```
6317    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6318        self.instance = v.into();
6319        self
6320    }
6321
6322    /// Sets the value of [project][crate::model::SqlInstancesRotateEntraIdCertificateRequest::project].
6323    ///
6324    /// # Example
6325    /// ```ignore,no_run
6326    /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6327    /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_project("example");
6328    /// ```
6329    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6330        self.project = v.into();
6331        self
6332    }
6333
6334    /// Sets the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
6335    ///
6336    /// # Example
6337    /// ```ignore,no_run
6338    /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6339    /// use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
6340    /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_body(InstancesRotateEntraIdCertificateRequest::default()/* use setters */);
6341    /// ```
6342    pub fn set_body<T>(mut self, v: T) -> Self
6343    where
6344        T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
6345    {
6346        self.body = std::option::Option::Some(v.into());
6347        self
6348    }
6349
6350    /// Sets or clears the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
6351    ///
6352    /// # Example
6353    /// ```ignore,no_run
6354    /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6355    /// use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
6356    /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_or_clear_body(Some(InstancesRotateEntraIdCertificateRequest::default()/* use setters */));
6357    /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_or_clear_body(None::<InstancesRotateEntraIdCertificateRequest>);
6358    /// ```
6359    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6360    where
6361        T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
6362    {
6363        self.body = v.map(|x| x.into());
6364        self
6365    }
6366}
6367
6368impl wkt::message::Message for SqlInstancesRotateEntraIdCertificateRequest {
6369    fn typename() -> &'static str {
6370        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest"
6371    }
6372}
6373
6374/// Instance start replica request.
6375#[derive(Clone, Default, PartialEq)]
6376#[non_exhaustive]
6377pub struct SqlInstancesStartReplicaRequest {
6378    /// Cloud SQL read replica instance name.
6379    pub instance: std::string::String,
6380
6381    /// ID of the project that contains the read replica.
6382    pub project: std::string::String,
6383
6384    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6385}
6386
6387impl SqlInstancesStartReplicaRequest {
6388    pub fn new() -> Self {
6389        std::default::Default::default()
6390    }
6391
6392    /// Sets the value of [instance][crate::model::SqlInstancesStartReplicaRequest::instance].
6393    ///
6394    /// # Example
6395    /// ```ignore,no_run
6396    /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
6397    /// let x = SqlInstancesStartReplicaRequest::new().set_instance("example");
6398    /// ```
6399    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6400        self.instance = v.into();
6401        self
6402    }
6403
6404    /// Sets the value of [project][crate::model::SqlInstancesStartReplicaRequest::project].
6405    ///
6406    /// # Example
6407    /// ```ignore,no_run
6408    /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
6409    /// let x = SqlInstancesStartReplicaRequest::new().set_project("example");
6410    /// ```
6411    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6412        self.project = v.into();
6413        self
6414    }
6415}
6416
6417impl wkt::message::Message for SqlInstancesStartReplicaRequest {
6418    fn typename() -> &'static str {
6419        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartReplicaRequest"
6420    }
6421}
6422
6423/// Instance stop replica request.
6424#[derive(Clone, Default, PartialEq)]
6425#[non_exhaustive]
6426pub struct SqlInstancesStopReplicaRequest {
6427    /// Cloud SQL read replica instance name.
6428    pub instance: std::string::String,
6429
6430    /// ID of the project that contains the read replica.
6431    pub project: std::string::String,
6432
6433    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6434}
6435
6436impl SqlInstancesStopReplicaRequest {
6437    pub fn new() -> Self {
6438        std::default::Default::default()
6439    }
6440
6441    /// Sets the value of [instance][crate::model::SqlInstancesStopReplicaRequest::instance].
6442    ///
6443    /// # Example
6444    /// ```ignore,no_run
6445    /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
6446    /// let x = SqlInstancesStopReplicaRequest::new().set_instance("example");
6447    /// ```
6448    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6449        self.instance = v.into();
6450        self
6451    }
6452
6453    /// Sets the value of [project][crate::model::SqlInstancesStopReplicaRequest::project].
6454    ///
6455    /// # Example
6456    /// ```ignore,no_run
6457    /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
6458    /// let x = SqlInstancesStopReplicaRequest::new().set_project("example");
6459    /// ```
6460    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6461        self.project = v.into();
6462        self
6463    }
6464}
6465
6466impl wkt::message::Message for SqlInstancesStopReplicaRequest {
6467    fn typename() -> &'static str {
6468        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStopReplicaRequest"
6469    }
6470}
6471
6472/// Instance truncate log request.
6473#[derive(Clone, Default, PartialEq)]
6474#[non_exhaustive]
6475pub struct SqlInstancesTruncateLogRequest {
6476    /// Cloud SQL instance ID. This does not include the project ID.
6477    pub instance: std::string::String,
6478
6479    /// Project ID of the Cloud SQL project.
6480    pub project: std::string::String,
6481
6482    pub body: std::option::Option<crate::model::InstancesTruncateLogRequest>,
6483
6484    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6485}
6486
6487impl SqlInstancesTruncateLogRequest {
6488    pub fn new() -> Self {
6489        std::default::Default::default()
6490    }
6491
6492    /// Sets the value of [instance][crate::model::SqlInstancesTruncateLogRequest::instance].
6493    ///
6494    /// # Example
6495    /// ```ignore,no_run
6496    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6497    /// let x = SqlInstancesTruncateLogRequest::new().set_instance("example");
6498    /// ```
6499    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6500        self.instance = v.into();
6501        self
6502    }
6503
6504    /// Sets the value of [project][crate::model::SqlInstancesTruncateLogRequest::project].
6505    ///
6506    /// # Example
6507    /// ```ignore,no_run
6508    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6509    /// let x = SqlInstancesTruncateLogRequest::new().set_project("example");
6510    /// ```
6511    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6512        self.project = v.into();
6513        self
6514    }
6515
6516    /// Sets the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
6517    ///
6518    /// # Example
6519    /// ```ignore,no_run
6520    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6521    /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
6522    /// let x = SqlInstancesTruncateLogRequest::new().set_body(InstancesTruncateLogRequest::default()/* use setters */);
6523    /// ```
6524    pub fn set_body<T>(mut self, v: T) -> Self
6525    where
6526        T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
6527    {
6528        self.body = std::option::Option::Some(v.into());
6529        self
6530    }
6531
6532    /// Sets or clears the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
6533    ///
6534    /// # Example
6535    /// ```ignore,no_run
6536    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6537    /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
6538    /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(Some(InstancesTruncateLogRequest::default()/* use setters */));
6539    /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(None::<InstancesTruncateLogRequest>);
6540    /// ```
6541    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6542    where
6543        T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
6544    {
6545        self.body = v.map(|x| x.into());
6546        self
6547    }
6548}
6549
6550impl wkt::message::Message for SqlInstancesTruncateLogRequest {
6551    fn typename() -> &'static str {
6552        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesTruncateLogRequest"
6553    }
6554}
6555
6556/// Instance perform disk shrink request.
6557#[derive(Clone, Default, PartialEq)]
6558#[non_exhaustive]
6559pub struct SqlInstancesPerformDiskShrinkRequest {
6560    /// Cloud SQL instance ID. This does not include the project ID.
6561    pub instance: std::string::String,
6562
6563    /// Project ID of the project that contains the instance.
6564    pub project: std::string::String,
6565
6566    /// Perform disk shrink context.
6567    pub body: std::option::Option<crate::model::PerformDiskShrinkContext>,
6568
6569    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6570}
6571
6572impl SqlInstancesPerformDiskShrinkRequest {
6573    pub fn new() -> Self {
6574        std::default::Default::default()
6575    }
6576
6577    /// Sets the value of [instance][crate::model::SqlInstancesPerformDiskShrinkRequest::instance].
6578    ///
6579    /// # Example
6580    /// ```ignore,no_run
6581    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6582    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_instance("example");
6583    /// ```
6584    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6585        self.instance = v.into();
6586        self
6587    }
6588
6589    /// Sets the value of [project][crate::model::SqlInstancesPerformDiskShrinkRequest::project].
6590    ///
6591    /// # Example
6592    /// ```ignore,no_run
6593    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6594    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_project("example");
6595    /// ```
6596    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6597        self.project = v.into();
6598        self
6599    }
6600
6601    /// Sets the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
6602    ///
6603    /// # Example
6604    /// ```ignore,no_run
6605    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6606    /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
6607    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_body(PerformDiskShrinkContext::default()/* use setters */);
6608    /// ```
6609    pub fn set_body<T>(mut self, v: T) -> Self
6610    where
6611        T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
6612    {
6613        self.body = std::option::Option::Some(v.into());
6614        self
6615    }
6616
6617    /// Sets or clears the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
6618    ///
6619    /// # Example
6620    /// ```ignore,no_run
6621    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6622    /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
6623    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(Some(PerformDiskShrinkContext::default()/* use setters */));
6624    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(None::<PerformDiskShrinkContext>);
6625    /// ```
6626    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6627    where
6628        T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
6629    {
6630        self.body = v.map(|x| x.into());
6631        self
6632    }
6633}
6634
6635impl wkt::message::Message for SqlInstancesPerformDiskShrinkRequest {
6636    fn typename() -> &'static str {
6637        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest"
6638    }
6639}
6640
6641/// Instance update request.
6642#[derive(Clone, Default, PartialEq)]
6643#[non_exhaustive]
6644pub struct SqlInstancesUpdateRequest {
6645    /// Cloud SQL instance ID. This does not include the project ID.
6646    pub instance: std::string::String,
6647
6648    /// Project ID of the project that contains the instance.
6649    pub project: std::string::String,
6650
6651    pub body: std::option::Option<crate::model::DatabaseInstance>,
6652
6653    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6654}
6655
6656impl SqlInstancesUpdateRequest {
6657    pub fn new() -> Self {
6658        std::default::Default::default()
6659    }
6660
6661    /// Sets the value of [instance][crate::model::SqlInstancesUpdateRequest::instance].
6662    ///
6663    /// # Example
6664    /// ```ignore,no_run
6665    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6666    /// let x = SqlInstancesUpdateRequest::new().set_instance("example");
6667    /// ```
6668    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6669        self.instance = v.into();
6670        self
6671    }
6672
6673    /// Sets the value of [project][crate::model::SqlInstancesUpdateRequest::project].
6674    ///
6675    /// # Example
6676    /// ```ignore,no_run
6677    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6678    /// let x = SqlInstancesUpdateRequest::new().set_project("example");
6679    /// ```
6680    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6681        self.project = v.into();
6682        self
6683    }
6684
6685    /// Sets the value of [body][crate::model::SqlInstancesUpdateRequest::body].
6686    ///
6687    /// # Example
6688    /// ```ignore,no_run
6689    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6690    /// use google_cloud_sql_v1::model::DatabaseInstance;
6691    /// let x = SqlInstancesUpdateRequest::new().set_body(DatabaseInstance::default()/* use setters */);
6692    /// ```
6693    pub fn set_body<T>(mut self, v: T) -> Self
6694    where
6695        T: std::convert::Into<crate::model::DatabaseInstance>,
6696    {
6697        self.body = std::option::Option::Some(v.into());
6698        self
6699    }
6700
6701    /// Sets or clears the value of [body][crate::model::SqlInstancesUpdateRequest::body].
6702    ///
6703    /// # Example
6704    /// ```ignore,no_run
6705    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6706    /// use google_cloud_sql_v1::model::DatabaseInstance;
6707    /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
6708    /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(None::<DatabaseInstance>);
6709    /// ```
6710    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6711    where
6712        T: std::convert::Into<crate::model::DatabaseInstance>,
6713    {
6714        self.body = v.map(|x| x.into());
6715        self
6716    }
6717}
6718
6719impl wkt::message::Message for SqlInstancesUpdateRequest {
6720    fn typename() -> &'static str {
6721        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesUpdateRequest"
6722    }
6723}
6724
6725/// Instance reschedule maintenance request.
6726#[derive(Clone, Default, PartialEq)]
6727#[non_exhaustive]
6728pub struct SqlInstancesRescheduleMaintenanceRequest {
6729    /// Cloud SQL instance ID. This does not include the project ID.
6730    pub instance: std::string::String,
6731
6732    /// ID of the project that contains the instance.
6733    pub project: std::string::String,
6734
6735    pub body: std::option::Option<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6736
6737    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6738}
6739
6740impl SqlInstancesRescheduleMaintenanceRequest {
6741    pub fn new() -> Self {
6742        std::default::Default::default()
6743    }
6744
6745    /// Sets the value of [instance][crate::model::SqlInstancesRescheduleMaintenanceRequest::instance].
6746    ///
6747    /// # Example
6748    /// ```ignore,no_run
6749    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6750    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_instance("example");
6751    /// ```
6752    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6753        self.instance = v.into();
6754        self
6755    }
6756
6757    /// Sets the value of [project][crate::model::SqlInstancesRescheduleMaintenanceRequest::project].
6758    ///
6759    /// # Example
6760    /// ```ignore,no_run
6761    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6762    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_project("example");
6763    /// ```
6764    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6765        self.project = v.into();
6766        self
6767    }
6768
6769    /// Sets the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
6770    ///
6771    /// # Example
6772    /// ```ignore,no_run
6773    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6774    /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
6775    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_body(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */);
6776    /// ```
6777    pub fn set_body<T>(mut self, v: T) -> Self
6778    where
6779        T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6780    {
6781        self.body = std::option::Option::Some(v.into());
6782        self
6783    }
6784
6785    /// Sets or clears the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
6786    ///
6787    /// # Example
6788    /// ```ignore,no_run
6789    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6790    /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
6791    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(Some(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */));
6792    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(None::<SqlInstancesRescheduleMaintenanceRequestBody>);
6793    /// ```
6794    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6795    where
6796        T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6797    {
6798        self.body = v.map(|x| x.into());
6799        self
6800    }
6801}
6802
6803impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequest {
6804    fn typename() -> &'static str {
6805        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest"
6806    }
6807}
6808
6809/// Instance reencrypt request.
6810#[derive(Clone, Default, PartialEq)]
6811#[non_exhaustive]
6812pub struct SqlInstancesReencryptRequest {
6813    /// Cloud SQL instance ID. This does not include the project ID.
6814    pub instance: std::string::String,
6815
6816    /// ID of the project that contains the instance.
6817    pub project: std::string::String,
6818
6819    /// Reencrypt body that users request
6820    pub body: std::option::Option<crate::model::InstancesReencryptRequest>,
6821
6822    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6823}
6824
6825impl SqlInstancesReencryptRequest {
6826    pub fn new() -> Self {
6827        std::default::Default::default()
6828    }
6829
6830    /// Sets the value of [instance][crate::model::SqlInstancesReencryptRequest::instance].
6831    ///
6832    /// # Example
6833    /// ```ignore,no_run
6834    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6835    /// let x = SqlInstancesReencryptRequest::new().set_instance("example");
6836    /// ```
6837    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6838        self.instance = v.into();
6839        self
6840    }
6841
6842    /// Sets the value of [project][crate::model::SqlInstancesReencryptRequest::project].
6843    ///
6844    /// # Example
6845    /// ```ignore,no_run
6846    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6847    /// let x = SqlInstancesReencryptRequest::new().set_project("example");
6848    /// ```
6849    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6850        self.project = v.into();
6851        self
6852    }
6853
6854    /// Sets the value of [body][crate::model::SqlInstancesReencryptRequest::body].
6855    ///
6856    /// # Example
6857    /// ```ignore,no_run
6858    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6859    /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
6860    /// let x = SqlInstancesReencryptRequest::new().set_body(InstancesReencryptRequest::default()/* use setters */);
6861    /// ```
6862    pub fn set_body<T>(mut self, v: T) -> Self
6863    where
6864        T: std::convert::Into<crate::model::InstancesReencryptRequest>,
6865    {
6866        self.body = std::option::Option::Some(v.into());
6867        self
6868    }
6869
6870    /// Sets or clears the value of [body][crate::model::SqlInstancesReencryptRequest::body].
6871    ///
6872    /// # Example
6873    /// ```ignore,no_run
6874    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6875    /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
6876    /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(Some(InstancesReencryptRequest::default()/* use setters */));
6877    /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(None::<InstancesReencryptRequest>);
6878    /// ```
6879    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6880    where
6881        T: std::convert::Into<crate::model::InstancesReencryptRequest>,
6882    {
6883        self.body = v.map(|x| x.into());
6884        self
6885    }
6886}
6887
6888impl wkt::message::Message for SqlInstancesReencryptRequest {
6889    fn typename() -> &'static str {
6890        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReencryptRequest"
6891    }
6892}
6893
6894/// Database Instance reencrypt request.
6895#[derive(Clone, Default, PartialEq)]
6896#[non_exhaustive]
6897pub struct InstancesReencryptRequest {
6898    /// Configuration specific to backup re-encryption
6899    pub backup_reencryption_config: std::option::Option<crate::model::BackupReencryptionConfig>,
6900
6901    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6902}
6903
6904impl InstancesReencryptRequest {
6905    pub fn new() -> Self {
6906        std::default::Default::default()
6907    }
6908
6909    /// Sets the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
6910    ///
6911    /// # Example
6912    /// ```ignore,no_run
6913    /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
6914    /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
6915    /// let x = InstancesReencryptRequest::new().set_backup_reencryption_config(BackupReencryptionConfig::default()/* use setters */);
6916    /// ```
6917    pub fn set_backup_reencryption_config<T>(mut self, v: T) -> Self
6918    where
6919        T: std::convert::Into<crate::model::BackupReencryptionConfig>,
6920    {
6921        self.backup_reencryption_config = std::option::Option::Some(v.into());
6922        self
6923    }
6924
6925    /// Sets or clears the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
6926    ///
6927    /// # Example
6928    /// ```ignore,no_run
6929    /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
6930    /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
6931    /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(Some(BackupReencryptionConfig::default()/* use setters */));
6932    /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(None::<BackupReencryptionConfig>);
6933    /// ```
6934    pub fn set_or_clear_backup_reencryption_config<T>(mut self, v: std::option::Option<T>) -> Self
6935    where
6936        T: std::convert::Into<crate::model::BackupReencryptionConfig>,
6937    {
6938        self.backup_reencryption_config = v.map(|x| x.into());
6939        self
6940    }
6941}
6942
6943impl wkt::message::Message for InstancesReencryptRequest {
6944    fn typename() -> &'static str {
6945        "type.googleapis.com/google.cloud.sql.v1.InstancesReencryptRequest"
6946    }
6947}
6948
6949/// Backup Reencryption Config
6950#[derive(Clone, Default, PartialEq)]
6951#[non_exhaustive]
6952pub struct BackupReencryptionConfig {
6953    /// Backup re-encryption limit
6954    pub backup_limit: std::option::Option<i32>,
6955
6956    /// Type of backups users want to re-encrypt.
6957    pub backup_type: std::option::Option<crate::model::backup_reencryption_config::BackupType>,
6958
6959    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6960}
6961
6962impl BackupReencryptionConfig {
6963    pub fn new() -> Self {
6964        std::default::Default::default()
6965    }
6966
6967    /// Sets the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
6968    ///
6969    /// # Example
6970    /// ```ignore,no_run
6971    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
6972    /// let x = BackupReencryptionConfig::new().set_backup_limit(42);
6973    /// ```
6974    pub fn set_backup_limit<T>(mut self, v: T) -> Self
6975    where
6976        T: std::convert::Into<i32>,
6977    {
6978        self.backup_limit = std::option::Option::Some(v.into());
6979        self
6980    }
6981
6982    /// Sets or clears the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
6983    ///
6984    /// # Example
6985    /// ```ignore,no_run
6986    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
6987    /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(Some(42));
6988    /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(None::<i32>);
6989    /// ```
6990    pub fn set_or_clear_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
6991    where
6992        T: std::convert::Into<i32>,
6993    {
6994        self.backup_limit = v.map(|x| x.into());
6995        self
6996    }
6997
6998    /// Sets the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
6999    ///
7000    /// # Example
7001    /// ```ignore,no_run
7002    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7003    /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
7004    /// let x0 = BackupReencryptionConfig::new().set_backup_type(BackupType::Automated);
7005    /// let x1 = BackupReencryptionConfig::new().set_backup_type(BackupType::OnDemand);
7006    /// ```
7007    pub fn set_backup_type<T>(mut self, v: T) -> Self
7008    where
7009        T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
7010    {
7011        self.backup_type = std::option::Option::Some(v.into());
7012        self
7013    }
7014
7015    /// Sets or clears the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
7016    ///
7017    /// # Example
7018    /// ```ignore,no_run
7019    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7020    /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
7021    /// let x0 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::Automated));
7022    /// let x1 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::OnDemand));
7023    /// let x_none = BackupReencryptionConfig::new().set_or_clear_backup_type(None::<BackupType>);
7024    /// ```
7025    pub fn set_or_clear_backup_type<T>(mut self, v: std::option::Option<T>) -> Self
7026    where
7027        T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
7028    {
7029        self.backup_type = v.map(|x| x.into());
7030        self
7031    }
7032}
7033
7034impl wkt::message::Message for BackupReencryptionConfig {
7035    fn typename() -> &'static str {
7036        "type.googleapis.com/google.cloud.sql.v1.BackupReencryptionConfig"
7037    }
7038}
7039
7040/// Defines additional types related to [BackupReencryptionConfig].
7041pub mod backup_reencryption_config {
7042    #[allow(unused_imports)]
7043    use super::*;
7044
7045    /// Backup type for re-encryption
7046    ///
7047    /// # Working with unknown values
7048    ///
7049    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7050    /// additional enum variants at any time. Adding new variants is not considered
7051    /// a breaking change. Applications should write their code in anticipation of:
7052    ///
7053    /// - New values appearing in future releases of the client library, **and**
7054    /// - New values received dynamically, without application changes.
7055    ///
7056    /// Please consult the [Working with enums] section in the user guide for some
7057    /// guidelines.
7058    ///
7059    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7060    #[derive(Clone, Debug, PartialEq)]
7061    #[non_exhaustive]
7062    pub enum BackupType {
7063        /// Unknown backup type, will be defaulted to AUTOMATIC backup type
7064        Unspecified,
7065        /// Reencrypt automatic backups
7066        Automated,
7067        /// Reencrypt on-demand backups
7068        OnDemand,
7069        /// If set, the enum was initialized with an unknown value.
7070        ///
7071        /// Applications can examine the value using [BackupType::value] or
7072        /// [BackupType::name].
7073        UnknownValue(backup_type::UnknownValue),
7074    }
7075
7076    #[doc(hidden)]
7077    pub mod backup_type {
7078        #[allow(unused_imports)]
7079        use super::*;
7080        #[derive(Clone, Debug, PartialEq)]
7081        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7082    }
7083
7084    impl BackupType {
7085        /// Gets the enum value.
7086        ///
7087        /// Returns `None` if the enum contains an unknown value deserialized from
7088        /// the string representation of enums.
7089        pub fn value(&self) -> std::option::Option<i32> {
7090            match self {
7091                Self::Unspecified => std::option::Option::Some(0),
7092                Self::Automated => std::option::Option::Some(1),
7093                Self::OnDemand => std::option::Option::Some(2),
7094                Self::UnknownValue(u) => u.0.value(),
7095            }
7096        }
7097
7098        /// Gets the enum value as a string.
7099        ///
7100        /// Returns `None` if the enum contains an unknown value deserialized from
7101        /// the integer representation of enums.
7102        pub fn name(&self) -> std::option::Option<&str> {
7103            match self {
7104                Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
7105                Self::Automated => std::option::Option::Some("AUTOMATED"),
7106                Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
7107                Self::UnknownValue(u) => u.0.name(),
7108            }
7109        }
7110    }
7111
7112    impl std::default::Default for BackupType {
7113        fn default() -> Self {
7114            use std::convert::From;
7115            Self::from(0)
7116        }
7117    }
7118
7119    impl std::fmt::Display for BackupType {
7120        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7121            wkt::internal::display_enum(f, self.name(), self.value())
7122        }
7123    }
7124
7125    impl std::convert::From<i32> for BackupType {
7126        fn from(value: i32) -> Self {
7127            match value {
7128                0 => Self::Unspecified,
7129                1 => Self::Automated,
7130                2 => Self::OnDemand,
7131                _ => Self::UnknownValue(backup_type::UnknownValue(
7132                    wkt::internal::UnknownEnumValue::Integer(value),
7133                )),
7134            }
7135        }
7136    }
7137
7138    impl std::convert::From<&str> for BackupType {
7139        fn from(value: &str) -> Self {
7140            use std::string::ToString;
7141            match value {
7142                "BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
7143                "AUTOMATED" => Self::Automated,
7144                "ON_DEMAND" => Self::OnDemand,
7145                _ => Self::UnknownValue(backup_type::UnknownValue(
7146                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7147                )),
7148            }
7149        }
7150    }
7151
7152    impl serde::ser::Serialize for BackupType {
7153        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7154        where
7155            S: serde::Serializer,
7156        {
7157            match self {
7158                Self::Unspecified => serializer.serialize_i32(0),
7159                Self::Automated => serializer.serialize_i32(1),
7160                Self::OnDemand => serializer.serialize_i32(2),
7161                Self::UnknownValue(u) => u.0.serialize(serializer),
7162            }
7163        }
7164    }
7165
7166    impl<'de> serde::de::Deserialize<'de> for BackupType {
7167        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7168        where
7169            D: serde::Deserializer<'de>,
7170        {
7171            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
7172                ".google.cloud.sql.v1.BackupReencryptionConfig.BackupType",
7173            ))
7174        }
7175    }
7176}
7177
7178/// The selected object that Cloud SQL migrates.
7179#[derive(Clone, Default, PartialEq)]
7180#[non_exhaustive]
7181pub struct ExternalSyncSelectedObject {
7182    /// The name of the database that Cloud SQL migrates.
7183    pub database: std::string::String,
7184
7185    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7186}
7187
7188impl ExternalSyncSelectedObject {
7189    pub fn new() -> Self {
7190        std::default::Default::default()
7191    }
7192
7193    /// Sets the value of [database][crate::model::ExternalSyncSelectedObject::database].
7194    ///
7195    /// # Example
7196    /// ```ignore,no_run
7197    /// # use google_cloud_sql_v1::model::ExternalSyncSelectedObject;
7198    /// let x = ExternalSyncSelectedObject::new().set_database("example");
7199    /// ```
7200    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7201        self.database = v.into();
7202        self
7203    }
7204}
7205
7206impl wkt::message::Message for ExternalSyncSelectedObject {
7207    fn typename() -> &'static str {
7208        "type.googleapis.com/google.cloud.sql.v1.ExternalSyncSelectedObject"
7209    }
7210}
7211
7212/// Instance get disk shrink config request.
7213#[derive(Clone, Default, PartialEq)]
7214#[non_exhaustive]
7215pub struct SqlInstancesGetDiskShrinkConfigRequest {
7216    /// Cloud SQL instance ID. This does not include the project ID.
7217    pub instance: std::string::String,
7218
7219    /// Project ID of the project that contains the instance.
7220    pub project: std::string::String,
7221
7222    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7223}
7224
7225impl SqlInstancesGetDiskShrinkConfigRequest {
7226    pub fn new() -> Self {
7227        std::default::Default::default()
7228    }
7229
7230    /// Sets the value of [instance][crate::model::SqlInstancesGetDiskShrinkConfigRequest::instance].
7231    ///
7232    /// # Example
7233    /// ```ignore,no_run
7234    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
7235    /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_instance("example");
7236    /// ```
7237    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7238        self.instance = v.into();
7239        self
7240    }
7241
7242    /// Sets the value of [project][crate::model::SqlInstancesGetDiskShrinkConfigRequest::project].
7243    ///
7244    /// # Example
7245    /// ```ignore,no_run
7246    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
7247    /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_project("example");
7248    /// ```
7249    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7250        self.project = v.into();
7251        self
7252    }
7253}
7254
7255impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigRequest {
7256    fn typename() -> &'static str {
7257        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest"
7258    }
7259}
7260
7261/// Instance verify external sync settings request.
7262#[derive(Clone, Default, PartialEq)]
7263#[non_exhaustive]
7264pub struct SqlInstancesVerifyExternalSyncSettingsRequest {
7265    /// Cloud SQL instance ID. This does not include the project ID.
7266    pub instance: std::string::String,
7267
7268    /// Project ID of the project that contains the instance.
7269    pub project: std::string::String,
7270
7271    /// Flag to enable verifying connection only
7272    pub verify_connection_only: bool,
7273
7274    /// External sync mode
7275    pub sync_mode:
7276        crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7277
7278    /// Optional. Flag to verify settings required by replication setup only
7279    pub verify_replication_only: bool,
7280
7281    /// Optional. MigrationType configures the migration to use physical files or
7282    /// logical dump files. If not set, then the logical dump file configuration is
7283    /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
7284    pub migration_type:
7285        crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7286
7287    /// Optional. Parallel level for initial data sync. Only applicable for
7288    /// PostgreSQL.
7289    pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
7290
7291    /// Optional. Migrate only the specified objects from the source instance. If
7292    /// this field is empty, then migrate all objects.
7293    pub selected_objects: std::vec::Vec<crate::model::ExternalSyncSelectedObject>,
7294
7295    pub sync_config: std::option::Option<
7296        crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
7297    >,
7298
7299    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7300}
7301
7302impl SqlInstancesVerifyExternalSyncSettingsRequest {
7303    pub fn new() -> Self {
7304        std::default::Default::default()
7305    }
7306
7307    /// Sets the value of [instance][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::instance].
7308    ///
7309    /// # Example
7310    /// ```ignore,no_run
7311    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7312    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_instance("example");
7313    /// ```
7314    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7315        self.instance = v.into();
7316        self
7317    }
7318
7319    /// Sets the value of [project][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::project].
7320    ///
7321    /// # Example
7322    /// ```ignore,no_run
7323    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7324    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_project("example");
7325    /// ```
7326    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7327        self.project = v.into();
7328        self
7329    }
7330
7331    /// Sets the value of [verify_connection_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_connection_only].
7332    ///
7333    /// # Example
7334    /// ```ignore,no_run
7335    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7336    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_connection_only(true);
7337    /// ```
7338    pub fn set_verify_connection_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7339        self.verify_connection_only = v.into();
7340        self
7341    }
7342
7343    /// Sets the value of [sync_mode][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_mode].
7344    ///
7345    /// # Example
7346    /// ```ignore,no_run
7347    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7348    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
7349    /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Online);
7350    /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Offline);
7351    /// ```
7352    pub fn set_sync_mode<
7353        T: std::convert::Into<
7354                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7355            >,
7356    >(
7357        mut self,
7358        v: T,
7359    ) -> Self {
7360        self.sync_mode = v.into();
7361        self
7362    }
7363
7364    /// Sets the value of [verify_replication_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_replication_only].
7365    ///
7366    /// # Example
7367    /// ```ignore,no_run
7368    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7369    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_replication_only(true);
7370    /// ```
7371    pub fn set_verify_replication_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7372        self.verify_replication_only = v.into();
7373        self
7374    }
7375
7376    /// Sets the value of [migration_type][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::migration_type].
7377    ///
7378    /// # Example
7379    /// ```ignore,no_run
7380    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7381    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
7382    /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Logical);
7383    /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Physical);
7384    /// ```
7385    pub fn set_migration_type<
7386        T: std::convert::Into<
7387                crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7388            >,
7389    >(
7390        mut self,
7391        v: T,
7392    ) -> Self {
7393        self.migration_type = v.into();
7394        self
7395    }
7396
7397    /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_parallel_level].
7398    ///
7399    /// # Example
7400    /// ```ignore,no_run
7401    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7402    /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
7403    /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
7404    /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
7405    /// let x2 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
7406    /// ```
7407    pub fn set_sync_parallel_level<
7408        T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
7409    >(
7410        mut self,
7411        v: T,
7412    ) -> Self {
7413        self.sync_parallel_level = v.into();
7414        self
7415    }
7416
7417    /// Sets the value of [selected_objects][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::selected_objects].
7418    ///
7419    /// # Example
7420    /// ```ignore,no_run
7421    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7422    /// use google_cloud_sql_v1::model::ExternalSyncSelectedObject;
7423    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new()
7424    ///     .set_selected_objects([
7425    ///         ExternalSyncSelectedObject::default()/* use setters */,
7426    ///         ExternalSyncSelectedObject::default()/* use (different) setters */,
7427    ///     ]);
7428    /// ```
7429    pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
7430    where
7431        T: std::iter::IntoIterator<Item = V>,
7432        V: std::convert::Into<crate::model::ExternalSyncSelectedObject>,
7433    {
7434        use std::iter::Iterator;
7435        self.selected_objects = v.into_iter().map(|i| i.into()).collect();
7436        self
7437    }
7438
7439    /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config].
7440    ///
7441    /// Note that all the setters affecting `sync_config` are mutually
7442    /// exclusive.
7443    ///
7444    /// # Example
7445    /// ```ignore,no_run
7446    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7447    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7448    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_config(Some(
7449    ///     google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
7450    /// ```
7451    pub fn set_sync_config<
7452        T: std::convert::Into<
7453                std::option::Option<
7454                    crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
7455                >,
7456            >,
7457    >(
7458        mut self,
7459        v: T,
7460    ) -> Self {
7461        self.sync_config = v.into();
7462        self
7463    }
7464
7465    /// The value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
7466    /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
7467    /// holds a different branch.
7468    pub fn mysql_sync_config(
7469        &self,
7470    ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
7471        #[allow(unreachable_patterns)]
7472        self.sync_config.as_ref().and_then(|v| match v {
7473            crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
7474            _ => std::option::Option::None,
7475        })
7476    }
7477
7478    /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
7479    /// to hold a `MysqlSyncConfig`.
7480    ///
7481    /// Note that all the setters affecting `sync_config` are
7482    /// mutually exclusive.
7483    ///
7484    /// # Example
7485    /// ```ignore,no_run
7486    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7487    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7488    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
7489    /// assert!(x.mysql_sync_config().is_some());
7490    /// ```
7491    pub fn set_mysql_sync_config<
7492        T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
7493    >(
7494        mut self,
7495        v: T,
7496    ) -> Self {
7497        self.sync_config = std::option::Option::Some(
7498            crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(
7499                v.into()
7500            )
7501        );
7502        self
7503    }
7504}
7505
7506impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsRequest {
7507    fn typename() -> &'static str {
7508        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest"
7509    }
7510}
7511
7512/// Defines additional types related to [SqlInstancesVerifyExternalSyncSettingsRequest].
7513pub mod sql_instances_verify_external_sync_settings_request {
7514    #[allow(unused_imports)]
7515    use super::*;
7516
7517    ///
7518    /// # Working with unknown values
7519    ///
7520    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7521    /// additional enum variants at any time. Adding new variants is not considered
7522    /// a breaking change. Applications should write their code in anticipation of:
7523    ///
7524    /// - New values appearing in future releases of the client library, **and**
7525    /// - New values received dynamically, without application changes.
7526    ///
7527    /// Please consult the [Working with enums] section in the user guide for some
7528    /// guidelines.
7529    ///
7530    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7531    #[derive(Clone, Debug, PartialEq)]
7532    #[non_exhaustive]
7533    pub enum ExternalSyncMode {
7534        /// Unknown external sync mode, will be defaulted to ONLINE mode
7535        Unspecified,
7536        /// Online external sync will set up replication after initial data external
7537        /// sync
7538        Online,
7539        /// Offline external sync only dumps and loads a one-time snapshot of
7540        /// the primary instance's data
7541        Offline,
7542        /// If set, the enum was initialized with an unknown value.
7543        ///
7544        /// Applications can examine the value using [ExternalSyncMode::value] or
7545        /// [ExternalSyncMode::name].
7546        UnknownValue(external_sync_mode::UnknownValue),
7547    }
7548
7549    #[doc(hidden)]
7550    pub mod external_sync_mode {
7551        #[allow(unused_imports)]
7552        use super::*;
7553        #[derive(Clone, Debug, PartialEq)]
7554        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7555    }
7556
7557    impl ExternalSyncMode {
7558        /// Gets the enum value.
7559        ///
7560        /// Returns `None` if the enum contains an unknown value deserialized from
7561        /// the string representation of enums.
7562        pub fn value(&self) -> std::option::Option<i32> {
7563            match self {
7564                Self::Unspecified => std::option::Option::Some(0),
7565                Self::Online => std::option::Option::Some(1),
7566                Self::Offline => std::option::Option::Some(2),
7567                Self::UnknownValue(u) => u.0.value(),
7568            }
7569        }
7570
7571        /// Gets the enum value as a string.
7572        ///
7573        /// Returns `None` if the enum contains an unknown value deserialized from
7574        /// the integer representation of enums.
7575        pub fn name(&self) -> std::option::Option<&str> {
7576            match self {
7577                Self::Unspecified => std::option::Option::Some("EXTERNAL_SYNC_MODE_UNSPECIFIED"),
7578                Self::Online => std::option::Option::Some("ONLINE"),
7579                Self::Offline => std::option::Option::Some("OFFLINE"),
7580                Self::UnknownValue(u) => u.0.name(),
7581            }
7582        }
7583    }
7584
7585    impl std::default::Default for ExternalSyncMode {
7586        fn default() -> Self {
7587            use std::convert::From;
7588            Self::from(0)
7589        }
7590    }
7591
7592    impl std::fmt::Display for ExternalSyncMode {
7593        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7594            wkt::internal::display_enum(f, self.name(), self.value())
7595        }
7596    }
7597
7598    impl std::convert::From<i32> for ExternalSyncMode {
7599        fn from(value: i32) -> Self {
7600            match value {
7601                0 => Self::Unspecified,
7602                1 => Self::Online,
7603                2 => Self::Offline,
7604                _ => Self::UnknownValue(external_sync_mode::UnknownValue(
7605                    wkt::internal::UnknownEnumValue::Integer(value),
7606                )),
7607            }
7608        }
7609    }
7610
7611    impl std::convert::From<&str> for ExternalSyncMode {
7612        fn from(value: &str) -> Self {
7613            use std::string::ToString;
7614            match value {
7615                "EXTERNAL_SYNC_MODE_UNSPECIFIED" => Self::Unspecified,
7616                "ONLINE" => Self::Online,
7617                "OFFLINE" => Self::Offline,
7618                _ => Self::UnknownValue(external_sync_mode::UnknownValue(
7619                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7620                )),
7621            }
7622        }
7623    }
7624
7625    impl serde::ser::Serialize for ExternalSyncMode {
7626        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7627        where
7628            S: serde::Serializer,
7629        {
7630            match self {
7631                Self::Unspecified => serializer.serialize_i32(0),
7632                Self::Online => serializer.serialize_i32(1),
7633                Self::Offline => serializer.serialize_i32(2),
7634                Self::UnknownValue(u) => u.0.serialize(serializer),
7635            }
7636        }
7637    }
7638
7639    impl<'de> serde::de::Deserialize<'de> for ExternalSyncMode {
7640        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7641        where
7642            D: serde::Deserializer<'de>,
7643        {
7644            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExternalSyncMode>::new(
7645                ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode"))
7646        }
7647    }
7648
7649    /// MigrationType determines whether the migration is a physical file-based
7650    /// migration or a logical dump file-based migration.
7651    ///
7652    /// # Working with unknown values
7653    ///
7654    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7655    /// additional enum variants at any time. Adding new variants is not considered
7656    /// a breaking change. Applications should write their code in anticipation of:
7657    ///
7658    /// - New values appearing in future releases of the client library, **and**
7659    /// - New values received dynamically, without application changes.
7660    ///
7661    /// Please consult the [Working with enums] section in the user guide for some
7662    /// guidelines.
7663    ///
7664    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7665    #[derive(Clone, Debug, PartialEq)]
7666    #[non_exhaustive]
7667    pub enum MigrationType {
7668        /// Default value is a logical dump file-based migration
7669        Unspecified,
7670        /// Logical dump file-based migration
7671        Logical,
7672        /// Physical file-based migration
7673        Physical,
7674        /// If set, the enum was initialized with an unknown value.
7675        ///
7676        /// Applications can examine the value using [MigrationType::value] or
7677        /// [MigrationType::name].
7678        UnknownValue(migration_type::UnknownValue),
7679    }
7680
7681    #[doc(hidden)]
7682    pub mod migration_type {
7683        #[allow(unused_imports)]
7684        use super::*;
7685        #[derive(Clone, Debug, PartialEq)]
7686        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7687    }
7688
7689    impl MigrationType {
7690        /// Gets the enum value.
7691        ///
7692        /// Returns `None` if the enum contains an unknown value deserialized from
7693        /// the string representation of enums.
7694        pub fn value(&self) -> std::option::Option<i32> {
7695            match self {
7696                Self::Unspecified => std::option::Option::Some(0),
7697                Self::Logical => std::option::Option::Some(1),
7698                Self::Physical => std::option::Option::Some(2),
7699                Self::UnknownValue(u) => u.0.value(),
7700            }
7701        }
7702
7703        /// Gets the enum value as a string.
7704        ///
7705        /// Returns `None` if the enum contains an unknown value deserialized from
7706        /// the integer representation of enums.
7707        pub fn name(&self) -> std::option::Option<&str> {
7708            match self {
7709                Self::Unspecified => std::option::Option::Some("MIGRATION_TYPE_UNSPECIFIED"),
7710                Self::Logical => std::option::Option::Some("LOGICAL"),
7711                Self::Physical => std::option::Option::Some("PHYSICAL"),
7712                Self::UnknownValue(u) => u.0.name(),
7713            }
7714        }
7715    }
7716
7717    impl std::default::Default for MigrationType {
7718        fn default() -> Self {
7719            use std::convert::From;
7720            Self::from(0)
7721        }
7722    }
7723
7724    impl std::fmt::Display for MigrationType {
7725        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7726            wkt::internal::display_enum(f, self.name(), self.value())
7727        }
7728    }
7729
7730    impl std::convert::From<i32> for MigrationType {
7731        fn from(value: i32) -> Self {
7732            match value {
7733                0 => Self::Unspecified,
7734                1 => Self::Logical,
7735                2 => Self::Physical,
7736                _ => Self::UnknownValue(migration_type::UnknownValue(
7737                    wkt::internal::UnknownEnumValue::Integer(value),
7738                )),
7739            }
7740        }
7741    }
7742
7743    impl std::convert::From<&str> for MigrationType {
7744        fn from(value: &str) -> Self {
7745            use std::string::ToString;
7746            match value {
7747                "MIGRATION_TYPE_UNSPECIFIED" => Self::Unspecified,
7748                "LOGICAL" => Self::Logical,
7749                "PHYSICAL" => Self::Physical,
7750                _ => Self::UnknownValue(migration_type::UnknownValue(
7751                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7752                )),
7753            }
7754        }
7755    }
7756
7757    impl serde::ser::Serialize for MigrationType {
7758        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7759        where
7760            S: serde::Serializer,
7761        {
7762            match self {
7763                Self::Unspecified => serializer.serialize_i32(0),
7764                Self::Logical => serializer.serialize_i32(1),
7765                Self::Physical => serializer.serialize_i32(2),
7766                Self::UnknownValue(u) => u.0.serialize(serializer),
7767            }
7768        }
7769    }
7770
7771    impl<'de> serde::de::Deserialize<'de> for MigrationType {
7772        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7773        where
7774            D: serde::Deserializer<'de>,
7775        {
7776            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationType>::new(
7777                ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType",
7778            ))
7779        }
7780    }
7781
7782    #[derive(Clone, Debug, PartialEq)]
7783    #[non_exhaustive]
7784    pub enum SyncConfig {
7785        /// Optional. MySQL-specific settings for start external sync.
7786        MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
7787    }
7788}
7789
7790/// Instance start external sync request.
7791#[derive(Clone, Default, PartialEq)]
7792#[non_exhaustive]
7793pub struct SqlInstancesStartExternalSyncRequest {
7794    /// Cloud SQL instance ID. This does not include the project ID.
7795    pub instance: std::string::String,
7796
7797    /// ID of the project that contains the instance.
7798    pub project: std::string::String,
7799
7800    /// External sync mode.
7801    pub sync_mode:
7802        crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7803
7804    /// Whether to skip the verification step (VESS).
7805    pub skip_verification: bool,
7806
7807    /// Optional. Parallel level for initial data sync. Currently only applicable
7808    /// for MySQL.
7809    pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
7810
7811    /// Optional. MigrationType configures the migration to use physical files or
7812    /// logical dump files. If not set, then the logical dump file configuration is
7813    /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
7814    pub migration_type:
7815        crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7816
7817    /// Optional. MySQL only. True if end-user has confirmed that this SES call
7818    /// will wipe replica databases overlapping with the proposed selected_objects.
7819    /// If this field is not set and there are both overlapping and additional
7820    /// databases proposed, an error will be returned.
7821    pub replica_overwrite_enabled: bool,
7822
7823    pub sync_config:
7824        std::option::Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>,
7825
7826    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7827}
7828
7829impl SqlInstancesStartExternalSyncRequest {
7830    pub fn new() -> Self {
7831        std::default::Default::default()
7832    }
7833
7834    /// Sets the value of [instance][crate::model::SqlInstancesStartExternalSyncRequest::instance].
7835    ///
7836    /// # Example
7837    /// ```ignore,no_run
7838    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7839    /// let x = SqlInstancesStartExternalSyncRequest::new().set_instance("example");
7840    /// ```
7841    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7842        self.instance = v.into();
7843        self
7844    }
7845
7846    /// Sets the value of [project][crate::model::SqlInstancesStartExternalSyncRequest::project].
7847    ///
7848    /// # Example
7849    /// ```ignore,no_run
7850    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7851    /// let x = SqlInstancesStartExternalSyncRequest::new().set_project("example");
7852    /// ```
7853    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7854        self.project = v.into();
7855        self
7856    }
7857
7858    /// Sets the value of [sync_mode][crate::model::SqlInstancesStartExternalSyncRequest::sync_mode].
7859    ///
7860    /// # Example
7861    /// ```ignore,no_run
7862    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7863    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
7864    /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Online);
7865    /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Offline);
7866    /// ```
7867    pub fn set_sync_mode<
7868        T: std::convert::Into<
7869                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7870            >,
7871    >(
7872        mut self,
7873        v: T,
7874    ) -> Self {
7875        self.sync_mode = v.into();
7876        self
7877    }
7878
7879    /// Sets the value of [skip_verification][crate::model::SqlInstancesStartExternalSyncRequest::skip_verification].
7880    ///
7881    /// # Example
7882    /// ```ignore,no_run
7883    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7884    /// let x = SqlInstancesStartExternalSyncRequest::new().set_skip_verification(true);
7885    /// ```
7886    pub fn set_skip_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7887        self.skip_verification = v.into();
7888        self
7889    }
7890
7891    /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesStartExternalSyncRequest::sync_parallel_level].
7892    ///
7893    /// # Example
7894    /// ```ignore,no_run
7895    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7896    /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
7897    /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
7898    /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
7899    /// let x2 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
7900    /// ```
7901    pub fn set_sync_parallel_level<
7902        T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
7903    >(
7904        mut self,
7905        v: T,
7906    ) -> Self {
7907        self.sync_parallel_level = v.into();
7908        self
7909    }
7910
7911    /// Sets the value of [migration_type][crate::model::SqlInstancesStartExternalSyncRequest::migration_type].
7912    ///
7913    /// # Example
7914    /// ```ignore,no_run
7915    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7916    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
7917    /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Logical);
7918    /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Physical);
7919    /// ```
7920    pub fn set_migration_type<
7921        T: std::convert::Into<
7922                crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7923            >,
7924    >(
7925        mut self,
7926        v: T,
7927    ) -> Self {
7928        self.migration_type = v.into();
7929        self
7930    }
7931
7932    /// Sets the value of [replica_overwrite_enabled][crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled].
7933    ///
7934    /// # Example
7935    /// ```ignore,no_run
7936    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7937    /// let x = SqlInstancesStartExternalSyncRequest::new().set_replica_overwrite_enabled(true);
7938    /// ```
7939    pub fn set_replica_overwrite_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7940        self.replica_overwrite_enabled = v.into();
7941        self
7942    }
7943
7944    /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config].
7945    ///
7946    /// Note that all the setters affecting `sync_config` are mutually
7947    /// exclusive.
7948    ///
7949    /// # Example
7950    /// ```ignore,no_run
7951    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7952    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7953    /// let x = SqlInstancesStartExternalSyncRequest::new().set_sync_config(Some(
7954    ///     google_cloud_sql_v1::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
7955    /// ```
7956    pub fn set_sync_config<
7957        T: std::convert::Into<
7958                std::option::Option<
7959                    crate::model::sql_instances_start_external_sync_request::SyncConfig,
7960                >,
7961            >,
7962    >(
7963        mut self,
7964        v: T,
7965    ) -> Self {
7966        self.sync_config = v.into();
7967        self
7968    }
7969
7970    /// The value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
7971    /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
7972    /// holds a different branch.
7973    pub fn mysql_sync_config(
7974        &self,
7975    ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
7976        #[allow(unreachable_patterns)]
7977        self.sync_config.as_ref().and_then(|v| match v {
7978            crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
7979            _ => std::option::Option::None,
7980        })
7981    }
7982
7983    /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
7984    /// to hold a `MysqlSyncConfig`.
7985    ///
7986    /// Note that all the setters affecting `sync_config` are
7987    /// mutually exclusive.
7988    ///
7989    /// # Example
7990    /// ```ignore,no_run
7991    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7992    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7993    /// let x = SqlInstancesStartExternalSyncRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
7994    /// assert!(x.mysql_sync_config().is_some());
7995    /// ```
7996    pub fn set_mysql_sync_config<
7997        T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
7998    >(
7999        mut self,
8000        v: T,
8001    ) -> Self {
8002        self.sync_config = std::option::Option::Some(
8003            crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(
8004                v.into(),
8005            ),
8006        );
8007        self
8008    }
8009}
8010
8011impl wkt::message::Message for SqlInstancesStartExternalSyncRequest {
8012    fn typename() -> &'static str {
8013        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest"
8014    }
8015}
8016
8017/// Defines additional types related to [SqlInstancesStartExternalSyncRequest].
8018pub mod sql_instances_start_external_sync_request {
8019    #[allow(unused_imports)]
8020    use super::*;
8021
8022    #[derive(Clone, Debug, PartialEq)]
8023    #[non_exhaustive]
8024    pub enum SyncConfig {
8025        /// MySQL-specific settings for start external sync.
8026        MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
8027    }
8028}
8029
8030/// Instance reset replica size request.
8031#[derive(Clone, Default, PartialEq)]
8032#[non_exhaustive]
8033pub struct SqlInstancesResetReplicaSizeRequest {
8034    /// Cloud SQL read replica instance name.
8035    pub instance: std::string::String,
8036
8037    /// ID of the project that contains the read replica.
8038    pub project: std::string::String,
8039
8040    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8041}
8042
8043impl SqlInstancesResetReplicaSizeRequest {
8044    pub fn new() -> Self {
8045        std::default::Default::default()
8046    }
8047
8048    /// Sets the value of [instance][crate::model::SqlInstancesResetReplicaSizeRequest::instance].
8049    ///
8050    /// # Example
8051    /// ```ignore,no_run
8052    /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
8053    /// let x = SqlInstancesResetReplicaSizeRequest::new().set_instance("example");
8054    /// ```
8055    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8056        self.instance = v.into();
8057        self
8058    }
8059
8060    /// Sets the value of [project][crate::model::SqlInstancesResetReplicaSizeRequest::project].
8061    ///
8062    /// # Example
8063    /// ```ignore,no_run
8064    /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
8065    /// let x = SqlInstancesResetReplicaSizeRequest::new().set_project("example");
8066    /// ```
8067    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8068        self.project = v.into();
8069        self
8070    }
8071}
8072
8073impl wkt::message::Message for SqlInstancesResetReplicaSizeRequest {
8074    fn typename() -> &'static str {
8075        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest"
8076    }
8077}
8078
8079/// Instance create ephemeral certificate request.
8080#[derive(Clone, Default, PartialEq)]
8081#[non_exhaustive]
8082pub struct SqlInstancesCreateEphemeralCertRequest {
8083    /// Cloud SQL instance ID. This does not include the project ID.
8084    pub instance: std::string::String,
8085
8086    /// Project ID of the Cloud SQL project.
8087    pub project: std::string::String,
8088
8089    pub body: std::option::Option<crate::model::SslCertsCreateEphemeralRequest>,
8090
8091    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8092}
8093
8094impl SqlInstancesCreateEphemeralCertRequest {
8095    pub fn new() -> Self {
8096        std::default::Default::default()
8097    }
8098
8099    /// Sets the value of [instance][crate::model::SqlInstancesCreateEphemeralCertRequest::instance].
8100    ///
8101    /// # Example
8102    /// ```ignore,no_run
8103    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8104    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_instance("example");
8105    /// ```
8106    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8107        self.instance = v.into();
8108        self
8109    }
8110
8111    /// Sets the value of [project][crate::model::SqlInstancesCreateEphemeralCertRequest::project].
8112    ///
8113    /// # Example
8114    /// ```ignore,no_run
8115    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8116    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_project("example");
8117    /// ```
8118    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8119        self.project = v.into();
8120        self
8121    }
8122
8123    /// Sets the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
8124    ///
8125    /// # Example
8126    /// ```ignore,no_run
8127    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8128    /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8129    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_body(SslCertsCreateEphemeralRequest::default()/* use setters */);
8130    /// ```
8131    pub fn set_body<T>(mut self, v: T) -> Self
8132    where
8133        T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
8134    {
8135        self.body = std::option::Option::Some(v.into());
8136        self
8137    }
8138
8139    /// Sets or clears the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
8140    ///
8141    /// # Example
8142    /// ```ignore,no_run
8143    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8144    /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8145    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(Some(SslCertsCreateEphemeralRequest::default()/* use setters */));
8146    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(None::<SslCertsCreateEphemeralRequest>);
8147    /// ```
8148    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
8149    where
8150        T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
8151    {
8152        self.body = v.map(|x| x.into());
8153        self
8154    }
8155}
8156
8157impl wkt::message::Message for SqlInstancesCreateEphemeralCertRequest {
8158    fn typename() -> &'static str {
8159        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest"
8160    }
8161}
8162
8163/// Database instance clone request.
8164#[derive(Clone, Default, PartialEq)]
8165#[non_exhaustive]
8166pub struct InstancesCloneRequest {
8167    /// Required. Contains details about the clone operation.
8168    pub clone_context: std::option::Option<crate::model::CloneContext>,
8169
8170    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8171}
8172
8173impl InstancesCloneRequest {
8174    pub fn new() -> Self {
8175        std::default::Default::default()
8176    }
8177
8178    /// Sets the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
8179    ///
8180    /// # Example
8181    /// ```ignore,no_run
8182    /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
8183    /// use google_cloud_sql_v1::model::CloneContext;
8184    /// let x = InstancesCloneRequest::new().set_clone_context(CloneContext::default()/* use setters */);
8185    /// ```
8186    pub fn set_clone_context<T>(mut self, v: T) -> Self
8187    where
8188        T: std::convert::Into<crate::model::CloneContext>,
8189    {
8190        self.clone_context = std::option::Option::Some(v.into());
8191        self
8192    }
8193
8194    /// Sets or clears the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
8195    ///
8196    /// # Example
8197    /// ```ignore,no_run
8198    /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
8199    /// use google_cloud_sql_v1::model::CloneContext;
8200    /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(Some(CloneContext::default()/* use setters */));
8201    /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(None::<CloneContext>);
8202    /// ```
8203    pub fn set_or_clear_clone_context<T>(mut self, v: std::option::Option<T>) -> Self
8204    where
8205        T: std::convert::Into<crate::model::CloneContext>,
8206    {
8207        self.clone_context = v.map(|x| x.into());
8208        self
8209    }
8210}
8211
8212impl wkt::message::Message for InstancesCloneRequest {
8213    fn typename() -> &'static str {
8214        "type.googleapis.com/google.cloud.sql.v1.InstancesCloneRequest"
8215    }
8216}
8217
8218/// Database demote primary instance request.
8219#[derive(Clone, Default, PartialEq)]
8220#[non_exhaustive]
8221pub struct InstancesDemoteMasterRequest {
8222    /// Contains details about the demoteMaster operation.
8223    pub demote_master_context: std::option::Option<crate::model::DemoteMasterContext>,
8224
8225    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8226}
8227
8228impl InstancesDemoteMasterRequest {
8229    pub fn new() -> Self {
8230        std::default::Default::default()
8231    }
8232
8233    /// Sets the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
8234    ///
8235    /// # Example
8236    /// ```ignore,no_run
8237    /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
8238    /// use google_cloud_sql_v1::model::DemoteMasterContext;
8239    /// let x = InstancesDemoteMasterRequest::new().set_demote_master_context(DemoteMasterContext::default()/* use setters */);
8240    /// ```
8241    pub fn set_demote_master_context<T>(mut self, v: T) -> Self
8242    where
8243        T: std::convert::Into<crate::model::DemoteMasterContext>,
8244    {
8245        self.demote_master_context = std::option::Option::Some(v.into());
8246        self
8247    }
8248
8249    /// Sets or clears the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
8250    ///
8251    /// # Example
8252    /// ```ignore,no_run
8253    /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
8254    /// use google_cloud_sql_v1::model::DemoteMasterContext;
8255    /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(Some(DemoteMasterContext::default()/* use setters */));
8256    /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(None::<DemoteMasterContext>);
8257    /// ```
8258    pub fn set_or_clear_demote_master_context<T>(mut self, v: std::option::Option<T>) -> Self
8259    where
8260        T: std::convert::Into<crate::model::DemoteMasterContext>,
8261    {
8262        self.demote_master_context = v.map(|x| x.into());
8263        self
8264    }
8265}
8266
8267impl wkt::message::Message for InstancesDemoteMasterRequest {
8268    fn typename() -> &'static str {
8269        "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteMasterRequest"
8270    }
8271}
8272
8273/// This request is used to demote an existing standalone instance to be a
8274/// Cloud SQL read replica for an external database server.
8275#[derive(Clone, Default, PartialEq)]
8276#[non_exhaustive]
8277pub struct InstancesDemoteRequest {
8278    /// Required. Contains details about the demote operation.
8279    pub demote_context: std::option::Option<crate::model::DemoteContext>,
8280
8281    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8282}
8283
8284impl InstancesDemoteRequest {
8285    pub fn new() -> Self {
8286        std::default::Default::default()
8287    }
8288
8289    /// Sets the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
8290    ///
8291    /// # Example
8292    /// ```ignore,no_run
8293    /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
8294    /// use google_cloud_sql_v1::model::DemoteContext;
8295    /// let x = InstancesDemoteRequest::new().set_demote_context(DemoteContext::default()/* use setters */);
8296    /// ```
8297    pub fn set_demote_context<T>(mut self, v: T) -> Self
8298    where
8299        T: std::convert::Into<crate::model::DemoteContext>,
8300    {
8301        self.demote_context = std::option::Option::Some(v.into());
8302        self
8303    }
8304
8305    /// Sets or clears the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
8306    ///
8307    /// # Example
8308    /// ```ignore,no_run
8309    /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
8310    /// use google_cloud_sql_v1::model::DemoteContext;
8311    /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(Some(DemoteContext::default()/* use setters */));
8312    /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(None::<DemoteContext>);
8313    /// ```
8314    pub fn set_or_clear_demote_context<T>(mut self, v: std::option::Option<T>) -> Self
8315    where
8316        T: std::convert::Into<crate::model::DemoteContext>,
8317    {
8318        self.demote_context = v.map(|x| x.into());
8319        self
8320    }
8321}
8322
8323impl wkt::message::Message for InstancesDemoteRequest {
8324    fn typename() -> &'static str {
8325        "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteRequest"
8326    }
8327}
8328
8329/// Database instance export request.
8330#[derive(Clone, Default, PartialEq)]
8331#[non_exhaustive]
8332pub struct InstancesExportRequest {
8333    /// Contains details about the export operation.
8334    pub export_context: std::option::Option<crate::model::ExportContext>,
8335
8336    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8337}
8338
8339impl InstancesExportRequest {
8340    pub fn new() -> Self {
8341        std::default::Default::default()
8342    }
8343
8344    /// Sets the value of [export_context][crate::model::InstancesExportRequest::export_context].
8345    ///
8346    /// # Example
8347    /// ```ignore,no_run
8348    /// # use google_cloud_sql_v1::model::InstancesExportRequest;
8349    /// use google_cloud_sql_v1::model::ExportContext;
8350    /// let x = InstancesExportRequest::new().set_export_context(ExportContext::default()/* use setters */);
8351    /// ```
8352    pub fn set_export_context<T>(mut self, v: T) -> Self
8353    where
8354        T: std::convert::Into<crate::model::ExportContext>,
8355    {
8356        self.export_context = std::option::Option::Some(v.into());
8357        self
8358    }
8359
8360    /// Sets or clears the value of [export_context][crate::model::InstancesExportRequest::export_context].
8361    ///
8362    /// # Example
8363    /// ```ignore,no_run
8364    /// # use google_cloud_sql_v1::model::InstancesExportRequest;
8365    /// use google_cloud_sql_v1::model::ExportContext;
8366    /// let x = InstancesExportRequest::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
8367    /// let x = InstancesExportRequest::new().set_or_clear_export_context(None::<ExportContext>);
8368    /// ```
8369    pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
8370    where
8371        T: std::convert::Into<crate::model::ExportContext>,
8372    {
8373        self.export_context = v.map(|x| x.into());
8374        self
8375    }
8376}
8377
8378impl wkt::message::Message for InstancesExportRequest {
8379    fn typename() -> &'static str {
8380        "type.googleapis.com/google.cloud.sql.v1.InstancesExportRequest"
8381    }
8382}
8383
8384/// Instance failover request.
8385#[derive(Clone, Default, PartialEq)]
8386#[non_exhaustive]
8387pub struct InstancesFailoverRequest {
8388    /// Failover Context.
8389    pub failover_context: std::option::Option<crate::model::FailoverContext>,
8390
8391    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8392}
8393
8394impl InstancesFailoverRequest {
8395    pub fn new() -> Self {
8396        std::default::Default::default()
8397    }
8398
8399    /// Sets the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
8400    ///
8401    /// # Example
8402    /// ```ignore,no_run
8403    /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
8404    /// use google_cloud_sql_v1::model::FailoverContext;
8405    /// let x = InstancesFailoverRequest::new().set_failover_context(FailoverContext::default()/* use setters */);
8406    /// ```
8407    pub fn set_failover_context<T>(mut self, v: T) -> Self
8408    where
8409        T: std::convert::Into<crate::model::FailoverContext>,
8410    {
8411        self.failover_context = std::option::Option::Some(v.into());
8412        self
8413    }
8414
8415    /// Sets or clears the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
8416    ///
8417    /// # Example
8418    /// ```ignore,no_run
8419    /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
8420    /// use google_cloud_sql_v1::model::FailoverContext;
8421    /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(Some(FailoverContext::default()/* use setters */));
8422    /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(None::<FailoverContext>);
8423    /// ```
8424    pub fn set_or_clear_failover_context<T>(mut self, v: std::option::Option<T>) -> Self
8425    where
8426        T: std::convert::Into<crate::model::FailoverContext>,
8427    {
8428        self.failover_context = v.map(|x| x.into());
8429        self
8430    }
8431}
8432
8433impl wkt::message::Message for InstancesFailoverRequest {
8434    fn typename() -> &'static str {
8435        "type.googleapis.com/google.cloud.sql.v1.InstancesFailoverRequest"
8436    }
8437}
8438
8439/// SslCerts create ephemeral certificate request.
8440#[derive(Clone, Default, PartialEq)]
8441#[non_exhaustive]
8442pub struct SslCertsCreateEphemeralRequest {
8443    /// PEM encoded public key to include in the signed certificate.
8444    pub public_key: std::string::String,
8445
8446    /// Access token to include in the signed certificate.
8447    pub access_token: std::string::String,
8448
8449    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8450}
8451
8452impl SslCertsCreateEphemeralRequest {
8453    pub fn new() -> Self {
8454        std::default::Default::default()
8455    }
8456
8457    /// Sets the value of [public_key][crate::model::SslCertsCreateEphemeralRequest::public_key].
8458    ///
8459    /// # Example
8460    /// ```ignore,no_run
8461    /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8462    /// let x = SslCertsCreateEphemeralRequest::new().set_public_key("example");
8463    /// ```
8464    pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8465        self.public_key = v.into();
8466        self
8467    }
8468
8469    /// Sets the value of [access_token][crate::model::SslCertsCreateEphemeralRequest::access_token].
8470    ///
8471    /// # Example
8472    /// ```ignore,no_run
8473    /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8474    /// let x = SslCertsCreateEphemeralRequest::new().set_access_token("example");
8475    /// ```
8476    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8477        self.access_token = v.into();
8478        self
8479    }
8480}
8481
8482impl wkt::message::Message for SslCertsCreateEphemeralRequest {
8483    fn typename() -> &'static str {
8484        "type.googleapis.com/google.cloud.sql.v1.SslCertsCreateEphemeralRequest"
8485    }
8486}
8487
8488/// Database instance import request.
8489#[derive(Clone, Default, PartialEq)]
8490#[non_exhaustive]
8491pub struct InstancesImportRequest {
8492    /// Contains details about the import operation.
8493    pub import_context: std::option::Option<crate::model::ImportContext>,
8494
8495    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8496}
8497
8498impl InstancesImportRequest {
8499    pub fn new() -> Self {
8500        std::default::Default::default()
8501    }
8502
8503    /// Sets the value of [import_context][crate::model::InstancesImportRequest::import_context].
8504    ///
8505    /// # Example
8506    /// ```ignore,no_run
8507    /// # use google_cloud_sql_v1::model::InstancesImportRequest;
8508    /// use google_cloud_sql_v1::model::ImportContext;
8509    /// let x = InstancesImportRequest::new().set_import_context(ImportContext::default()/* use setters */);
8510    /// ```
8511    pub fn set_import_context<T>(mut self, v: T) -> Self
8512    where
8513        T: std::convert::Into<crate::model::ImportContext>,
8514    {
8515        self.import_context = std::option::Option::Some(v.into());
8516        self
8517    }
8518
8519    /// Sets or clears the value of [import_context][crate::model::InstancesImportRequest::import_context].
8520    ///
8521    /// # Example
8522    /// ```ignore,no_run
8523    /// # use google_cloud_sql_v1::model::InstancesImportRequest;
8524    /// use google_cloud_sql_v1::model::ImportContext;
8525    /// let x = InstancesImportRequest::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
8526    /// let x = InstancesImportRequest::new().set_or_clear_import_context(None::<ImportContext>);
8527    /// ```
8528    pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
8529    where
8530        T: std::convert::Into<crate::model::ImportContext>,
8531    {
8532        self.import_context = v.map(|x| x.into());
8533        self
8534    }
8535}
8536
8537impl wkt::message::Message for InstancesImportRequest {
8538    fn typename() -> &'static str {
8539        "type.googleapis.com/google.cloud.sql.v1.InstancesImportRequest"
8540    }
8541}
8542
8543/// Request for Pre-checks for MVU
8544#[derive(Clone, Default, PartialEq)]
8545#[non_exhaustive]
8546pub struct InstancesPreCheckMajorVersionUpgradeRequest {
8547    /// Required. Contains details about the pre-check major version upgrade
8548    /// operation.
8549    pub pre_check_major_version_upgrade_context:
8550        std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
8551
8552    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8553}
8554
8555impl InstancesPreCheckMajorVersionUpgradeRequest {
8556    pub fn new() -> Self {
8557        std::default::Default::default()
8558    }
8559
8560    /// Sets the value of [pre_check_major_version_upgrade_context][crate::model::InstancesPreCheckMajorVersionUpgradeRequest::pre_check_major_version_upgrade_context].
8561    ///
8562    /// # Example
8563    /// ```ignore,no_run
8564    /// # use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
8565    /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
8566    /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_pre_check_major_version_upgrade_context(PreCheckMajorVersionUpgradeContext::default()/* use setters */);
8567    /// ```
8568    pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
8569    where
8570        T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
8571    {
8572        self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
8573        self
8574    }
8575
8576    /// Sets or clears the value of [pre_check_major_version_upgrade_context][crate::model::InstancesPreCheckMajorVersionUpgradeRequest::pre_check_major_version_upgrade_context].
8577    ///
8578    /// # Example
8579    /// ```ignore,no_run
8580    /// # use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
8581    /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
8582    /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_pre_check_major_version_upgrade_context(Some(PreCheckMajorVersionUpgradeContext::default()/* use setters */));
8583    /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_pre_check_major_version_upgrade_context(None::<PreCheckMajorVersionUpgradeContext>);
8584    /// ```
8585    pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
8586        mut self,
8587        v: std::option::Option<T>,
8588    ) -> Self
8589    where
8590        T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
8591    {
8592        self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
8593        self
8594    }
8595}
8596
8597impl wkt::message::Message for InstancesPreCheckMajorVersionUpgradeRequest {
8598    fn typename() -> &'static str {
8599        "type.googleapis.com/google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest"
8600    }
8601}
8602
8603/// Database instances list response.
8604#[derive(Clone, Default, PartialEq)]
8605#[non_exhaustive]
8606pub struct InstancesListResponse {
8607    /// This is always `sql#instancesList`.
8608    pub kind: std::string::String,
8609
8610    /// List of warnings that occurred while handling the request.
8611    pub warnings: std::vec::Vec<crate::model::ApiWarning>,
8612
8613    /// List of database instance resources.
8614    pub items: std::vec::Vec<crate::model::DatabaseInstance>,
8615
8616    /// The continuation token, used to page through large result sets. Provide
8617    /// this value in a subsequent request to return the next page of results.
8618    pub next_page_token: std::string::String,
8619
8620    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8621}
8622
8623impl InstancesListResponse {
8624    pub fn new() -> Self {
8625        std::default::Default::default()
8626    }
8627
8628    /// Sets the value of [kind][crate::model::InstancesListResponse::kind].
8629    ///
8630    /// # Example
8631    /// ```ignore,no_run
8632    /// # use google_cloud_sql_v1::model::InstancesListResponse;
8633    /// let x = InstancesListResponse::new().set_kind("example");
8634    /// ```
8635    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8636        self.kind = v.into();
8637        self
8638    }
8639
8640    /// Sets the value of [warnings][crate::model::InstancesListResponse::warnings].
8641    ///
8642    /// # Example
8643    /// ```ignore,no_run
8644    /// # use google_cloud_sql_v1::model::InstancesListResponse;
8645    /// use google_cloud_sql_v1::model::ApiWarning;
8646    /// let x = InstancesListResponse::new()
8647    ///     .set_warnings([
8648    ///         ApiWarning::default()/* use setters */,
8649    ///         ApiWarning::default()/* use (different) setters */,
8650    ///     ]);
8651    /// ```
8652    pub fn set_warnings<T, V>(mut self, v: T) -> Self
8653    where
8654        T: std::iter::IntoIterator<Item = V>,
8655        V: std::convert::Into<crate::model::ApiWarning>,
8656    {
8657        use std::iter::Iterator;
8658        self.warnings = v.into_iter().map(|i| i.into()).collect();
8659        self
8660    }
8661
8662    /// Sets the value of [items][crate::model::InstancesListResponse::items].
8663    ///
8664    /// # Example
8665    /// ```ignore,no_run
8666    /// # use google_cloud_sql_v1::model::InstancesListResponse;
8667    /// use google_cloud_sql_v1::model::DatabaseInstance;
8668    /// let x = InstancesListResponse::new()
8669    ///     .set_items([
8670    ///         DatabaseInstance::default()/* use setters */,
8671    ///         DatabaseInstance::default()/* use (different) setters */,
8672    ///     ]);
8673    /// ```
8674    pub fn set_items<T, V>(mut self, v: T) -> Self
8675    where
8676        T: std::iter::IntoIterator<Item = V>,
8677        V: std::convert::Into<crate::model::DatabaseInstance>,
8678    {
8679        use std::iter::Iterator;
8680        self.items = v.into_iter().map(|i| i.into()).collect();
8681        self
8682    }
8683
8684    /// Sets the value of [next_page_token][crate::model::InstancesListResponse::next_page_token].
8685    ///
8686    /// # Example
8687    /// ```ignore,no_run
8688    /// # use google_cloud_sql_v1::model::InstancesListResponse;
8689    /// let x = InstancesListResponse::new().set_next_page_token("example");
8690    /// ```
8691    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8692        self.next_page_token = v.into();
8693        self
8694    }
8695}
8696
8697impl wkt::message::Message for InstancesListResponse {
8698    fn typename() -> &'static str {
8699        "type.googleapis.com/google.cloud.sql.v1.InstancesListResponse"
8700    }
8701}
8702
8703#[doc(hidden)]
8704impl gax::paginator::internal::PageableResponse for InstancesListResponse {
8705    type PageItem = crate::model::DatabaseInstance;
8706
8707    fn items(self) -> std::vec::Vec<Self::PageItem> {
8708        self.items
8709    }
8710
8711    fn next_page_token(&self) -> std::string::String {
8712        use std::clone::Clone;
8713        self.next_page_token.clone()
8714    }
8715}
8716
8717/// Instances ListServerCas response.
8718#[derive(Clone, Default, PartialEq)]
8719#[non_exhaustive]
8720pub struct InstancesListServerCasResponse {
8721    /// List of server CA certificates for the instance.
8722    pub certs: std::vec::Vec<crate::model::SslCert>,
8723
8724    pub active_version: std::string::String,
8725
8726    /// This is always `sql#instancesListServerCas`.
8727    pub kind: std::string::String,
8728
8729    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8730}
8731
8732impl InstancesListServerCasResponse {
8733    pub fn new() -> Self {
8734        std::default::Default::default()
8735    }
8736
8737    /// Sets the value of [certs][crate::model::InstancesListServerCasResponse::certs].
8738    ///
8739    /// # Example
8740    /// ```ignore,no_run
8741    /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8742    /// use google_cloud_sql_v1::model::SslCert;
8743    /// let x = InstancesListServerCasResponse::new()
8744    ///     .set_certs([
8745    ///         SslCert::default()/* use setters */,
8746    ///         SslCert::default()/* use (different) setters */,
8747    ///     ]);
8748    /// ```
8749    pub fn set_certs<T, V>(mut self, v: T) -> Self
8750    where
8751        T: std::iter::IntoIterator<Item = V>,
8752        V: std::convert::Into<crate::model::SslCert>,
8753    {
8754        use std::iter::Iterator;
8755        self.certs = v.into_iter().map(|i| i.into()).collect();
8756        self
8757    }
8758
8759    /// Sets the value of [active_version][crate::model::InstancesListServerCasResponse::active_version].
8760    ///
8761    /// # Example
8762    /// ```ignore,no_run
8763    /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8764    /// let x = InstancesListServerCasResponse::new().set_active_version("example");
8765    /// ```
8766    pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8767        self.active_version = v.into();
8768        self
8769    }
8770
8771    /// Sets the value of [kind][crate::model::InstancesListServerCasResponse::kind].
8772    ///
8773    /// # Example
8774    /// ```ignore,no_run
8775    /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8776    /// let x = InstancesListServerCasResponse::new().set_kind("example");
8777    /// ```
8778    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8779        self.kind = v.into();
8780        self
8781    }
8782}
8783
8784impl wkt::message::Message for InstancesListServerCasResponse {
8785    fn typename() -> &'static str {
8786        "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCasResponse"
8787    }
8788}
8789
8790/// Instances ListServerCertificates response.
8791#[derive(Clone, Default, PartialEq)]
8792#[non_exhaustive]
8793pub struct InstancesListServerCertificatesResponse {
8794    /// List of server CA certificates for the instance.
8795    pub ca_certs: std::vec::Vec<crate::model::SslCert>,
8796
8797    /// List of server certificates for the instance, signed by the corresponding
8798    /// CA from the `ca_certs` list.
8799    pub server_certs: std::vec::Vec<crate::model::SslCert>,
8800
8801    /// The `sha1_fingerprint` of the active certificate from `server_certs`.
8802    pub active_version: std::string::String,
8803
8804    /// This is always `sql#instancesListServerCertificates`.
8805    pub kind: std::string::String,
8806
8807    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8808}
8809
8810impl InstancesListServerCertificatesResponse {
8811    pub fn new() -> Self {
8812        std::default::Default::default()
8813    }
8814
8815    /// Sets the value of [ca_certs][crate::model::InstancesListServerCertificatesResponse::ca_certs].
8816    ///
8817    /// # Example
8818    /// ```ignore,no_run
8819    /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8820    /// use google_cloud_sql_v1::model::SslCert;
8821    /// let x = InstancesListServerCertificatesResponse::new()
8822    ///     .set_ca_certs([
8823    ///         SslCert::default()/* use setters */,
8824    ///         SslCert::default()/* use (different) setters */,
8825    ///     ]);
8826    /// ```
8827    pub fn set_ca_certs<T, V>(mut self, v: T) -> Self
8828    where
8829        T: std::iter::IntoIterator<Item = V>,
8830        V: std::convert::Into<crate::model::SslCert>,
8831    {
8832        use std::iter::Iterator;
8833        self.ca_certs = v.into_iter().map(|i| i.into()).collect();
8834        self
8835    }
8836
8837    /// Sets the value of [server_certs][crate::model::InstancesListServerCertificatesResponse::server_certs].
8838    ///
8839    /// # Example
8840    /// ```ignore,no_run
8841    /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8842    /// use google_cloud_sql_v1::model::SslCert;
8843    /// let x = InstancesListServerCertificatesResponse::new()
8844    ///     .set_server_certs([
8845    ///         SslCert::default()/* use setters */,
8846    ///         SslCert::default()/* use (different) setters */,
8847    ///     ]);
8848    /// ```
8849    pub fn set_server_certs<T, V>(mut self, v: T) -> Self
8850    where
8851        T: std::iter::IntoIterator<Item = V>,
8852        V: std::convert::Into<crate::model::SslCert>,
8853    {
8854        use std::iter::Iterator;
8855        self.server_certs = v.into_iter().map(|i| i.into()).collect();
8856        self
8857    }
8858
8859    /// Sets the value of [active_version][crate::model::InstancesListServerCertificatesResponse::active_version].
8860    ///
8861    /// # Example
8862    /// ```ignore,no_run
8863    /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8864    /// let x = InstancesListServerCertificatesResponse::new().set_active_version("example");
8865    /// ```
8866    pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8867        self.active_version = v.into();
8868        self
8869    }
8870
8871    /// Sets the value of [kind][crate::model::InstancesListServerCertificatesResponse::kind].
8872    ///
8873    /// # Example
8874    /// ```ignore,no_run
8875    /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8876    /// let x = InstancesListServerCertificatesResponse::new().set_kind("example");
8877    /// ```
8878    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8879        self.kind = v.into();
8880        self
8881    }
8882}
8883
8884impl wkt::message::Message for InstancesListServerCertificatesResponse {
8885    fn typename() -> &'static str {
8886        "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCertificatesResponse"
8887    }
8888}
8889
8890/// Instances ListEntraIdCertificates response.
8891#[derive(Clone, Default, PartialEq)]
8892#[non_exhaustive]
8893pub struct InstancesListEntraIdCertificatesResponse {
8894    /// List of Entra ID certificates for the instance.
8895    pub certs: std::vec::Vec<crate::model::SslCert>,
8896
8897    /// The `sha1_fingerprint` of the active certificate from `certs`.
8898    pub active_version: std::string::String,
8899
8900    /// This is always `sql#instancesListEntraIdCertificates`.
8901    pub kind: std::string::String,
8902
8903    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8904}
8905
8906impl InstancesListEntraIdCertificatesResponse {
8907    pub fn new() -> Self {
8908        std::default::Default::default()
8909    }
8910
8911    /// Sets the value of [certs][crate::model::InstancesListEntraIdCertificatesResponse::certs].
8912    ///
8913    /// # Example
8914    /// ```ignore,no_run
8915    /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
8916    /// use google_cloud_sql_v1::model::SslCert;
8917    /// let x = InstancesListEntraIdCertificatesResponse::new()
8918    ///     .set_certs([
8919    ///         SslCert::default()/* use setters */,
8920    ///         SslCert::default()/* use (different) setters */,
8921    ///     ]);
8922    /// ```
8923    pub fn set_certs<T, V>(mut self, v: T) -> Self
8924    where
8925        T: std::iter::IntoIterator<Item = V>,
8926        V: std::convert::Into<crate::model::SslCert>,
8927    {
8928        use std::iter::Iterator;
8929        self.certs = v.into_iter().map(|i| i.into()).collect();
8930        self
8931    }
8932
8933    /// Sets the value of [active_version][crate::model::InstancesListEntraIdCertificatesResponse::active_version].
8934    ///
8935    /// # Example
8936    /// ```ignore,no_run
8937    /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
8938    /// let x = InstancesListEntraIdCertificatesResponse::new().set_active_version("example");
8939    /// ```
8940    pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8941        self.active_version = v.into();
8942        self
8943    }
8944
8945    /// Sets the value of [kind][crate::model::InstancesListEntraIdCertificatesResponse::kind].
8946    ///
8947    /// # Example
8948    /// ```ignore,no_run
8949    /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
8950    /// let x = InstancesListEntraIdCertificatesResponse::new().set_kind("example");
8951    /// ```
8952    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8953        self.kind = v.into();
8954        self
8955    }
8956}
8957
8958impl wkt::message::Message for InstancesListEntraIdCertificatesResponse {
8959    fn typename() -> &'static str {
8960        "type.googleapis.com/google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse"
8961    }
8962}
8963
8964/// Database instance restore backup request.
8965#[derive(Clone, Default, PartialEq)]
8966#[non_exhaustive]
8967pub struct InstancesRestoreBackupRequest {
8968    /// Parameters required to perform the restore backup operation.
8969    pub restore_backup_context: std::option::Option<crate::model::RestoreBackupContext>,
8970
8971    /// The name of the backup that's used to restore a Cloud SQL instance:
8972    /// Format:  projects/{project-id}/backups/{backup-uid}. Only one of
8973    /// restore_backup_context, backup, backupdr_backup can be passed to the input.
8974    pub backup: std::string::String,
8975
8976    /// The name of the backup that's used to restore a Cloud SQL instance:
8977    /// Format:
8978    /// "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
8979    /// Only one of restore_backup_context, backup, backupdr_backup can be
8980    /// passed to the input.
8981    pub backupdr_backup: std::string::String,
8982
8983    /// Optional. By using this parameter, Cloud SQL overrides any instance
8984    /// settings stored in the backup you are restoring from. You can't change the
8985    /// instance's major database version and you can only increase the disk size.
8986    /// You can use this field to restore new instances only. This field is not
8987    /// applicable for restore to existing instances.
8988    pub restore_instance_settings: std::option::Option<crate::model::DatabaseInstance>,
8989
8990    /// Optional. This field has the same purpose as restore_instance_settings,
8991    /// changes any instance settings stored in the backup you are restoring from.
8992    /// With the difference that these fields are cleared in the settings.
8993    pub restore_instance_clear_overrides_field_names: std::vec::Vec<std::string::String>,
8994
8995    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8996}
8997
8998impl InstancesRestoreBackupRequest {
8999    pub fn new() -> Self {
9000        std::default::Default::default()
9001    }
9002
9003    /// Sets the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
9004    ///
9005    /// # Example
9006    /// ```ignore,no_run
9007    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9008    /// use google_cloud_sql_v1::model::RestoreBackupContext;
9009    /// let x = InstancesRestoreBackupRequest::new().set_restore_backup_context(RestoreBackupContext::default()/* use setters */);
9010    /// ```
9011    pub fn set_restore_backup_context<T>(mut self, v: T) -> Self
9012    where
9013        T: std::convert::Into<crate::model::RestoreBackupContext>,
9014    {
9015        self.restore_backup_context = std::option::Option::Some(v.into());
9016        self
9017    }
9018
9019    /// Sets or clears the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
9020    ///
9021    /// # Example
9022    /// ```ignore,no_run
9023    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9024    /// use google_cloud_sql_v1::model::RestoreBackupContext;
9025    /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(Some(RestoreBackupContext::default()/* use setters */));
9026    /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(None::<RestoreBackupContext>);
9027    /// ```
9028    pub fn set_or_clear_restore_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
9029    where
9030        T: std::convert::Into<crate::model::RestoreBackupContext>,
9031    {
9032        self.restore_backup_context = v.map(|x| x.into());
9033        self
9034    }
9035
9036    /// Sets the value of [backup][crate::model::InstancesRestoreBackupRequest::backup].
9037    ///
9038    /// # Example
9039    /// ```ignore,no_run
9040    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9041    /// let x = InstancesRestoreBackupRequest::new().set_backup("example");
9042    /// ```
9043    pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9044        self.backup = v.into();
9045        self
9046    }
9047
9048    /// Sets the value of [backupdr_backup][crate::model::InstancesRestoreBackupRequest::backupdr_backup].
9049    ///
9050    /// # Example
9051    /// ```ignore,no_run
9052    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9053    /// let x = InstancesRestoreBackupRequest::new().set_backupdr_backup("example");
9054    /// ```
9055    pub fn set_backupdr_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9056        self.backupdr_backup = v.into();
9057        self
9058    }
9059
9060    /// Sets the value of [restore_instance_settings][crate::model::InstancesRestoreBackupRequest::restore_instance_settings].
9061    ///
9062    /// # Example
9063    /// ```ignore,no_run
9064    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9065    /// use google_cloud_sql_v1::model::DatabaseInstance;
9066    /// let x = InstancesRestoreBackupRequest::new().set_restore_instance_settings(DatabaseInstance::default()/* use setters */);
9067    /// ```
9068    pub fn set_restore_instance_settings<T>(mut self, v: T) -> Self
9069    where
9070        T: std::convert::Into<crate::model::DatabaseInstance>,
9071    {
9072        self.restore_instance_settings = std::option::Option::Some(v.into());
9073        self
9074    }
9075
9076    /// Sets or clears the value of [restore_instance_settings][crate::model::InstancesRestoreBackupRequest::restore_instance_settings].
9077    ///
9078    /// # Example
9079    /// ```ignore,no_run
9080    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9081    /// use google_cloud_sql_v1::model::DatabaseInstance;
9082    /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_instance_settings(Some(DatabaseInstance::default()/* use setters */));
9083    /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_instance_settings(None::<DatabaseInstance>);
9084    /// ```
9085    pub fn set_or_clear_restore_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
9086    where
9087        T: std::convert::Into<crate::model::DatabaseInstance>,
9088    {
9089        self.restore_instance_settings = v.map(|x| x.into());
9090        self
9091    }
9092
9093    /// Sets the value of [restore_instance_clear_overrides_field_names][crate::model::InstancesRestoreBackupRequest::restore_instance_clear_overrides_field_names].
9094    ///
9095    /// # Example
9096    /// ```ignore,no_run
9097    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9098    /// let x = InstancesRestoreBackupRequest::new().set_restore_instance_clear_overrides_field_names(["a", "b", "c"]);
9099    /// ```
9100    pub fn set_restore_instance_clear_overrides_field_names<T, V>(mut self, v: T) -> Self
9101    where
9102        T: std::iter::IntoIterator<Item = V>,
9103        V: std::convert::Into<std::string::String>,
9104    {
9105        use std::iter::Iterator;
9106        self.restore_instance_clear_overrides_field_names =
9107            v.into_iter().map(|i| i.into()).collect();
9108        self
9109    }
9110}
9111
9112impl wkt::message::Message for InstancesRestoreBackupRequest {
9113    fn typename() -> &'static str {
9114        "type.googleapis.com/google.cloud.sql.v1.InstancesRestoreBackupRequest"
9115    }
9116}
9117
9118/// Rotate server CA request.
9119#[derive(Clone, Default, PartialEq)]
9120#[non_exhaustive]
9121pub struct InstancesRotateServerCaRequest {
9122    /// Contains details about the rotate server CA operation.
9123    pub rotate_server_ca_context: std::option::Option<crate::model::RotateServerCaContext>,
9124
9125    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9126}
9127
9128impl InstancesRotateServerCaRequest {
9129    pub fn new() -> Self {
9130        std::default::Default::default()
9131    }
9132
9133    /// Sets the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
9134    ///
9135    /// # Example
9136    /// ```ignore,no_run
9137    /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
9138    /// use google_cloud_sql_v1::model::RotateServerCaContext;
9139    /// let x = InstancesRotateServerCaRequest::new().set_rotate_server_ca_context(RotateServerCaContext::default()/* use setters */);
9140    /// ```
9141    pub fn set_rotate_server_ca_context<T>(mut self, v: T) -> Self
9142    where
9143        T: std::convert::Into<crate::model::RotateServerCaContext>,
9144    {
9145        self.rotate_server_ca_context = std::option::Option::Some(v.into());
9146        self
9147    }
9148
9149    /// Sets or clears the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
9150    ///
9151    /// # Example
9152    /// ```ignore,no_run
9153    /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
9154    /// use google_cloud_sql_v1::model::RotateServerCaContext;
9155    /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(Some(RotateServerCaContext::default()/* use setters */));
9156    /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(None::<RotateServerCaContext>);
9157    /// ```
9158    pub fn set_or_clear_rotate_server_ca_context<T>(mut self, v: std::option::Option<T>) -> Self
9159    where
9160        T: std::convert::Into<crate::model::RotateServerCaContext>,
9161    {
9162        self.rotate_server_ca_context = v.map(|x| x.into());
9163        self
9164    }
9165}
9166
9167impl wkt::message::Message for InstancesRotateServerCaRequest {
9168    fn typename() -> &'static str {
9169        "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCaRequest"
9170    }
9171}
9172
9173/// Rotate server certificate request.
9174#[derive(Clone, Default, PartialEq)]
9175#[non_exhaustive]
9176pub struct InstancesRotateServerCertificateRequest {
9177    /// Optional. Contains details about the rotate server certificate operation.
9178    pub rotate_server_certificate_context:
9179        std::option::Option<crate::model::RotateServerCertificateContext>,
9180
9181    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9182}
9183
9184impl InstancesRotateServerCertificateRequest {
9185    pub fn new() -> Self {
9186        std::default::Default::default()
9187    }
9188
9189    /// Sets the value of [rotate_server_certificate_context][crate::model::InstancesRotateServerCertificateRequest::rotate_server_certificate_context].
9190    ///
9191    /// # Example
9192    /// ```ignore,no_run
9193    /// # use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
9194    /// use google_cloud_sql_v1::model::RotateServerCertificateContext;
9195    /// let x = InstancesRotateServerCertificateRequest::new().set_rotate_server_certificate_context(RotateServerCertificateContext::default()/* use setters */);
9196    /// ```
9197    pub fn set_rotate_server_certificate_context<T>(mut self, v: T) -> Self
9198    where
9199        T: std::convert::Into<crate::model::RotateServerCertificateContext>,
9200    {
9201        self.rotate_server_certificate_context = std::option::Option::Some(v.into());
9202        self
9203    }
9204
9205    /// Sets or clears the value of [rotate_server_certificate_context][crate::model::InstancesRotateServerCertificateRequest::rotate_server_certificate_context].
9206    ///
9207    /// # Example
9208    /// ```ignore,no_run
9209    /// # use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
9210    /// use google_cloud_sql_v1::model::RotateServerCertificateContext;
9211    /// let x = InstancesRotateServerCertificateRequest::new().set_or_clear_rotate_server_certificate_context(Some(RotateServerCertificateContext::default()/* use setters */));
9212    /// let x = InstancesRotateServerCertificateRequest::new().set_or_clear_rotate_server_certificate_context(None::<RotateServerCertificateContext>);
9213    /// ```
9214    pub fn set_or_clear_rotate_server_certificate_context<T>(
9215        mut self,
9216        v: std::option::Option<T>,
9217    ) -> Self
9218    where
9219        T: std::convert::Into<crate::model::RotateServerCertificateContext>,
9220    {
9221        self.rotate_server_certificate_context = v.map(|x| x.into());
9222        self
9223    }
9224}
9225
9226impl wkt::message::Message for InstancesRotateServerCertificateRequest {
9227    fn typename() -> &'static str {
9228        "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCertificateRequest"
9229    }
9230}
9231
9232/// Rotate Entra ID certificate request.
9233#[derive(Clone, Default, PartialEq)]
9234#[non_exhaustive]
9235pub struct InstancesRotateEntraIdCertificateRequest {
9236    /// Optional. Contains details about the rotate server certificate operation.
9237    pub rotate_entra_id_certificate_context:
9238        std::option::Option<crate::model::RotateEntraIdCertificateContext>,
9239
9240    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9241}
9242
9243impl InstancesRotateEntraIdCertificateRequest {
9244    pub fn new() -> Self {
9245        std::default::Default::default()
9246    }
9247
9248    /// Sets the value of [rotate_entra_id_certificate_context][crate::model::InstancesRotateEntraIdCertificateRequest::rotate_entra_id_certificate_context].
9249    ///
9250    /// # Example
9251    /// ```ignore,no_run
9252    /// # use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
9253    /// use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
9254    /// let x = InstancesRotateEntraIdCertificateRequest::new().set_rotate_entra_id_certificate_context(RotateEntraIdCertificateContext::default()/* use setters */);
9255    /// ```
9256    pub fn set_rotate_entra_id_certificate_context<T>(mut self, v: T) -> Self
9257    where
9258        T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
9259    {
9260        self.rotate_entra_id_certificate_context = std::option::Option::Some(v.into());
9261        self
9262    }
9263
9264    /// Sets or clears the value of [rotate_entra_id_certificate_context][crate::model::InstancesRotateEntraIdCertificateRequest::rotate_entra_id_certificate_context].
9265    ///
9266    /// # Example
9267    /// ```ignore,no_run
9268    /// # use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
9269    /// use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
9270    /// let x = InstancesRotateEntraIdCertificateRequest::new().set_or_clear_rotate_entra_id_certificate_context(Some(RotateEntraIdCertificateContext::default()/* use setters */));
9271    /// let x = InstancesRotateEntraIdCertificateRequest::new().set_or_clear_rotate_entra_id_certificate_context(None::<RotateEntraIdCertificateContext>);
9272    /// ```
9273    pub fn set_or_clear_rotate_entra_id_certificate_context<T>(
9274        mut self,
9275        v: std::option::Option<T>,
9276    ) -> Self
9277    where
9278        T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
9279    {
9280        self.rotate_entra_id_certificate_context = v.map(|x| x.into());
9281        self
9282    }
9283}
9284
9285impl wkt::message::Message for InstancesRotateEntraIdCertificateRequest {
9286    fn typename() -> &'static str {
9287        "type.googleapis.com/google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest"
9288    }
9289}
9290
9291/// Instance truncate log request.
9292#[derive(Clone, Default, PartialEq)]
9293#[non_exhaustive]
9294pub struct InstancesTruncateLogRequest {
9295    /// Contains details about the truncate log operation.
9296    pub truncate_log_context: std::option::Option<crate::model::TruncateLogContext>,
9297
9298    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9299}
9300
9301impl InstancesTruncateLogRequest {
9302    pub fn new() -> Self {
9303        std::default::Default::default()
9304    }
9305
9306    /// Sets the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
9307    ///
9308    /// # Example
9309    /// ```ignore,no_run
9310    /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
9311    /// use google_cloud_sql_v1::model::TruncateLogContext;
9312    /// let x = InstancesTruncateLogRequest::new().set_truncate_log_context(TruncateLogContext::default()/* use setters */);
9313    /// ```
9314    pub fn set_truncate_log_context<T>(mut self, v: T) -> Self
9315    where
9316        T: std::convert::Into<crate::model::TruncateLogContext>,
9317    {
9318        self.truncate_log_context = std::option::Option::Some(v.into());
9319        self
9320    }
9321
9322    /// Sets or clears the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
9323    ///
9324    /// # Example
9325    /// ```ignore,no_run
9326    /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
9327    /// use google_cloud_sql_v1::model::TruncateLogContext;
9328    /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(Some(TruncateLogContext::default()/* use setters */));
9329    /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(None::<TruncateLogContext>);
9330    /// ```
9331    pub fn set_or_clear_truncate_log_context<T>(mut self, v: std::option::Option<T>) -> Self
9332    where
9333        T: std::convert::Into<crate::model::TruncateLogContext>,
9334    {
9335        self.truncate_log_context = v.map(|x| x.into());
9336        self
9337    }
9338}
9339
9340impl wkt::message::Message for InstancesTruncateLogRequest {
9341    fn typename() -> &'static str {
9342        "type.googleapis.com/google.cloud.sql.v1.InstancesTruncateLogRequest"
9343    }
9344}
9345
9346/// Request to acquire a lease for SSRS.
9347#[derive(Clone, Default, PartialEq)]
9348#[non_exhaustive]
9349pub struct InstancesAcquireSsrsLeaseRequest {
9350    /// Contains details about the acquire SSRS lease operation.
9351    pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
9352
9353    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9354}
9355
9356impl InstancesAcquireSsrsLeaseRequest {
9357    pub fn new() -> Self {
9358        std::default::Default::default()
9359    }
9360
9361    /// Sets the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
9362    ///
9363    /// # Example
9364    /// ```ignore,no_run
9365    /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
9366    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
9367    /// let x = InstancesAcquireSsrsLeaseRequest::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
9368    /// ```
9369    pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
9370    where
9371        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
9372    {
9373        self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
9374        self
9375    }
9376
9377    /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
9378    ///
9379    /// # Example
9380    /// ```ignore,no_run
9381    /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
9382    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
9383    /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
9384    /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
9385    /// ```
9386    pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
9387    where
9388        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
9389    {
9390        self.acquire_ssrs_lease_context = v.map(|x| x.into());
9391        self
9392    }
9393}
9394
9395impl wkt::message::Message for InstancesAcquireSsrsLeaseRequest {
9396    fn typename() -> &'static str {
9397        "type.googleapis.com/google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest"
9398    }
9399}
9400
9401/// Request for Pre-checks for MVU
9402#[derive(Clone, Default, PartialEq)]
9403#[non_exhaustive]
9404pub struct SqlInstancesPreCheckMajorVersionUpgradeRequest {
9405    /// Required. Cloud SQL instance ID. This does not include the project ID.
9406    pub instance: std::string::String,
9407
9408    /// Required. Project ID of the project that contains the instance.
9409    pub project: std::string::String,
9410
9411    /// Required. The context for request to perform the pre-check major version
9412    /// upgrade operation.
9413    pub body: std::option::Option<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9414
9415    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9416}
9417
9418impl SqlInstancesPreCheckMajorVersionUpgradeRequest {
9419    pub fn new() -> Self {
9420        std::default::Default::default()
9421    }
9422
9423    /// Sets the value of [instance][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::instance].
9424    ///
9425    /// # Example
9426    /// ```ignore,no_run
9427    /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9428    /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_instance("example");
9429    /// ```
9430    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9431        self.instance = v.into();
9432        self
9433    }
9434
9435    /// Sets the value of [project][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::project].
9436    ///
9437    /// # Example
9438    /// ```ignore,no_run
9439    /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9440    /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_project("example");
9441    /// ```
9442    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9443        self.project = v.into();
9444        self
9445    }
9446
9447    /// Sets the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
9448    ///
9449    /// # Example
9450    /// ```ignore,no_run
9451    /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9452    /// use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
9453    /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_body(InstancesPreCheckMajorVersionUpgradeRequest::default()/* use setters */);
9454    /// ```
9455    pub fn set_body<T>(mut self, v: T) -> Self
9456    where
9457        T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9458    {
9459        self.body = std::option::Option::Some(v.into());
9460        self
9461    }
9462
9463    /// Sets or clears the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
9464    ///
9465    /// # Example
9466    /// ```ignore,no_run
9467    /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9468    /// use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
9469    /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_body(Some(InstancesPreCheckMajorVersionUpgradeRequest::default()/* use setters */));
9470    /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_body(None::<InstancesPreCheckMajorVersionUpgradeRequest>);
9471    /// ```
9472    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
9473    where
9474        T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9475    {
9476        self.body = v.map(|x| x.into());
9477        self
9478    }
9479}
9480
9481impl wkt::message::Message for SqlInstancesPreCheckMajorVersionUpgradeRequest {
9482    fn typename() -> &'static str {
9483        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest"
9484    }
9485}
9486
9487/// Instance verify external sync settings response.
9488#[derive(Clone, Default, PartialEq)]
9489#[non_exhaustive]
9490pub struct SqlInstancesVerifyExternalSyncSettingsResponse {
9491    /// This is always `sql#migrationSettingErrorList`.
9492    pub kind: std::string::String,
9493
9494    /// List of migration violations.
9495    pub errors: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
9496
9497    /// List of migration warnings.
9498    pub warnings: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
9499
9500    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9501}
9502
9503impl SqlInstancesVerifyExternalSyncSettingsResponse {
9504    pub fn new() -> Self {
9505        std::default::Default::default()
9506    }
9507
9508    /// Sets the value of [kind][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::kind].
9509    ///
9510    /// # Example
9511    /// ```ignore,no_run
9512    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9513    /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new().set_kind("example");
9514    /// ```
9515    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9516        self.kind = v.into();
9517        self
9518    }
9519
9520    /// Sets the value of [errors][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::errors].
9521    ///
9522    /// # Example
9523    /// ```ignore,no_run
9524    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9525    /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
9526    /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
9527    ///     .set_errors([
9528    ///         SqlExternalSyncSettingError::default()/* use setters */,
9529    ///         SqlExternalSyncSettingError::default()/* use (different) setters */,
9530    ///     ]);
9531    /// ```
9532    pub fn set_errors<T, V>(mut self, v: T) -> Self
9533    where
9534        T: std::iter::IntoIterator<Item = V>,
9535        V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
9536    {
9537        use std::iter::Iterator;
9538        self.errors = v.into_iter().map(|i| i.into()).collect();
9539        self
9540    }
9541
9542    /// Sets the value of [warnings][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::warnings].
9543    ///
9544    /// # Example
9545    /// ```ignore,no_run
9546    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9547    /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
9548    /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
9549    ///     .set_warnings([
9550    ///         SqlExternalSyncSettingError::default()/* use setters */,
9551    ///         SqlExternalSyncSettingError::default()/* use (different) setters */,
9552    ///     ]);
9553    /// ```
9554    pub fn set_warnings<T, V>(mut self, v: T) -> Self
9555    where
9556        T: std::iter::IntoIterator<Item = V>,
9557        V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
9558    {
9559        use std::iter::Iterator;
9560        self.warnings = v.into_iter().map(|i| i.into()).collect();
9561        self
9562    }
9563}
9564
9565impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsResponse {
9566    fn typename() -> &'static str {
9567        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse"
9568    }
9569}
9570
9571/// Instance get disk shrink config response.
9572#[derive(Clone, Default, PartialEq)]
9573#[non_exhaustive]
9574pub struct SqlInstancesGetDiskShrinkConfigResponse {
9575    /// This is always `sql#getDiskShrinkConfig`.
9576    pub kind: std::string::String,
9577
9578    /// The minimum size to which a disk can be shrunk in GigaBytes.
9579    pub minimal_target_size_gb: i64,
9580
9581    /// Additional message to customers.
9582    pub message: std::string::String,
9583
9584    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9585}
9586
9587impl SqlInstancesGetDiskShrinkConfigResponse {
9588    pub fn new() -> Self {
9589        std::default::Default::default()
9590    }
9591
9592    /// Sets the value of [kind][crate::model::SqlInstancesGetDiskShrinkConfigResponse::kind].
9593    ///
9594    /// # Example
9595    /// ```ignore,no_run
9596    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9597    /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_kind("example");
9598    /// ```
9599    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9600        self.kind = v.into();
9601        self
9602    }
9603
9604    /// Sets the value of [minimal_target_size_gb][crate::model::SqlInstancesGetDiskShrinkConfigResponse::minimal_target_size_gb].
9605    ///
9606    /// # Example
9607    /// ```ignore,no_run
9608    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9609    /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_minimal_target_size_gb(42);
9610    /// ```
9611    pub fn set_minimal_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9612        self.minimal_target_size_gb = v.into();
9613        self
9614    }
9615
9616    /// Sets the value of [message][crate::model::SqlInstancesGetDiskShrinkConfigResponse::message].
9617    ///
9618    /// # Example
9619    /// ```ignore,no_run
9620    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9621    /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_message("example");
9622    /// ```
9623    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9624        self.message = v.into();
9625        self
9626    }
9627}
9628
9629impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigResponse {
9630    fn typename() -> &'static str {
9631        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse"
9632    }
9633}
9634
9635/// Instance get latest recovery time request.
9636#[derive(Clone, Default, PartialEq)]
9637#[non_exhaustive]
9638pub struct SqlInstancesGetLatestRecoveryTimeRequest {
9639    /// Cloud SQL instance ID. This does not include the project ID.
9640    pub instance: std::string::String,
9641
9642    /// Project ID of the project that contains the instance.
9643    pub project: std::string::String,
9644
9645    /// The timestamp used to identify the time when the source instance is
9646    /// deleted. If this instance is deleted, then you must set the timestamp.
9647    pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
9648
9649    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9650}
9651
9652impl SqlInstancesGetLatestRecoveryTimeRequest {
9653    pub fn new() -> Self {
9654        std::default::Default::default()
9655    }
9656
9657    /// Sets the value of [instance][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::instance].
9658    ///
9659    /// # Example
9660    /// ```ignore,no_run
9661    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9662    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_instance("example");
9663    /// ```
9664    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9665        self.instance = v.into();
9666        self
9667    }
9668
9669    /// Sets the value of [project][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::project].
9670    ///
9671    /// # Example
9672    /// ```ignore,no_run
9673    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9674    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_project("example");
9675    /// ```
9676    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9677        self.project = v.into();
9678        self
9679    }
9680
9681    /// Sets the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
9682    ///
9683    /// # Example
9684    /// ```ignore,no_run
9685    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9686    /// use wkt::Timestamp;
9687    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_source_instance_deletion_time(Timestamp::default()/* use setters */);
9688    /// ```
9689    pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
9690    where
9691        T: std::convert::Into<wkt::Timestamp>,
9692    {
9693        self.source_instance_deletion_time = std::option::Option::Some(v.into());
9694        self
9695    }
9696
9697    /// Sets or clears the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
9698    ///
9699    /// # Example
9700    /// ```ignore,no_run
9701    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9702    /// use wkt::Timestamp;
9703    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_or_clear_source_instance_deletion_time(Some(Timestamp::default()/* use setters */));
9704    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_or_clear_source_instance_deletion_time(None::<Timestamp>);
9705    /// ```
9706    pub fn set_or_clear_source_instance_deletion_time<T>(
9707        mut self,
9708        v: std::option::Option<T>,
9709    ) -> Self
9710    where
9711        T: std::convert::Into<wkt::Timestamp>,
9712    {
9713        self.source_instance_deletion_time = v.map(|x| x.into());
9714        self
9715    }
9716}
9717
9718impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeRequest {
9719    fn typename() -> &'static str {
9720        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest"
9721    }
9722}
9723
9724/// Instance get latest recovery time response.
9725#[derive(Clone, Default, PartialEq)]
9726#[non_exhaustive]
9727pub struct SqlInstancesGetLatestRecoveryTimeResponse {
9728    /// This is always `sql#getLatestRecoveryTime`.
9729    pub kind: std::string::String,
9730
9731    /// Timestamp, identifies the latest recovery time of the source instance.
9732    pub latest_recovery_time: std::option::Option<wkt::Timestamp>,
9733
9734    /// Timestamp, identifies the earliest recovery time of the source instance.
9735    pub earliest_recovery_time: std::option::Option<wkt::Timestamp>,
9736
9737    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9738}
9739
9740impl SqlInstancesGetLatestRecoveryTimeResponse {
9741    pub fn new() -> Self {
9742        std::default::Default::default()
9743    }
9744
9745    /// Sets the value of [kind][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::kind].
9746    ///
9747    /// # Example
9748    /// ```ignore,no_run
9749    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9750    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_kind("example");
9751    /// ```
9752    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9753        self.kind = v.into();
9754        self
9755    }
9756
9757    /// Sets the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
9758    ///
9759    /// # Example
9760    /// ```ignore,no_run
9761    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9762    /// use wkt::Timestamp;
9763    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_latest_recovery_time(Timestamp::default()/* use setters */);
9764    /// ```
9765    pub fn set_latest_recovery_time<T>(mut self, v: T) -> Self
9766    where
9767        T: std::convert::Into<wkt::Timestamp>,
9768    {
9769        self.latest_recovery_time = std::option::Option::Some(v.into());
9770        self
9771    }
9772
9773    /// Sets or clears the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
9774    ///
9775    /// # Example
9776    /// ```ignore,no_run
9777    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9778    /// use wkt::Timestamp;
9779    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(Some(Timestamp::default()/* use setters */));
9780    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(None::<Timestamp>);
9781    /// ```
9782    pub fn set_or_clear_latest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
9783    where
9784        T: std::convert::Into<wkt::Timestamp>,
9785    {
9786        self.latest_recovery_time = v.map(|x| x.into());
9787        self
9788    }
9789
9790    /// Sets the value of [earliest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::earliest_recovery_time].
9791    ///
9792    /// # Example
9793    /// ```ignore,no_run
9794    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9795    /// use wkt::Timestamp;
9796    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_earliest_recovery_time(Timestamp::default()/* use setters */);
9797    /// ```
9798    pub fn set_earliest_recovery_time<T>(mut self, v: T) -> Self
9799    where
9800        T: std::convert::Into<wkt::Timestamp>,
9801    {
9802        self.earliest_recovery_time = std::option::Option::Some(v.into());
9803        self
9804    }
9805
9806    /// Sets or clears the value of [earliest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::earliest_recovery_time].
9807    ///
9808    /// # Example
9809    /// ```ignore,no_run
9810    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9811    /// use wkt::Timestamp;
9812    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_earliest_recovery_time(Some(Timestamp::default()/* use setters */));
9813    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_earliest_recovery_time(None::<Timestamp>);
9814    /// ```
9815    pub fn set_or_clear_earliest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
9816    where
9817        T: std::convert::Into<wkt::Timestamp>,
9818    {
9819        self.earliest_recovery_time = v.map(|x| x.into());
9820        self
9821    }
9822}
9823
9824impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeResponse {
9825    fn typename() -> &'static str {
9826        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse"
9827    }
9828}
9829
9830/// Database instance clone context.
9831#[derive(Clone, Default, PartialEq)]
9832#[non_exhaustive]
9833pub struct CloneContext {
9834    /// This is always `sql#cloneContext`.
9835    pub kind: std::string::String,
9836
9837    /// Reserved for future use.
9838    pub pitr_timestamp_ms: i64,
9839
9840    /// Required. Name of the Cloud SQL instance to be created as a clone.
9841    pub destination_instance_name: std::string::String,
9842
9843    /// Binary log coordinates, if specified, identify the position up to which the
9844    /// source instance is cloned. If not specified, the source instance is
9845    /// cloned up to the most recent binary log coordinates.
9846    pub bin_log_coordinates: std::option::Option<crate::model::BinLogCoordinates>,
9847
9848    /// Timestamp, if specified, identifies the time to which the source instance
9849    /// is cloned.
9850    pub point_in_time: std::option::Option<wkt::Timestamp>,
9851
9852    /// The name of the allocated ip range for the private ip Cloud SQL instance.
9853    /// For example: "google-managed-services-default". If set, the cloned instance
9854    /// ip will be created in the allocated range. The range name must comply with
9855    /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
9856    /// must be 1-63 characters long and match the regular expression
9857    /// [a-z]([-a-z0-9]*[a-z0-9])?.
9858    /// Reserved for future use.
9859    pub allocated_ip_range: std::string::String,
9860
9861    /// (SQL Server only) Clone only the specified databases from the source
9862    /// instance. Clone all databases if empty.
9863    pub database_names: std::vec::Vec<std::string::String>,
9864
9865    /// Optional. Copy clone and point-in-time recovery clone of an instance to the
9866    /// specified zone. If no zone is specified, clone to the same primary zone as
9867    /// the source instance. This field applies to all DB types.
9868    pub preferred_zone: std::option::Option<std::string::String>,
9869
9870    /// Optional. Copy clone and point-in-time recovery clone of a regional
9871    /// instance in the specified zones. If not specified, clone to the same
9872    /// secondary zone as the source instance. This value cannot be the same as the
9873    /// preferred_zone field. This field applies to all DB types.
9874    pub preferred_secondary_zone: std::option::Option<std::string::String>,
9875
9876    /// The timestamp used to identify the time when the source instance is
9877    /// deleted. If this instance is deleted, then you must set the timestamp.
9878    pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
9879
9880    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9881}
9882
9883impl CloneContext {
9884    pub fn new() -> Self {
9885        std::default::Default::default()
9886    }
9887
9888    /// Sets the value of [kind][crate::model::CloneContext::kind].
9889    ///
9890    /// # Example
9891    /// ```ignore,no_run
9892    /// # use google_cloud_sql_v1::model::CloneContext;
9893    /// let x = CloneContext::new().set_kind("example");
9894    /// ```
9895    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9896        self.kind = v.into();
9897        self
9898    }
9899
9900    /// Sets the value of [pitr_timestamp_ms][crate::model::CloneContext::pitr_timestamp_ms].
9901    ///
9902    /// # Example
9903    /// ```ignore,no_run
9904    /// # use google_cloud_sql_v1::model::CloneContext;
9905    /// let x = CloneContext::new().set_pitr_timestamp_ms(42);
9906    /// ```
9907    pub fn set_pitr_timestamp_ms<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9908        self.pitr_timestamp_ms = v.into();
9909        self
9910    }
9911
9912    /// Sets the value of [destination_instance_name][crate::model::CloneContext::destination_instance_name].
9913    ///
9914    /// # Example
9915    /// ```ignore,no_run
9916    /// # use google_cloud_sql_v1::model::CloneContext;
9917    /// let x = CloneContext::new().set_destination_instance_name("example");
9918    /// ```
9919    pub fn set_destination_instance_name<T: std::convert::Into<std::string::String>>(
9920        mut self,
9921        v: T,
9922    ) -> Self {
9923        self.destination_instance_name = v.into();
9924        self
9925    }
9926
9927    /// Sets the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
9928    ///
9929    /// # Example
9930    /// ```ignore,no_run
9931    /// # use google_cloud_sql_v1::model::CloneContext;
9932    /// use google_cloud_sql_v1::model::BinLogCoordinates;
9933    /// let x = CloneContext::new().set_bin_log_coordinates(BinLogCoordinates::default()/* use setters */);
9934    /// ```
9935    pub fn set_bin_log_coordinates<T>(mut self, v: T) -> Self
9936    where
9937        T: std::convert::Into<crate::model::BinLogCoordinates>,
9938    {
9939        self.bin_log_coordinates = std::option::Option::Some(v.into());
9940        self
9941    }
9942
9943    /// Sets or clears the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
9944    ///
9945    /// # Example
9946    /// ```ignore,no_run
9947    /// # use google_cloud_sql_v1::model::CloneContext;
9948    /// use google_cloud_sql_v1::model::BinLogCoordinates;
9949    /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(Some(BinLogCoordinates::default()/* use setters */));
9950    /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(None::<BinLogCoordinates>);
9951    /// ```
9952    pub fn set_or_clear_bin_log_coordinates<T>(mut self, v: std::option::Option<T>) -> Self
9953    where
9954        T: std::convert::Into<crate::model::BinLogCoordinates>,
9955    {
9956        self.bin_log_coordinates = v.map(|x| x.into());
9957        self
9958    }
9959
9960    /// Sets the value of [point_in_time][crate::model::CloneContext::point_in_time].
9961    ///
9962    /// # Example
9963    /// ```ignore,no_run
9964    /// # use google_cloud_sql_v1::model::CloneContext;
9965    /// use wkt::Timestamp;
9966    /// let x = CloneContext::new().set_point_in_time(Timestamp::default()/* use setters */);
9967    /// ```
9968    pub fn set_point_in_time<T>(mut self, v: T) -> Self
9969    where
9970        T: std::convert::Into<wkt::Timestamp>,
9971    {
9972        self.point_in_time = std::option::Option::Some(v.into());
9973        self
9974    }
9975
9976    /// Sets or clears the value of [point_in_time][crate::model::CloneContext::point_in_time].
9977    ///
9978    /// # Example
9979    /// ```ignore,no_run
9980    /// # use google_cloud_sql_v1::model::CloneContext;
9981    /// use wkt::Timestamp;
9982    /// let x = CloneContext::new().set_or_clear_point_in_time(Some(Timestamp::default()/* use setters */));
9983    /// let x = CloneContext::new().set_or_clear_point_in_time(None::<Timestamp>);
9984    /// ```
9985    pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
9986    where
9987        T: std::convert::Into<wkt::Timestamp>,
9988    {
9989        self.point_in_time = v.map(|x| x.into());
9990        self
9991    }
9992
9993    /// Sets the value of [allocated_ip_range][crate::model::CloneContext::allocated_ip_range].
9994    ///
9995    /// # Example
9996    /// ```ignore,no_run
9997    /// # use google_cloud_sql_v1::model::CloneContext;
9998    /// let x = CloneContext::new().set_allocated_ip_range("example");
9999    /// ```
10000    pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
10001        mut self,
10002        v: T,
10003    ) -> Self {
10004        self.allocated_ip_range = v.into();
10005        self
10006    }
10007
10008    /// Sets the value of [database_names][crate::model::CloneContext::database_names].
10009    ///
10010    /// # Example
10011    /// ```ignore,no_run
10012    /// # use google_cloud_sql_v1::model::CloneContext;
10013    /// let x = CloneContext::new().set_database_names(["a", "b", "c"]);
10014    /// ```
10015    pub fn set_database_names<T, V>(mut self, v: T) -> Self
10016    where
10017        T: std::iter::IntoIterator<Item = V>,
10018        V: std::convert::Into<std::string::String>,
10019    {
10020        use std::iter::Iterator;
10021        self.database_names = v.into_iter().map(|i| i.into()).collect();
10022        self
10023    }
10024
10025    /// Sets the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
10026    ///
10027    /// # Example
10028    /// ```ignore,no_run
10029    /// # use google_cloud_sql_v1::model::CloneContext;
10030    /// let x = CloneContext::new().set_preferred_zone("example");
10031    /// ```
10032    pub fn set_preferred_zone<T>(mut self, v: T) -> Self
10033    where
10034        T: std::convert::Into<std::string::String>,
10035    {
10036        self.preferred_zone = std::option::Option::Some(v.into());
10037        self
10038    }
10039
10040    /// Sets or clears the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
10041    ///
10042    /// # Example
10043    /// ```ignore,no_run
10044    /// # use google_cloud_sql_v1::model::CloneContext;
10045    /// let x = CloneContext::new().set_or_clear_preferred_zone(Some("example"));
10046    /// let x = CloneContext::new().set_or_clear_preferred_zone(None::<String>);
10047    /// ```
10048    pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
10049    where
10050        T: std::convert::Into<std::string::String>,
10051    {
10052        self.preferred_zone = v.map(|x| x.into());
10053        self
10054    }
10055
10056    /// Sets the value of [preferred_secondary_zone][crate::model::CloneContext::preferred_secondary_zone].
10057    ///
10058    /// # Example
10059    /// ```ignore,no_run
10060    /// # use google_cloud_sql_v1::model::CloneContext;
10061    /// let x = CloneContext::new().set_preferred_secondary_zone("example");
10062    /// ```
10063    pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
10064    where
10065        T: std::convert::Into<std::string::String>,
10066    {
10067        self.preferred_secondary_zone = std::option::Option::Some(v.into());
10068        self
10069    }
10070
10071    /// Sets or clears the value of [preferred_secondary_zone][crate::model::CloneContext::preferred_secondary_zone].
10072    ///
10073    /// # Example
10074    /// ```ignore,no_run
10075    /// # use google_cloud_sql_v1::model::CloneContext;
10076    /// let x = CloneContext::new().set_or_clear_preferred_secondary_zone(Some("example"));
10077    /// let x = CloneContext::new().set_or_clear_preferred_secondary_zone(None::<String>);
10078    /// ```
10079    pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
10080    where
10081        T: std::convert::Into<std::string::String>,
10082    {
10083        self.preferred_secondary_zone = v.map(|x| x.into());
10084        self
10085    }
10086
10087    /// Sets the value of [source_instance_deletion_time][crate::model::CloneContext::source_instance_deletion_time].
10088    ///
10089    /// # Example
10090    /// ```ignore,no_run
10091    /// # use google_cloud_sql_v1::model::CloneContext;
10092    /// use wkt::Timestamp;
10093    /// let x = CloneContext::new().set_source_instance_deletion_time(Timestamp::default()/* use setters */);
10094    /// ```
10095    pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
10096    where
10097        T: std::convert::Into<wkt::Timestamp>,
10098    {
10099        self.source_instance_deletion_time = std::option::Option::Some(v.into());
10100        self
10101    }
10102
10103    /// Sets or clears the value of [source_instance_deletion_time][crate::model::CloneContext::source_instance_deletion_time].
10104    ///
10105    /// # Example
10106    /// ```ignore,no_run
10107    /// # use google_cloud_sql_v1::model::CloneContext;
10108    /// use wkt::Timestamp;
10109    /// let x = CloneContext::new().set_or_clear_source_instance_deletion_time(Some(Timestamp::default()/* use setters */));
10110    /// let x = CloneContext::new().set_or_clear_source_instance_deletion_time(None::<Timestamp>);
10111    /// ```
10112    pub fn set_or_clear_source_instance_deletion_time<T>(
10113        mut self,
10114        v: std::option::Option<T>,
10115    ) -> Self
10116    where
10117        T: std::convert::Into<wkt::Timestamp>,
10118    {
10119        self.source_instance_deletion_time = v.map(|x| x.into());
10120        self
10121    }
10122}
10123
10124impl wkt::message::Message for CloneContext {
10125    fn typename() -> &'static str {
10126        "type.googleapis.com/google.cloud.sql.v1.CloneContext"
10127    }
10128}
10129
10130/// The context to perform a point-in-time recovery of an instance managed by
10131/// Backup and Disaster Recovery (DR) Service.
10132#[derive(Clone, Default, PartialEq)]
10133#[non_exhaustive]
10134pub struct PointInTimeRestoreContext {
10135    /// The Backup and Disaster Recovery (DR) Service Datasource URI.
10136    /// Format:
10137    /// projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
10138    pub datasource: std::option::Option<std::string::String>,
10139
10140    /// Required. The date and time to which you want to restore the instance.
10141    pub point_in_time: std::option::Option<wkt::Timestamp>,
10142
10143    /// Target instance name.
10144    pub target_instance: std::option::Option<std::string::String>,
10145
10146    /// Optional. The resource link for the VPC network from which the Cloud SQL
10147    /// instance is accessible for private IP. For example,
10148    /// `/projects/myProject/global/networks/default`.
10149    pub private_network: std::option::Option<std::string::String>,
10150
10151    /// Optional. The name of the allocated IP range for the internal IP Cloud SQL
10152    /// instance. For example: "google-managed-services-default". If you set this,
10153    /// then Cloud SQL creates the IP address for the cloned instance in the
10154    /// allocated range. This range must comply with [RFC
10155    /// 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
10156    /// name must be 1-63 characters long and match the regular expression
10157    /// [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
10158    pub allocated_ip_range: std::option::Option<std::string::String>,
10159
10160    /// Optional. Point-in-time recovery of an instance to the specified zone. If
10161    /// no zone is specified, then clone to the same primary zone as the source
10162    /// instance.
10163    pub preferred_zone: std::option::Option<std::string::String>,
10164
10165    /// Optional. Point-in-time recovery of a regional instance in the specified
10166    /// zones. If not specified, clone to the same secondary zone as the source
10167    /// instance. This value cannot be the same as the preferred_zone field.
10168    pub preferred_secondary_zone: std::option::Option<std::string::String>,
10169
10170    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10171}
10172
10173impl PointInTimeRestoreContext {
10174    pub fn new() -> Self {
10175        std::default::Default::default()
10176    }
10177
10178    /// Sets the value of [datasource][crate::model::PointInTimeRestoreContext::datasource].
10179    ///
10180    /// # Example
10181    /// ```ignore,no_run
10182    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10183    /// let x = PointInTimeRestoreContext::new().set_datasource("example");
10184    /// ```
10185    pub fn set_datasource<T>(mut self, v: T) -> Self
10186    where
10187        T: std::convert::Into<std::string::String>,
10188    {
10189        self.datasource = std::option::Option::Some(v.into());
10190        self
10191    }
10192
10193    /// Sets or clears the value of [datasource][crate::model::PointInTimeRestoreContext::datasource].
10194    ///
10195    /// # Example
10196    /// ```ignore,no_run
10197    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10198    /// let x = PointInTimeRestoreContext::new().set_or_clear_datasource(Some("example"));
10199    /// let x = PointInTimeRestoreContext::new().set_or_clear_datasource(None::<String>);
10200    /// ```
10201    pub fn set_or_clear_datasource<T>(mut self, v: std::option::Option<T>) -> Self
10202    where
10203        T: std::convert::Into<std::string::String>,
10204    {
10205        self.datasource = v.map(|x| x.into());
10206        self
10207    }
10208
10209    /// Sets the value of [point_in_time][crate::model::PointInTimeRestoreContext::point_in_time].
10210    ///
10211    /// # Example
10212    /// ```ignore,no_run
10213    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10214    /// use wkt::Timestamp;
10215    /// let x = PointInTimeRestoreContext::new().set_point_in_time(Timestamp::default()/* use setters */);
10216    /// ```
10217    pub fn set_point_in_time<T>(mut self, v: T) -> Self
10218    where
10219        T: std::convert::Into<wkt::Timestamp>,
10220    {
10221        self.point_in_time = std::option::Option::Some(v.into());
10222        self
10223    }
10224
10225    /// Sets or clears the value of [point_in_time][crate::model::PointInTimeRestoreContext::point_in_time].
10226    ///
10227    /// # Example
10228    /// ```ignore,no_run
10229    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10230    /// use wkt::Timestamp;
10231    /// let x = PointInTimeRestoreContext::new().set_or_clear_point_in_time(Some(Timestamp::default()/* use setters */));
10232    /// let x = PointInTimeRestoreContext::new().set_or_clear_point_in_time(None::<Timestamp>);
10233    /// ```
10234    pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
10235    where
10236        T: std::convert::Into<wkt::Timestamp>,
10237    {
10238        self.point_in_time = v.map(|x| x.into());
10239        self
10240    }
10241
10242    /// Sets the value of [target_instance][crate::model::PointInTimeRestoreContext::target_instance].
10243    ///
10244    /// # Example
10245    /// ```ignore,no_run
10246    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10247    /// let x = PointInTimeRestoreContext::new().set_target_instance("example");
10248    /// ```
10249    pub fn set_target_instance<T>(mut self, v: T) -> Self
10250    where
10251        T: std::convert::Into<std::string::String>,
10252    {
10253        self.target_instance = std::option::Option::Some(v.into());
10254        self
10255    }
10256
10257    /// Sets or clears the value of [target_instance][crate::model::PointInTimeRestoreContext::target_instance].
10258    ///
10259    /// # Example
10260    /// ```ignore,no_run
10261    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10262    /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance(Some("example"));
10263    /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance(None::<String>);
10264    /// ```
10265    pub fn set_or_clear_target_instance<T>(mut self, v: std::option::Option<T>) -> Self
10266    where
10267        T: std::convert::Into<std::string::String>,
10268    {
10269        self.target_instance = v.map(|x| x.into());
10270        self
10271    }
10272
10273    /// Sets the value of [private_network][crate::model::PointInTimeRestoreContext::private_network].
10274    ///
10275    /// # Example
10276    /// ```ignore,no_run
10277    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10278    /// let x = PointInTimeRestoreContext::new().set_private_network("example");
10279    /// ```
10280    pub fn set_private_network<T>(mut self, v: T) -> Self
10281    where
10282        T: std::convert::Into<std::string::String>,
10283    {
10284        self.private_network = std::option::Option::Some(v.into());
10285        self
10286    }
10287
10288    /// Sets or clears the value of [private_network][crate::model::PointInTimeRestoreContext::private_network].
10289    ///
10290    /// # Example
10291    /// ```ignore,no_run
10292    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10293    /// let x = PointInTimeRestoreContext::new().set_or_clear_private_network(Some("example"));
10294    /// let x = PointInTimeRestoreContext::new().set_or_clear_private_network(None::<String>);
10295    /// ```
10296    pub fn set_or_clear_private_network<T>(mut self, v: std::option::Option<T>) -> Self
10297    where
10298        T: std::convert::Into<std::string::String>,
10299    {
10300        self.private_network = v.map(|x| x.into());
10301        self
10302    }
10303
10304    /// Sets the value of [allocated_ip_range][crate::model::PointInTimeRestoreContext::allocated_ip_range].
10305    ///
10306    /// # Example
10307    /// ```ignore,no_run
10308    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10309    /// let x = PointInTimeRestoreContext::new().set_allocated_ip_range("example");
10310    /// ```
10311    pub fn set_allocated_ip_range<T>(mut self, v: T) -> Self
10312    where
10313        T: std::convert::Into<std::string::String>,
10314    {
10315        self.allocated_ip_range = std::option::Option::Some(v.into());
10316        self
10317    }
10318
10319    /// Sets or clears the value of [allocated_ip_range][crate::model::PointInTimeRestoreContext::allocated_ip_range].
10320    ///
10321    /// # Example
10322    /// ```ignore,no_run
10323    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10324    /// let x = PointInTimeRestoreContext::new().set_or_clear_allocated_ip_range(Some("example"));
10325    /// let x = PointInTimeRestoreContext::new().set_or_clear_allocated_ip_range(None::<String>);
10326    /// ```
10327    pub fn set_or_clear_allocated_ip_range<T>(mut self, v: std::option::Option<T>) -> Self
10328    where
10329        T: std::convert::Into<std::string::String>,
10330    {
10331        self.allocated_ip_range = v.map(|x| x.into());
10332        self
10333    }
10334
10335    /// Sets the value of [preferred_zone][crate::model::PointInTimeRestoreContext::preferred_zone].
10336    ///
10337    /// # Example
10338    /// ```ignore,no_run
10339    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10340    /// let x = PointInTimeRestoreContext::new().set_preferred_zone("example");
10341    /// ```
10342    pub fn set_preferred_zone<T>(mut self, v: T) -> Self
10343    where
10344        T: std::convert::Into<std::string::String>,
10345    {
10346        self.preferred_zone = std::option::Option::Some(v.into());
10347        self
10348    }
10349
10350    /// Sets or clears the value of [preferred_zone][crate::model::PointInTimeRestoreContext::preferred_zone].
10351    ///
10352    /// # Example
10353    /// ```ignore,no_run
10354    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10355    /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_zone(Some("example"));
10356    /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_zone(None::<String>);
10357    /// ```
10358    pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
10359    where
10360        T: std::convert::Into<std::string::String>,
10361    {
10362        self.preferred_zone = v.map(|x| x.into());
10363        self
10364    }
10365
10366    /// Sets the value of [preferred_secondary_zone][crate::model::PointInTimeRestoreContext::preferred_secondary_zone].
10367    ///
10368    /// # Example
10369    /// ```ignore,no_run
10370    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10371    /// let x = PointInTimeRestoreContext::new().set_preferred_secondary_zone("example");
10372    /// ```
10373    pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
10374    where
10375        T: std::convert::Into<std::string::String>,
10376    {
10377        self.preferred_secondary_zone = std::option::Option::Some(v.into());
10378        self
10379    }
10380
10381    /// Sets or clears the value of [preferred_secondary_zone][crate::model::PointInTimeRestoreContext::preferred_secondary_zone].
10382    ///
10383    /// # Example
10384    /// ```ignore,no_run
10385    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10386    /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_secondary_zone(Some("example"));
10387    /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_secondary_zone(None::<String>);
10388    /// ```
10389    pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
10390    where
10391        T: std::convert::Into<std::string::String>,
10392    {
10393        self.preferred_secondary_zone = v.map(|x| x.into());
10394        self
10395    }
10396}
10397
10398impl wkt::message::Message for PointInTimeRestoreContext {
10399    fn typename() -> &'static str {
10400        "type.googleapis.com/google.cloud.sql.v1.PointInTimeRestoreContext"
10401    }
10402}
10403
10404/// Binary log coordinates.
10405#[derive(Clone, Default, PartialEq)]
10406#[non_exhaustive]
10407pub struct BinLogCoordinates {
10408    /// Name of the binary log file for a Cloud SQL instance.
10409    pub bin_log_file_name: std::string::String,
10410
10411    /// Position (offset) within the binary log file.
10412    pub bin_log_position: i64,
10413
10414    /// This is always `sql#binLogCoordinates`.
10415    pub kind: std::string::String,
10416
10417    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10418}
10419
10420impl BinLogCoordinates {
10421    pub fn new() -> Self {
10422        std::default::Default::default()
10423    }
10424
10425    /// Sets the value of [bin_log_file_name][crate::model::BinLogCoordinates::bin_log_file_name].
10426    ///
10427    /// # Example
10428    /// ```ignore,no_run
10429    /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10430    /// let x = BinLogCoordinates::new().set_bin_log_file_name("example");
10431    /// ```
10432    pub fn set_bin_log_file_name<T: std::convert::Into<std::string::String>>(
10433        mut self,
10434        v: T,
10435    ) -> Self {
10436        self.bin_log_file_name = v.into();
10437        self
10438    }
10439
10440    /// Sets the value of [bin_log_position][crate::model::BinLogCoordinates::bin_log_position].
10441    ///
10442    /// # Example
10443    /// ```ignore,no_run
10444    /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10445    /// let x = BinLogCoordinates::new().set_bin_log_position(42);
10446    /// ```
10447    pub fn set_bin_log_position<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10448        self.bin_log_position = v.into();
10449        self
10450    }
10451
10452    /// Sets the value of [kind][crate::model::BinLogCoordinates::kind].
10453    ///
10454    /// # Example
10455    /// ```ignore,no_run
10456    /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10457    /// let x = BinLogCoordinates::new().set_kind("example");
10458    /// ```
10459    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10460        self.kind = v.into();
10461        self
10462    }
10463}
10464
10465impl wkt::message::Message for BinLogCoordinates {
10466    fn typename() -> &'static str {
10467        "type.googleapis.com/google.cloud.sql.v1.BinLogCoordinates"
10468    }
10469}
10470
10471/// A Cloud SQL instance resource.
10472#[derive(Clone, Default, PartialEq)]
10473#[non_exhaustive]
10474pub struct DatabaseInstance {
10475    /// This is always `sql#instance`.
10476    pub kind: std::string::String,
10477
10478    /// The current serving state of the Cloud SQL instance.
10479    pub state: crate::model::database_instance::SqlInstanceState,
10480
10481    /// The database engine type and version. The `databaseVersion` field cannot
10482    /// be changed after instance creation.
10483    pub database_version: crate::model::SqlDatabaseVersion,
10484
10485    /// The user settings.
10486    pub settings: std::option::Option<crate::model::Settings>,
10487
10488    /// This field is deprecated and will be removed from a future version of the
10489    /// API. Use the `settings.settingsVersion` field instead.
10490    pub etag: std::string::String,
10491
10492    /// The name and status of the failover replica.
10493    pub failover_replica: std::option::Option<crate::model::database_instance::SqlFailoverReplica>,
10494
10495    /// The name of the instance which will act as primary in the replication
10496    /// setup.
10497    pub master_instance_name: std::string::String,
10498
10499    /// The replicas of the instance.
10500    pub replica_names: std::vec::Vec<std::string::String>,
10501
10502    /// The maximum disk size of the instance in bytes.
10503    #[deprecated]
10504    pub max_disk_size: std::option::Option<wkt::Int64Value>,
10505
10506    /// The current disk usage of the instance in bytes. This property has been
10507    /// deprecated. Use the
10508    /// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
10509    /// Monitoring API instead. Please see [this
10510    /// announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
10511    /// for details.
10512    #[deprecated]
10513    pub current_disk_size: std::option::Option<wkt::Int64Value>,
10514
10515    /// The assigned IP addresses for the instance.
10516    pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
10517
10518    /// SSL configuration.
10519    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
10520
10521    /// The instance type.
10522    pub instance_type: crate::model::SqlInstanceType,
10523
10524    /// The project ID of the project containing the Cloud SQL instance. The Google
10525    /// apps domain is prefixed if applicable.
10526    pub project: std::string::String,
10527
10528    /// The IPv6 address assigned to the instance.
10529    /// (Deprecated) This property was applicable only
10530    /// to First Generation instances.
10531    #[deprecated]
10532    pub ipv6_address: std::string::String,
10533
10534    /// The service account email address assigned to the instance.\This
10535    /// property is read-only.
10536    pub service_account_email_address: std::string::String,
10537
10538    /// Configuration specific to on-premises instances.
10539    pub on_premises_configuration: std::option::Option<crate::model::OnPremisesConfiguration>,
10540
10541    /// Configuration specific to failover replicas and read replicas.
10542    pub replica_configuration: std::option::Option<crate::model::ReplicaConfiguration>,
10543
10544    /// The backend type.
10545    /// `SECOND_GEN`: Cloud SQL database instance.
10546    /// `EXTERNAL`: A database server that is not managed by Google.
10547    ///
10548    /// This property is read-only; use the `tier` property in the `settings`
10549    /// object to determine the database type.
10550    pub backend_type: crate::model::SqlBackendType,
10551
10552    /// The URI of this resource.
10553    pub self_link: std::string::String,
10554
10555    /// If the instance state is SUSPENDED, the reason for the suspension.
10556    pub suspension_reason: std::vec::Vec<crate::model::SqlSuspensionReason>,
10557
10558    /// Connection name of the Cloud SQL instance used in connection strings.
10559    pub connection_name: std::string::String,
10560
10561    /// Name of the Cloud SQL instance. This does not include the project ID.
10562    pub name: std::string::String,
10563
10564    /// The geographical region of the Cloud SQL instance.
10565    ///
10566    /// It can be one of the
10567    /// [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
10568    /// where Cloud SQL operates:
10569    ///
10570    /// For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
10571    /// The default value is `us-central1`.
10572    pub region: std::string::String,
10573
10574    /// The Compute Engine zone that the instance is currently serving from. This
10575    /// value could be different from the zone that was specified when the instance
10576    /// was created if the instance has failed over to its secondary zone. WARNING:
10577    /// Changing this might restart the instance.
10578    pub gce_zone: std::string::String,
10579
10580    /// The Compute Engine zone that the failover instance is currently serving
10581    /// from for a regional instance. This value could be different
10582    /// from the zone that was specified when the instance
10583    /// was created if the instance has failed over to its secondary/failover zone.
10584    pub secondary_gce_zone: std::string::String,
10585
10586    /// Disk encryption configuration specific to an instance.
10587    pub disk_encryption_configuration:
10588        std::option::Option<crate::model::DiskEncryptionConfiguration>,
10589
10590    /// Disk encryption status specific to an instance.
10591    pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
10592
10593    /// Initial root password. Use only on creation. You must set root passwords
10594    /// before you can connect to PostgreSQL instances.
10595    pub root_password: std::string::String,
10596
10597    /// The start time of any upcoming scheduled maintenance for this instance.
10598    pub scheduled_maintenance:
10599        std::option::Option<crate::model::database_instance::SqlScheduledMaintenance>,
10600
10601    /// This status indicates whether the instance satisfies PZS.
10602    ///
10603    /// The status is reserved for future use.
10604    pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
10605
10606    /// Output only. Stores the current database version running on the instance
10607    /// including minor version such as `MYSQL_8_0_18`.
10608    pub database_installed_version: std::string::String,
10609
10610    /// This field represents the report generated by the proactive database
10611    /// wellness job for OutOfDisk issues.
10612    ///
10613    /// * Writers:
10614    /// * the proactive database wellness job for OOD.
10615    /// * Readers:
10616    /// * the proactive database wellness job
10617    pub out_of_disk_report:
10618        std::option::Option<crate::model::database_instance::SqlOutOfDiskReport>,
10619
10620    /// Output only. The time when the instance was created in
10621    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
10622    /// `2012-11-15T16:19:00.094Z`.
10623    pub create_time: std::option::Option<wkt::Timestamp>,
10624
10625    /// Output only. List all maintenance versions applicable on the instance
10626    pub available_maintenance_versions: std::vec::Vec<std::string::String>,
10627
10628    /// The current software version on the instance.
10629    pub maintenance_version: std::string::String,
10630
10631    /// Output only. All database versions that are available for upgrade.
10632    pub upgradable_database_versions: std::vec::Vec<crate::model::AvailableDatabaseVersion>,
10633
10634    pub sql_network_architecture:
10635        std::option::Option<crate::model::database_instance::SqlNetworkArchitecture>,
10636
10637    /// Output only. The link to service attachment of PSC instance.
10638    pub psc_service_attachment_link: std::option::Option<std::string::String>,
10639
10640    /// Output only. The dns name of the instance.
10641    pub dns_name: std::option::Option<std::string::String>,
10642
10643    /// Output only. DEPRECATED: please use write_endpoint instead.
10644    #[deprecated]
10645    pub primary_dns_name: std::option::Option<std::string::String>,
10646
10647    /// Output only. The dns name of the primary instance in a replication group.
10648    pub write_endpoint: std::option::Option<std::string::String>,
10649
10650    /// Optional. A primary instance and disaster recovery (DR) replica pair.
10651    /// A DR replica is a cross-region replica that you designate
10652    /// for failover in the event that the primary instance
10653    /// experiences regional failure.
10654    /// Applicable to MySQL and PostgreSQL.
10655    pub replication_cluster: std::option::Option<crate::model::ReplicationCluster>,
10656
10657    /// Gemini instance configuration.
10658    pub gemini_config: std::option::Option<crate::model::GeminiInstanceConfig>,
10659
10660    /// Output only. This status indicates whether the instance satisfies PZI.
10661    ///
10662    /// The status is reserved for future use.
10663    pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
10664
10665    /// Input only. Whether Cloud SQL is enabled to switch storing point-in-time
10666    /// recovery log files from a data disk to Cloud Storage.
10667    pub switch_transaction_logs_to_cloud_storage_enabled: std::option::Option<wkt::BoolValue>,
10668
10669    /// Input only. Determines whether an in-place major version upgrade of
10670    /// replicas happens when an in-place major version upgrade of a primary
10671    /// instance is initiated.
10672    pub include_replicas_for_major_version_upgrade: std::option::Option<wkt::BoolValue>,
10673
10674    /// Optional. Input only. Immutable. Tag keys and tag values that are bound to
10675    /// this instance. You must represent each item in the map as:
10676    /// `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
10677    ///
10678    /// For example, a single resource can have the following tags:
10679    ///
10680    /// ```norust
10681    ///   "123/environment": "production",
10682    ///   "123/costCenter": "marketing",
10683    /// ```
10684    ///
10685    /// For more information on tag creation and management, see
10686    /// <https://cloud.google.com/resource-manager/docs/tags/tags-overview>.
10687    pub tags: std::collections::HashMap<std::string::String, std::string::String>,
10688
10689    /// The number of read pool nodes in a read pool.
10690    pub node_count: std::option::Option<i32>,
10691
10692    /// Output only. Entries containing information about each read pool node of
10693    /// the read pool.
10694    pub nodes: std::vec::Vec<crate::model::database_instance::PoolNodeConfig>,
10695
10696    /// Output only. The list of DNS names used by this instance.
10697    pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
10698
10699    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10700}
10701
10702impl DatabaseInstance {
10703    pub fn new() -> Self {
10704        std::default::Default::default()
10705    }
10706
10707    /// Sets the value of [kind][crate::model::DatabaseInstance::kind].
10708    ///
10709    /// # Example
10710    /// ```ignore,no_run
10711    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10712    /// let x = DatabaseInstance::new().set_kind("example");
10713    /// ```
10714    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10715        self.kind = v.into();
10716        self
10717    }
10718
10719    /// Sets the value of [state][crate::model::DatabaseInstance::state].
10720    ///
10721    /// # Example
10722    /// ```ignore,no_run
10723    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10724    /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
10725    /// let x0 = DatabaseInstance::new().set_state(SqlInstanceState::Runnable);
10726    /// let x1 = DatabaseInstance::new().set_state(SqlInstanceState::Suspended);
10727    /// let x2 = DatabaseInstance::new().set_state(SqlInstanceState::PendingDelete);
10728    /// ```
10729    pub fn set_state<T: std::convert::Into<crate::model::database_instance::SqlInstanceState>>(
10730        mut self,
10731        v: T,
10732    ) -> Self {
10733        self.state = v.into();
10734        self
10735    }
10736
10737    /// Sets the value of [database_version][crate::model::DatabaseInstance::database_version].
10738    ///
10739    /// # Example
10740    /// ```ignore,no_run
10741    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10742    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
10743    /// let x0 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql56);
10744    /// let x1 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql57);
10745    /// let x2 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql80);
10746    /// ```
10747    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
10748        mut self,
10749        v: T,
10750    ) -> Self {
10751        self.database_version = v.into();
10752        self
10753    }
10754
10755    /// Sets the value of [settings][crate::model::DatabaseInstance::settings].
10756    ///
10757    /// # Example
10758    /// ```ignore,no_run
10759    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10760    /// use google_cloud_sql_v1::model::Settings;
10761    /// let x = DatabaseInstance::new().set_settings(Settings::default()/* use setters */);
10762    /// ```
10763    pub fn set_settings<T>(mut self, v: T) -> Self
10764    where
10765        T: std::convert::Into<crate::model::Settings>,
10766    {
10767        self.settings = std::option::Option::Some(v.into());
10768        self
10769    }
10770
10771    /// Sets or clears the value of [settings][crate::model::DatabaseInstance::settings].
10772    ///
10773    /// # Example
10774    /// ```ignore,no_run
10775    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10776    /// use google_cloud_sql_v1::model::Settings;
10777    /// let x = DatabaseInstance::new().set_or_clear_settings(Some(Settings::default()/* use setters */));
10778    /// let x = DatabaseInstance::new().set_or_clear_settings(None::<Settings>);
10779    /// ```
10780    pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
10781    where
10782        T: std::convert::Into<crate::model::Settings>,
10783    {
10784        self.settings = v.map(|x| x.into());
10785        self
10786    }
10787
10788    /// Sets the value of [etag][crate::model::DatabaseInstance::etag].
10789    ///
10790    /// # Example
10791    /// ```ignore,no_run
10792    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10793    /// let x = DatabaseInstance::new().set_etag("example");
10794    /// ```
10795    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10796        self.etag = v.into();
10797        self
10798    }
10799
10800    /// Sets the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
10801    ///
10802    /// # Example
10803    /// ```ignore,no_run
10804    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10805    /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
10806    /// let x = DatabaseInstance::new().set_failover_replica(SqlFailoverReplica::default()/* use setters */);
10807    /// ```
10808    pub fn set_failover_replica<T>(mut self, v: T) -> Self
10809    where
10810        T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
10811    {
10812        self.failover_replica = std::option::Option::Some(v.into());
10813        self
10814    }
10815
10816    /// Sets or clears the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
10817    ///
10818    /// # Example
10819    /// ```ignore,no_run
10820    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10821    /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
10822    /// let x = DatabaseInstance::new().set_or_clear_failover_replica(Some(SqlFailoverReplica::default()/* use setters */));
10823    /// let x = DatabaseInstance::new().set_or_clear_failover_replica(None::<SqlFailoverReplica>);
10824    /// ```
10825    pub fn set_or_clear_failover_replica<T>(mut self, v: std::option::Option<T>) -> Self
10826    where
10827        T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
10828    {
10829        self.failover_replica = v.map(|x| x.into());
10830        self
10831    }
10832
10833    /// Sets the value of [master_instance_name][crate::model::DatabaseInstance::master_instance_name].
10834    ///
10835    /// # Example
10836    /// ```ignore,no_run
10837    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10838    /// let x = DatabaseInstance::new().set_master_instance_name("example");
10839    /// ```
10840    pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
10841        mut self,
10842        v: T,
10843    ) -> Self {
10844        self.master_instance_name = v.into();
10845        self
10846    }
10847
10848    /// Sets the value of [replica_names][crate::model::DatabaseInstance::replica_names].
10849    ///
10850    /// # Example
10851    /// ```ignore,no_run
10852    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10853    /// let x = DatabaseInstance::new().set_replica_names(["a", "b", "c"]);
10854    /// ```
10855    pub fn set_replica_names<T, V>(mut self, v: T) -> Self
10856    where
10857        T: std::iter::IntoIterator<Item = V>,
10858        V: std::convert::Into<std::string::String>,
10859    {
10860        use std::iter::Iterator;
10861        self.replica_names = v.into_iter().map(|i| i.into()).collect();
10862        self
10863    }
10864
10865    /// Sets the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
10866    ///
10867    /// # Example
10868    /// ```ignore,no_run
10869    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10870    /// use wkt::Int64Value;
10871    /// let x = DatabaseInstance::new().set_max_disk_size(Int64Value::default()/* use setters */);
10872    /// ```
10873    #[deprecated]
10874    pub fn set_max_disk_size<T>(mut self, v: T) -> Self
10875    where
10876        T: std::convert::Into<wkt::Int64Value>,
10877    {
10878        self.max_disk_size = std::option::Option::Some(v.into());
10879        self
10880    }
10881
10882    /// Sets or clears the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
10883    ///
10884    /// # Example
10885    /// ```ignore,no_run
10886    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10887    /// use wkt::Int64Value;
10888    /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(Some(Int64Value::default()/* use setters */));
10889    /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(None::<Int64Value>);
10890    /// ```
10891    #[deprecated]
10892    pub fn set_or_clear_max_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
10893    where
10894        T: std::convert::Into<wkt::Int64Value>,
10895    {
10896        self.max_disk_size = v.map(|x| x.into());
10897        self
10898    }
10899
10900    /// Sets the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
10901    ///
10902    /// # Example
10903    /// ```ignore,no_run
10904    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10905    /// use wkt::Int64Value;
10906    /// let x = DatabaseInstance::new().set_current_disk_size(Int64Value::default()/* use setters */);
10907    /// ```
10908    #[deprecated]
10909    pub fn set_current_disk_size<T>(mut self, v: T) -> Self
10910    where
10911        T: std::convert::Into<wkt::Int64Value>,
10912    {
10913        self.current_disk_size = std::option::Option::Some(v.into());
10914        self
10915    }
10916
10917    /// Sets or clears the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
10918    ///
10919    /// # Example
10920    /// ```ignore,no_run
10921    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10922    /// use wkt::Int64Value;
10923    /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(Some(Int64Value::default()/* use setters */));
10924    /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(None::<Int64Value>);
10925    /// ```
10926    #[deprecated]
10927    pub fn set_or_clear_current_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
10928    where
10929        T: std::convert::Into<wkt::Int64Value>,
10930    {
10931        self.current_disk_size = v.map(|x| x.into());
10932        self
10933    }
10934
10935    /// Sets the value of [ip_addresses][crate::model::DatabaseInstance::ip_addresses].
10936    ///
10937    /// # Example
10938    /// ```ignore,no_run
10939    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10940    /// use google_cloud_sql_v1::model::IpMapping;
10941    /// let x = DatabaseInstance::new()
10942    ///     .set_ip_addresses([
10943    ///         IpMapping::default()/* use setters */,
10944    ///         IpMapping::default()/* use (different) setters */,
10945    ///     ]);
10946    /// ```
10947    pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
10948    where
10949        T: std::iter::IntoIterator<Item = V>,
10950        V: std::convert::Into<crate::model::IpMapping>,
10951    {
10952        use std::iter::Iterator;
10953        self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
10954        self
10955    }
10956
10957    /// Sets the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
10958    ///
10959    /// # Example
10960    /// ```ignore,no_run
10961    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10962    /// use google_cloud_sql_v1::model::SslCert;
10963    /// let x = DatabaseInstance::new().set_server_ca_cert(SslCert::default()/* use setters */);
10964    /// ```
10965    pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
10966    where
10967        T: std::convert::Into<crate::model::SslCert>,
10968    {
10969        self.server_ca_cert = std::option::Option::Some(v.into());
10970        self
10971    }
10972
10973    /// Sets or clears the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
10974    ///
10975    /// # Example
10976    /// ```ignore,no_run
10977    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10978    /// use google_cloud_sql_v1::model::SslCert;
10979    /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
10980    /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(None::<SslCert>);
10981    /// ```
10982    pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
10983    where
10984        T: std::convert::Into<crate::model::SslCert>,
10985    {
10986        self.server_ca_cert = v.map(|x| x.into());
10987        self
10988    }
10989
10990    /// Sets the value of [instance_type][crate::model::DatabaseInstance::instance_type].
10991    ///
10992    /// # Example
10993    /// ```ignore,no_run
10994    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10995    /// use google_cloud_sql_v1::model::SqlInstanceType;
10996    /// let x0 = DatabaseInstance::new().set_instance_type(SqlInstanceType::CloudSqlInstance);
10997    /// let x1 = DatabaseInstance::new().set_instance_type(SqlInstanceType::OnPremisesInstance);
10998    /// let x2 = DatabaseInstance::new().set_instance_type(SqlInstanceType::ReadReplicaInstance);
10999    /// ```
11000    pub fn set_instance_type<T: std::convert::Into<crate::model::SqlInstanceType>>(
11001        mut self,
11002        v: T,
11003    ) -> Self {
11004        self.instance_type = v.into();
11005        self
11006    }
11007
11008    /// Sets the value of [project][crate::model::DatabaseInstance::project].
11009    ///
11010    /// # Example
11011    /// ```ignore,no_run
11012    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11013    /// let x = DatabaseInstance::new().set_project("example");
11014    /// ```
11015    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11016        self.project = v.into();
11017        self
11018    }
11019
11020    /// Sets the value of [ipv6_address][crate::model::DatabaseInstance::ipv6_address].
11021    ///
11022    /// # Example
11023    /// ```ignore,no_run
11024    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11025    /// let x = DatabaseInstance::new().set_ipv6_address("example");
11026    /// ```
11027    #[deprecated]
11028    pub fn set_ipv6_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11029        self.ipv6_address = v.into();
11030        self
11031    }
11032
11033    /// Sets the value of [service_account_email_address][crate::model::DatabaseInstance::service_account_email_address].
11034    ///
11035    /// # Example
11036    /// ```ignore,no_run
11037    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11038    /// let x = DatabaseInstance::new().set_service_account_email_address("example");
11039    /// ```
11040    pub fn set_service_account_email_address<T: std::convert::Into<std::string::String>>(
11041        mut self,
11042        v: T,
11043    ) -> Self {
11044        self.service_account_email_address = v.into();
11045        self
11046    }
11047
11048    /// Sets the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
11049    ///
11050    /// # Example
11051    /// ```ignore,no_run
11052    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11053    /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
11054    /// let x = DatabaseInstance::new().set_on_premises_configuration(OnPremisesConfiguration::default()/* use setters */);
11055    /// ```
11056    pub fn set_on_premises_configuration<T>(mut self, v: T) -> Self
11057    where
11058        T: std::convert::Into<crate::model::OnPremisesConfiguration>,
11059    {
11060        self.on_premises_configuration = std::option::Option::Some(v.into());
11061        self
11062    }
11063
11064    /// Sets or clears the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
11065    ///
11066    /// # Example
11067    /// ```ignore,no_run
11068    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11069    /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
11070    /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(Some(OnPremisesConfiguration::default()/* use setters */));
11071    /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(None::<OnPremisesConfiguration>);
11072    /// ```
11073    pub fn set_or_clear_on_premises_configuration<T>(mut self, v: std::option::Option<T>) -> Self
11074    where
11075        T: std::convert::Into<crate::model::OnPremisesConfiguration>,
11076    {
11077        self.on_premises_configuration = v.map(|x| x.into());
11078        self
11079    }
11080
11081    /// Sets the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
11082    ///
11083    /// # Example
11084    /// ```ignore,no_run
11085    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11086    /// use google_cloud_sql_v1::model::ReplicaConfiguration;
11087    /// let x = DatabaseInstance::new().set_replica_configuration(ReplicaConfiguration::default()/* use setters */);
11088    /// ```
11089    pub fn set_replica_configuration<T>(mut self, v: T) -> Self
11090    where
11091        T: std::convert::Into<crate::model::ReplicaConfiguration>,
11092    {
11093        self.replica_configuration = std::option::Option::Some(v.into());
11094        self
11095    }
11096
11097    /// Sets or clears the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
11098    ///
11099    /// # Example
11100    /// ```ignore,no_run
11101    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11102    /// use google_cloud_sql_v1::model::ReplicaConfiguration;
11103    /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(Some(ReplicaConfiguration::default()/* use setters */));
11104    /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(None::<ReplicaConfiguration>);
11105    /// ```
11106    pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
11107    where
11108        T: std::convert::Into<crate::model::ReplicaConfiguration>,
11109    {
11110        self.replica_configuration = v.map(|x| x.into());
11111        self
11112    }
11113
11114    /// Sets the value of [backend_type][crate::model::DatabaseInstance::backend_type].
11115    ///
11116    /// # Example
11117    /// ```ignore,no_run
11118    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11119    /// use google_cloud_sql_v1::model::SqlBackendType;
11120    /// let x0 = DatabaseInstance::new().set_backend_type(SqlBackendType::SecondGen);
11121    /// let x1 = DatabaseInstance::new().set_backend_type(SqlBackendType::External);
11122    /// ```
11123    pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
11124        mut self,
11125        v: T,
11126    ) -> Self {
11127        self.backend_type = v.into();
11128        self
11129    }
11130
11131    /// Sets the value of [self_link][crate::model::DatabaseInstance::self_link].
11132    ///
11133    /// # Example
11134    /// ```ignore,no_run
11135    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11136    /// let x = DatabaseInstance::new().set_self_link("example");
11137    /// ```
11138    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11139        self.self_link = v.into();
11140        self
11141    }
11142
11143    /// Sets the value of [suspension_reason][crate::model::DatabaseInstance::suspension_reason].
11144    ///
11145    /// # Example
11146    /// ```ignore,no_run
11147    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11148    /// use google_cloud_sql_v1::model::SqlSuspensionReason;
11149    /// let x = DatabaseInstance::new().set_suspension_reason([
11150    ///     SqlSuspensionReason::BillingIssue,
11151    ///     SqlSuspensionReason::LegalIssue,
11152    ///     SqlSuspensionReason::OperationalIssue,
11153    /// ]);
11154    /// ```
11155    pub fn set_suspension_reason<T, V>(mut self, v: T) -> Self
11156    where
11157        T: std::iter::IntoIterator<Item = V>,
11158        V: std::convert::Into<crate::model::SqlSuspensionReason>,
11159    {
11160        use std::iter::Iterator;
11161        self.suspension_reason = v.into_iter().map(|i| i.into()).collect();
11162        self
11163    }
11164
11165    /// Sets the value of [connection_name][crate::model::DatabaseInstance::connection_name].
11166    ///
11167    /// # Example
11168    /// ```ignore,no_run
11169    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11170    /// let x = DatabaseInstance::new().set_connection_name("example");
11171    /// ```
11172    pub fn set_connection_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11173        self.connection_name = v.into();
11174        self
11175    }
11176
11177    /// Sets the value of [name][crate::model::DatabaseInstance::name].
11178    ///
11179    /// # Example
11180    /// ```ignore,no_run
11181    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11182    /// let x = DatabaseInstance::new().set_name("example");
11183    /// ```
11184    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11185        self.name = v.into();
11186        self
11187    }
11188
11189    /// Sets the value of [region][crate::model::DatabaseInstance::region].
11190    ///
11191    /// # Example
11192    /// ```ignore,no_run
11193    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11194    /// let x = DatabaseInstance::new().set_region("example");
11195    /// ```
11196    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11197        self.region = v.into();
11198        self
11199    }
11200
11201    /// Sets the value of [gce_zone][crate::model::DatabaseInstance::gce_zone].
11202    ///
11203    /// # Example
11204    /// ```ignore,no_run
11205    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11206    /// let x = DatabaseInstance::new().set_gce_zone("example");
11207    /// ```
11208    pub fn set_gce_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11209        self.gce_zone = v.into();
11210        self
11211    }
11212
11213    /// Sets the value of [secondary_gce_zone][crate::model::DatabaseInstance::secondary_gce_zone].
11214    ///
11215    /// # Example
11216    /// ```ignore,no_run
11217    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11218    /// let x = DatabaseInstance::new().set_secondary_gce_zone("example");
11219    /// ```
11220    pub fn set_secondary_gce_zone<T: std::convert::Into<std::string::String>>(
11221        mut self,
11222        v: T,
11223    ) -> Self {
11224        self.secondary_gce_zone = v.into();
11225        self
11226    }
11227
11228    /// Sets the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
11229    ///
11230    /// # Example
11231    /// ```ignore,no_run
11232    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11233    /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
11234    /// let x = DatabaseInstance::new().set_disk_encryption_configuration(DiskEncryptionConfiguration::default()/* use setters */);
11235    /// ```
11236    pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
11237    where
11238        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
11239    {
11240        self.disk_encryption_configuration = std::option::Option::Some(v.into());
11241        self
11242    }
11243
11244    /// Sets or clears the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
11245    ///
11246    /// # Example
11247    /// ```ignore,no_run
11248    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11249    /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
11250    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(Some(DiskEncryptionConfiguration::default()/* use setters */));
11251    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(None::<DiskEncryptionConfiguration>);
11252    /// ```
11253    pub fn set_or_clear_disk_encryption_configuration<T>(
11254        mut self,
11255        v: std::option::Option<T>,
11256    ) -> Self
11257    where
11258        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
11259    {
11260        self.disk_encryption_configuration = v.map(|x| x.into());
11261        self
11262    }
11263
11264    /// Sets the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
11265    ///
11266    /// # Example
11267    /// ```ignore,no_run
11268    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11269    /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
11270    /// let x = DatabaseInstance::new().set_disk_encryption_status(DiskEncryptionStatus::default()/* use setters */);
11271    /// ```
11272    pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
11273    where
11274        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
11275    {
11276        self.disk_encryption_status = std::option::Option::Some(v.into());
11277        self
11278    }
11279
11280    /// Sets or clears the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
11281    ///
11282    /// # Example
11283    /// ```ignore,no_run
11284    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11285    /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
11286    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(Some(DiskEncryptionStatus::default()/* use setters */));
11287    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(None::<DiskEncryptionStatus>);
11288    /// ```
11289    pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
11290    where
11291        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
11292    {
11293        self.disk_encryption_status = v.map(|x| x.into());
11294        self
11295    }
11296
11297    /// Sets the value of [root_password][crate::model::DatabaseInstance::root_password].
11298    ///
11299    /// # Example
11300    /// ```ignore,no_run
11301    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11302    /// let x = DatabaseInstance::new().set_root_password("example");
11303    /// ```
11304    pub fn set_root_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11305        self.root_password = v.into();
11306        self
11307    }
11308
11309    /// Sets the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
11310    ///
11311    /// # Example
11312    /// ```ignore,no_run
11313    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11314    /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
11315    /// let x = DatabaseInstance::new().set_scheduled_maintenance(SqlScheduledMaintenance::default()/* use setters */);
11316    /// ```
11317    pub fn set_scheduled_maintenance<T>(mut self, v: T) -> Self
11318    where
11319        T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
11320    {
11321        self.scheduled_maintenance = std::option::Option::Some(v.into());
11322        self
11323    }
11324
11325    /// Sets or clears the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
11326    ///
11327    /// # Example
11328    /// ```ignore,no_run
11329    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11330    /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
11331    /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(Some(SqlScheduledMaintenance::default()/* use setters */));
11332    /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(None::<SqlScheduledMaintenance>);
11333    /// ```
11334    pub fn set_or_clear_scheduled_maintenance<T>(mut self, v: std::option::Option<T>) -> Self
11335    where
11336        T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
11337    {
11338        self.scheduled_maintenance = v.map(|x| x.into());
11339        self
11340    }
11341
11342    /// Sets the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
11343    ///
11344    /// # Example
11345    /// ```ignore,no_run
11346    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11347    /// use wkt::BoolValue;
11348    /// let x = DatabaseInstance::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
11349    /// ```
11350    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
11351    where
11352        T: std::convert::Into<wkt::BoolValue>,
11353    {
11354        self.satisfies_pzs = std::option::Option::Some(v.into());
11355        self
11356    }
11357
11358    /// Sets or clears the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
11359    ///
11360    /// # Example
11361    /// ```ignore,no_run
11362    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11363    /// use wkt::BoolValue;
11364    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
11365    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
11366    /// ```
11367    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
11368    where
11369        T: std::convert::Into<wkt::BoolValue>,
11370    {
11371        self.satisfies_pzs = v.map(|x| x.into());
11372        self
11373    }
11374
11375    /// Sets the value of [database_installed_version][crate::model::DatabaseInstance::database_installed_version].
11376    ///
11377    /// # Example
11378    /// ```ignore,no_run
11379    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11380    /// let x = DatabaseInstance::new().set_database_installed_version("example");
11381    /// ```
11382    pub fn set_database_installed_version<T: std::convert::Into<std::string::String>>(
11383        mut self,
11384        v: T,
11385    ) -> Self {
11386        self.database_installed_version = v.into();
11387        self
11388    }
11389
11390    /// Sets the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
11391    ///
11392    /// # Example
11393    /// ```ignore,no_run
11394    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11395    /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
11396    /// let x = DatabaseInstance::new().set_out_of_disk_report(SqlOutOfDiskReport::default()/* use setters */);
11397    /// ```
11398    pub fn set_out_of_disk_report<T>(mut self, v: T) -> Self
11399    where
11400        T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
11401    {
11402        self.out_of_disk_report = std::option::Option::Some(v.into());
11403        self
11404    }
11405
11406    /// Sets or clears the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
11407    ///
11408    /// # Example
11409    /// ```ignore,no_run
11410    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11411    /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
11412    /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(Some(SqlOutOfDiskReport::default()/* use setters */));
11413    /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(None::<SqlOutOfDiskReport>);
11414    /// ```
11415    pub fn set_or_clear_out_of_disk_report<T>(mut self, v: std::option::Option<T>) -> Self
11416    where
11417        T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
11418    {
11419        self.out_of_disk_report = v.map(|x| x.into());
11420        self
11421    }
11422
11423    /// Sets the value of [create_time][crate::model::DatabaseInstance::create_time].
11424    ///
11425    /// # Example
11426    /// ```ignore,no_run
11427    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11428    /// use wkt::Timestamp;
11429    /// let x = DatabaseInstance::new().set_create_time(Timestamp::default()/* use setters */);
11430    /// ```
11431    pub fn set_create_time<T>(mut self, v: T) -> Self
11432    where
11433        T: std::convert::Into<wkt::Timestamp>,
11434    {
11435        self.create_time = std::option::Option::Some(v.into());
11436        self
11437    }
11438
11439    /// Sets or clears the value of [create_time][crate::model::DatabaseInstance::create_time].
11440    ///
11441    /// # Example
11442    /// ```ignore,no_run
11443    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11444    /// use wkt::Timestamp;
11445    /// let x = DatabaseInstance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11446    /// let x = DatabaseInstance::new().set_or_clear_create_time(None::<Timestamp>);
11447    /// ```
11448    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11449    where
11450        T: std::convert::Into<wkt::Timestamp>,
11451    {
11452        self.create_time = v.map(|x| x.into());
11453        self
11454    }
11455
11456    /// Sets the value of [available_maintenance_versions][crate::model::DatabaseInstance::available_maintenance_versions].
11457    ///
11458    /// # Example
11459    /// ```ignore,no_run
11460    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11461    /// let x = DatabaseInstance::new().set_available_maintenance_versions(["a", "b", "c"]);
11462    /// ```
11463    pub fn set_available_maintenance_versions<T, V>(mut self, v: T) -> Self
11464    where
11465        T: std::iter::IntoIterator<Item = V>,
11466        V: std::convert::Into<std::string::String>,
11467    {
11468        use std::iter::Iterator;
11469        self.available_maintenance_versions = v.into_iter().map(|i| i.into()).collect();
11470        self
11471    }
11472
11473    /// Sets the value of [maintenance_version][crate::model::DatabaseInstance::maintenance_version].
11474    ///
11475    /// # Example
11476    /// ```ignore,no_run
11477    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11478    /// let x = DatabaseInstance::new().set_maintenance_version("example");
11479    /// ```
11480    pub fn set_maintenance_version<T: std::convert::Into<std::string::String>>(
11481        mut self,
11482        v: T,
11483    ) -> Self {
11484        self.maintenance_version = v.into();
11485        self
11486    }
11487
11488    /// Sets the value of [upgradable_database_versions][crate::model::DatabaseInstance::upgradable_database_versions].
11489    ///
11490    /// # Example
11491    /// ```ignore,no_run
11492    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11493    /// use google_cloud_sql_v1::model::AvailableDatabaseVersion;
11494    /// let x = DatabaseInstance::new()
11495    ///     .set_upgradable_database_versions([
11496    ///         AvailableDatabaseVersion::default()/* use setters */,
11497    ///         AvailableDatabaseVersion::default()/* use (different) setters */,
11498    ///     ]);
11499    /// ```
11500    pub fn set_upgradable_database_versions<T, V>(mut self, v: T) -> Self
11501    where
11502        T: std::iter::IntoIterator<Item = V>,
11503        V: std::convert::Into<crate::model::AvailableDatabaseVersion>,
11504    {
11505        use std::iter::Iterator;
11506        self.upgradable_database_versions = v.into_iter().map(|i| i.into()).collect();
11507        self
11508    }
11509
11510    /// Sets the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
11511    ///
11512    /// # Example
11513    /// ```ignore,no_run
11514    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11515    /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
11516    /// let x0 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::NewNetworkArchitecture);
11517    /// let x1 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::OldNetworkArchitecture);
11518    /// ```
11519    pub fn set_sql_network_architecture<T>(mut self, v: T) -> Self
11520    where
11521        T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
11522    {
11523        self.sql_network_architecture = std::option::Option::Some(v.into());
11524        self
11525    }
11526
11527    /// Sets or clears the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
11528    ///
11529    /// # Example
11530    /// ```ignore,no_run
11531    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11532    /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
11533    /// let x0 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::NewNetworkArchitecture));
11534    /// let x1 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::OldNetworkArchitecture));
11535    /// let x_none = DatabaseInstance::new().set_or_clear_sql_network_architecture(None::<SqlNetworkArchitecture>);
11536    /// ```
11537    pub fn set_or_clear_sql_network_architecture<T>(mut self, v: std::option::Option<T>) -> Self
11538    where
11539        T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
11540    {
11541        self.sql_network_architecture = v.map(|x| x.into());
11542        self
11543    }
11544
11545    /// Sets the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
11546    ///
11547    /// # Example
11548    /// ```ignore,no_run
11549    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11550    /// let x = DatabaseInstance::new().set_psc_service_attachment_link("example");
11551    /// ```
11552    pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
11553    where
11554        T: std::convert::Into<std::string::String>,
11555    {
11556        self.psc_service_attachment_link = std::option::Option::Some(v.into());
11557        self
11558    }
11559
11560    /// Sets or clears the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
11561    ///
11562    /// # Example
11563    /// ```ignore,no_run
11564    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11565    /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(Some("example"));
11566    /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(None::<String>);
11567    /// ```
11568    pub fn set_or_clear_psc_service_attachment_link<T>(mut self, v: std::option::Option<T>) -> Self
11569    where
11570        T: std::convert::Into<std::string::String>,
11571    {
11572        self.psc_service_attachment_link = v.map(|x| x.into());
11573        self
11574    }
11575
11576    /// Sets the value of [dns_name][crate::model::DatabaseInstance::dns_name].
11577    ///
11578    /// # Example
11579    /// ```ignore,no_run
11580    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11581    /// let x = DatabaseInstance::new().set_dns_name("example");
11582    /// ```
11583    pub fn set_dns_name<T>(mut self, v: T) -> Self
11584    where
11585        T: std::convert::Into<std::string::String>,
11586    {
11587        self.dns_name = std::option::Option::Some(v.into());
11588        self
11589    }
11590
11591    /// Sets or clears the value of [dns_name][crate::model::DatabaseInstance::dns_name].
11592    ///
11593    /// # Example
11594    /// ```ignore,no_run
11595    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11596    /// let x = DatabaseInstance::new().set_or_clear_dns_name(Some("example"));
11597    /// let x = DatabaseInstance::new().set_or_clear_dns_name(None::<String>);
11598    /// ```
11599    pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
11600    where
11601        T: std::convert::Into<std::string::String>,
11602    {
11603        self.dns_name = v.map(|x| x.into());
11604        self
11605    }
11606
11607    /// Sets the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
11608    ///
11609    /// # Example
11610    /// ```ignore,no_run
11611    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11612    /// let x = DatabaseInstance::new().set_primary_dns_name("example");
11613    /// ```
11614    #[deprecated]
11615    pub fn set_primary_dns_name<T>(mut self, v: T) -> Self
11616    where
11617        T: std::convert::Into<std::string::String>,
11618    {
11619        self.primary_dns_name = std::option::Option::Some(v.into());
11620        self
11621    }
11622
11623    /// Sets or clears the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
11624    ///
11625    /// # Example
11626    /// ```ignore,no_run
11627    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11628    /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(Some("example"));
11629    /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(None::<String>);
11630    /// ```
11631    #[deprecated]
11632    pub fn set_or_clear_primary_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
11633    where
11634        T: std::convert::Into<std::string::String>,
11635    {
11636        self.primary_dns_name = v.map(|x| x.into());
11637        self
11638    }
11639
11640    /// Sets the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
11641    ///
11642    /// # Example
11643    /// ```ignore,no_run
11644    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11645    /// let x = DatabaseInstance::new().set_write_endpoint("example");
11646    /// ```
11647    pub fn set_write_endpoint<T>(mut self, v: T) -> Self
11648    where
11649        T: std::convert::Into<std::string::String>,
11650    {
11651        self.write_endpoint = std::option::Option::Some(v.into());
11652        self
11653    }
11654
11655    /// Sets or clears the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
11656    ///
11657    /// # Example
11658    /// ```ignore,no_run
11659    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11660    /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(Some("example"));
11661    /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(None::<String>);
11662    /// ```
11663    pub fn set_or_clear_write_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
11664    where
11665        T: std::convert::Into<std::string::String>,
11666    {
11667        self.write_endpoint = v.map(|x| x.into());
11668        self
11669    }
11670
11671    /// Sets the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
11672    ///
11673    /// # Example
11674    /// ```ignore,no_run
11675    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11676    /// use google_cloud_sql_v1::model::ReplicationCluster;
11677    /// let x = DatabaseInstance::new().set_replication_cluster(ReplicationCluster::default()/* use setters */);
11678    /// ```
11679    pub fn set_replication_cluster<T>(mut self, v: T) -> Self
11680    where
11681        T: std::convert::Into<crate::model::ReplicationCluster>,
11682    {
11683        self.replication_cluster = std::option::Option::Some(v.into());
11684        self
11685    }
11686
11687    /// Sets or clears the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
11688    ///
11689    /// # Example
11690    /// ```ignore,no_run
11691    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11692    /// use google_cloud_sql_v1::model::ReplicationCluster;
11693    /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(Some(ReplicationCluster::default()/* use setters */));
11694    /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(None::<ReplicationCluster>);
11695    /// ```
11696    pub fn set_or_clear_replication_cluster<T>(mut self, v: std::option::Option<T>) -> Self
11697    where
11698        T: std::convert::Into<crate::model::ReplicationCluster>,
11699    {
11700        self.replication_cluster = v.map(|x| x.into());
11701        self
11702    }
11703
11704    /// Sets the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
11705    ///
11706    /// # Example
11707    /// ```ignore,no_run
11708    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11709    /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
11710    /// let x = DatabaseInstance::new().set_gemini_config(GeminiInstanceConfig::default()/* use setters */);
11711    /// ```
11712    pub fn set_gemini_config<T>(mut self, v: T) -> Self
11713    where
11714        T: std::convert::Into<crate::model::GeminiInstanceConfig>,
11715    {
11716        self.gemini_config = std::option::Option::Some(v.into());
11717        self
11718    }
11719
11720    /// Sets or clears the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
11721    ///
11722    /// # Example
11723    /// ```ignore,no_run
11724    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11725    /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
11726    /// let x = DatabaseInstance::new().set_or_clear_gemini_config(Some(GeminiInstanceConfig::default()/* use setters */));
11727    /// let x = DatabaseInstance::new().set_or_clear_gemini_config(None::<GeminiInstanceConfig>);
11728    /// ```
11729    pub fn set_or_clear_gemini_config<T>(mut self, v: std::option::Option<T>) -> Self
11730    where
11731        T: std::convert::Into<crate::model::GeminiInstanceConfig>,
11732    {
11733        self.gemini_config = v.map(|x| x.into());
11734        self
11735    }
11736
11737    /// Sets the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
11738    ///
11739    /// # Example
11740    /// ```ignore,no_run
11741    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11742    /// use wkt::BoolValue;
11743    /// let x = DatabaseInstance::new().set_satisfies_pzi(BoolValue::default()/* use setters */);
11744    /// ```
11745    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
11746    where
11747        T: std::convert::Into<wkt::BoolValue>,
11748    {
11749        self.satisfies_pzi = std::option::Option::Some(v.into());
11750        self
11751    }
11752
11753    /// Sets or clears the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
11754    ///
11755    /// # Example
11756    /// ```ignore,no_run
11757    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11758    /// use wkt::BoolValue;
11759    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(Some(BoolValue::default()/* use setters */));
11760    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(None::<BoolValue>);
11761    /// ```
11762    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
11763    where
11764        T: std::convert::Into<wkt::BoolValue>,
11765    {
11766        self.satisfies_pzi = v.map(|x| x.into());
11767        self
11768    }
11769
11770    /// Sets the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
11771    ///
11772    /// # Example
11773    /// ```ignore,no_run
11774    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11775    /// use wkt::BoolValue;
11776    /// let x = DatabaseInstance::new().set_switch_transaction_logs_to_cloud_storage_enabled(BoolValue::default()/* use setters */);
11777    /// ```
11778    pub fn set_switch_transaction_logs_to_cloud_storage_enabled<T>(mut self, v: T) -> Self
11779    where
11780        T: std::convert::Into<wkt::BoolValue>,
11781    {
11782        self.switch_transaction_logs_to_cloud_storage_enabled = std::option::Option::Some(v.into());
11783        self
11784    }
11785
11786    /// Sets or clears the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
11787    ///
11788    /// # Example
11789    /// ```ignore,no_run
11790    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11791    /// use wkt::BoolValue;
11792    /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(Some(BoolValue::default()/* use setters */));
11793    /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(None::<BoolValue>);
11794    /// ```
11795    pub fn set_or_clear_switch_transaction_logs_to_cloud_storage_enabled<T>(
11796        mut self,
11797        v: std::option::Option<T>,
11798    ) -> Self
11799    where
11800        T: std::convert::Into<wkt::BoolValue>,
11801    {
11802        self.switch_transaction_logs_to_cloud_storage_enabled = v.map(|x| x.into());
11803        self
11804    }
11805
11806    /// Sets the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
11807    ///
11808    /// # Example
11809    /// ```ignore,no_run
11810    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11811    /// use wkt::BoolValue;
11812    /// let x = DatabaseInstance::new().set_include_replicas_for_major_version_upgrade(BoolValue::default()/* use setters */);
11813    /// ```
11814    pub fn set_include_replicas_for_major_version_upgrade<T>(mut self, v: T) -> Self
11815    where
11816        T: std::convert::Into<wkt::BoolValue>,
11817    {
11818        self.include_replicas_for_major_version_upgrade = std::option::Option::Some(v.into());
11819        self
11820    }
11821
11822    /// Sets or clears the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
11823    ///
11824    /// # Example
11825    /// ```ignore,no_run
11826    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11827    /// use wkt::BoolValue;
11828    /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(Some(BoolValue::default()/* use setters */));
11829    /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(None::<BoolValue>);
11830    /// ```
11831    pub fn set_or_clear_include_replicas_for_major_version_upgrade<T>(
11832        mut self,
11833        v: std::option::Option<T>,
11834    ) -> Self
11835    where
11836        T: std::convert::Into<wkt::BoolValue>,
11837    {
11838        self.include_replicas_for_major_version_upgrade = v.map(|x| x.into());
11839        self
11840    }
11841
11842    /// Sets the value of [tags][crate::model::DatabaseInstance::tags].
11843    ///
11844    /// # Example
11845    /// ```ignore,no_run
11846    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11847    /// let x = DatabaseInstance::new().set_tags([
11848    ///     ("key0", "abc"),
11849    ///     ("key1", "xyz"),
11850    /// ]);
11851    /// ```
11852    pub fn set_tags<T, K, V>(mut self, v: T) -> Self
11853    where
11854        T: std::iter::IntoIterator<Item = (K, V)>,
11855        K: std::convert::Into<std::string::String>,
11856        V: std::convert::Into<std::string::String>,
11857    {
11858        use std::iter::Iterator;
11859        self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11860        self
11861    }
11862
11863    /// Sets the value of [node_count][crate::model::DatabaseInstance::node_count].
11864    ///
11865    /// # Example
11866    /// ```ignore,no_run
11867    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11868    /// let x = DatabaseInstance::new().set_node_count(42);
11869    /// ```
11870    pub fn set_node_count<T>(mut self, v: T) -> Self
11871    where
11872        T: std::convert::Into<i32>,
11873    {
11874        self.node_count = std::option::Option::Some(v.into());
11875        self
11876    }
11877
11878    /// Sets or clears the value of [node_count][crate::model::DatabaseInstance::node_count].
11879    ///
11880    /// # Example
11881    /// ```ignore,no_run
11882    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11883    /// let x = DatabaseInstance::new().set_or_clear_node_count(Some(42));
11884    /// let x = DatabaseInstance::new().set_or_clear_node_count(None::<i32>);
11885    /// ```
11886    pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
11887    where
11888        T: std::convert::Into<i32>,
11889    {
11890        self.node_count = v.map(|x| x.into());
11891        self
11892    }
11893
11894    /// Sets the value of [nodes][crate::model::DatabaseInstance::nodes].
11895    ///
11896    /// # Example
11897    /// ```ignore,no_run
11898    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11899    /// use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
11900    /// let x = DatabaseInstance::new()
11901    ///     .set_nodes([
11902    ///         PoolNodeConfig::default()/* use setters */,
11903    ///         PoolNodeConfig::default()/* use (different) setters */,
11904    ///     ]);
11905    /// ```
11906    pub fn set_nodes<T, V>(mut self, v: T) -> Self
11907    where
11908        T: std::iter::IntoIterator<Item = V>,
11909        V: std::convert::Into<crate::model::database_instance::PoolNodeConfig>,
11910    {
11911        use std::iter::Iterator;
11912        self.nodes = v.into_iter().map(|i| i.into()).collect();
11913        self
11914    }
11915
11916    /// Sets the value of [dns_names][crate::model::DatabaseInstance::dns_names].
11917    ///
11918    /// # Example
11919    /// ```ignore,no_run
11920    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11921    /// use google_cloud_sql_v1::model::DnsNameMapping;
11922    /// let x = DatabaseInstance::new()
11923    ///     .set_dns_names([
11924    ///         DnsNameMapping::default()/* use setters */,
11925    ///         DnsNameMapping::default()/* use (different) setters */,
11926    ///     ]);
11927    /// ```
11928    pub fn set_dns_names<T, V>(mut self, v: T) -> Self
11929    where
11930        T: std::iter::IntoIterator<Item = V>,
11931        V: std::convert::Into<crate::model::DnsNameMapping>,
11932    {
11933        use std::iter::Iterator;
11934        self.dns_names = v.into_iter().map(|i| i.into()).collect();
11935        self
11936    }
11937}
11938
11939impl wkt::message::Message for DatabaseInstance {
11940    fn typename() -> &'static str {
11941        "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance"
11942    }
11943}
11944
11945/// Defines additional types related to [DatabaseInstance].
11946pub mod database_instance {
11947    #[allow(unused_imports)]
11948    use super::*;
11949
11950    #[derive(Clone, Default, PartialEq)]
11951    #[non_exhaustive]
11952    pub struct SqlFailoverReplica {
11953        /// The name of the failover replica. If specified at instance creation, a
11954        /// failover replica is created for the instance. The name
11955        /// doesn't include the project ID.
11956        pub name: std::string::String,
11957
11958        /// The availability status of the failover replica. A false status indicates
11959        /// that the failover replica is out of sync. The primary instance can only
11960        /// failover to the failover replica when the status is true.
11961        pub available: std::option::Option<wkt::BoolValue>,
11962
11963        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11964    }
11965
11966    impl SqlFailoverReplica {
11967        pub fn new() -> Self {
11968            std::default::Default::default()
11969        }
11970
11971        /// Sets the value of [name][crate::model::database_instance::SqlFailoverReplica::name].
11972        ///
11973        /// # Example
11974        /// ```ignore,no_run
11975        /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
11976        /// let x = SqlFailoverReplica::new().set_name("example");
11977        /// ```
11978        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11979            self.name = v.into();
11980            self
11981        }
11982
11983        /// Sets the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
11984        ///
11985        /// # Example
11986        /// ```ignore,no_run
11987        /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
11988        /// use wkt::BoolValue;
11989        /// let x = SqlFailoverReplica::new().set_available(BoolValue::default()/* use setters */);
11990        /// ```
11991        pub fn set_available<T>(mut self, v: T) -> Self
11992        where
11993            T: std::convert::Into<wkt::BoolValue>,
11994        {
11995            self.available = std::option::Option::Some(v.into());
11996            self
11997        }
11998
11999        /// Sets or clears the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
12000        ///
12001        /// # Example
12002        /// ```ignore,no_run
12003        /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12004        /// use wkt::BoolValue;
12005        /// let x = SqlFailoverReplica::new().set_or_clear_available(Some(BoolValue::default()/* use setters */));
12006        /// let x = SqlFailoverReplica::new().set_or_clear_available(None::<BoolValue>);
12007        /// ```
12008        pub fn set_or_clear_available<T>(mut self, v: std::option::Option<T>) -> Self
12009        where
12010            T: std::convert::Into<wkt::BoolValue>,
12011        {
12012            self.available = v.map(|x| x.into());
12013            self
12014        }
12015    }
12016
12017    impl wkt::message::Message for SqlFailoverReplica {
12018        fn typename() -> &'static str {
12019            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica"
12020        }
12021    }
12022
12023    /// Any scheduled maintenance for this instance.
12024    #[derive(Clone, Default, PartialEq)]
12025    #[non_exhaustive]
12026    pub struct SqlScheduledMaintenance {
12027        /// The start time of any upcoming scheduled maintenance for this instance.
12028        pub start_time: std::option::Option<wkt::Timestamp>,
12029
12030        #[deprecated]
12031        pub can_defer: bool,
12032
12033        /// If the scheduled maintenance can be rescheduled.
12034        pub can_reschedule: bool,
12035
12036        /// Maintenance cannot be rescheduled to start beyond this deadline.
12037        pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
12038
12039        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12040    }
12041
12042    impl SqlScheduledMaintenance {
12043        pub fn new() -> Self {
12044            std::default::Default::default()
12045        }
12046
12047        /// Sets the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
12048        ///
12049        /// # Example
12050        /// ```ignore,no_run
12051        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12052        /// use wkt::Timestamp;
12053        /// let x = SqlScheduledMaintenance::new().set_start_time(Timestamp::default()/* use setters */);
12054        /// ```
12055        pub fn set_start_time<T>(mut self, v: T) -> Self
12056        where
12057            T: std::convert::Into<wkt::Timestamp>,
12058        {
12059            self.start_time = std::option::Option::Some(v.into());
12060            self
12061        }
12062
12063        /// Sets or clears the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
12064        ///
12065        /// # Example
12066        /// ```ignore,no_run
12067        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12068        /// use wkt::Timestamp;
12069        /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
12070        /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(None::<Timestamp>);
12071        /// ```
12072        pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12073        where
12074            T: std::convert::Into<wkt::Timestamp>,
12075        {
12076            self.start_time = v.map(|x| x.into());
12077            self
12078        }
12079
12080        /// Sets the value of [can_defer][crate::model::database_instance::SqlScheduledMaintenance::can_defer].
12081        ///
12082        /// # Example
12083        /// ```ignore,no_run
12084        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12085        /// let x = SqlScheduledMaintenance::new().set_can_defer(true);
12086        /// ```
12087        #[deprecated]
12088        pub fn set_can_defer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12089            self.can_defer = v.into();
12090            self
12091        }
12092
12093        /// Sets the value of [can_reschedule][crate::model::database_instance::SqlScheduledMaintenance::can_reschedule].
12094        ///
12095        /// # Example
12096        /// ```ignore,no_run
12097        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12098        /// let x = SqlScheduledMaintenance::new().set_can_reschedule(true);
12099        /// ```
12100        pub fn set_can_reschedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12101            self.can_reschedule = v.into();
12102            self
12103        }
12104
12105        /// Sets the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
12106        ///
12107        /// # Example
12108        /// ```ignore,no_run
12109        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12110        /// use wkt::Timestamp;
12111        /// let x = SqlScheduledMaintenance::new().set_schedule_deadline_time(Timestamp::default()/* use setters */);
12112        /// ```
12113        pub fn set_schedule_deadline_time<T>(mut self, v: T) -> Self
12114        where
12115            T: std::convert::Into<wkt::Timestamp>,
12116        {
12117            self.schedule_deadline_time = std::option::Option::Some(v.into());
12118            self
12119        }
12120
12121        /// Sets or clears the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
12122        ///
12123        /// # Example
12124        /// ```ignore,no_run
12125        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12126        /// use wkt::Timestamp;
12127        /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(Some(Timestamp::default()/* use setters */));
12128        /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(None::<Timestamp>);
12129        /// ```
12130        pub fn set_or_clear_schedule_deadline_time<T>(mut self, v: std::option::Option<T>) -> Self
12131        where
12132            T: std::convert::Into<wkt::Timestamp>,
12133        {
12134            self.schedule_deadline_time = v.map(|x| x.into());
12135            self
12136        }
12137    }
12138
12139    impl wkt::message::Message for SqlScheduledMaintenance {
12140        fn typename() -> &'static str {
12141            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance"
12142        }
12143    }
12144
12145    /// This message wraps up the information written by out-of-disk detection job.
12146    #[derive(Clone, Default, PartialEq)]
12147    #[non_exhaustive]
12148    pub struct SqlOutOfDiskReport {
12149        /// This field represents the state generated by the proactive database
12150        /// wellness job for OutOfDisk issues.
12151        ///
12152        /// * Writers:
12153        /// * the proactive database wellness job for OOD.
12154        /// * Readers:
12155        /// * the proactive database wellness job
12156        pub sql_out_of_disk_state: std::option::Option<
12157            crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12158        >,
12159
12160        /// The minimum recommended increase size in GigaBytes
12161        /// This field is consumed by the frontend
12162        ///
12163        /// * Writers:
12164        /// * the proactive database wellness job for OOD.
12165        /// * Readers:
12166        pub sql_min_recommended_increase_size_gb: std::option::Option<i32>,
12167
12168        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12169    }
12170
12171    impl SqlOutOfDiskReport {
12172        pub fn new() -> Self {
12173            std::default::Default::default()
12174        }
12175
12176        /// Sets the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
12177        ///
12178        /// # Example
12179        /// ```ignore,no_run
12180        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12181        /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
12182        /// let x0 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::Normal);
12183        /// let x1 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::SoftShutdown);
12184        /// ```
12185        pub fn set_sql_out_of_disk_state<T>(mut self, v: T) -> Self
12186        where
12187            T: std::convert::Into<
12188                    crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12189                >,
12190        {
12191            self.sql_out_of_disk_state = std::option::Option::Some(v.into());
12192            self
12193        }
12194
12195        /// Sets or clears the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
12196        ///
12197        /// # Example
12198        /// ```ignore,no_run
12199        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12200        /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
12201        /// let x0 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::Normal));
12202        /// let x1 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::SoftShutdown));
12203        /// let x_none = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(None::<SqlOutOfDiskState>);
12204        /// ```
12205        pub fn set_or_clear_sql_out_of_disk_state<T>(mut self, v: std::option::Option<T>) -> Self
12206        where
12207            T: std::convert::Into<
12208                    crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12209                >,
12210        {
12211            self.sql_out_of_disk_state = v.map(|x| x.into());
12212            self
12213        }
12214
12215        /// Sets the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
12216        ///
12217        /// # Example
12218        /// ```ignore,no_run
12219        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12220        /// let x = SqlOutOfDiskReport::new().set_sql_min_recommended_increase_size_gb(42);
12221        /// ```
12222        pub fn set_sql_min_recommended_increase_size_gb<T>(mut self, v: T) -> Self
12223        where
12224            T: std::convert::Into<i32>,
12225        {
12226            self.sql_min_recommended_increase_size_gb = std::option::Option::Some(v.into());
12227            self
12228        }
12229
12230        /// Sets or clears the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
12231        ///
12232        /// # Example
12233        /// ```ignore,no_run
12234        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12235        /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(Some(42));
12236        /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(None::<i32>);
12237        /// ```
12238        pub fn set_or_clear_sql_min_recommended_increase_size_gb<T>(
12239            mut self,
12240            v: std::option::Option<T>,
12241        ) -> Self
12242        where
12243            T: std::convert::Into<i32>,
12244        {
12245            self.sql_min_recommended_increase_size_gb = v.map(|x| x.into());
12246            self
12247        }
12248    }
12249
12250    impl wkt::message::Message for SqlOutOfDiskReport {
12251        fn typename() -> &'static str {
12252            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport"
12253        }
12254    }
12255
12256    /// Defines additional types related to [SqlOutOfDiskReport].
12257    pub mod sql_out_of_disk_report {
12258        #[allow(unused_imports)]
12259        use super::*;
12260
12261        /// This enum lists all possible states regarding out-of-disk issues.
12262        ///
12263        /// # Working with unknown values
12264        ///
12265        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12266        /// additional enum variants at any time. Adding new variants is not considered
12267        /// a breaking change. Applications should write their code in anticipation of:
12268        ///
12269        /// - New values appearing in future releases of the client library, **and**
12270        /// - New values received dynamically, without application changes.
12271        ///
12272        /// Please consult the [Working with enums] section in the user guide for some
12273        /// guidelines.
12274        ///
12275        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12276        #[derive(Clone, Debug, PartialEq)]
12277        #[non_exhaustive]
12278        pub enum SqlOutOfDiskState {
12279            /// Unspecified state
12280            Unspecified,
12281            /// The instance has plenty space on data disk
12282            Normal,
12283            /// Data disk is almost used up. It is shutdown to prevent data
12284            /// corruption.
12285            SoftShutdown,
12286            /// If set, the enum was initialized with an unknown value.
12287            ///
12288            /// Applications can examine the value using [SqlOutOfDiskState::value] or
12289            /// [SqlOutOfDiskState::name].
12290            UnknownValue(sql_out_of_disk_state::UnknownValue),
12291        }
12292
12293        #[doc(hidden)]
12294        pub mod sql_out_of_disk_state {
12295            #[allow(unused_imports)]
12296            use super::*;
12297            #[derive(Clone, Debug, PartialEq)]
12298            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12299        }
12300
12301        impl SqlOutOfDiskState {
12302            /// Gets the enum value.
12303            ///
12304            /// Returns `None` if the enum contains an unknown value deserialized from
12305            /// the string representation of enums.
12306            pub fn value(&self) -> std::option::Option<i32> {
12307                match self {
12308                    Self::Unspecified => std::option::Option::Some(0),
12309                    Self::Normal => std::option::Option::Some(1),
12310                    Self::SoftShutdown => std::option::Option::Some(2),
12311                    Self::UnknownValue(u) => u.0.value(),
12312                }
12313            }
12314
12315            /// Gets the enum value as a string.
12316            ///
12317            /// Returns `None` if the enum contains an unknown value deserialized from
12318            /// the integer representation of enums.
12319            pub fn name(&self) -> std::option::Option<&str> {
12320                match self {
12321                    Self::Unspecified => {
12322                        std::option::Option::Some("SQL_OUT_OF_DISK_STATE_UNSPECIFIED")
12323                    }
12324                    Self::Normal => std::option::Option::Some("NORMAL"),
12325                    Self::SoftShutdown => std::option::Option::Some("SOFT_SHUTDOWN"),
12326                    Self::UnknownValue(u) => u.0.name(),
12327                }
12328            }
12329        }
12330
12331        impl std::default::Default for SqlOutOfDiskState {
12332            fn default() -> Self {
12333                use std::convert::From;
12334                Self::from(0)
12335            }
12336        }
12337
12338        impl std::fmt::Display for SqlOutOfDiskState {
12339            fn fmt(
12340                &self,
12341                f: &mut std::fmt::Formatter<'_>,
12342            ) -> std::result::Result<(), std::fmt::Error> {
12343                wkt::internal::display_enum(f, self.name(), self.value())
12344            }
12345        }
12346
12347        impl std::convert::From<i32> for SqlOutOfDiskState {
12348            fn from(value: i32) -> Self {
12349                match value {
12350                    0 => Self::Unspecified,
12351                    1 => Self::Normal,
12352                    2 => Self::SoftShutdown,
12353                    _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
12354                        wkt::internal::UnknownEnumValue::Integer(value),
12355                    )),
12356                }
12357            }
12358        }
12359
12360        impl std::convert::From<&str> for SqlOutOfDiskState {
12361            fn from(value: &str) -> Self {
12362                use std::string::ToString;
12363                match value {
12364                    "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" => Self::Unspecified,
12365                    "NORMAL" => Self::Normal,
12366                    "SOFT_SHUTDOWN" => Self::SoftShutdown,
12367                    _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
12368                        wkt::internal::UnknownEnumValue::String(value.to_string()),
12369                    )),
12370                }
12371            }
12372        }
12373
12374        impl serde::ser::Serialize for SqlOutOfDiskState {
12375            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12376            where
12377                S: serde::Serializer,
12378            {
12379                match self {
12380                    Self::Unspecified => serializer.serialize_i32(0),
12381                    Self::Normal => serializer.serialize_i32(1),
12382                    Self::SoftShutdown => serializer.serialize_i32(2),
12383                    Self::UnknownValue(u) => u.0.serialize(serializer),
12384                }
12385            }
12386        }
12387
12388        impl<'de> serde::de::Deserialize<'de> for SqlOutOfDiskState {
12389            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12390            where
12391                D: serde::Deserializer<'de>,
12392            {
12393                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOutOfDiskState>::new(
12394                    ".google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState",
12395                ))
12396            }
12397        }
12398    }
12399
12400    /// Details of a single read pool node of a read pool.
12401    #[derive(Clone, Default, PartialEq)]
12402    #[non_exhaustive]
12403    pub struct PoolNodeConfig {
12404        /// Output only. The name of the read pool node, to be used for retrieving
12405        /// metrics and logs.
12406        pub name: std::option::Option<std::string::String>,
12407
12408        /// Output only. The zone of the read pool node.
12409        pub gce_zone: std::option::Option<std::string::String>,
12410
12411        /// Output only. Mappings containing IP addresses that can be used to connect
12412        /// to the read pool node.
12413        pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
12414
12415        /// Output only. The DNS name of the read pool node.
12416        pub dns_name: std::option::Option<std::string::String>,
12417
12418        /// Output only. The current state of the read pool node.
12419        pub state: std::option::Option<crate::model::database_instance::SqlInstanceState>,
12420
12421        /// Output only. The list of DNS names used by this read pool node.
12422        pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
12423
12424        /// Output only. The Private Service Connect (PSC) service attachment of the
12425        /// read pool node.
12426        pub psc_service_attachment_link: std::option::Option<std::string::String>,
12427
12428        /// Output only. The list of settings for requested automatically-setup
12429        /// Private Service Connect (PSC) consumer endpoints that can be used to
12430        /// connect to this read pool node.
12431        pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
12432
12433        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12434    }
12435
12436    impl PoolNodeConfig {
12437        pub fn new() -> Self {
12438            std::default::Default::default()
12439        }
12440
12441        /// Sets the value of [name][crate::model::database_instance::PoolNodeConfig::name].
12442        ///
12443        /// # Example
12444        /// ```ignore,no_run
12445        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12446        /// let x = PoolNodeConfig::new().set_name("example");
12447        /// ```
12448        pub fn set_name<T>(mut self, v: T) -> Self
12449        where
12450            T: std::convert::Into<std::string::String>,
12451        {
12452            self.name = std::option::Option::Some(v.into());
12453            self
12454        }
12455
12456        /// Sets or clears the value of [name][crate::model::database_instance::PoolNodeConfig::name].
12457        ///
12458        /// # Example
12459        /// ```ignore,no_run
12460        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12461        /// let x = PoolNodeConfig::new().set_or_clear_name(Some("example"));
12462        /// let x = PoolNodeConfig::new().set_or_clear_name(None::<String>);
12463        /// ```
12464        pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
12465        where
12466            T: std::convert::Into<std::string::String>,
12467        {
12468            self.name = v.map(|x| x.into());
12469            self
12470        }
12471
12472        /// Sets the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
12473        ///
12474        /// # Example
12475        /// ```ignore,no_run
12476        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12477        /// let x = PoolNodeConfig::new().set_gce_zone("example");
12478        /// ```
12479        pub fn set_gce_zone<T>(mut self, v: T) -> Self
12480        where
12481            T: std::convert::Into<std::string::String>,
12482        {
12483            self.gce_zone = std::option::Option::Some(v.into());
12484            self
12485        }
12486
12487        /// Sets or clears the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
12488        ///
12489        /// # Example
12490        /// ```ignore,no_run
12491        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12492        /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(Some("example"));
12493        /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(None::<String>);
12494        /// ```
12495        pub fn set_or_clear_gce_zone<T>(mut self, v: std::option::Option<T>) -> Self
12496        where
12497            T: std::convert::Into<std::string::String>,
12498        {
12499            self.gce_zone = v.map(|x| x.into());
12500            self
12501        }
12502
12503        /// Sets the value of [ip_addresses][crate::model::database_instance::PoolNodeConfig::ip_addresses].
12504        ///
12505        /// # Example
12506        /// ```ignore,no_run
12507        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12508        /// use google_cloud_sql_v1::model::IpMapping;
12509        /// let x = PoolNodeConfig::new()
12510        ///     .set_ip_addresses([
12511        ///         IpMapping::default()/* use setters */,
12512        ///         IpMapping::default()/* use (different) setters */,
12513        ///     ]);
12514        /// ```
12515        pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
12516        where
12517            T: std::iter::IntoIterator<Item = V>,
12518            V: std::convert::Into<crate::model::IpMapping>,
12519        {
12520            use std::iter::Iterator;
12521            self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
12522            self
12523        }
12524
12525        /// Sets the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
12526        ///
12527        /// # Example
12528        /// ```ignore,no_run
12529        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12530        /// let x = PoolNodeConfig::new().set_dns_name("example");
12531        /// ```
12532        pub fn set_dns_name<T>(mut self, v: T) -> Self
12533        where
12534            T: std::convert::Into<std::string::String>,
12535        {
12536            self.dns_name = std::option::Option::Some(v.into());
12537            self
12538        }
12539
12540        /// Sets or clears the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
12541        ///
12542        /// # Example
12543        /// ```ignore,no_run
12544        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12545        /// let x = PoolNodeConfig::new().set_or_clear_dns_name(Some("example"));
12546        /// let x = PoolNodeConfig::new().set_or_clear_dns_name(None::<String>);
12547        /// ```
12548        pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
12549        where
12550            T: std::convert::Into<std::string::String>,
12551        {
12552            self.dns_name = v.map(|x| x.into());
12553            self
12554        }
12555
12556        /// Sets the value of [state][crate::model::database_instance::PoolNodeConfig::state].
12557        ///
12558        /// # Example
12559        /// ```ignore,no_run
12560        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12561        /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
12562        /// let x0 = PoolNodeConfig::new().set_state(SqlInstanceState::Runnable);
12563        /// let x1 = PoolNodeConfig::new().set_state(SqlInstanceState::Suspended);
12564        /// let x2 = PoolNodeConfig::new().set_state(SqlInstanceState::PendingDelete);
12565        /// ```
12566        pub fn set_state<T>(mut self, v: T) -> Self
12567        where
12568            T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
12569        {
12570            self.state = std::option::Option::Some(v.into());
12571            self
12572        }
12573
12574        /// Sets or clears the value of [state][crate::model::database_instance::PoolNodeConfig::state].
12575        ///
12576        /// # Example
12577        /// ```ignore,no_run
12578        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12579        /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
12580        /// let x0 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Runnable));
12581        /// let x1 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Suspended));
12582        /// let x2 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::PendingDelete));
12583        /// let x_none = PoolNodeConfig::new().set_or_clear_state(None::<SqlInstanceState>);
12584        /// ```
12585        pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
12586        where
12587            T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
12588        {
12589            self.state = v.map(|x| x.into());
12590            self
12591        }
12592
12593        /// Sets the value of [dns_names][crate::model::database_instance::PoolNodeConfig::dns_names].
12594        ///
12595        /// # Example
12596        /// ```ignore,no_run
12597        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12598        /// use google_cloud_sql_v1::model::DnsNameMapping;
12599        /// let x = PoolNodeConfig::new()
12600        ///     .set_dns_names([
12601        ///         DnsNameMapping::default()/* use setters */,
12602        ///         DnsNameMapping::default()/* use (different) setters */,
12603        ///     ]);
12604        /// ```
12605        pub fn set_dns_names<T, V>(mut self, v: T) -> Self
12606        where
12607            T: std::iter::IntoIterator<Item = V>,
12608            V: std::convert::Into<crate::model::DnsNameMapping>,
12609        {
12610            use std::iter::Iterator;
12611            self.dns_names = v.into_iter().map(|i| i.into()).collect();
12612            self
12613        }
12614
12615        /// Sets the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
12616        ///
12617        /// # Example
12618        /// ```ignore,no_run
12619        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12620        /// let x = PoolNodeConfig::new().set_psc_service_attachment_link("example");
12621        /// ```
12622        pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
12623        where
12624            T: std::convert::Into<std::string::String>,
12625        {
12626            self.psc_service_attachment_link = std::option::Option::Some(v.into());
12627            self
12628        }
12629
12630        /// Sets or clears the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
12631        ///
12632        /// # Example
12633        /// ```ignore,no_run
12634        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12635        /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(Some("example"));
12636        /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(None::<String>);
12637        /// ```
12638        pub fn set_or_clear_psc_service_attachment_link<T>(
12639            mut self,
12640            v: std::option::Option<T>,
12641        ) -> Self
12642        where
12643            T: std::convert::Into<std::string::String>,
12644        {
12645            self.psc_service_attachment_link = v.map(|x| x.into());
12646            self
12647        }
12648
12649        /// Sets the value of [psc_auto_connections][crate::model::database_instance::PoolNodeConfig::psc_auto_connections].
12650        ///
12651        /// # Example
12652        /// ```ignore,no_run
12653        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12654        /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
12655        /// let x = PoolNodeConfig::new()
12656        ///     .set_psc_auto_connections([
12657        ///         PscAutoConnectionConfig::default()/* use setters */,
12658        ///         PscAutoConnectionConfig::default()/* use (different) setters */,
12659        ///     ]);
12660        /// ```
12661        pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
12662        where
12663            T: std::iter::IntoIterator<Item = V>,
12664            V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
12665        {
12666            use std::iter::Iterator;
12667            self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
12668            self
12669        }
12670    }
12671
12672    impl wkt::message::Message for PoolNodeConfig {
12673        fn typename() -> &'static str {
12674            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig"
12675        }
12676    }
12677
12678    /// The current serving state of the database instance.
12679    ///
12680    /// # Working with unknown values
12681    ///
12682    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12683    /// additional enum variants at any time. Adding new variants is not considered
12684    /// a breaking change. Applications should write their code in anticipation of:
12685    ///
12686    /// - New values appearing in future releases of the client library, **and**
12687    /// - New values received dynamically, without application changes.
12688    ///
12689    /// Please consult the [Working with enums] section in the user guide for some
12690    /// guidelines.
12691    ///
12692    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12693    #[derive(Clone, Debug, PartialEq)]
12694    #[non_exhaustive]
12695    pub enum SqlInstanceState {
12696        /// The state of the instance is unknown.
12697        Unspecified,
12698        /// The instance is running, or has been stopped by owner.
12699        Runnable,
12700        /// The instance is not available, for example due to problems with billing.
12701        Suspended,
12702        /// The instance is being deleted.
12703        PendingDelete,
12704        /// The instance is being created.
12705        PendingCreate,
12706        /// The instance is down for maintenance.
12707        Maintenance,
12708        /// The creation of the instance failed or a fatal error occurred during
12709        /// maintenance.
12710        Failed,
12711        /// Deprecated
12712        #[deprecated]
12713        OnlineMaintenance,
12714        /// (Applicable to read pool nodes only.) The read pool node needs to be
12715        /// repaired. The database might be unavailable.
12716        Repairing,
12717        /// If set, the enum was initialized with an unknown value.
12718        ///
12719        /// Applications can examine the value using [SqlInstanceState::value] or
12720        /// [SqlInstanceState::name].
12721        UnknownValue(sql_instance_state::UnknownValue),
12722    }
12723
12724    #[doc(hidden)]
12725    pub mod sql_instance_state {
12726        #[allow(unused_imports)]
12727        use super::*;
12728        #[derive(Clone, Debug, PartialEq)]
12729        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12730    }
12731
12732    impl SqlInstanceState {
12733        /// Gets the enum value.
12734        ///
12735        /// Returns `None` if the enum contains an unknown value deserialized from
12736        /// the string representation of enums.
12737        pub fn value(&self) -> std::option::Option<i32> {
12738            match self {
12739                Self::Unspecified => std::option::Option::Some(0),
12740                Self::Runnable => std::option::Option::Some(1),
12741                Self::Suspended => std::option::Option::Some(2),
12742                Self::PendingDelete => std::option::Option::Some(3),
12743                Self::PendingCreate => std::option::Option::Some(4),
12744                Self::Maintenance => std::option::Option::Some(5),
12745                Self::Failed => std::option::Option::Some(6),
12746                Self::OnlineMaintenance => std::option::Option::Some(7),
12747                Self::Repairing => std::option::Option::Some(8),
12748                Self::UnknownValue(u) => u.0.value(),
12749            }
12750        }
12751
12752        /// Gets the enum value as a string.
12753        ///
12754        /// Returns `None` if the enum contains an unknown value deserialized from
12755        /// the integer representation of enums.
12756        pub fn name(&self) -> std::option::Option<&str> {
12757            match self {
12758                Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_STATE_UNSPECIFIED"),
12759                Self::Runnable => std::option::Option::Some("RUNNABLE"),
12760                Self::Suspended => std::option::Option::Some("SUSPENDED"),
12761                Self::PendingDelete => std::option::Option::Some("PENDING_DELETE"),
12762                Self::PendingCreate => std::option::Option::Some("PENDING_CREATE"),
12763                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
12764                Self::Failed => std::option::Option::Some("FAILED"),
12765                Self::OnlineMaintenance => std::option::Option::Some("ONLINE_MAINTENANCE"),
12766                Self::Repairing => std::option::Option::Some("REPAIRING"),
12767                Self::UnknownValue(u) => u.0.name(),
12768            }
12769        }
12770    }
12771
12772    impl std::default::Default for SqlInstanceState {
12773        fn default() -> Self {
12774            use std::convert::From;
12775            Self::from(0)
12776        }
12777    }
12778
12779    impl std::fmt::Display for SqlInstanceState {
12780        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12781            wkt::internal::display_enum(f, self.name(), self.value())
12782        }
12783    }
12784
12785    impl std::convert::From<i32> for SqlInstanceState {
12786        fn from(value: i32) -> Self {
12787            match value {
12788                0 => Self::Unspecified,
12789                1 => Self::Runnable,
12790                2 => Self::Suspended,
12791                3 => Self::PendingDelete,
12792                4 => Self::PendingCreate,
12793                5 => Self::Maintenance,
12794                6 => Self::Failed,
12795                7 => Self::OnlineMaintenance,
12796                8 => Self::Repairing,
12797                _ => Self::UnknownValue(sql_instance_state::UnknownValue(
12798                    wkt::internal::UnknownEnumValue::Integer(value),
12799                )),
12800            }
12801        }
12802    }
12803
12804    impl std::convert::From<&str> for SqlInstanceState {
12805        fn from(value: &str) -> Self {
12806            use std::string::ToString;
12807            match value {
12808                "SQL_INSTANCE_STATE_UNSPECIFIED" => Self::Unspecified,
12809                "RUNNABLE" => Self::Runnable,
12810                "SUSPENDED" => Self::Suspended,
12811                "PENDING_DELETE" => Self::PendingDelete,
12812                "PENDING_CREATE" => Self::PendingCreate,
12813                "MAINTENANCE" => Self::Maintenance,
12814                "FAILED" => Self::Failed,
12815                "ONLINE_MAINTENANCE" => Self::OnlineMaintenance,
12816                "REPAIRING" => Self::Repairing,
12817                _ => Self::UnknownValue(sql_instance_state::UnknownValue(
12818                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12819                )),
12820            }
12821        }
12822    }
12823
12824    impl serde::ser::Serialize for SqlInstanceState {
12825        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12826        where
12827            S: serde::Serializer,
12828        {
12829            match self {
12830                Self::Unspecified => serializer.serialize_i32(0),
12831                Self::Runnable => serializer.serialize_i32(1),
12832                Self::Suspended => serializer.serialize_i32(2),
12833                Self::PendingDelete => serializer.serialize_i32(3),
12834                Self::PendingCreate => serializer.serialize_i32(4),
12835                Self::Maintenance => serializer.serialize_i32(5),
12836                Self::Failed => serializer.serialize_i32(6),
12837                Self::OnlineMaintenance => serializer.serialize_i32(7),
12838                Self::Repairing => serializer.serialize_i32(8),
12839                Self::UnknownValue(u) => u.0.serialize(serializer),
12840            }
12841        }
12842    }
12843
12844    impl<'de> serde::de::Deserialize<'de> for SqlInstanceState {
12845        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12846        where
12847            D: serde::Deserializer<'de>,
12848        {
12849            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceState>::new(
12850                ".google.cloud.sql.v1.DatabaseInstance.SqlInstanceState",
12851            ))
12852        }
12853    }
12854
12855    /// The SQL network architecture for the instance.
12856    ///
12857    /// # Working with unknown values
12858    ///
12859    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12860    /// additional enum variants at any time. Adding new variants is not considered
12861    /// a breaking change. Applications should write their code in anticipation of:
12862    ///
12863    /// - New values appearing in future releases of the client library, **and**
12864    /// - New values received dynamically, without application changes.
12865    ///
12866    /// Please consult the [Working with enums] section in the user guide for some
12867    /// guidelines.
12868    ///
12869    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12870    #[derive(Clone, Debug, PartialEq)]
12871    #[non_exhaustive]
12872    pub enum SqlNetworkArchitecture {
12873        Unspecified,
12874        /// The instance uses the new network architecture.
12875        NewNetworkArchitecture,
12876        /// The instance uses the old network architecture.
12877        OldNetworkArchitecture,
12878        /// If set, the enum was initialized with an unknown value.
12879        ///
12880        /// Applications can examine the value using [SqlNetworkArchitecture::value] or
12881        /// [SqlNetworkArchitecture::name].
12882        UnknownValue(sql_network_architecture::UnknownValue),
12883    }
12884
12885    #[doc(hidden)]
12886    pub mod sql_network_architecture {
12887        #[allow(unused_imports)]
12888        use super::*;
12889        #[derive(Clone, Debug, PartialEq)]
12890        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12891    }
12892
12893    impl SqlNetworkArchitecture {
12894        /// Gets the enum value.
12895        ///
12896        /// Returns `None` if the enum contains an unknown value deserialized from
12897        /// the string representation of enums.
12898        pub fn value(&self) -> std::option::Option<i32> {
12899            match self {
12900                Self::Unspecified => std::option::Option::Some(0),
12901                Self::NewNetworkArchitecture => std::option::Option::Some(1),
12902                Self::OldNetworkArchitecture => std::option::Option::Some(2),
12903                Self::UnknownValue(u) => u.0.value(),
12904            }
12905        }
12906
12907        /// Gets the enum value as a string.
12908        ///
12909        /// Returns `None` if the enum contains an unknown value deserialized from
12910        /// the integer representation of enums.
12911        pub fn name(&self) -> std::option::Option<&str> {
12912            match self {
12913                Self::Unspecified => {
12914                    std::option::Option::Some("SQL_NETWORK_ARCHITECTURE_UNSPECIFIED")
12915                }
12916                Self::NewNetworkArchitecture => {
12917                    std::option::Option::Some("NEW_NETWORK_ARCHITECTURE")
12918                }
12919                Self::OldNetworkArchitecture => {
12920                    std::option::Option::Some("OLD_NETWORK_ARCHITECTURE")
12921                }
12922                Self::UnknownValue(u) => u.0.name(),
12923            }
12924        }
12925    }
12926
12927    impl std::default::Default for SqlNetworkArchitecture {
12928        fn default() -> Self {
12929            use std::convert::From;
12930            Self::from(0)
12931        }
12932    }
12933
12934    impl std::fmt::Display for SqlNetworkArchitecture {
12935        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12936            wkt::internal::display_enum(f, self.name(), self.value())
12937        }
12938    }
12939
12940    impl std::convert::From<i32> for SqlNetworkArchitecture {
12941        fn from(value: i32) -> Self {
12942            match value {
12943                0 => Self::Unspecified,
12944                1 => Self::NewNetworkArchitecture,
12945                2 => Self::OldNetworkArchitecture,
12946                _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
12947                    wkt::internal::UnknownEnumValue::Integer(value),
12948                )),
12949            }
12950        }
12951    }
12952
12953    impl std::convert::From<&str> for SqlNetworkArchitecture {
12954        fn from(value: &str) -> Self {
12955            use std::string::ToString;
12956            match value {
12957                "SQL_NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
12958                "NEW_NETWORK_ARCHITECTURE" => Self::NewNetworkArchitecture,
12959                "OLD_NETWORK_ARCHITECTURE" => Self::OldNetworkArchitecture,
12960                _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
12961                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12962                )),
12963            }
12964        }
12965    }
12966
12967    impl serde::ser::Serialize for SqlNetworkArchitecture {
12968        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12969        where
12970            S: serde::Serializer,
12971        {
12972            match self {
12973                Self::Unspecified => serializer.serialize_i32(0),
12974                Self::NewNetworkArchitecture => serializer.serialize_i32(1),
12975                Self::OldNetworkArchitecture => serializer.serialize_i32(2),
12976                Self::UnknownValue(u) => u.0.serialize(serializer),
12977            }
12978        }
12979    }
12980
12981    impl<'de> serde::de::Deserialize<'de> for SqlNetworkArchitecture {
12982        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12983        where
12984            D: serde::Deserializer<'de>,
12985        {
12986            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlNetworkArchitecture>::new(
12987                ".google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture",
12988            ))
12989        }
12990    }
12991}
12992
12993/// Gemini instance configuration.
12994#[derive(Clone, Default, PartialEq)]
12995#[non_exhaustive]
12996pub struct GeminiInstanceConfig {
12997    /// Output only. Whether Gemini is enabled.
12998    pub entitled: std::option::Option<bool>,
12999
13000    /// Output only. Whether the vacuum management is enabled.
13001    pub google_vacuum_mgmt_enabled: std::option::Option<bool>,
13002
13003    /// Output only. Whether canceling the out-of-memory (OOM) session is enabled.
13004    pub oom_session_cancel_enabled: std::option::Option<bool>,
13005
13006    /// Output only. Whether the active query is enabled.
13007    pub active_query_enabled: std::option::Option<bool>,
13008
13009    /// Output only. Whether the index advisor is enabled.
13010    pub index_advisor_enabled: std::option::Option<bool>,
13011
13012    /// Output only. Whether the flag recommender is enabled.
13013    pub flag_recommender_enabled: std::option::Option<bool>,
13014
13015    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13016}
13017
13018impl GeminiInstanceConfig {
13019    pub fn new() -> Self {
13020        std::default::Default::default()
13021    }
13022
13023    /// Sets the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
13024    ///
13025    /// # Example
13026    /// ```ignore,no_run
13027    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13028    /// let x = GeminiInstanceConfig::new().set_entitled(true);
13029    /// ```
13030    pub fn set_entitled<T>(mut self, v: T) -> Self
13031    where
13032        T: std::convert::Into<bool>,
13033    {
13034        self.entitled = std::option::Option::Some(v.into());
13035        self
13036    }
13037
13038    /// Sets or clears the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
13039    ///
13040    /// # Example
13041    /// ```ignore,no_run
13042    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13043    /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(Some(false));
13044    /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(None::<bool>);
13045    /// ```
13046    pub fn set_or_clear_entitled<T>(mut self, v: std::option::Option<T>) -> Self
13047    where
13048        T: std::convert::Into<bool>,
13049    {
13050        self.entitled = v.map(|x| x.into());
13051        self
13052    }
13053
13054    /// Sets the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
13055    ///
13056    /// # Example
13057    /// ```ignore,no_run
13058    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13059    /// let x = GeminiInstanceConfig::new().set_google_vacuum_mgmt_enabled(true);
13060    /// ```
13061    pub fn set_google_vacuum_mgmt_enabled<T>(mut self, v: T) -> Self
13062    where
13063        T: std::convert::Into<bool>,
13064    {
13065        self.google_vacuum_mgmt_enabled = std::option::Option::Some(v.into());
13066        self
13067    }
13068
13069    /// Sets or clears the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
13070    ///
13071    /// # Example
13072    /// ```ignore,no_run
13073    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13074    /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(Some(false));
13075    /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(None::<bool>);
13076    /// ```
13077    pub fn set_or_clear_google_vacuum_mgmt_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13078    where
13079        T: std::convert::Into<bool>,
13080    {
13081        self.google_vacuum_mgmt_enabled = v.map(|x| x.into());
13082        self
13083    }
13084
13085    /// Sets the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
13086    ///
13087    /// # Example
13088    /// ```ignore,no_run
13089    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13090    /// let x = GeminiInstanceConfig::new().set_oom_session_cancel_enabled(true);
13091    /// ```
13092    pub fn set_oom_session_cancel_enabled<T>(mut self, v: T) -> Self
13093    where
13094        T: std::convert::Into<bool>,
13095    {
13096        self.oom_session_cancel_enabled = std::option::Option::Some(v.into());
13097        self
13098    }
13099
13100    /// Sets or clears the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
13101    ///
13102    /// # Example
13103    /// ```ignore,no_run
13104    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13105    /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(Some(false));
13106    /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(None::<bool>);
13107    /// ```
13108    pub fn set_or_clear_oom_session_cancel_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13109    where
13110        T: std::convert::Into<bool>,
13111    {
13112        self.oom_session_cancel_enabled = v.map(|x| x.into());
13113        self
13114    }
13115
13116    /// Sets the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
13117    ///
13118    /// # Example
13119    /// ```ignore,no_run
13120    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13121    /// let x = GeminiInstanceConfig::new().set_active_query_enabled(true);
13122    /// ```
13123    pub fn set_active_query_enabled<T>(mut self, v: T) -> Self
13124    where
13125        T: std::convert::Into<bool>,
13126    {
13127        self.active_query_enabled = std::option::Option::Some(v.into());
13128        self
13129    }
13130
13131    /// Sets or clears the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
13132    ///
13133    /// # Example
13134    /// ```ignore,no_run
13135    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13136    /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(Some(false));
13137    /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(None::<bool>);
13138    /// ```
13139    pub fn set_or_clear_active_query_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13140    where
13141        T: std::convert::Into<bool>,
13142    {
13143        self.active_query_enabled = v.map(|x| x.into());
13144        self
13145    }
13146
13147    /// Sets the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
13148    ///
13149    /// # Example
13150    /// ```ignore,no_run
13151    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13152    /// let x = GeminiInstanceConfig::new().set_index_advisor_enabled(true);
13153    /// ```
13154    pub fn set_index_advisor_enabled<T>(mut self, v: T) -> Self
13155    where
13156        T: std::convert::Into<bool>,
13157    {
13158        self.index_advisor_enabled = std::option::Option::Some(v.into());
13159        self
13160    }
13161
13162    /// Sets or clears the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
13163    ///
13164    /// # Example
13165    /// ```ignore,no_run
13166    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13167    /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(Some(false));
13168    /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(None::<bool>);
13169    /// ```
13170    pub fn set_or_clear_index_advisor_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13171    where
13172        T: std::convert::Into<bool>,
13173    {
13174        self.index_advisor_enabled = v.map(|x| x.into());
13175        self
13176    }
13177
13178    /// Sets the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
13179    ///
13180    /// # Example
13181    /// ```ignore,no_run
13182    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13183    /// let x = GeminiInstanceConfig::new().set_flag_recommender_enabled(true);
13184    /// ```
13185    pub fn set_flag_recommender_enabled<T>(mut self, v: T) -> Self
13186    where
13187        T: std::convert::Into<bool>,
13188    {
13189        self.flag_recommender_enabled = std::option::Option::Some(v.into());
13190        self
13191    }
13192
13193    /// Sets or clears the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
13194    ///
13195    /// # Example
13196    /// ```ignore,no_run
13197    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13198    /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(Some(false));
13199    /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(None::<bool>);
13200    /// ```
13201    pub fn set_or_clear_flag_recommender_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13202    where
13203        T: std::convert::Into<bool>,
13204    {
13205        self.flag_recommender_enabled = v.map(|x| x.into());
13206        self
13207    }
13208}
13209
13210impl wkt::message::Message for GeminiInstanceConfig {
13211    fn typename() -> &'static str {
13212        "type.googleapis.com/google.cloud.sql.v1.GeminiInstanceConfig"
13213    }
13214}
13215
13216/// A primary instance and disaster recovery (DR) replica pair.
13217/// A DR replica is a cross-region replica that you designate for failover in
13218/// the event that the primary instance experiences regional failure.
13219/// Applicable to MySQL and PostgreSQL.
13220#[derive(Clone, Default, PartialEq)]
13221#[non_exhaustive]
13222pub struct ReplicationCluster {
13223    /// Output only. If set, this field indicates this instance has a private
13224    /// service access (PSA) DNS endpoint that is pointing to the primary instance
13225    /// of the cluster. If this instance is the primary, then the DNS endpoint
13226    /// points to this instance. After a switchover or replica failover operation,
13227    /// this DNS endpoint points to the promoted instance. This is a read-only
13228    /// field, returned to the user as information. This field can exist even if a
13229    /// standalone instance doesn't have a DR replica yet or the DR replica is
13230    /// deleted.
13231    pub psa_write_endpoint: std::string::String,
13232
13233    /// Optional. If the instance is a primary instance, then this field identifies
13234    /// the disaster recovery (DR) replica. A DR replica is an optional
13235    /// configuration for Enterprise Plus edition instances. If the instance is a
13236    /// read replica, then the field is not set. Set this field to a replica name
13237    /// to designate a DR replica for a primary instance. Remove the replica name
13238    /// to remove the DR replica designation.
13239    pub failover_dr_replica_name: std::string::String,
13240
13241    /// Output only. Read-only field that indicates whether the replica is a DR
13242    /// replica. This field is not set if the instance is a primary instance.
13243    pub dr_replica: bool,
13244
13245    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13246}
13247
13248impl ReplicationCluster {
13249    pub fn new() -> Self {
13250        std::default::Default::default()
13251    }
13252
13253    /// Sets the value of [psa_write_endpoint][crate::model::ReplicationCluster::psa_write_endpoint].
13254    ///
13255    /// # Example
13256    /// ```ignore,no_run
13257    /// # use google_cloud_sql_v1::model::ReplicationCluster;
13258    /// let x = ReplicationCluster::new().set_psa_write_endpoint("example");
13259    /// ```
13260    pub fn set_psa_write_endpoint<T: std::convert::Into<std::string::String>>(
13261        mut self,
13262        v: T,
13263    ) -> Self {
13264        self.psa_write_endpoint = v.into();
13265        self
13266    }
13267
13268    /// Sets the value of [failover_dr_replica_name][crate::model::ReplicationCluster::failover_dr_replica_name].
13269    ///
13270    /// # Example
13271    /// ```ignore,no_run
13272    /// # use google_cloud_sql_v1::model::ReplicationCluster;
13273    /// let x = ReplicationCluster::new().set_failover_dr_replica_name("example");
13274    /// ```
13275    pub fn set_failover_dr_replica_name<T: std::convert::Into<std::string::String>>(
13276        mut self,
13277        v: T,
13278    ) -> Self {
13279        self.failover_dr_replica_name = v.into();
13280        self
13281    }
13282
13283    /// Sets the value of [dr_replica][crate::model::ReplicationCluster::dr_replica].
13284    ///
13285    /// # Example
13286    /// ```ignore,no_run
13287    /// # use google_cloud_sql_v1::model::ReplicationCluster;
13288    /// let x = ReplicationCluster::new().set_dr_replica(true);
13289    /// ```
13290    pub fn set_dr_replica<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13291        self.dr_replica = v.into();
13292        self
13293    }
13294}
13295
13296impl wkt::message::Message for ReplicationCluster {
13297    fn typename() -> &'static str {
13298        "type.googleapis.com/google.cloud.sql.v1.ReplicationCluster"
13299    }
13300}
13301
13302/// An available database version. It can be a major or a minor version.
13303#[derive(Clone, Default, PartialEq)]
13304#[non_exhaustive]
13305pub struct AvailableDatabaseVersion {
13306    /// The version's major version name.
13307    pub major_version: std::option::Option<std::string::String>,
13308
13309    /// The database version name. For MySQL 8.0, this string provides the database
13310    /// major and minor version.
13311    pub name: std::option::Option<std::string::String>,
13312
13313    /// The database version's display name.
13314    pub display_name: std::option::Option<std::string::String>,
13315
13316    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13317}
13318
13319impl AvailableDatabaseVersion {
13320    pub fn new() -> Self {
13321        std::default::Default::default()
13322    }
13323
13324    /// Sets the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
13325    ///
13326    /// # Example
13327    /// ```ignore,no_run
13328    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13329    /// let x = AvailableDatabaseVersion::new().set_major_version("example");
13330    /// ```
13331    pub fn set_major_version<T>(mut self, v: T) -> Self
13332    where
13333        T: std::convert::Into<std::string::String>,
13334    {
13335        self.major_version = std::option::Option::Some(v.into());
13336        self
13337    }
13338
13339    /// Sets or clears the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
13340    ///
13341    /// # Example
13342    /// ```ignore,no_run
13343    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13344    /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(Some("example"));
13345    /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(None::<String>);
13346    /// ```
13347    pub fn set_or_clear_major_version<T>(mut self, v: std::option::Option<T>) -> Self
13348    where
13349        T: std::convert::Into<std::string::String>,
13350    {
13351        self.major_version = v.map(|x| x.into());
13352        self
13353    }
13354
13355    /// Sets the value of [name][crate::model::AvailableDatabaseVersion::name].
13356    ///
13357    /// # Example
13358    /// ```ignore,no_run
13359    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13360    /// let x = AvailableDatabaseVersion::new().set_name("example");
13361    /// ```
13362    pub fn set_name<T>(mut self, v: T) -> Self
13363    where
13364        T: std::convert::Into<std::string::String>,
13365    {
13366        self.name = std::option::Option::Some(v.into());
13367        self
13368    }
13369
13370    /// Sets or clears the value of [name][crate::model::AvailableDatabaseVersion::name].
13371    ///
13372    /// # Example
13373    /// ```ignore,no_run
13374    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13375    /// let x = AvailableDatabaseVersion::new().set_or_clear_name(Some("example"));
13376    /// let x = AvailableDatabaseVersion::new().set_or_clear_name(None::<String>);
13377    /// ```
13378    pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
13379    where
13380        T: std::convert::Into<std::string::String>,
13381    {
13382        self.name = v.map(|x| x.into());
13383        self
13384    }
13385
13386    /// Sets the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
13387    ///
13388    /// # Example
13389    /// ```ignore,no_run
13390    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13391    /// let x = AvailableDatabaseVersion::new().set_display_name("example");
13392    /// ```
13393    pub fn set_display_name<T>(mut self, v: T) -> Self
13394    where
13395        T: std::convert::Into<std::string::String>,
13396    {
13397        self.display_name = std::option::Option::Some(v.into());
13398        self
13399    }
13400
13401    /// Sets or clears the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
13402    ///
13403    /// # Example
13404    /// ```ignore,no_run
13405    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13406    /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(Some("example"));
13407    /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(None::<String>);
13408    /// ```
13409    pub fn set_or_clear_display_name<T>(mut self, v: std::option::Option<T>) -> Self
13410    where
13411        T: std::convert::Into<std::string::String>,
13412    {
13413        self.display_name = v.map(|x| x.into());
13414        self
13415    }
13416}
13417
13418impl wkt::message::Message for AvailableDatabaseVersion {
13419    fn typename() -> &'static str {
13420        "type.googleapis.com/google.cloud.sql.v1.AvailableDatabaseVersion"
13421    }
13422}
13423
13424/// Reschedule options for maintenance windows.
13425#[derive(Clone, Default, PartialEq)]
13426#[non_exhaustive]
13427pub struct SqlInstancesRescheduleMaintenanceRequestBody {
13428    /// Required. The type of the reschedule the user wants.
13429    pub reschedule: std::option::Option<
13430        crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13431    >,
13432
13433    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13434}
13435
13436impl SqlInstancesRescheduleMaintenanceRequestBody {
13437    pub fn new() -> Self {
13438        std::default::Default::default()
13439    }
13440
13441    /// Sets the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
13442    ///
13443    /// # Example
13444    /// ```ignore,no_run
13445    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
13446    /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13447    /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_reschedule(Reschedule::default()/* use setters */);
13448    /// ```
13449    pub fn set_reschedule<T>(mut self, v: T) -> Self
13450    where
13451        T: std::convert::Into<
13452                crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13453            >,
13454    {
13455        self.reschedule = std::option::Option::Some(v.into());
13456        self
13457    }
13458
13459    /// Sets or clears the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
13460    ///
13461    /// # Example
13462    /// ```ignore,no_run
13463    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
13464    /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13465    /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(Some(Reschedule::default()/* use setters */));
13466    /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(None::<Reschedule>);
13467    /// ```
13468    pub fn set_or_clear_reschedule<T>(mut self, v: std::option::Option<T>) -> Self
13469    where
13470        T: std::convert::Into<
13471                crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13472            >,
13473    {
13474        self.reschedule = v.map(|x| x.into());
13475        self
13476    }
13477}
13478
13479impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequestBody {
13480    fn typename() -> &'static str {
13481        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody"
13482    }
13483}
13484
13485/// Defines additional types related to [SqlInstancesRescheduleMaintenanceRequestBody].
13486pub mod sql_instances_reschedule_maintenance_request_body {
13487    #[allow(unused_imports)]
13488    use super::*;
13489
13490    #[derive(Clone, Default, PartialEq)]
13491    #[non_exhaustive]
13492    pub struct Reschedule {
13493        /// Required. The type of the reschedule.
13494        pub reschedule_type:
13495            crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
13496
13497        /// Optional. Timestamp when the maintenance shall be rescheduled to if
13498        /// reschedule_type=SPECIFIC_TIME, in
13499        /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
13500        /// `2012-11-15T16:19:00.094Z`.
13501        pub schedule_time: std::option::Option<wkt::Timestamp>,
13502
13503        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13504    }
13505
13506    impl Reschedule {
13507        pub fn new() -> Self {
13508            std::default::Default::default()
13509        }
13510
13511        /// Sets the value of [reschedule_type][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::reschedule_type].
13512        ///
13513        /// # Example
13514        /// ```ignore,no_run
13515        /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13516        /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::RescheduleType;
13517        /// let x0 = Reschedule::new().set_reschedule_type(RescheduleType::Immediate);
13518        /// let x1 = Reschedule::new().set_reschedule_type(RescheduleType::NextAvailableWindow);
13519        /// let x2 = Reschedule::new().set_reschedule_type(RescheduleType::SpecificTime);
13520        /// ```
13521        pub fn set_reschedule_type<
13522            T: std::convert::Into<
13523                    crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
13524                >,
13525        >(
13526            mut self,
13527            v: T,
13528        ) -> Self {
13529            self.reschedule_type = v.into();
13530            self
13531        }
13532
13533        /// Sets the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
13534        ///
13535        /// # Example
13536        /// ```ignore,no_run
13537        /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13538        /// use wkt::Timestamp;
13539        /// let x = Reschedule::new().set_schedule_time(Timestamp::default()/* use setters */);
13540        /// ```
13541        pub fn set_schedule_time<T>(mut self, v: T) -> Self
13542        where
13543            T: std::convert::Into<wkt::Timestamp>,
13544        {
13545            self.schedule_time = std::option::Option::Some(v.into());
13546            self
13547        }
13548
13549        /// Sets or clears the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
13550        ///
13551        /// # Example
13552        /// ```ignore,no_run
13553        /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13554        /// use wkt::Timestamp;
13555        /// let x = Reschedule::new().set_or_clear_schedule_time(Some(Timestamp::default()/* use setters */));
13556        /// let x = Reschedule::new().set_or_clear_schedule_time(None::<Timestamp>);
13557        /// ```
13558        pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
13559        where
13560            T: std::convert::Into<wkt::Timestamp>,
13561        {
13562            self.schedule_time = v.map(|x| x.into());
13563            self
13564        }
13565    }
13566
13567    impl wkt::message::Message for Reschedule {
13568        fn typename() -> &'static str {
13569            "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule"
13570        }
13571    }
13572
13573    ///
13574    /// # Working with unknown values
13575    ///
13576    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13577    /// additional enum variants at any time. Adding new variants is not considered
13578    /// a breaking change. Applications should write their code in anticipation of:
13579    ///
13580    /// - New values appearing in future releases of the client library, **and**
13581    /// - New values received dynamically, without application changes.
13582    ///
13583    /// Please consult the [Working with enums] section in the user guide for some
13584    /// guidelines.
13585    ///
13586    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13587    #[derive(Clone, Debug, PartialEq)]
13588    #[non_exhaustive]
13589    pub enum RescheduleType {
13590        Unspecified,
13591        /// Reschedules maintenance to happen now (within 5 minutes).
13592        Immediate,
13593        /// Reschedules maintenance to occur within one week from the originally
13594        /// scheduled day and time.
13595        NextAvailableWindow,
13596        /// Reschedules maintenance to a specific time and day.
13597        SpecificTime,
13598        /// If set, the enum was initialized with an unknown value.
13599        ///
13600        /// Applications can examine the value using [RescheduleType::value] or
13601        /// [RescheduleType::name].
13602        UnknownValue(reschedule_type::UnknownValue),
13603    }
13604
13605    #[doc(hidden)]
13606    pub mod reschedule_type {
13607        #[allow(unused_imports)]
13608        use super::*;
13609        #[derive(Clone, Debug, PartialEq)]
13610        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13611    }
13612
13613    impl RescheduleType {
13614        /// Gets the enum value.
13615        ///
13616        /// Returns `None` if the enum contains an unknown value deserialized from
13617        /// the string representation of enums.
13618        pub fn value(&self) -> std::option::Option<i32> {
13619            match self {
13620                Self::Unspecified => std::option::Option::Some(0),
13621                Self::Immediate => std::option::Option::Some(1),
13622                Self::NextAvailableWindow => std::option::Option::Some(2),
13623                Self::SpecificTime => std::option::Option::Some(3),
13624                Self::UnknownValue(u) => u.0.value(),
13625            }
13626        }
13627
13628        /// Gets the enum value as a string.
13629        ///
13630        /// Returns `None` if the enum contains an unknown value deserialized from
13631        /// the integer representation of enums.
13632        pub fn name(&self) -> std::option::Option<&str> {
13633            match self {
13634                Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
13635                Self::Immediate => std::option::Option::Some("IMMEDIATE"),
13636                Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
13637                Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
13638                Self::UnknownValue(u) => u.0.name(),
13639            }
13640        }
13641    }
13642
13643    impl std::default::Default for RescheduleType {
13644        fn default() -> Self {
13645            use std::convert::From;
13646            Self::from(0)
13647        }
13648    }
13649
13650    impl std::fmt::Display for RescheduleType {
13651        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13652            wkt::internal::display_enum(f, self.name(), self.value())
13653        }
13654    }
13655
13656    impl std::convert::From<i32> for RescheduleType {
13657        fn from(value: i32) -> Self {
13658            match value {
13659                0 => Self::Unspecified,
13660                1 => Self::Immediate,
13661                2 => Self::NextAvailableWindow,
13662                3 => Self::SpecificTime,
13663                _ => Self::UnknownValue(reschedule_type::UnknownValue(
13664                    wkt::internal::UnknownEnumValue::Integer(value),
13665                )),
13666            }
13667        }
13668    }
13669
13670    impl std::convert::From<&str> for RescheduleType {
13671        fn from(value: &str) -> Self {
13672            use std::string::ToString;
13673            match value {
13674                "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
13675                "IMMEDIATE" => Self::Immediate,
13676                "NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
13677                "SPECIFIC_TIME" => Self::SpecificTime,
13678                _ => Self::UnknownValue(reschedule_type::UnknownValue(
13679                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13680                )),
13681            }
13682        }
13683    }
13684
13685    impl serde::ser::Serialize for RescheduleType {
13686        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13687        where
13688            S: serde::Serializer,
13689        {
13690            match self {
13691                Self::Unspecified => serializer.serialize_i32(0),
13692                Self::Immediate => serializer.serialize_i32(1),
13693                Self::NextAvailableWindow => serializer.serialize_i32(2),
13694                Self::SpecificTime => serializer.serialize_i32(3),
13695                Self::UnknownValue(u) => u.0.serialize(serializer),
13696            }
13697        }
13698    }
13699
13700    impl<'de> serde::de::Deserialize<'de> for RescheduleType {
13701        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13702        where
13703            D: serde::Deserializer<'de>,
13704        {
13705            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
13706                ".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType",
13707            ))
13708        }
13709    }
13710}
13711
13712/// Database instance demote primary instance context.
13713#[derive(Clone, Default, PartialEq)]
13714#[non_exhaustive]
13715pub struct DemoteMasterContext {
13716    /// This is always `sql#demoteMasterContext`.
13717    pub kind: std::string::String,
13718
13719    /// Verify the GTID consistency for demote operation. Default value:
13720    /// `True`. Setting this flag to `false` enables you to bypass the GTID
13721    /// consistency check between on-premises primary instance and Cloud SQL
13722    /// instance during the demotion operation but also exposes you to the risk of
13723    /// future replication failures. Change the value only if you know the reason
13724    /// for the GTID divergence and are confident that doing so will not cause any
13725    /// replication issues.
13726    pub verify_gtid_consistency: std::option::Option<wkt::BoolValue>,
13727
13728    /// The name of the instance which will act as on-premises primary instance
13729    /// in the replication setup.
13730    pub master_instance_name: std::string::String,
13731
13732    /// Configuration specific to read-replicas replicating from the on-premises
13733    /// primary instance.
13734    pub replica_configuration: std::option::Option<crate::model::DemoteMasterConfiguration>,
13735
13736    /// Flag to skip replication setup on the instance.
13737    pub skip_replication_setup: bool,
13738
13739    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13740}
13741
13742impl DemoteMasterContext {
13743    pub fn new() -> Self {
13744        std::default::Default::default()
13745    }
13746
13747    /// Sets the value of [kind][crate::model::DemoteMasterContext::kind].
13748    ///
13749    /// # Example
13750    /// ```ignore,no_run
13751    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13752    /// let x = DemoteMasterContext::new().set_kind("example");
13753    /// ```
13754    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13755        self.kind = v.into();
13756        self
13757    }
13758
13759    /// Sets the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
13760    ///
13761    /// # Example
13762    /// ```ignore,no_run
13763    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13764    /// use wkt::BoolValue;
13765    /// let x = DemoteMasterContext::new().set_verify_gtid_consistency(BoolValue::default()/* use setters */);
13766    /// ```
13767    pub fn set_verify_gtid_consistency<T>(mut self, v: T) -> Self
13768    where
13769        T: std::convert::Into<wkt::BoolValue>,
13770    {
13771        self.verify_gtid_consistency = std::option::Option::Some(v.into());
13772        self
13773    }
13774
13775    /// Sets or clears the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
13776    ///
13777    /// # Example
13778    /// ```ignore,no_run
13779    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13780    /// use wkt::BoolValue;
13781    /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(Some(BoolValue::default()/* use setters */));
13782    /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(None::<BoolValue>);
13783    /// ```
13784    pub fn set_or_clear_verify_gtid_consistency<T>(mut self, v: std::option::Option<T>) -> Self
13785    where
13786        T: std::convert::Into<wkt::BoolValue>,
13787    {
13788        self.verify_gtid_consistency = v.map(|x| x.into());
13789        self
13790    }
13791
13792    /// Sets the value of [master_instance_name][crate::model::DemoteMasterContext::master_instance_name].
13793    ///
13794    /// # Example
13795    /// ```ignore,no_run
13796    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13797    /// let x = DemoteMasterContext::new().set_master_instance_name("example");
13798    /// ```
13799    pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
13800        mut self,
13801        v: T,
13802    ) -> Self {
13803        self.master_instance_name = v.into();
13804        self
13805    }
13806
13807    /// Sets the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
13808    ///
13809    /// # Example
13810    /// ```ignore,no_run
13811    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13812    /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
13813    /// let x = DemoteMasterContext::new().set_replica_configuration(DemoteMasterConfiguration::default()/* use setters */);
13814    /// ```
13815    pub fn set_replica_configuration<T>(mut self, v: T) -> Self
13816    where
13817        T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
13818    {
13819        self.replica_configuration = std::option::Option::Some(v.into());
13820        self
13821    }
13822
13823    /// Sets or clears the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
13824    ///
13825    /// # Example
13826    /// ```ignore,no_run
13827    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13828    /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
13829    /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(Some(DemoteMasterConfiguration::default()/* use setters */));
13830    /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(None::<DemoteMasterConfiguration>);
13831    /// ```
13832    pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
13833    where
13834        T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
13835    {
13836        self.replica_configuration = v.map(|x| x.into());
13837        self
13838    }
13839
13840    /// Sets the value of [skip_replication_setup][crate::model::DemoteMasterContext::skip_replication_setup].
13841    ///
13842    /// # Example
13843    /// ```ignore,no_run
13844    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13845    /// let x = DemoteMasterContext::new().set_skip_replication_setup(true);
13846    /// ```
13847    pub fn set_skip_replication_setup<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13848        self.skip_replication_setup = v.into();
13849        self
13850    }
13851}
13852
13853impl wkt::message::Message for DemoteMasterContext {
13854    fn typename() -> &'static str {
13855        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterContext"
13856    }
13857}
13858
13859/// This context is used to demote an existing standalone instance to be
13860/// a Cloud SQL read replica for an external database server.
13861#[derive(Clone, Default, PartialEq)]
13862#[non_exhaustive]
13863pub struct DemoteContext {
13864    /// This is always `sql#demoteContext`.
13865    pub kind: std::string::String,
13866
13867    /// Required. The name of the instance which acts as the on-premises primary
13868    /// instance in the replication setup.
13869    pub source_representative_instance_name: std::string::String,
13870
13871    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13872}
13873
13874impl DemoteContext {
13875    pub fn new() -> Self {
13876        std::default::Default::default()
13877    }
13878
13879    /// Sets the value of [kind][crate::model::DemoteContext::kind].
13880    ///
13881    /// # Example
13882    /// ```ignore,no_run
13883    /// # use google_cloud_sql_v1::model::DemoteContext;
13884    /// let x = DemoteContext::new().set_kind("example");
13885    /// ```
13886    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13887        self.kind = v.into();
13888        self
13889    }
13890
13891    /// Sets the value of [source_representative_instance_name][crate::model::DemoteContext::source_representative_instance_name].
13892    ///
13893    /// # Example
13894    /// ```ignore,no_run
13895    /// # use google_cloud_sql_v1::model::DemoteContext;
13896    /// let x = DemoteContext::new().set_source_representative_instance_name("example");
13897    /// ```
13898    pub fn set_source_representative_instance_name<T: std::convert::Into<std::string::String>>(
13899        mut self,
13900        v: T,
13901    ) -> Self {
13902        self.source_representative_instance_name = v.into();
13903        self
13904    }
13905}
13906
13907impl wkt::message::Message for DemoteContext {
13908    fn typename() -> &'static str {
13909        "type.googleapis.com/google.cloud.sql.v1.DemoteContext"
13910    }
13911}
13912
13913/// Database instance failover context.
13914#[derive(Clone, Default, PartialEq)]
13915#[non_exhaustive]
13916pub struct FailoverContext {
13917    /// The current settings version of this instance. Request will be rejected if
13918    /// this version doesn't match the current settings version.
13919    pub settings_version: i64,
13920
13921    /// This is always `sql#failoverContext`.
13922    pub kind: std::string::String,
13923
13924    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13925}
13926
13927impl FailoverContext {
13928    pub fn new() -> Self {
13929        std::default::Default::default()
13930    }
13931
13932    /// Sets the value of [settings_version][crate::model::FailoverContext::settings_version].
13933    ///
13934    /// # Example
13935    /// ```ignore,no_run
13936    /// # use google_cloud_sql_v1::model::FailoverContext;
13937    /// let x = FailoverContext::new().set_settings_version(42);
13938    /// ```
13939    pub fn set_settings_version<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13940        self.settings_version = v.into();
13941        self
13942    }
13943
13944    /// Sets the value of [kind][crate::model::FailoverContext::kind].
13945    ///
13946    /// # Example
13947    /// ```ignore,no_run
13948    /// # use google_cloud_sql_v1::model::FailoverContext;
13949    /// let x = FailoverContext::new().set_kind("example");
13950    /// ```
13951    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13952        self.kind = v.into();
13953        self
13954    }
13955}
13956
13957impl wkt::message::Message for FailoverContext {
13958    fn typename() -> &'static str {
13959        "type.googleapis.com/google.cloud.sql.v1.FailoverContext"
13960    }
13961}
13962
13963/// Database instance restore from backup context.
13964/// Backup context contains source instance id and project id.
13965#[derive(Clone, Default, PartialEq)]
13966#[non_exhaustive]
13967pub struct RestoreBackupContext {
13968    /// This is always `sql#restoreBackupContext`.
13969    pub kind: std::string::String,
13970
13971    /// The ID of the backup run to restore from.
13972    pub backup_run_id: i64,
13973
13974    /// The ID of the instance that the backup was taken from.
13975    pub instance_id: std::string::String,
13976
13977    /// The full project ID of the source instance.
13978    pub project: std::string::String,
13979
13980    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13981}
13982
13983impl RestoreBackupContext {
13984    pub fn new() -> Self {
13985        std::default::Default::default()
13986    }
13987
13988    /// Sets the value of [kind][crate::model::RestoreBackupContext::kind].
13989    ///
13990    /// # Example
13991    /// ```ignore,no_run
13992    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
13993    /// let x = RestoreBackupContext::new().set_kind("example");
13994    /// ```
13995    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13996        self.kind = v.into();
13997        self
13998    }
13999
14000    /// Sets the value of [backup_run_id][crate::model::RestoreBackupContext::backup_run_id].
14001    ///
14002    /// # Example
14003    /// ```ignore,no_run
14004    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14005    /// let x = RestoreBackupContext::new().set_backup_run_id(42);
14006    /// ```
14007    pub fn set_backup_run_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14008        self.backup_run_id = v.into();
14009        self
14010    }
14011
14012    /// Sets the value of [instance_id][crate::model::RestoreBackupContext::instance_id].
14013    ///
14014    /// # Example
14015    /// ```ignore,no_run
14016    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14017    /// let x = RestoreBackupContext::new().set_instance_id("example");
14018    /// ```
14019    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14020        self.instance_id = v.into();
14021        self
14022    }
14023
14024    /// Sets the value of [project][crate::model::RestoreBackupContext::project].
14025    ///
14026    /// # Example
14027    /// ```ignore,no_run
14028    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14029    /// let x = RestoreBackupContext::new().set_project("example");
14030    /// ```
14031    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14032        self.project = v.into();
14033        self
14034    }
14035}
14036
14037impl wkt::message::Message for RestoreBackupContext {
14038    fn typename() -> &'static str {
14039        "type.googleapis.com/google.cloud.sql.v1.RestoreBackupContext"
14040    }
14041}
14042
14043/// Instance rotate server CA context.
14044#[derive(Clone, Default, PartialEq)]
14045#[non_exhaustive]
14046pub struct RotateServerCaContext {
14047    /// This is always `sql#rotateServerCaContext`.
14048    pub kind: std::string::String,
14049
14050    /// The fingerprint of the next version to be rotated to. If left unspecified,
14051    /// will be rotated to the most recently added server CA version.
14052    pub next_version: std::string::String,
14053
14054    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14055}
14056
14057impl RotateServerCaContext {
14058    pub fn new() -> Self {
14059        std::default::Default::default()
14060    }
14061
14062    /// Sets the value of [kind][crate::model::RotateServerCaContext::kind].
14063    ///
14064    /// # Example
14065    /// ```ignore,no_run
14066    /// # use google_cloud_sql_v1::model::RotateServerCaContext;
14067    /// let x = RotateServerCaContext::new().set_kind("example");
14068    /// ```
14069    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14070        self.kind = v.into();
14071        self
14072    }
14073
14074    /// Sets the value of [next_version][crate::model::RotateServerCaContext::next_version].
14075    ///
14076    /// # Example
14077    /// ```ignore,no_run
14078    /// # use google_cloud_sql_v1::model::RotateServerCaContext;
14079    /// let x = RotateServerCaContext::new().set_next_version("example");
14080    /// ```
14081    pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14082        self.next_version = v.into();
14083        self
14084    }
14085}
14086
14087impl wkt::message::Message for RotateServerCaContext {
14088    fn typename() -> &'static str {
14089        "type.googleapis.com/google.cloud.sql.v1.RotateServerCaContext"
14090    }
14091}
14092
14093/// Instance rotate server certificate context.
14094#[derive(Clone, Default, PartialEq)]
14095#[non_exhaustive]
14096pub struct RotateServerCertificateContext {
14097    /// Optional. This is always `sql#rotateServerCertificateContext`.
14098    pub kind: std::string::String,
14099
14100    /// The fingerprint of the next version to be rotated to. If left unspecified,
14101    /// will be rotated to the most recently added server certificate version.
14102    pub next_version: std::string::String,
14103
14104    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14105}
14106
14107impl RotateServerCertificateContext {
14108    pub fn new() -> Self {
14109        std::default::Default::default()
14110    }
14111
14112    /// Sets the value of [kind][crate::model::RotateServerCertificateContext::kind].
14113    ///
14114    /// # Example
14115    /// ```ignore,no_run
14116    /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
14117    /// let x = RotateServerCertificateContext::new().set_kind("example");
14118    /// ```
14119    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14120        self.kind = v.into();
14121        self
14122    }
14123
14124    /// Sets the value of [next_version][crate::model::RotateServerCertificateContext::next_version].
14125    ///
14126    /// # Example
14127    /// ```ignore,no_run
14128    /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
14129    /// let x = RotateServerCertificateContext::new().set_next_version("example");
14130    /// ```
14131    pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14132        self.next_version = v.into();
14133        self
14134    }
14135}
14136
14137impl wkt::message::Message for RotateServerCertificateContext {
14138    fn typename() -> &'static str {
14139        "type.googleapis.com/google.cloud.sql.v1.RotateServerCertificateContext"
14140    }
14141}
14142
14143/// Instance rotate Entra ID certificate context.
14144#[derive(Clone, Default, PartialEq)]
14145#[non_exhaustive]
14146pub struct RotateEntraIdCertificateContext {
14147    /// Optional. This is always `sql#rotateEntraIdCertificateContext`.
14148    pub kind: std::string::String,
14149
14150    /// Optional. The fingerprint of the next version to be rotated to. If left
14151    /// unspecified, will be rotated to the most recently added server certificate
14152    /// version.
14153    pub next_version: std::string::String,
14154
14155    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14156}
14157
14158impl RotateEntraIdCertificateContext {
14159    pub fn new() -> Self {
14160        std::default::Default::default()
14161    }
14162
14163    /// Sets the value of [kind][crate::model::RotateEntraIdCertificateContext::kind].
14164    ///
14165    /// # Example
14166    /// ```ignore,no_run
14167    /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
14168    /// let x = RotateEntraIdCertificateContext::new().set_kind("example");
14169    /// ```
14170    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14171        self.kind = v.into();
14172        self
14173    }
14174
14175    /// Sets the value of [next_version][crate::model::RotateEntraIdCertificateContext::next_version].
14176    ///
14177    /// # Example
14178    /// ```ignore,no_run
14179    /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
14180    /// let x = RotateEntraIdCertificateContext::new().set_next_version("example");
14181    /// ```
14182    pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14183        self.next_version = v.into();
14184        self
14185    }
14186}
14187
14188impl wkt::message::Message for RotateEntraIdCertificateContext {
14189    fn typename() -> &'static str {
14190        "type.googleapis.com/google.cloud.sql.v1.RotateEntraIdCertificateContext"
14191    }
14192}
14193
14194/// Database Instance truncate log context.
14195#[derive(Clone, Default, PartialEq)]
14196#[non_exhaustive]
14197pub struct TruncateLogContext {
14198    /// This is always `sql#truncateLogContext`.
14199    pub kind: std::string::String,
14200
14201    /// The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
14202    /// `MYSQL_SLOW_TABLE`.
14203    pub log_type: std::string::String,
14204
14205    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14206}
14207
14208impl TruncateLogContext {
14209    pub fn new() -> Self {
14210        std::default::Default::default()
14211    }
14212
14213    /// Sets the value of [kind][crate::model::TruncateLogContext::kind].
14214    ///
14215    /// # Example
14216    /// ```ignore,no_run
14217    /// # use google_cloud_sql_v1::model::TruncateLogContext;
14218    /// let x = TruncateLogContext::new().set_kind("example");
14219    /// ```
14220    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14221        self.kind = v.into();
14222        self
14223    }
14224
14225    /// Sets the value of [log_type][crate::model::TruncateLogContext::log_type].
14226    ///
14227    /// # Example
14228    /// ```ignore,no_run
14229    /// # use google_cloud_sql_v1::model::TruncateLogContext;
14230    /// let x = TruncateLogContext::new().set_log_type("example");
14231    /// ```
14232    pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14233        self.log_type = v.into();
14234        self
14235    }
14236}
14237
14238impl wkt::message::Message for TruncateLogContext {
14239    fn typename() -> &'static str {
14240        "type.googleapis.com/google.cloud.sql.v1.TruncateLogContext"
14241    }
14242}
14243
14244/// External primary instance migration setting error/warning.
14245#[derive(Clone, Default, PartialEq)]
14246#[non_exhaustive]
14247pub struct SqlExternalSyncSettingError {
14248    /// Can be `sql#externalSyncSettingError` or
14249    /// `sql#externalSyncSettingWarning`.
14250    pub kind: std::string::String,
14251
14252    /// Identifies the specific error that occurred.
14253    pub r#type: crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
14254
14255    /// Additional information about the error encountered.
14256    pub detail: std::string::String,
14257
14258    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14259}
14260
14261impl SqlExternalSyncSettingError {
14262    pub fn new() -> Self {
14263        std::default::Default::default()
14264    }
14265
14266    /// Sets the value of [kind][crate::model::SqlExternalSyncSettingError::kind].
14267    ///
14268    /// # Example
14269    /// ```ignore,no_run
14270    /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14271    /// let x = SqlExternalSyncSettingError::new().set_kind("example");
14272    /// ```
14273    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14274        self.kind = v.into();
14275        self
14276    }
14277
14278    /// Sets the value of [r#type][crate::model::SqlExternalSyncSettingError::type].
14279    ///
14280    /// # Example
14281    /// ```ignore,no_run
14282    /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14283    /// use google_cloud_sql_v1::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType;
14284    /// let x0 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::ConnectionFailure);
14285    /// let x1 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::BinlogNotEnabled);
14286    /// let x2 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::IncompatibleDatabaseVersion);
14287    /// ```
14288    pub fn set_type<
14289        T: std::convert::Into<
14290                crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
14291            >,
14292    >(
14293        mut self,
14294        v: T,
14295    ) -> Self {
14296        self.r#type = v.into();
14297        self
14298    }
14299
14300    /// Sets the value of [detail][crate::model::SqlExternalSyncSettingError::detail].
14301    ///
14302    /// # Example
14303    /// ```ignore,no_run
14304    /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14305    /// let x = SqlExternalSyncSettingError::new().set_detail("example");
14306    /// ```
14307    pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14308        self.detail = v.into();
14309        self
14310    }
14311}
14312
14313impl wkt::message::Message for SqlExternalSyncSettingError {
14314    fn typename() -> &'static str {
14315        "type.googleapis.com/google.cloud.sql.v1.SqlExternalSyncSettingError"
14316    }
14317}
14318
14319/// Defines additional types related to [SqlExternalSyncSettingError].
14320pub mod sql_external_sync_setting_error {
14321    #[allow(unused_imports)]
14322    use super::*;
14323
14324    ///
14325    /// # Working with unknown values
14326    ///
14327    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14328    /// additional enum variants at any time. Adding new variants is not considered
14329    /// a breaking change. Applications should write their code in anticipation of:
14330    ///
14331    /// - New values appearing in future releases of the client library, **and**
14332    /// - New values received dynamically, without application changes.
14333    ///
14334    /// Please consult the [Working with enums] section in the user guide for some
14335    /// guidelines.
14336    ///
14337    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14338    #[derive(Clone, Debug, PartialEq)]
14339    #[non_exhaustive]
14340    pub enum SqlExternalSyncSettingErrorType {
14341        Unspecified,
14342        ConnectionFailure,
14343        BinlogNotEnabled,
14344        IncompatibleDatabaseVersion,
14345        ReplicaAlreadySetup,
14346        /// The replication user is missing privileges that are required.
14347        InsufficientPrivilege,
14348        /// Unsupported migration type.
14349        UnsupportedMigrationType,
14350        /// No pglogical extension installed on databases, applicable for postgres.
14351        NoPglogicalInstalled,
14352        /// pglogical node already exists on databases, applicable for postgres.
14353        PglogicalNodeAlreadyExists,
14354        /// The value of parameter wal_level is not set to logical.
14355        InvalidWalLevel,
14356        /// The value of parameter shared_preload_libraries does not include
14357        /// pglogical.
14358        InvalidSharedPreloadLibrary,
14359        /// The value of parameter max_replication_slots is not sufficient.
14360        InsufficientMaxReplicationSlots,
14361        /// The value of parameter max_wal_senders is not sufficient.
14362        InsufficientMaxWalSenders,
14363        /// The value of parameter max_worker_processes is not sufficient.
14364        InsufficientMaxWorkerProcesses,
14365        /// Extensions installed are either not supported or having unsupported
14366        /// versions.
14367        UnsupportedExtensions,
14368        /// The value of parameter rds.logical_replication is not set to 1.
14369        InvalidRdsLogicalReplication,
14370        /// The primary instance logging setup doesn't allow EM sync.
14371        InvalidLoggingSetup,
14372        /// The primary instance database parameter setup doesn't allow EM sync.
14373        InvalidDbParam,
14374        /// The gtid_mode is not supported, applicable for MySQL.
14375        UnsupportedGtidMode,
14376        /// SQL Server Agent is not running.
14377        SqlserverAgentNotRunning,
14378        /// The table definition is not support due to missing primary key or replica
14379        /// identity, applicable for postgres. Note that this is a warning and won't
14380        /// block the migration.
14381        UnsupportedTableDefinition,
14382        /// The customer has a definer that will break EM setup.
14383        UnsupportedDefiner,
14384        /// SQL Server @@SERVERNAME does not match actual host name.
14385        SqlserverServernameMismatch,
14386        /// The primary instance has been setup and will fail the setup.
14387        PrimaryAlreadySetup,
14388        /// The primary instance has unsupported binary log format.
14389        UnsupportedBinlogFormat,
14390        /// The primary instance's binary log retention setting.
14391        BinlogRetentionSetting,
14392        /// The primary instance has tables with unsupported storage engine.
14393        UnsupportedStorageEngine,
14394        /// Source has tables with limited support
14395        /// eg: PostgreSQL tables without primary keys.
14396        LimitedSupportTables,
14397        /// The replica instance contains existing data.
14398        ExistingDataInReplica,
14399        /// The replication user is missing privileges that are optional.
14400        MissingOptionalPrivileges,
14401        /// Additional BACKUP_ADMIN privilege is granted to the replication user
14402        /// which may lock source MySQL 8 instance for DDLs during initial sync.
14403        RiskyBackupAdminPrivilege,
14404        /// The Cloud Storage bucket is missing necessary permissions.
14405        InsufficientGcsPermissions,
14406        /// The Cloud Storage bucket has an error in the file or contains invalid
14407        /// file information.
14408        InvalidFileInfo,
14409        /// The source instance has unsupported database settings for migration.
14410        UnsupportedDatabaseSettings,
14411        /// The replication user is missing parallel import specific privileges.
14412        /// (e.g. LOCK TABLES) for MySQL.
14413        MysqlParallelImportInsufficientPrivilege,
14414        /// The global variable local_infile is off on external server replica.
14415        LocalInfileOff,
14416        /// This code instructs customers to turn on point-in-time recovery manually
14417        /// for the instance after promoting the Cloud SQL for PostgreSQL instance.
14418        TurnOnPitrAfterPromote,
14419        /// The minor version of replica database is incompatible with the source.
14420        IncompatibleDatabaseMinorVersion,
14421        /// This warning message indicates that Cloud SQL uses the maximum number of
14422        /// subscriptions to migrate data from the source to the destination.
14423        SourceMaxSubscriptions,
14424        /// Unable to verify definers on the source for MySQL.
14425        UnableToVerifyDefiners,
14426        /// If a time out occurs while the subscription counts are calculated, then
14427        /// this value is set to 1. Otherwise, this value is set to 2.
14428        SubscriptionCalculationStatus,
14429        /// Count of subscriptions needed to sync source data for PostgreSQL
14430        /// database.
14431        PgSubscriptionCount,
14432        /// Final parallel level that is used to do migration.
14433        PgSyncParallelLevel,
14434        /// The disk size of the replica instance is smaller than the data size of
14435        /// the source instance.
14436        InsufficientDiskSize,
14437        /// The data size of the source instance is greater than 1 TB, the number of
14438        /// cores of the replica instance is less than 8, and the memory of the
14439        /// replica is less than 32 GB.
14440        InsufficientMachineTier,
14441        /// The warning message indicates the unsupported extensions will not be
14442        /// migrated to the destination.
14443        UnsupportedExtensionsNotMigrated,
14444        /// The warning message indicates the pg_cron extension and settings will not
14445        /// be migrated to the destination.
14446        ExtensionsNotMigrated,
14447        /// The error message indicates that pg_cron flags are enabled on the
14448        /// destination which is not supported during the migration.
14449        PgCronFlagEnabledInReplica,
14450        /// This error message indicates that the specified extensions are not
14451        /// enabled on destination instance. For example, before you can migrate
14452        /// data to the destination instance, you must enable the PGAudit extension
14453        /// on the instance.
14454        ExtensionsNotEnabledInReplica,
14455        /// The source database has generated columns that can't be migrated. Please
14456        /// change them to regular columns before migration.
14457        UnsupportedColumns,
14458        /// The source database has users that aren't created in the replica.
14459        /// First, create all users, which are in the pg_user_mappings table
14460        /// of the source database, in the destination instance. Then, perform the
14461        /// migration.
14462        UsersNotCreatedInReplica,
14463        /// The selected objects include system objects that aren't supported for
14464        /// migration.
14465        UnsupportedSystemObjects,
14466        /// The source database has tables with the FULL or NOTHING replica identity.
14467        /// Before starting your migration, either remove the identity or change it
14468        /// to DEFAULT. Note that this is an error and will block the migration.
14469        UnsupportedTablesWithReplicaIdentity,
14470        /// The selected objects don't exist on the source instance.
14471        SelectedObjectsNotExistOnSource,
14472        /// PSC only destination instance does not have a network attachment URI.
14473        PscOnlyInstanceWithNoNetworkAttachmentUri,
14474        /// Selected objects reference unselected objects. Based on their object type
14475        /// (foreign key constraint or view), selected objects will fail during
14476        /// migration.
14477        SelectedObjectsReferenceUnselectedObjects,
14478        /// The migration will delete existing data in the replica; set
14479        /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
14480        /// in the request to acknowledge this. This is an error. MySQL only.
14481        ///
14482        /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
14483        PromptDeleteExisting,
14484        /// The migration will delete existing data in the replica;
14485        /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
14486        /// was set in the request acknowledging this. This is a warning rather than
14487        /// an error. MySQL only.
14488        ///
14489        /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
14490        WillDeleteExisting,
14491        /// The replication user is missing specific privileges to setup DDL
14492        /// replication. (e.g. CREATE EVENT TRIGGER, CREATE SCHEMA) for PostgreSQL.
14493        PgDdlReplicationInsufficientPrivilege,
14494        /// If set, the enum was initialized with an unknown value.
14495        ///
14496        /// Applications can examine the value using [SqlExternalSyncSettingErrorType::value] or
14497        /// [SqlExternalSyncSettingErrorType::name].
14498        UnknownValue(sql_external_sync_setting_error_type::UnknownValue),
14499    }
14500
14501    #[doc(hidden)]
14502    pub mod sql_external_sync_setting_error_type {
14503        #[allow(unused_imports)]
14504        use super::*;
14505        #[derive(Clone, Debug, PartialEq)]
14506        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14507    }
14508
14509    impl SqlExternalSyncSettingErrorType {
14510        /// Gets the enum value.
14511        ///
14512        /// Returns `None` if the enum contains an unknown value deserialized from
14513        /// the string representation of enums.
14514        pub fn value(&self) -> std::option::Option<i32> {
14515            match self {
14516                Self::Unspecified => std::option::Option::Some(0),
14517                Self::ConnectionFailure => std::option::Option::Some(1),
14518                Self::BinlogNotEnabled => std::option::Option::Some(2),
14519                Self::IncompatibleDatabaseVersion => std::option::Option::Some(3),
14520                Self::ReplicaAlreadySetup => std::option::Option::Some(4),
14521                Self::InsufficientPrivilege => std::option::Option::Some(5),
14522                Self::UnsupportedMigrationType => std::option::Option::Some(6),
14523                Self::NoPglogicalInstalled => std::option::Option::Some(7),
14524                Self::PglogicalNodeAlreadyExists => std::option::Option::Some(8),
14525                Self::InvalidWalLevel => std::option::Option::Some(9),
14526                Self::InvalidSharedPreloadLibrary => std::option::Option::Some(10),
14527                Self::InsufficientMaxReplicationSlots => std::option::Option::Some(11),
14528                Self::InsufficientMaxWalSenders => std::option::Option::Some(12),
14529                Self::InsufficientMaxWorkerProcesses => std::option::Option::Some(13),
14530                Self::UnsupportedExtensions => std::option::Option::Some(14),
14531                Self::InvalidRdsLogicalReplication => std::option::Option::Some(15),
14532                Self::InvalidLoggingSetup => std::option::Option::Some(16),
14533                Self::InvalidDbParam => std::option::Option::Some(17),
14534                Self::UnsupportedGtidMode => std::option::Option::Some(18),
14535                Self::SqlserverAgentNotRunning => std::option::Option::Some(19),
14536                Self::UnsupportedTableDefinition => std::option::Option::Some(20),
14537                Self::UnsupportedDefiner => std::option::Option::Some(21),
14538                Self::SqlserverServernameMismatch => std::option::Option::Some(22),
14539                Self::PrimaryAlreadySetup => std::option::Option::Some(23),
14540                Self::UnsupportedBinlogFormat => std::option::Option::Some(24),
14541                Self::BinlogRetentionSetting => std::option::Option::Some(25),
14542                Self::UnsupportedStorageEngine => std::option::Option::Some(26),
14543                Self::LimitedSupportTables => std::option::Option::Some(27),
14544                Self::ExistingDataInReplica => std::option::Option::Some(28),
14545                Self::MissingOptionalPrivileges => std::option::Option::Some(29),
14546                Self::RiskyBackupAdminPrivilege => std::option::Option::Some(30),
14547                Self::InsufficientGcsPermissions => std::option::Option::Some(31),
14548                Self::InvalidFileInfo => std::option::Option::Some(32),
14549                Self::UnsupportedDatabaseSettings => std::option::Option::Some(33),
14550                Self::MysqlParallelImportInsufficientPrivilege => std::option::Option::Some(34),
14551                Self::LocalInfileOff => std::option::Option::Some(35),
14552                Self::TurnOnPitrAfterPromote => std::option::Option::Some(36),
14553                Self::IncompatibleDatabaseMinorVersion => std::option::Option::Some(37),
14554                Self::SourceMaxSubscriptions => std::option::Option::Some(38),
14555                Self::UnableToVerifyDefiners => std::option::Option::Some(39),
14556                Self::SubscriptionCalculationStatus => std::option::Option::Some(40),
14557                Self::PgSubscriptionCount => std::option::Option::Some(41),
14558                Self::PgSyncParallelLevel => std::option::Option::Some(42),
14559                Self::InsufficientDiskSize => std::option::Option::Some(43),
14560                Self::InsufficientMachineTier => std::option::Option::Some(44),
14561                Self::UnsupportedExtensionsNotMigrated => std::option::Option::Some(45),
14562                Self::ExtensionsNotMigrated => std::option::Option::Some(46),
14563                Self::PgCronFlagEnabledInReplica => std::option::Option::Some(47),
14564                Self::ExtensionsNotEnabledInReplica => std::option::Option::Some(48),
14565                Self::UnsupportedColumns => std::option::Option::Some(49),
14566                Self::UsersNotCreatedInReplica => std::option::Option::Some(50),
14567                Self::UnsupportedSystemObjects => std::option::Option::Some(51),
14568                Self::UnsupportedTablesWithReplicaIdentity => std::option::Option::Some(52),
14569                Self::SelectedObjectsNotExistOnSource => std::option::Option::Some(53),
14570                Self::PscOnlyInstanceWithNoNetworkAttachmentUri => std::option::Option::Some(54),
14571                Self::SelectedObjectsReferenceUnselectedObjects => std::option::Option::Some(55),
14572                Self::PromptDeleteExisting => std::option::Option::Some(56),
14573                Self::WillDeleteExisting => std::option::Option::Some(57),
14574                Self::PgDdlReplicationInsufficientPrivilege => std::option::Option::Some(58),
14575                Self::UnknownValue(u) => u.0.value(),
14576            }
14577        }
14578
14579        /// Gets the enum value as a string.
14580        ///
14581        /// Returns `None` if the enum contains an unknown value deserialized from
14582        /// the integer representation of enums.
14583        pub fn name(&self) -> std::option::Option<&str> {
14584            match self {
14585                Self::Unspecified => {
14586                    std::option::Option::Some("SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED")
14587                }
14588                Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
14589                Self::BinlogNotEnabled => std::option::Option::Some("BINLOG_NOT_ENABLED"),
14590                Self::IncompatibleDatabaseVersion => {
14591                    std::option::Option::Some("INCOMPATIBLE_DATABASE_VERSION")
14592                }
14593                Self::ReplicaAlreadySetup => std::option::Option::Some("REPLICA_ALREADY_SETUP"),
14594                Self::InsufficientPrivilege => std::option::Option::Some("INSUFFICIENT_PRIVILEGE"),
14595                Self::UnsupportedMigrationType => {
14596                    std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
14597                }
14598                Self::NoPglogicalInstalled => std::option::Option::Some("NO_PGLOGICAL_INSTALLED"),
14599                Self::PglogicalNodeAlreadyExists => {
14600                    std::option::Option::Some("PGLOGICAL_NODE_ALREADY_EXISTS")
14601                }
14602                Self::InvalidWalLevel => std::option::Option::Some("INVALID_WAL_LEVEL"),
14603                Self::InvalidSharedPreloadLibrary => {
14604                    std::option::Option::Some("INVALID_SHARED_PRELOAD_LIBRARY")
14605                }
14606                Self::InsufficientMaxReplicationSlots => {
14607                    std::option::Option::Some("INSUFFICIENT_MAX_REPLICATION_SLOTS")
14608                }
14609                Self::InsufficientMaxWalSenders => {
14610                    std::option::Option::Some("INSUFFICIENT_MAX_WAL_SENDERS")
14611                }
14612                Self::InsufficientMaxWorkerProcesses => {
14613                    std::option::Option::Some("INSUFFICIENT_MAX_WORKER_PROCESSES")
14614                }
14615                Self::UnsupportedExtensions => std::option::Option::Some("UNSUPPORTED_EXTENSIONS"),
14616                Self::InvalidRdsLogicalReplication => {
14617                    std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
14618                }
14619                Self::InvalidLoggingSetup => std::option::Option::Some("INVALID_LOGGING_SETUP"),
14620                Self::InvalidDbParam => std::option::Option::Some("INVALID_DB_PARAM"),
14621                Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
14622                Self::SqlserverAgentNotRunning => {
14623                    std::option::Option::Some("SQLSERVER_AGENT_NOT_RUNNING")
14624                }
14625                Self::UnsupportedTableDefinition => {
14626                    std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
14627                }
14628                Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
14629                Self::SqlserverServernameMismatch => {
14630                    std::option::Option::Some("SQLSERVER_SERVERNAME_MISMATCH")
14631                }
14632                Self::PrimaryAlreadySetup => std::option::Option::Some("PRIMARY_ALREADY_SETUP"),
14633                Self::UnsupportedBinlogFormat => {
14634                    std::option::Option::Some("UNSUPPORTED_BINLOG_FORMAT")
14635                }
14636                Self::BinlogRetentionSetting => {
14637                    std::option::Option::Some("BINLOG_RETENTION_SETTING")
14638                }
14639                Self::UnsupportedStorageEngine => {
14640                    std::option::Option::Some("UNSUPPORTED_STORAGE_ENGINE")
14641                }
14642                Self::LimitedSupportTables => std::option::Option::Some("LIMITED_SUPPORT_TABLES"),
14643                Self::ExistingDataInReplica => {
14644                    std::option::Option::Some("EXISTING_DATA_IN_REPLICA")
14645                }
14646                Self::MissingOptionalPrivileges => {
14647                    std::option::Option::Some("MISSING_OPTIONAL_PRIVILEGES")
14648                }
14649                Self::RiskyBackupAdminPrivilege => {
14650                    std::option::Option::Some("RISKY_BACKUP_ADMIN_PRIVILEGE")
14651                }
14652                Self::InsufficientGcsPermissions => {
14653                    std::option::Option::Some("INSUFFICIENT_GCS_PERMISSIONS")
14654                }
14655                Self::InvalidFileInfo => std::option::Option::Some("INVALID_FILE_INFO"),
14656                Self::UnsupportedDatabaseSettings => {
14657                    std::option::Option::Some("UNSUPPORTED_DATABASE_SETTINGS")
14658                }
14659                Self::MysqlParallelImportInsufficientPrivilege => {
14660                    std::option::Option::Some("MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
14661                }
14662                Self::LocalInfileOff => std::option::Option::Some("LOCAL_INFILE_OFF"),
14663                Self::TurnOnPitrAfterPromote => {
14664                    std::option::Option::Some("TURN_ON_PITR_AFTER_PROMOTE")
14665                }
14666                Self::IncompatibleDatabaseMinorVersion => {
14667                    std::option::Option::Some("INCOMPATIBLE_DATABASE_MINOR_VERSION")
14668                }
14669                Self::SourceMaxSubscriptions => {
14670                    std::option::Option::Some("SOURCE_MAX_SUBSCRIPTIONS")
14671                }
14672                Self::UnableToVerifyDefiners => {
14673                    std::option::Option::Some("UNABLE_TO_VERIFY_DEFINERS")
14674                }
14675                Self::SubscriptionCalculationStatus => {
14676                    std::option::Option::Some("SUBSCRIPTION_CALCULATION_STATUS")
14677                }
14678                Self::PgSubscriptionCount => std::option::Option::Some("PG_SUBSCRIPTION_COUNT"),
14679                Self::PgSyncParallelLevel => std::option::Option::Some("PG_SYNC_PARALLEL_LEVEL"),
14680                Self::InsufficientDiskSize => std::option::Option::Some("INSUFFICIENT_DISK_SIZE"),
14681                Self::InsufficientMachineTier => {
14682                    std::option::Option::Some("INSUFFICIENT_MACHINE_TIER")
14683                }
14684                Self::UnsupportedExtensionsNotMigrated => {
14685                    std::option::Option::Some("UNSUPPORTED_EXTENSIONS_NOT_MIGRATED")
14686                }
14687                Self::ExtensionsNotMigrated => std::option::Option::Some("EXTENSIONS_NOT_MIGRATED"),
14688                Self::PgCronFlagEnabledInReplica => {
14689                    std::option::Option::Some("PG_CRON_FLAG_ENABLED_IN_REPLICA")
14690                }
14691                Self::ExtensionsNotEnabledInReplica => {
14692                    std::option::Option::Some("EXTENSIONS_NOT_ENABLED_IN_REPLICA")
14693                }
14694                Self::UnsupportedColumns => std::option::Option::Some("UNSUPPORTED_COLUMNS"),
14695                Self::UsersNotCreatedInReplica => {
14696                    std::option::Option::Some("USERS_NOT_CREATED_IN_REPLICA")
14697                }
14698                Self::UnsupportedSystemObjects => {
14699                    std::option::Option::Some("UNSUPPORTED_SYSTEM_OBJECTS")
14700                }
14701                Self::UnsupportedTablesWithReplicaIdentity => {
14702                    std::option::Option::Some("UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY")
14703                }
14704                Self::SelectedObjectsNotExistOnSource => {
14705                    std::option::Option::Some("SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE")
14706                }
14707                Self::PscOnlyInstanceWithNoNetworkAttachmentUri => {
14708                    std::option::Option::Some("PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI")
14709                }
14710                Self::SelectedObjectsReferenceUnselectedObjects => {
14711                    std::option::Option::Some("SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS")
14712                }
14713                Self::PromptDeleteExisting => std::option::Option::Some("PROMPT_DELETE_EXISTING"),
14714                Self::WillDeleteExisting => std::option::Option::Some("WILL_DELETE_EXISTING"),
14715                Self::PgDdlReplicationInsufficientPrivilege => {
14716                    std::option::Option::Some("PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE")
14717                }
14718                Self::UnknownValue(u) => u.0.name(),
14719            }
14720        }
14721    }
14722
14723    impl std::default::Default for SqlExternalSyncSettingErrorType {
14724        fn default() -> Self {
14725            use std::convert::From;
14726            Self::from(0)
14727        }
14728    }
14729
14730    impl std::fmt::Display for SqlExternalSyncSettingErrorType {
14731        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14732            wkt::internal::display_enum(f, self.name(), self.value())
14733        }
14734    }
14735
14736    impl std::convert::From<i32> for SqlExternalSyncSettingErrorType {
14737        fn from(value: i32) -> Self {
14738            match value {
14739                0 => Self::Unspecified,
14740                1 => Self::ConnectionFailure,
14741                2 => Self::BinlogNotEnabled,
14742                3 => Self::IncompatibleDatabaseVersion,
14743                4 => Self::ReplicaAlreadySetup,
14744                5 => Self::InsufficientPrivilege,
14745                6 => Self::UnsupportedMigrationType,
14746                7 => Self::NoPglogicalInstalled,
14747                8 => Self::PglogicalNodeAlreadyExists,
14748                9 => Self::InvalidWalLevel,
14749                10 => Self::InvalidSharedPreloadLibrary,
14750                11 => Self::InsufficientMaxReplicationSlots,
14751                12 => Self::InsufficientMaxWalSenders,
14752                13 => Self::InsufficientMaxWorkerProcesses,
14753                14 => Self::UnsupportedExtensions,
14754                15 => Self::InvalidRdsLogicalReplication,
14755                16 => Self::InvalidLoggingSetup,
14756                17 => Self::InvalidDbParam,
14757                18 => Self::UnsupportedGtidMode,
14758                19 => Self::SqlserverAgentNotRunning,
14759                20 => Self::UnsupportedTableDefinition,
14760                21 => Self::UnsupportedDefiner,
14761                22 => Self::SqlserverServernameMismatch,
14762                23 => Self::PrimaryAlreadySetup,
14763                24 => Self::UnsupportedBinlogFormat,
14764                25 => Self::BinlogRetentionSetting,
14765                26 => Self::UnsupportedStorageEngine,
14766                27 => Self::LimitedSupportTables,
14767                28 => Self::ExistingDataInReplica,
14768                29 => Self::MissingOptionalPrivileges,
14769                30 => Self::RiskyBackupAdminPrivilege,
14770                31 => Self::InsufficientGcsPermissions,
14771                32 => Self::InvalidFileInfo,
14772                33 => Self::UnsupportedDatabaseSettings,
14773                34 => Self::MysqlParallelImportInsufficientPrivilege,
14774                35 => Self::LocalInfileOff,
14775                36 => Self::TurnOnPitrAfterPromote,
14776                37 => Self::IncompatibleDatabaseMinorVersion,
14777                38 => Self::SourceMaxSubscriptions,
14778                39 => Self::UnableToVerifyDefiners,
14779                40 => Self::SubscriptionCalculationStatus,
14780                41 => Self::PgSubscriptionCount,
14781                42 => Self::PgSyncParallelLevel,
14782                43 => Self::InsufficientDiskSize,
14783                44 => Self::InsufficientMachineTier,
14784                45 => Self::UnsupportedExtensionsNotMigrated,
14785                46 => Self::ExtensionsNotMigrated,
14786                47 => Self::PgCronFlagEnabledInReplica,
14787                48 => Self::ExtensionsNotEnabledInReplica,
14788                49 => Self::UnsupportedColumns,
14789                50 => Self::UsersNotCreatedInReplica,
14790                51 => Self::UnsupportedSystemObjects,
14791                52 => Self::UnsupportedTablesWithReplicaIdentity,
14792                53 => Self::SelectedObjectsNotExistOnSource,
14793                54 => Self::PscOnlyInstanceWithNoNetworkAttachmentUri,
14794                55 => Self::SelectedObjectsReferenceUnselectedObjects,
14795                56 => Self::PromptDeleteExisting,
14796                57 => Self::WillDeleteExisting,
14797                58 => Self::PgDdlReplicationInsufficientPrivilege,
14798                _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
14799                    wkt::internal::UnknownEnumValue::Integer(value),
14800                )),
14801            }
14802        }
14803    }
14804
14805    impl std::convert::From<&str> for SqlExternalSyncSettingErrorType {
14806        fn from(value: &str) -> Self {
14807            use std::string::ToString;
14808            match value {
14809                "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
14810                "CONNECTION_FAILURE" => Self::ConnectionFailure,
14811                "BINLOG_NOT_ENABLED" => Self::BinlogNotEnabled,
14812                "INCOMPATIBLE_DATABASE_VERSION" => Self::IncompatibleDatabaseVersion,
14813                "REPLICA_ALREADY_SETUP" => Self::ReplicaAlreadySetup,
14814                "INSUFFICIENT_PRIVILEGE" => Self::InsufficientPrivilege,
14815                "UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
14816                "NO_PGLOGICAL_INSTALLED" => Self::NoPglogicalInstalled,
14817                "PGLOGICAL_NODE_ALREADY_EXISTS" => Self::PglogicalNodeAlreadyExists,
14818                "INVALID_WAL_LEVEL" => Self::InvalidWalLevel,
14819                "INVALID_SHARED_PRELOAD_LIBRARY" => Self::InvalidSharedPreloadLibrary,
14820                "INSUFFICIENT_MAX_REPLICATION_SLOTS" => Self::InsufficientMaxReplicationSlots,
14821                "INSUFFICIENT_MAX_WAL_SENDERS" => Self::InsufficientMaxWalSenders,
14822                "INSUFFICIENT_MAX_WORKER_PROCESSES" => Self::InsufficientMaxWorkerProcesses,
14823                "UNSUPPORTED_EXTENSIONS" => Self::UnsupportedExtensions,
14824                "INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
14825                "INVALID_LOGGING_SETUP" => Self::InvalidLoggingSetup,
14826                "INVALID_DB_PARAM" => Self::InvalidDbParam,
14827                "UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
14828                "SQLSERVER_AGENT_NOT_RUNNING" => Self::SqlserverAgentNotRunning,
14829                "UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
14830                "UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
14831                "SQLSERVER_SERVERNAME_MISMATCH" => Self::SqlserverServernameMismatch,
14832                "PRIMARY_ALREADY_SETUP" => Self::PrimaryAlreadySetup,
14833                "UNSUPPORTED_BINLOG_FORMAT" => Self::UnsupportedBinlogFormat,
14834                "BINLOG_RETENTION_SETTING" => Self::BinlogRetentionSetting,
14835                "UNSUPPORTED_STORAGE_ENGINE" => Self::UnsupportedStorageEngine,
14836                "LIMITED_SUPPORT_TABLES" => Self::LimitedSupportTables,
14837                "EXISTING_DATA_IN_REPLICA" => Self::ExistingDataInReplica,
14838                "MISSING_OPTIONAL_PRIVILEGES" => Self::MissingOptionalPrivileges,
14839                "RISKY_BACKUP_ADMIN_PRIVILEGE" => Self::RiskyBackupAdminPrivilege,
14840                "INSUFFICIENT_GCS_PERMISSIONS" => Self::InsufficientGcsPermissions,
14841                "INVALID_FILE_INFO" => Self::InvalidFileInfo,
14842                "UNSUPPORTED_DATABASE_SETTINGS" => Self::UnsupportedDatabaseSettings,
14843                "MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
14844                    Self::MysqlParallelImportInsufficientPrivilege
14845                }
14846                "LOCAL_INFILE_OFF" => Self::LocalInfileOff,
14847                "TURN_ON_PITR_AFTER_PROMOTE" => Self::TurnOnPitrAfterPromote,
14848                "INCOMPATIBLE_DATABASE_MINOR_VERSION" => Self::IncompatibleDatabaseMinorVersion,
14849                "SOURCE_MAX_SUBSCRIPTIONS" => Self::SourceMaxSubscriptions,
14850                "UNABLE_TO_VERIFY_DEFINERS" => Self::UnableToVerifyDefiners,
14851                "SUBSCRIPTION_CALCULATION_STATUS" => Self::SubscriptionCalculationStatus,
14852                "PG_SUBSCRIPTION_COUNT" => Self::PgSubscriptionCount,
14853                "PG_SYNC_PARALLEL_LEVEL" => Self::PgSyncParallelLevel,
14854                "INSUFFICIENT_DISK_SIZE" => Self::InsufficientDiskSize,
14855                "INSUFFICIENT_MACHINE_TIER" => Self::InsufficientMachineTier,
14856                "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED" => Self::UnsupportedExtensionsNotMigrated,
14857                "EXTENSIONS_NOT_MIGRATED" => Self::ExtensionsNotMigrated,
14858                "PG_CRON_FLAG_ENABLED_IN_REPLICA" => Self::PgCronFlagEnabledInReplica,
14859                "EXTENSIONS_NOT_ENABLED_IN_REPLICA" => Self::ExtensionsNotEnabledInReplica,
14860                "UNSUPPORTED_COLUMNS" => Self::UnsupportedColumns,
14861                "USERS_NOT_CREATED_IN_REPLICA" => Self::UsersNotCreatedInReplica,
14862                "UNSUPPORTED_SYSTEM_OBJECTS" => Self::UnsupportedSystemObjects,
14863                "UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY" => {
14864                    Self::UnsupportedTablesWithReplicaIdentity
14865                }
14866                "SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE" => Self::SelectedObjectsNotExistOnSource,
14867                "PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI" => {
14868                    Self::PscOnlyInstanceWithNoNetworkAttachmentUri
14869                }
14870                "SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS" => {
14871                    Self::SelectedObjectsReferenceUnselectedObjects
14872                }
14873                "PROMPT_DELETE_EXISTING" => Self::PromptDeleteExisting,
14874                "WILL_DELETE_EXISTING" => Self::WillDeleteExisting,
14875                "PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE" => {
14876                    Self::PgDdlReplicationInsufficientPrivilege
14877                }
14878                _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
14879                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14880                )),
14881            }
14882        }
14883    }
14884
14885    impl serde::ser::Serialize for SqlExternalSyncSettingErrorType {
14886        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14887        where
14888            S: serde::Serializer,
14889        {
14890            match self {
14891                Self::Unspecified => serializer.serialize_i32(0),
14892                Self::ConnectionFailure => serializer.serialize_i32(1),
14893                Self::BinlogNotEnabled => serializer.serialize_i32(2),
14894                Self::IncompatibleDatabaseVersion => serializer.serialize_i32(3),
14895                Self::ReplicaAlreadySetup => serializer.serialize_i32(4),
14896                Self::InsufficientPrivilege => serializer.serialize_i32(5),
14897                Self::UnsupportedMigrationType => serializer.serialize_i32(6),
14898                Self::NoPglogicalInstalled => serializer.serialize_i32(7),
14899                Self::PglogicalNodeAlreadyExists => serializer.serialize_i32(8),
14900                Self::InvalidWalLevel => serializer.serialize_i32(9),
14901                Self::InvalidSharedPreloadLibrary => serializer.serialize_i32(10),
14902                Self::InsufficientMaxReplicationSlots => serializer.serialize_i32(11),
14903                Self::InsufficientMaxWalSenders => serializer.serialize_i32(12),
14904                Self::InsufficientMaxWorkerProcesses => serializer.serialize_i32(13),
14905                Self::UnsupportedExtensions => serializer.serialize_i32(14),
14906                Self::InvalidRdsLogicalReplication => serializer.serialize_i32(15),
14907                Self::InvalidLoggingSetup => serializer.serialize_i32(16),
14908                Self::InvalidDbParam => serializer.serialize_i32(17),
14909                Self::UnsupportedGtidMode => serializer.serialize_i32(18),
14910                Self::SqlserverAgentNotRunning => serializer.serialize_i32(19),
14911                Self::UnsupportedTableDefinition => serializer.serialize_i32(20),
14912                Self::UnsupportedDefiner => serializer.serialize_i32(21),
14913                Self::SqlserverServernameMismatch => serializer.serialize_i32(22),
14914                Self::PrimaryAlreadySetup => serializer.serialize_i32(23),
14915                Self::UnsupportedBinlogFormat => serializer.serialize_i32(24),
14916                Self::BinlogRetentionSetting => serializer.serialize_i32(25),
14917                Self::UnsupportedStorageEngine => serializer.serialize_i32(26),
14918                Self::LimitedSupportTables => serializer.serialize_i32(27),
14919                Self::ExistingDataInReplica => serializer.serialize_i32(28),
14920                Self::MissingOptionalPrivileges => serializer.serialize_i32(29),
14921                Self::RiskyBackupAdminPrivilege => serializer.serialize_i32(30),
14922                Self::InsufficientGcsPermissions => serializer.serialize_i32(31),
14923                Self::InvalidFileInfo => serializer.serialize_i32(32),
14924                Self::UnsupportedDatabaseSettings => serializer.serialize_i32(33),
14925                Self::MysqlParallelImportInsufficientPrivilege => serializer.serialize_i32(34),
14926                Self::LocalInfileOff => serializer.serialize_i32(35),
14927                Self::TurnOnPitrAfterPromote => serializer.serialize_i32(36),
14928                Self::IncompatibleDatabaseMinorVersion => serializer.serialize_i32(37),
14929                Self::SourceMaxSubscriptions => serializer.serialize_i32(38),
14930                Self::UnableToVerifyDefiners => serializer.serialize_i32(39),
14931                Self::SubscriptionCalculationStatus => serializer.serialize_i32(40),
14932                Self::PgSubscriptionCount => serializer.serialize_i32(41),
14933                Self::PgSyncParallelLevel => serializer.serialize_i32(42),
14934                Self::InsufficientDiskSize => serializer.serialize_i32(43),
14935                Self::InsufficientMachineTier => serializer.serialize_i32(44),
14936                Self::UnsupportedExtensionsNotMigrated => serializer.serialize_i32(45),
14937                Self::ExtensionsNotMigrated => serializer.serialize_i32(46),
14938                Self::PgCronFlagEnabledInReplica => serializer.serialize_i32(47),
14939                Self::ExtensionsNotEnabledInReplica => serializer.serialize_i32(48),
14940                Self::UnsupportedColumns => serializer.serialize_i32(49),
14941                Self::UsersNotCreatedInReplica => serializer.serialize_i32(50),
14942                Self::UnsupportedSystemObjects => serializer.serialize_i32(51),
14943                Self::UnsupportedTablesWithReplicaIdentity => serializer.serialize_i32(52),
14944                Self::SelectedObjectsNotExistOnSource => serializer.serialize_i32(53),
14945                Self::PscOnlyInstanceWithNoNetworkAttachmentUri => serializer.serialize_i32(54),
14946                Self::SelectedObjectsReferenceUnselectedObjects => serializer.serialize_i32(55),
14947                Self::PromptDeleteExisting => serializer.serialize_i32(56),
14948                Self::WillDeleteExisting => serializer.serialize_i32(57),
14949                Self::PgDdlReplicationInsufficientPrivilege => serializer.serialize_i32(58),
14950                Self::UnknownValue(u) => u.0.serialize(serializer),
14951            }
14952        }
14953    }
14954
14955    impl<'de> serde::de::Deserialize<'de> for SqlExternalSyncSettingErrorType {
14956        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14957        where
14958            D: serde::Deserializer<'de>,
14959        {
14960            deserializer.deserialize_any(wkt::internal::EnumVisitor::<
14961                SqlExternalSyncSettingErrorType,
14962            >::new(
14963                ".google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType",
14964            ))
14965        }
14966    }
14967}
14968
14969/// A list of objects that the user selects for replication from an external
14970/// source instance.
14971#[derive(Clone, Default, PartialEq)]
14972#[non_exhaustive]
14973pub struct SelectedObjects {
14974    /// Required. The name of the database to migrate.
14975    pub database: std::string::String,
14976
14977    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14978}
14979
14980impl SelectedObjects {
14981    pub fn new() -> Self {
14982        std::default::Default::default()
14983    }
14984
14985    /// Sets the value of [database][crate::model::SelectedObjects::database].
14986    ///
14987    /// # Example
14988    /// ```ignore,no_run
14989    /// # use google_cloud_sql_v1::model::SelectedObjects;
14990    /// let x = SelectedObjects::new().set_database("example");
14991    /// ```
14992    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14993        self.database = v.into();
14994        self
14995    }
14996}
14997
14998impl wkt::message::Message for SelectedObjects {
14999    fn typename() -> &'static str {
15000        "type.googleapis.com/google.cloud.sql.v1.SelectedObjects"
15001    }
15002}
15003
15004/// On-premises instance configuration.
15005#[derive(Clone, Default, PartialEq)]
15006#[non_exhaustive]
15007pub struct OnPremisesConfiguration {
15008    /// The host and port of the on-premises instance in host:port format
15009    pub host_port: std::string::String,
15010
15011    /// This is always `sql#onPremisesConfiguration`.
15012    pub kind: std::string::String,
15013
15014    /// The username for connecting to on-premises instance.
15015    pub username: std::string::String,
15016
15017    /// The password for connecting to on-premises instance.
15018    pub password: std::string::String,
15019
15020    /// PEM representation of the trusted CA's x509 certificate.
15021    pub ca_certificate: std::string::String,
15022
15023    /// PEM representation of the replica's x509 certificate.
15024    pub client_certificate: std::string::String,
15025
15026    /// PEM representation of the replica's private key. The corresponding public
15027    /// key is encoded in the client's certificate.
15028    pub client_key: std::string::String,
15029
15030    /// The dump file to create the Cloud SQL replica.
15031    pub dump_file_path: std::string::String,
15032
15033    /// The reference to Cloud SQL instance if the source is Cloud SQL.
15034    pub source_instance: std::option::Option<crate::model::InstanceReference>,
15035
15036    /// Optional. A list of objects that the user selects for replication from an
15037    /// external source instance.
15038    pub selected_objects: std::vec::Vec<crate::model::SelectedObjects>,
15039
15040    /// Optional. SSL option for replica connection to the on-premises source.
15041    pub ssl_option: crate::model::on_premises_configuration::SslOption,
15042
15043    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15044}
15045
15046impl OnPremisesConfiguration {
15047    pub fn new() -> Self {
15048        std::default::Default::default()
15049    }
15050
15051    /// Sets the value of [host_port][crate::model::OnPremisesConfiguration::host_port].
15052    ///
15053    /// # Example
15054    /// ```ignore,no_run
15055    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15056    /// let x = OnPremisesConfiguration::new().set_host_port("example");
15057    /// ```
15058    pub fn set_host_port<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15059        self.host_port = v.into();
15060        self
15061    }
15062
15063    /// Sets the value of [kind][crate::model::OnPremisesConfiguration::kind].
15064    ///
15065    /// # Example
15066    /// ```ignore,no_run
15067    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15068    /// let x = OnPremisesConfiguration::new().set_kind("example");
15069    /// ```
15070    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15071        self.kind = v.into();
15072        self
15073    }
15074
15075    /// Sets the value of [username][crate::model::OnPremisesConfiguration::username].
15076    ///
15077    /// # Example
15078    /// ```ignore,no_run
15079    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15080    /// let x = OnPremisesConfiguration::new().set_username("example");
15081    /// ```
15082    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15083        self.username = v.into();
15084        self
15085    }
15086
15087    /// Sets the value of [password][crate::model::OnPremisesConfiguration::password].
15088    ///
15089    /// # Example
15090    /// ```ignore,no_run
15091    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15092    /// let x = OnPremisesConfiguration::new().set_password("example");
15093    /// ```
15094    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15095        self.password = v.into();
15096        self
15097    }
15098
15099    /// Sets the value of [ca_certificate][crate::model::OnPremisesConfiguration::ca_certificate].
15100    ///
15101    /// # Example
15102    /// ```ignore,no_run
15103    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15104    /// let x = OnPremisesConfiguration::new().set_ca_certificate("example");
15105    /// ```
15106    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15107        self.ca_certificate = v.into();
15108        self
15109    }
15110
15111    /// Sets the value of [client_certificate][crate::model::OnPremisesConfiguration::client_certificate].
15112    ///
15113    /// # Example
15114    /// ```ignore,no_run
15115    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15116    /// let x = OnPremisesConfiguration::new().set_client_certificate("example");
15117    /// ```
15118    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
15119        mut self,
15120        v: T,
15121    ) -> Self {
15122        self.client_certificate = v.into();
15123        self
15124    }
15125
15126    /// Sets the value of [client_key][crate::model::OnPremisesConfiguration::client_key].
15127    ///
15128    /// # Example
15129    /// ```ignore,no_run
15130    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15131    /// let x = OnPremisesConfiguration::new().set_client_key("example");
15132    /// ```
15133    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15134        self.client_key = v.into();
15135        self
15136    }
15137
15138    /// Sets the value of [dump_file_path][crate::model::OnPremisesConfiguration::dump_file_path].
15139    ///
15140    /// # Example
15141    /// ```ignore,no_run
15142    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15143    /// let x = OnPremisesConfiguration::new().set_dump_file_path("example");
15144    /// ```
15145    pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15146        self.dump_file_path = v.into();
15147        self
15148    }
15149
15150    /// Sets the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
15151    ///
15152    /// # Example
15153    /// ```ignore,no_run
15154    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15155    /// use google_cloud_sql_v1::model::InstanceReference;
15156    /// let x = OnPremisesConfiguration::new().set_source_instance(InstanceReference::default()/* use setters */);
15157    /// ```
15158    pub fn set_source_instance<T>(mut self, v: T) -> Self
15159    where
15160        T: std::convert::Into<crate::model::InstanceReference>,
15161    {
15162        self.source_instance = std::option::Option::Some(v.into());
15163        self
15164    }
15165
15166    /// Sets or clears the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
15167    ///
15168    /// # Example
15169    /// ```ignore,no_run
15170    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15171    /// use google_cloud_sql_v1::model::InstanceReference;
15172    /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(Some(InstanceReference::default()/* use setters */));
15173    /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(None::<InstanceReference>);
15174    /// ```
15175    pub fn set_or_clear_source_instance<T>(mut self, v: std::option::Option<T>) -> Self
15176    where
15177        T: std::convert::Into<crate::model::InstanceReference>,
15178    {
15179        self.source_instance = v.map(|x| x.into());
15180        self
15181    }
15182
15183    /// Sets the value of [selected_objects][crate::model::OnPremisesConfiguration::selected_objects].
15184    ///
15185    /// # Example
15186    /// ```ignore,no_run
15187    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15188    /// use google_cloud_sql_v1::model::SelectedObjects;
15189    /// let x = OnPremisesConfiguration::new()
15190    ///     .set_selected_objects([
15191    ///         SelectedObjects::default()/* use setters */,
15192    ///         SelectedObjects::default()/* use (different) setters */,
15193    ///     ]);
15194    /// ```
15195    pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
15196    where
15197        T: std::iter::IntoIterator<Item = V>,
15198        V: std::convert::Into<crate::model::SelectedObjects>,
15199    {
15200        use std::iter::Iterator;
15201        self.selected_objects = v.into_iter().map(|i| i.into()).collect();
15202        self
15203    }
15204
15205    /// Sets the value of [ssl_option][crate::model::OnPremisesConfiguration::ssl_option].
15206    ///
15207    /// # Example
15208    /// ```ignore,no_run
15209    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15210    /// use google_cloud_sql_v1::model::on_premises_configuration::SslOption;
15211    /// let x0 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Disable);
15212    /// let x1 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Require);
15213    /// let x2 = OnPremisesConfiguration::new().set_ssl_option(SslOption::VerifyCa);
15214    /// ```
15215    pub fn set_ssl_option<
15216        T: std::convert::Into<crate::model::on_premises_configuration::SslOption>,
15217    >(
15218        mut self,
15219        v: T,
15220    ) -> Self {
15221        self.ssl_option = v.into();
15222        self
15223    }
15224}
15225
15226impl wkt::message::Message for OnPremisesConfiguration {
15227    fn typename() -> &'static str {
15228        "type.googleapis.com/google.cloud.sql.v1.OnPremisesConfiguration"
15229    }
15230}
15231
15232/// Defines additional types related to [OnPremisesConfiguration].
15233pub mod on_premises_configuration {
15234    #[allow(unused_imports)]
15235    use super::*;
15236
15237    /// SslOption defines the SSL mode to be used for replica connection to the
15238    /// on-premises source.
15239    ///
15240    /// # Working with unknown values
15241    ///
15242    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15243    /// additional enum variants at any time. Adding new variants is not considered
15244    /// a breaking change. Applications should write their code in anticipation of:
15245    ///
15246    /// - New values appearing in future releases of the client library, **and**
15247    /// - New values received dynamically, without application changes.
15248    ///
15249    /// Please consult the [Working with enums] section in the user guide for some
15250    /// guidelines.
15251    ///
15252    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15253    #[derive(Clone, Debug, PartialEq)]
15254    #[non_exhaustive]
15255    pub enum SslOption {
15256        /// Unknown SSL option i.e. SSL option not specified by user.
15257        Unspecified,
15258        /// SSL is not used for replica connection to the on-premises source.
15259        Disable,
15260        /// SSL is required for replica connection to the on-premises source.
15261        Require,
15262        /// Verify CA is required for replica connection to the on-premises source.
15263        VerifyCa,
15264        /// If set, the enum was initialized with an unknown value.
15265        ///
15266        /// Applications can examine the value using [SslOption::value] or
15267        /// [SslOption::name].
15268        UnknownValue(ssl_option::UnknownValue),
15269    }
15270
15271    #[doc(hidden)]
15272    pub mod ssl_option {
15273        #[allow(unused_imports)]
15274        use super::*;
15275        #[derive(Clone, Debug, PartialEq)]
15276        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15277    }
15278
15279    impl SslOption {
15280        /// Gets the enum value.
15281        ///
15282        /// Returns `None` if the enum contains an unknown value deserialized from
15283        /// the string representation of enums.
15284        pub fn value(&self) -> std::option::Option<i32> {
15285            match self {
15286                Self::Unspecified => std::option::Option::Some(0),
15287                Self::Disable => std::option::Option::Some(1),
15288                Self::Require => std::option::Option::Some(2),
15289                Self::VerifyCa => std::option::Option::Some(3),
15290                Self::UnknownValue(u) => u.0.value(),
15291            }
15292        }
15293
15294        /// Gets the enum value as a string.
15295        ///
15296        /// Returns `None` if the enum contains an unknown value deserialized from
15297        /// the integer representation of enums.
15298        pub fn name(&self) -> std::option::Option<&str> {
15299            match self {
15300                Self::Unspecified => std::option::Option::Some("SSL_OPTION_UNSPECIFIED"),
15301                Self::Disable => std::option::Option::Some("DISABLE"),
15302                Self::Require => std::option::Option::Some("REQUIRE"),
15303                Self::VerifyCa => std::option::Option::Some("VERIFY_CA"),
15304                Self::UnknownValue(u) => u.0.name(),
15305            }
15306        }
15307    }
15308
15309    impl std::default::Default for SslOption {
15310        fn default() -> Self {
15311            use std::convert::From;
15312            Self::from(0)
15313        }
15314    }
15315
15316    impl std::fmt::Display for SslOption {
15317        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15318            wkt::internal::display_enum(f, self.name(), self.value())
15319        }
15320    }
15321
15322    impl std::convert::From<i32> for SslOption {
15323        fn from(value: i32) -> Self {
15324            match value {
15325                0 => Self::Unspecified,
15326                1 => Self::Disable,
15327                2 => Self::Require,
15328                3 => Self::VerifyCa,
15329                _ => Self::UnknownValue(ssl_option::UnknownValue(
15330                    wkt::internal::UnknownEnumValue::Integer(value),
15331                )),
15332            }
15333        }
15334    }
15335
15336    impl std::convert::From<&str> for SslOption {
15337        fn from(value: &str) -> Self {
15338            use std::string::ToString;
15339            match value {
15340                "SSL_OPTION_UNSPECIFIED" => Self::Unspecified,
15341                "DISABLE" => Self::Disable,
15342                "REQUIRE" => Self::Require,
15343                "VERIFY_CA" => Self::VerifyCa,
15344                _ => Self::UnknownValue(ssl_option::UnknownValue(
15345                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15346                )),
15347            }
15348        }
15349    }
15350
15351    impl serde::ser::Serialize for SslOption {
15352        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15353        where
15354            S: serde::Serializer,
15355        {
15356            match self {
15357                Self::Unspecified => serializer.serialize_i32(0),
15358                Self::Disable => serializer.serialize_i32(1),
15359                Self::Require => serializer.serialize_i32(2),
15360                Self::VerifyCa => serializer.serialize_i32(3),
15361                Self::UnknownValue(u) => u.0.serialize(serializer),
15362            }
15363        }
15364    }
15365
15366    impl<'de> serde::de::Deserialize<'de> for SslOption {
15367        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15368        where
15369            D: serde::Deserializer<'de>,
15370        {
15371            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslOption>::new(
15372                ".google.cloud.sql.v1.OnPremisesConfiguration.SslOption",
15373            ))
15374        }
15375    }
15376}
15377
15378/// Read-replica configuration for connecting to the primary instance.
15379#[derive(Clone, Default, PartialEq)]
15380#[non_exhaustive]
15381pub struct ReplicaConfiguration {
15382    /// This is always `sql#replicaConfiguration`.
15383    pub kind: std::string::String,
15384
15385    /// MySQL specific configuration when replicating from a MySQL on-premises
15386    /// primary instance. Replication configuration information such as the
15387    /// username, password, certificates, and keys are not stored in the instance
15388    /// metadata. The configuration information is used only to set up the
15389    /// replication connection and is stored by MySQL in a file named
15390    /// `master.info` in the data directory.
15391    pub mysql_replica_configuration: std::option::Option<crate::model::MySqlReplicaConfiguration>,
15392
15393    /// Specifies if the replica is the failover target. If the field is set to
15394    /// `true`, the replica will be designated as a failover replica. In case the
15395    /// primary instance fails, the replica instance will be promoted as the new
15396    /// primary instance. Only one replica can be specified as failover target, and
15397    /// the replica has to be in different zone with the primary instance.
15398    pub failover_target: std::option::Option<wkt::BoolValue>,
15399
15400    /// Optional. Specifies if a SQL Server replica is a cascadable replica. A
15401    /// cascadable replica is a SQL Server cross region replica that supports
15402    /// replica(s) under it.
15403    pub cascadable_replica: std::option::Option<wkt::BoolValue>,
15404
15405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15406}
15407
15408impl ReplicaConfiguration {
15409    pub fn new() -> Self {
15410        std::default::Default::default()
15411    }
15412
15413    /// Sets the value of [kind][crate::model::ReplicaConfiguration::kind].
15414    ///
15415    /// # Example
15416    /// ```ignore,no_run
15417    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15418    /// let x = ReplicaConfiguration::new().set_kind("example");
15419    /// ```
15420    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15421        self.kind = v.into();
15422        self
15423    }
15424
15425    /// Sets the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
15426    ///
15427    /// # Example
15428    /// ```ignore,no_run
15429    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15430    /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
15431    /// let x = ReplicaConfiguration::new().set_mysql_replica_configuration(MySqlReplicaConfiguration::default()/* use setters */);
15432    /// ```
15433    pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
15434    where
15435        T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
15436    {
15437        self.mysql_replica_configuration = std::option::Option::Some(v.into());
15438        self
15439    }
15440
15441    /// Sets or clears the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
15442    ///
15443    /// # Example
15444    /// ```ignore,no_run
15445    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15446    /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
15447    /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(Some(MySqlReplicaConfiguration::default()/* use setters */));
15448    /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(None::<MySqlReplicaConfiguration>);
15449    /// ```
15450    pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
15451    where
15452        T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
15453    {
15454        self.mysql_replica_configuration = v.map(|x| x.into());
15455        self
15456    }
15457
15458    /// Sets the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
15459    ///
15460    /// # Example
15461    /// ```ignore,no_run
15462    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15463    /// use wkt::BoolValue;
15464    /// let x = ReplicaConfiguration::new().set_failover_target(BoolValue::default()/* use setters */);
15465    /// ```
15466    pub fn set_failover_target<T>(mut self, v: T) -> Self
15467    where
15468        T: std::convert::Into<wkt::BoolValue>,
15469    {
15470        self.failover_target = std::option::Option::Some(v.into());
15471        self
15472    }
15473
15474    /// Sets or clears the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
15475    ///
15476    /// # Example
15477    /// ```ignore,no_run
15478    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15479    /// use wkt::BoolValue;
15480    /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(Some(BoolValue::default()/* use setters */));
15481    /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(None::<BoolValue>);
15482    /// ```
15483    pub fn set_or_clear_failover_target<T>(mut self, v: std::option::Option<T>) -> Self
15484    where
15485        T: std::convert::Into<wkt::BoolValue>,
15486    {
15487        self.failover_target = v.map(|x| x.into());
15488        self
15489    }
15490
15491    /// Sets the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
15492    ///
15493    /// # Example
15494    /// ```ignore,no_run
15495    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15496    /// use wkt::BoolValue;
15497    /// let x = ReplicaConfiguration::new().set_cascadable_replica(BoolValue::default()/* use setters */);
15498    /// ```
15499    pub fn set_cascadable_replica<T>(mut self, v: T) -> Self
15500    where
15501        T: std::convert::Into<wkt::BoolValue>,
15502    {
15503        self.cascadable_replica = std::option::Option::Some(v.into());
15504        self
15505    }
15506
15507    /// Sets or clears the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
15508    ///
15509    /// # Example
15510    /// ```ignore,no_run
15511    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15512    /// use wkt::BoolValue;
15513    /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(Some(BoolValue::default()/* use setters */));
15514    /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(None::<BoolValue>);
15515    /// ```
15516    pub fn set_or_clear_cascadable_replica<T>(mut self, v: std::option::Option<T>) -> Self
15517    where
15518        T: std::convert::Into<wkt::BoolValue>,
15519    {
15520        self.cascadable_replica = v.map(|x| x.into());
15521        self
15522    }
15523}
15524
15525impl wkt::message::Message for ReplicaConfiguration {
15526    fn typename() -> &'static str {
15527        "type.googleapis.com/google.cloud.sql.v1.ReplicaConfiguration"
15528    }
15529}
15530
15531/// Execute SQL statements request.
15532#[derive(Clone, Default, PartialEq)]
15533#[non_exhaustive]
15534pub struct SqlInstancesExecuteSqlRequest {
15535    /// Required. Database instance ID. This does not include the project ID.
15536    pub instance: std::string::String,
15537
15538    /// Required. Project ID of the project that contains the instance.
15539    pub project: std::string::String,
15540
15541    /// The request body.
15542    pub body: std::option::Option<crate::model::ExecuteSqlPayload>,
15543
15544    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15545}
15546
15547impl SqlInstancesExecuteSqlRequest {
15548    pub fn new() -> Self {
15549        std::default::Default::default()
15550    }
15551
15552    /// Sets the value of [instance][crate::model::SqlInstancesExecuteSqlRequest::instance].
15553    ///
15554    /// # Example
15555    /// ```ignore,no_run
15556    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15557    /// let x = SqlInstancesExecuteSqlRequest::new().set_instance("example");
15558    /// ```
15559    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15560        self.instance = v.into();
15561        self
15562    }
15563
15564    /// Sets the value of [project][crate::model::SqlInstancesExecuteSqlRequest::project].
15565    ///
15566    /// # Example
15567    /// ```ignore,no_run
15568    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15569    /// let x = SqlInstancesExecuteSqlRequest::new().set_project("example");
15570    /// ```
15571    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15572        self.project = v.into();
15573        self
15574    }
15575
15576    /// Sets the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
15577    ///
15578    /// # Example
15579    /// ```ignore,no_run
15580    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15581    /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
15582    /// let x = SqlInstancesExecuteSqlRequest::new().set_body(ExecuteSqlPayload::default()/* use setters */);
15583    /// ```
15584    pub fn set_body<T>(mut self, v: T) -> Self
15585    where
15586        T: std::convert::Into<crate::model::ExecuteSqlPayload>,
15587    {
15588        self.body = std::option::Option::Some(v.into());
15589        self
15590    }
15591
15592    /// Sets or clears the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
15593    ///
15594    /// # Example
15595    /// ```ignore,no_run
15596    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15597    /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
15598    /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(Some(ExecuteSqlPayload::default()/* use setters */));
15599    /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(None::<ExecuteSqlPayload>);
15600    /// ```
15601    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15602    where
15603        T: std::convert::Into<crate::model::ExecuteSqlPayload>,
15604    {
15605        self.body = v.map(|x| x.into());
15606        self
15607    }
15608}
15609
15610impl wkt::message::Message for SqlInstancesExecuteSqlRequest {
15611    fn typename() -> &'static str {
15612        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlRequest"
15613    }
15614}
15615
15616/// The request payload used to execute SQL statements.
15617#[derive(Clone, Default, PartialEq)]
15618#[non_exhaustive]
15619pub struct ExecuteSqlPayload {
15620    /// Optional. The name of an existing database user to connect to the database.
15621    /// When `auto_iam_authn` is set to true, this field is ignored and the API
15622    /// caller's IAM user is used.
15623    pub user: std::string::String,
15624
15625    /// Required. SQL statements to run on the database. It can be a single
15626    /// statement or a sequence of statements separated by semicolons.
15627    pub sql_statement: std::string::String,
15628
15629    /// Optional. Name of the database on which the statement will be executed.
15630    pub database: std::string::String,
15631
15632    /// Optional. The maximum number of rows returned per SQL statement.
15633    pub row_limit: i64,
15634
15635    /// Optional. Controls how the API should respond when the SQL execution result
15636    /// is incomplete due to the size limit or another error. The default mode is
15637    /// to throw an error.
15638    pub partial_result_mode: crate::model::execute_sql_payload::PartialResultMode,
15639
15640    /// Credentials for the database connection.
15641    pub user_password: std::option::Option<crate::model::execute_sql_payload::UserPassword>,
15642
15643    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15644}
15645
15646impl ExecuteSqlPayload {
15647    pub fn new() -> Self {
15648        std::default::Default::default()
15649    }
15650
15651    /// Sets the value of [user][crate::model::ExecuteSqlPayload::user].
15652    ///
15653    /// # Example
15654    /// ```ignore,no_run
15655    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15656    /// let x = ExecuteSqlPayload::new().set_user("example");
15657    /// ```
15658    pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15659        self.user = v.into();
15660        self
15661    }
15662
15663    /// Sets the value of [sql_statement][crate::model::ExecuteSqlPayload::sql_statement].
15664    ///
15665    /// # Example
15666    /// ```ignore,no_run
15667    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15668    /// let x = ExecuteSqlPayload::new().set_sql_statement("example");
15669    /// ```
15670    pub fn set_sql_statement<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15671        self.sql_statement = v.into();
15672        self
15673    }
15674
15675    /// Sets the value of [database][crate::model::ExecuteSqlPayload::database].
15676    ///
15677    /// # Example
15678    /// ```ignore,no_run
15679    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15680    /// let x = ExecuteSqlPayload::new().set_database("example");
15681    /// ```
15682    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15683        self.database = v.into();
15684        self
15685    }
15686
15687    /// Sets the value of [row_limit][crate::model::ExecuteSqlPayload::row_limit].
15688    ///
15689    /// # Example
15690    /// ```ignore,no_run
15691    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15692    /// let x = ExecuteSqlPayload::new().set_row_limit(42);
15693    /// ```
15694    pub fn set_row_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15695        self.row_limit = v.into();
15696        self
15697    }
15698
15699    /// Sets the value of [partial_result_mode][crate::model::ExecuteSqlPayload::partial_result_mode].
15700    ///
15701    /// # Example
15702    /// ```ignore,no_run
15703    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15704    /// use google_cloud_sql_v1::model::execute_sql_payload::PartialResultMode;
15705    /// let x0 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::FailPartialResult);
15706    /// let x1 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::AllowPartialResult);
15707    /// ```
15708    pub fn set_partial_result_mode<
15709        T: std::convert::Into<crate::model::execute_sql_payload::PartialResultMode>,
15710    >(
15711        mut self,
15712        v: T,
15713    ) -> Self {
15714        self.partial_result_mode = v.into();
15715        self
15716    }
15717
15718    /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password].
15719    ///
15720    /// Note that all the setters affecting `user_password` are mutually
15721    /// exclusive.
15722    ///
15723    /// # Example
15724    /// ```ignore,no_run
15725    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15726    /// use google_cloud_sql_v1::model::execute_sql_payload::UserPassword;
15727    /// let x = ExecuteSqlPayload::new().set_user_password(Some(UserPassword::AutoIamAuthn(true)));
15728    /// ```
15729    pub fn set_user_password<
15730        T: std::convert::Into<std::option::Option<crate::model::execute_sql_payload::UserPassword>>,
15731    >(
15732        mut self,
15733        v: T,
15734    ) -> Self {
15735        self.user_password = v.into();
15736        self
15737    }
15738
15739    /// The value of [user_password][crate::model::ExecuteSqlPayload::user_password]
15740    /// if it holds a `AutoIamAuthn`, `None` if the field is not set or
15741    /// holds a different branch.
15742    pub fn auto_iam_authn(&self) -> std::option::Option<&bool> {
15743        #[allow(unreachable_patterns)]
15744        self.user_password.as_ref().and_then(|v| match v {
15745            crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v) => {
15746                std::option::Option::Some(v)
15747            }
15748            _ => std::option::Option::None,
15749        })
15750    }
15751
15752    /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password]
15753    /// to hold a `AutoIamAuthn`.
15754    ///
15755    /// Note that all the setters affecting `user_password` are
15756    /// mutually exclusive.
15757    ///
15758    /// # Example
15759    /// ```ignore,no_run
15760    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15761    /// let x = ExecuteSqlPayload::new().set_auto_iam_authn(true);
15762    /// assert!(x.auto_iam_authn().is_some());
15763    /// ```
15764    pub fn set_auto_iam_authn<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15765        self.user_password = std::option::Option::Some(
15766            crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v.into()),
15767        );
15768        self
15769    }
15770}
15771
15772impl wkt::message::Message for ExecuteSqlPayload {
15773    fn typename() -> &'static str {
15774        "type.googleapis.com/google.cloud.sql.v1.ExecuteSqlPayload"
15775    }
15776}
15777
15778/// Defines additional types related to [ExecuteSqlPayload].
15779pub mod execute_sql_payload {
15780    #[allow(unused_imports)]
15781    use super::*;
15782
15783    /// Controls how the API should respond when the SQL execution result exceeds
15784    /// 10 MB.
15785    ///
15786    /// # Working with unknown values
15787    ///
15788    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15789    /// additional enum variants at any time. Adding new variants is not considered
15790    /// a breaking change. Applications should write their code in anticipation of:
15791    ///
15792    /// - New values appearing in future releases of the client library, **and**
15793    /// - New values received dynamically, without application changes.
15794    ///
15795    /// Please consult the [Working with enums] section in the user guide for some
15796    /// guidelines.
15797    ///
15798    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15799    #[derive(Clone, Debug, PartialEq)]
15800    #[non_exhaustive]
15801    pub enum PartialResultMode {
15802        /// Unspecified mode, effectively the same as `FAIL_PARTIAL_RESULT`.
15803        Unspecified,
15804        /// Throw an error if the result exceeds 10 MB or if only a partial result
15805        /// can be retrieved. Don't return the result.
15806        FailPartialResult,
15807        /// Return a truncated result and set `partial_result` to true if the result
15808        /// exceeds 10 MB or if only a partial result can be retrieved due to error.
15809        /// Don't throw an error.
15810        AllowPartialResult,
15811        /// If set, the enum was initialized with an unknown value.
15812        ///
15813        /// Applications can examine the value using [PartialResultMode::value] or
15814        /// [PartialResultMode::name].
15815        UnknownValue(partial_result_mode::UnknownValue),
15816    }
15817
15818    #[doc(hidden)]
15819    pub mod partial_result_mode {
15820        #[allow(unused_imports)]
15821        use super::*;
15822        #[derive(Clone, Debug, PartialEq)]
15823        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15824    }
15825
15826    impl PartialResultMode {
15827        /// Gets the enum value.
15828        ///
15829        /// Returns `None` if the enum contains an unknown value deserialized from
15830        /// the string representation of enums.
15831        pub fn value(&self) -> std::option::Option<i32> {
15832            match self {
15833                Self::Unspecified => std::option::Option::Some(0),
15834                Self::FailPartialResult => std::option::Option::Some(1),
15835                Self::AllowPartialResult => std::option::Option::Some(2),
15836                Self::UnknownValue(u) => u.0.value(),
15837            }
15838        }
15839
15840        /// Gets the enum value as a string.
15841        ///
15842        /// Returns `None` if the enum contains an unknown value deserialized from
15843        /// the integer representation of enums.
15844        pub fn name(&self) -> std::option::Option<&str> {
15845            match self {
15846                Self::Unspecified => std::option::Option::Some("PARTIAL_RESULT_MODE_UNSPECIFIED"),
15847                Self::FailPartialResult => std::option::Option::Some("FAIL_PARTIAL_RESULT"),
15848                Self::AllowPartialResult => std::option::Option::Some("ALLOW_PARTIAL_RESULT"),
15849                Self::UnknownValue(u) => u.0.name(),
15850            }
15851        }
15852    }
15853
15854    impl std::default::Default for PartialResultMode {
15855        fn default() -> Self {
15856            use std::convert::From;
15857            Self::from(0)
15858        }
15859    }
15860
15861    impl std::fmt::Display for PartialResultMode {
15862        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15863            wkt::internal::display_enum(f, self.name(), self.value())
15864        }
15865    }
15866
15867    impl std::convert::From<i32> for PartialResultMode {
15868        fn from(value: i32) -> Self {
15869            match value {
15870                0 => Self::Unspecified,
15871                1 => Self::FailPartialResult,
15872                2 => Self::AllowPartialResult,
15873                _ => Self::UnknownValue(partial_result_mode::UnknownValue(
15874                    wkt::internal::UnknownEnumValue::Integer(value),
15875                )),
15876            }
15877        }
15878    }
15879
15880    impl std::convert::From<&str> for PartialResultMode {
15881        fn from(value: &str) -> Self {
15882            use std::string::ToString;
15883            match value {
15884                "PARTIAL_RESULT_MODE_UNSPECIFIED" => Self::Unspecified,
15885                "FAIL_PARTIAL_RESULT" => Self::FailPartialResult,
15886                "ALLOW_PARTIAL_RESULT" => Self::AllowPartialResult,
15887                _ => Self::UnknownValue(partial_result_mode::UnknownValue(
15888                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15889                )),
15890            }
15891        }
15892    }
15893
15894    impl serde::ser::Serialize for PartialResultMode {
15895        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15896        where
15897            S: serde::Serializer,
15898        {
15899            match self {
15900                Self::Unspecified => serializer.serialize_i32(0),
15901                Self::FailPartialResult => serializer.serialize_i32(1),
15902                Self::AllowPartialResult => serializer.serialize_i32(2),
15903                Self::UnknownValue(u) => u.0.serialize(serializer),
15904            }
15905        }
15906    }
15907
15908    impl<'de> serde::de::Deserialize<'de> for PartialResultMode {
15909        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15910        where
15911            D: serde::Deserializer<'de>,
15912        {
15913            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PartialResultMode>::new(
15914                ".google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode",
15915            ))
15916        }
15917    }
15918
15919    /// Credentials for the database connection.
15920    #[derive(Clone, Debug, PartialEq)]
15921    #[non_exhaustive]
15922    pub enum UserPassword {
15923        /// Optional. When set to true, the API caller identity associated with the
15924        /// request is used for database authentication. The API caller must be an
15925        /// IAM user in the database.
15926        AutoIamAuthn(bool),
15927    }
15928}
15929
15930/// Execute SQL statements response.
15931#[derive(Clone, Default, PartialEq)]
15932#[non_exhaustive]
15933pub struct SqlInstancesExecuteSqlResponse {
15934    /// A list of notices and warnings generated during query execution.
15935    /// For PostgreSQL, this includes all notices and warnings.
15936    /// For MySQL, this includes warnings generated by the last executed statement.
15937    /// To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
15938    /// be executed after each statement.
15939    pub messages: std::vec::Vec<crate::model::sql_instances_execute_sql_response::Message>,
15940
15941    /// The additional metadata information regarding the execution of the SQL
15942    /// statements.
15943    pub metadata: std::option::Option<crate::model::Metadata>,
15944
15945    /// The list of results after executing all the SQL statements.
15946    pub results: std::vec::Vec<crate::model::QueryResult>,
15947
15948    /// Contains the error from the database if the SQL execution failed.
15949    pub status: std::option::Option<rpc::model::Status>,
15950
15951    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15952}
15953
15954impl SqlInstancesExecuteSqlResponse {
15955    pub fn new() -> Self {
15956        std::default::Default::default()
15957    }
15958
15959    /// Sets the value of [messages][crate::model::SqlInstancesExecuteSqlResponse::messages].
15960    ///
15961    /// # Example
15962    /// ```ignore,no_run
15963    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
15964    /// use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
15965    /// let x = SqlInstancesExecuteSqlResponse::new()
15966    ///     .set_messages([
15967    ///         Message::default()/* use setters */,
15968    ///         Message::default()/* use (different) setters */,
15969    ///     ]);
15970    /// ```
15971    pub fn set_messages<T, V>(mut self, v: T) -> Self
15972    where
15973        T: std::iter::IntoIterator<Item = V>,
15974        V: std::convert::Into<crate::model::sql_instances_execute_sql_response::Message>,
15975    {
15976        use std::iter::Iterator;
15977        self.messages = v.into_iter().map(|i| i.into()).collect();
15978        self
15979    }
15980
15981    /// Sets the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
15982    ///
15983    /// # Example
15984    /// ```ignore,no_run
15985    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
15986    /// use google_cloud_sql_v1::model::Metadata;
15987    /// let x = SqlInstancesExecuteSqlResponse::new().set_metadata(Metadata::default()/* use setters */);
15988    /// ```
15989    pub fn set_metadata<T>(mut self, v: T) -> Self
15990    where
15991        T: std::convert::Into<crate::model::Metadata>,
15992    {
15993        self.metadata = std::option::Option::Some(v.into());
15994        self
15995    }
15996
15997    /// Sets or clears the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
15998    ///
15999    /// # Example
16000    /// ```ignore,no_run
16001    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16002    /// use google_cloud_sql_v1::model::Metadata;
16003    /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
16004    /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(None::<Metadata>);
16005    /// ```
16006    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16007    where
16008        T: std::convert::Into<crate::model::Metadata>,
16009    {
16010        self.metadata = v.map(|x| x.into());
16011        self
16012    }
16013
16014    /// Sets the value of [results][crate::model::SqlInstancesExecuteSqlResponse::results].
16015    ///
16016    /// # Example
16017    /// ```ignore,no_run
16018    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16019    /// use google_cloud_sql_v1::model::QueryResult;
16020    /// let x = SqlInstancesExecuteSqlResponse::new()
16021    ///     .set_results([
16022    ///         QueryResult::default()/* use setters */,
16023    ///         QueryResult::default()/* use (different) setters */,
16024    ///     ]);
16025    /// ```
16026    pub fn set_results<T, V>(mut self, v: T) -> Self
16027    where
16028        T: std::iter::IntoIterator<Item = V>,
16029        V: std::convert::Into<crate::model::QueryResult>,
16030    {
16031        use std::iter::Iterator;
16032        self.results = v.into_iter().map(|i| i.into()).collect();
16033        self
16034    }
16035
16036    /// Sets the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
16037    ///
16038    /// # Example
16039    /// ```ignore,no_run
16040    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16041    /// use rpc::model::Status;
16042    /// let x = SqlInstancesExecuteSqlResponse::new().set_status(Status::default()/* use setters */);
16043    /// ```
16044    pub fn set_status<T>(mut self, v: T) -> Self
16045    where
16046        T: std::convert::Into<rpc::model::Status>,
16047    {
16048        self.status = std::option::Option::Some(v.into());
16049        self
16050    }
16051
16052    /// Sets or clears the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
16053    ///
16054    /// # Example
16055    /// ```ignore,no_run
16056    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16057    /// use rpc::model::Status;
16058    /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(Some(Status::default()/* use setters */));
16059    /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(None::<Status>);
16060    /// ```
16061    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
16062    where
16063        T: std::convert::Into<rpc::model::Status>,
16064    {
16065        self.status = v.map(|x| x.into());
16066        self
16067    }
16068}
16069
16070impl wkt::message::Message for SqlInstancesExecuteSqlResponse {
16071    fn typename() -> &'static str {
16072        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse"
16073    }
16074}
16075
16076/// Defines additional types related to [SqlInstancesExecuteSqlResponse].
16077pub mod sql_instances_execute_sql_response {
16078    #[allow(unused_imports)]
16079    use super::*;
16080
16081    /// Represents a notice or warning message from the database.
16082    #[derive(Clone, Default, PartialEq)]
16083    #[non_exhaustive]
16084    pub struct Message {
16085        /// The full message string.
16086        /// For PostgreSQL, this is a formatted string that may include severity,
16087        /// code, and the notice/warning message.
16088        /// For MySQL, this contains the warning message.
16089        pub message: std::option::Option<std::string::String>,
16090
16091        /// The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
16092        /// MySQL).
16093        pub severity: std::option::Option<std::string::String>,
16094
16095        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16096    }
16097
16098    impl Message {
16099        pub fn new() -> Self {
16100            std::default::Default::default()
16101        }
16102
16103        /// Sets the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
16104        ///
16105        /// # Example
16106        /// ```ignore,no_run
16107        /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16108        /// let x = Message::new().set_message("example");
16109        /// ```
16110        pub fn set_message<T>(mut self, v: T) -> Self
16111        where
16112            T: std::convert::Into<std::string::String>,
16113        {
16114            self.message = std::option::Option::Some(v.into());
16115            self
16116        }
16117
16118        /// Sets or clears the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
16119        ///
16120        /// # Example
16121        /// ```ignore,no_run
16122        /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16123        /// let x = Message::new().set_or_clear_message(Some("example"));
16124        /// let x = Message::new().set_or_clear_message(None::<String>);
16125        /// ```
16126        pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
16127        where
16128            T: std::convert::Into<std::string::String>,
16129        {
16130            self.message = v.map(|x| x.into());
16131            self
16132        }
16133
16134        /// Sets the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
16135        ///
16136        /// # Example
16137        /// ```ignore,no_run
16138        /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16139        /// let x = Message::new().set_severity("example");
16140        /// ```
16141        pub fn set_severity<T>(mut self, v: T) -> Self
16142        where
16143            T: std::convert::Into<std::string::String>,
16144        {
16145            self.severity = std::option::Option::Some(v.into());
16146            self
16147        }
16148
16149        /// Sets or clears the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
16150        ///
16151        /// # Example
16152        /// ```ignore,no_run
16153        /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16154        /// let x = Message::new().set_or_clear_severity(Some("example"));
16155        /// let x = Message::new().set_or_clear_severity(None::<String>);
16156        /// ```
16157        pub fn set_or_clear_severity<T>(mut self, v: std::option::Option<T>) -> Self
16158        where
16159            T: std::convert::Into<std::string::String>,
16160        {
16161            self.severity = v.map(|x| x.into());
16162            self
16163        }
16164    }
16165
16166    impl wkt::message::Message for Message {
16167        fn typename() -> &'static str {
16168            "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message"
16169        }
16170    }
16171}
16172
16173/// QueryResult contains the result of executing a single SQL statement.
16174#[derive(Clone, Default, PartialEq)]
16175#[non_exhaustive]
16176pub struct QueryResult {
16177    /// List of columns included in the result. This also includes the data type
16178    /// of the column.
16179    pub columns: std::vec::Vec<crate::model::Column>,
16180
16181    /// Rows returned by the SQL statement.
16182    pub rows: std::vec::Vec<crate::model::Row>,
16183
16184    /// Message related to the SQL execution result.
16185    pub message: std::string::String,
16186
16187    /// Set to true if the SQL execution's result is truncated due to size limits
16188    /// or an error retrieving results.
16189    pub partial_result: bool,
16190
16191    /// If results were truncated due to an error, details of that error.
16192    pub status: std::option::Option<rpc::model::Status>,
16193
16194    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16195}
16196
16197impl QueryResult {
16198    pub fn new() -> Self {
16199        std::default::Default::default()
16200    }
16201
16202    /// Sets the value of [columns][crate::model::QueryResult::columns].
16203    ///
16204    /// # Example
16205    /// ```ignore,no_run
16206    /// # use google_cloud_sql_v1::model::QueryResult;
16207    /// use google_cloud_sql_v1::model::Column;
16208    /// let x = QueryResult::new()
16209    ///     .set_columns([
16210    ///         Column::default()/* use setters */,
16211    ///         Column::default()/* use (different) setters */,
16212    ///     ]);
16213    /// ```
16214    pub fn set_columns<T, V>(mut self, v: T) -> Self
16215    where
16216        T: std::iter::IntoIterator<Item = V>,
16217        V: std::convert::Into<crate::model::Column>,
16218    {
16219        use std::iter::Iterator;
16220        self.columns = v.into_iter().map(|i| i.into()).collect();
16221        self
16222    }
16223
16224    /// Sets the value of [rows][crate::model::QueryResult::rows].
16225    ///
16226    /// # Example
16227    /// ```ignore,no_run
16228    /// # use google_cloud_sql_v1::model::QueryResult;
16229    /// use google_cloud_sql_v1::model::Row;
16230    /// let x = QueryResult::new()
16231    ///     .set_rows([
16232    ///         Row::default()/* use setters */,
16233    ///         Row::default()/* use (different) setters */,
16234    ///     ]);
16235    /// ```
16236    pub fn set_rows<T, V>(mut self, v: T) -> Self
16237    where
16238        T: std::iter::IntoIterator<Item = V>,
16239        V: std::convert::Into<crate::model::Row>,
16240    {
16241        use std::iter::Iterator;
16242        self.rows = v.into_iter().map(|i| i.into()).collect();
16243        self
16244    }
16245
16246    /// Sets the value of [message][crate::model::QueryResult::message].
16247    ///
16248    /// # Example
16249    /// ```ignore,no_run
16250    /// # use google_cloud_sql_v1::model::QueryResult;
16251    /// let x = QueryResult::new().set_message("example");
16252    /// ```
16253    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16254        self.message = v.into();
16255        self
16256    }
16257
16258    /// Sets the value of [partial_result][crate::model::QueryResult::partial_result].
16259    ///
16260    /// # Example
16261    /// ```ignore,no_run
16262    /// # use google_cloud_sql_v1::model::QueryResult;
16263    /// let x = QueryResult::new().set_partial_result(true);
16264    /// ```
16265    pub fn set_partial_result<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16266        self.partial_result = v.into();
16267        self
16268    }
16269
16270    /// Sets the value of [status][crate::model::QueryResult::status].
16271    ///
16272    /// # Example
16273    /// ```ignore,no_run
16274    /// # use google_cloud_sql_v1::model::QueryResult;
16275    /// use rpc::model::Status;
16276    /// let x = QueryResult::new().set_status(Status::default()/* use setters */);
16277    /// ```
16278    pub fn set_status<T>(mut self, v: T) -> Self
16279    where
16280        T: std::convert::Into<rpc::model::Status>,
16281    {
16282        self.status = std::option::Option::Some(v.into());
16283        self
16284    }
16285
16286    /// Sets or clears the value of [status][crate::model::QueryResult::status].
16287    ///
16288    /// # Example
16289    /// ```ignore,no_run
16290    /// # use google_cloud_sql_v1::model::QueryResult;
16291    /// use rpc::model::Status;
16292    /// let x = QueryResult::new().set_or_clear_status(Some(Status::default()/* use setters */));
16293    /// let x = QueryResult::new().set_or_clear_status(None::<Status>);
16294    /// ```
16295    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
16296    where
16297        T: std::convert::Into<rpc::model::Status>,
16298    {
16299        self.status = v.map(|x| x.into());
16300        self
16301    }
16302}
16303
16304impl wkt::message::Message for QueryResult {
16305    fn typename() -> &'static str {
16306        "type.googleapis.com/google.cloud.sql.v1.QueryResult"
16307    }
16308}
16309
16310/// Contains the name and datatype of a column.
16311#[derive(Clone, Default, PartialEq)]
16312#[non_exhaustive]
16313pub struct Column {
16314    /// Name of the column.
16315    pub name: std::string::String,
16316
16317    /// Datatype of the column.
16318    pub r#type: std::string::String,
16319
16320    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16321}
16322
16323impl Column {
16324    pub fn new() -> Self {
16325        std::default::Default::default()
16326    }
16327
16328    /// Sets the value of [name][crate::model::Column::name].
16329    ///
16330    /// # Example
16331    /// ```ignore,no_run
16332    /// # use google_cloud_sql_v1::model::Column;
16333    /// let x = Column::new().set_name("example");
16334    /// ```
16335    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16336        self.name = v.into();
16337        self
16338    }
16339
16340    /// Sets the value of [r#type][crate::model::Column::type].
16341    ///
16342    /// # Example
16343    /// ```ignore,no_run
16344    /// # use google_cloud_sql_v1::model::Column;
16345    /// let x = Column::new().set_type("example");
16346    /// ```
16347    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16348        self.r#type = v.into();
16349        self
16350    }
16351}
16352
16353impl wkt::message::Message for Column {
16354    fn typename() -> &'static str {
16355        "type.googleapis.com/google.cloud.sql.v1.Column"
16356    }
16357}
16358
16359/// Contains the values for a row.
16360#[derive(Clone, Default, PartialEq)]
16361#[non_exhaustive]
16362pub struct Row {
16363    /// The values for the row.
16364    pub values: std::vec::Vec<crate::model::Value>,
16365
16366    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16367}
16368
16369impl Row {
16370    pub fn new() -> Self {
16371        std::default::Default::default()
16372    }
16373
16374    /// Sets the value of [values][crate::model::Row::values].
16375    ///
16376    /// # Example
16377    /// ```ignore,no_run
16378    /// # use google_cloud_sql_v1::model::Row;
16379    /// use google_cloud_sql_v1::model::Value;
16380    /// let x = Row::new()
16381    ///     .set_values([
16382    ///         Value::default()/* use setters */,
16383    ///         Value::default()/* use (different) setters */,
16384    ///     ]);
16385    /// ```
16386    pub fn set_values<T, V>(mut self, v: T) -> Self
16387    where
16388        T: std::iter::IntoIterator<Item = V>,
16389        V: std::convert::Into<crate::model::Value>,
16390    {
16391        use std::iter::Iterator;
16392        self.values = v.into_iter().map(|i| i.into()).collect();
16393        self
16394    }
16395}
16396
16397impl wkt::message::Message for Row {
16398    fn typename() -> &'static str {
16399        "type.googleapis.com/google.cloud.sql.v1.Row"
16400    }
16401}
16402
16403/// The cell value of the table.
16404#[derive(Clone, Default, PartialEq)]
16405#[non_exhaustive]
16406pub struct Value {
16407    /// The cell value in string format.
16408    pub value: std::string::String,
16409
16410    /// If cell value is null, then this flag will be set to true.
16411    pub null_value: bool,
16412
16413    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16414}
16415
16416impl Value {
16417    pub fn new() -> Self {
16418        std::default::Default::default()
16419    }
16420
16421    /// Sets the value of [value][crate::model::Value::value].
16422    ///
16423    /// # Example
16424    /// ```ignore,no_run
16425    /// # use google_cloud_sql_v1::model::Value;
16426    /// let x = Value::new().set_value("example");
16427    /// ```
16428    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16429        self.value = v.into();
16430        self
16431    }
16432
16433    /// Sets the value of [null_value][crate::model::Value::null_value].
16434    ///
16435    /// # Example
16436    /// ```ignore,no_run
16437    /// # use google_cloud_sql_v1::model::Value;
16438    /// let x = Value::new().set_null_value(true);
16439    /// ```
16440    pub fn set_null_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16441        self.null_value = v.into();
16442        self
16443    }
16444}
16445
16446impl wkt::message::Message for Value {
16447    fn typename() -> &'static str {
16448        "type.googleapis.com/google.cloud.sql.v1.Value"
16449    }
16450}
16451
16452/// The additional metadata information regarding the execution of the SQL
16453/// statements.
16454#[derive(Clone, Default, PartialEq)]
16455#[non_exhaustive]
16456pub struct Metadata {
16457    /// The time taken to execute the SQL statements.
16458    pub sql_statement_execution_time: std::option::Option<wkt::Duration>,
16459
16460    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16461}
16462
16463impl Metadata {
16464    pub fn new() -> Self {
16465        std::default::Default::default()
16466    }
16467
16468    /// Sets the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
16469    ///
16470    /// # Example
16471    /// ```ignore,no_run
16472    /// # use google_cloud_sql_v1::model::Metadata;
16473    /// use wkt::Duration;
16474    /// let x = Metadata::new().set_sql_statement_execution_time(Duration::default()/* use setters */);
16475    /// ```
16476    pub fn set_sql_statement_execution_time<T>(mut self, v: T) -> Self
16477    where
16478        T: std::convert::Into<wkt::Duration>,
16479    {
16480        self.sql_statement_execution_time = std::option::Option::Some(v.into());
16481        self
16482    }
16483
16484    /// Sets or clears the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
16485    ///
16486    /// # Example
16487    /// ```ignore,no_run
16488    /// # use google_cloud_sql_v1::model::Metadata;
16489    /// use wkt::Duration;
16490    /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(Some(Duration::default()/* use setters */));
16491    /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(None::<Duration>);
16492    /// ```
16493    pub fn set_or_clear_sql_statement_execution_time<T>(mut self, v: std::option::Option<T>) -> Self
16494    where
16495        T: std::convert::Into<wkt::Duration>,
16496    {
16497        self.sql_statement_execution_time = v.map(|x| x.into());
16498        self
16499    }
16500}
16501
16502impl wkt::message::Message for Metadata {
16503    fn typename() -> &'static str {
16504        "type.googleapis.com/google.cloud.sql.v1.Metadata"
16505    }
16506}
16507
16508/// Request to acquire a lease for SSRS.
16509#[derive(Clone, Default, PartialEq)]
16510#[non_exhaustive]
16511pub struct SqlInstancesAcquireSsrsLeaseRequest {
16512    /// Required. Cloud SQL instance ID. This doesn't include the project ID. It's
16513    /// composed of lowercase letters, numbers, and hyphens, and it must start with
16514    /// a letter. The total length must be 98 characters or less (Example:
16515    /// instance-id).
16516    pub instance: std::string::String,
16517
16518    /// Required. Project ID of the project that contains the instance (Example:
16519    /// project-id).
16520    pub project: std::string::String,
16521
16522    /// Required. The request body.
16523    pub body: std::option::Option<crate::model::InstancesAcquireSsrsLeaseRequest>,
16524
16525    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16526}
16527
16528impl SqlInstancesAcquireSsrsLeaseRequest {
16529    pub fn new() -> Self {
16530        std::default::Default::default()
16531    }
16532
16533    /// Sets the value of [instance][crate::model::SqlInstancesAcquireSsrsLeaseRequest::instance].
16534    ///
16535    /// # Example
16536    /// ```ignore,no_run
16537    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16538    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_instance("example");
16539    /// ```
16540    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16541        self.instance = v.into();
16542        self
16543    }
16544
16545    /// Sets the value of [project][crate::model::SqlInstancesAcquireSsrsLeaseRequest::project].
16546    ///
16547    /// # Example
16548    /// ```ignore,no_run
16549    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16550    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_project("example");
16551    /// ```
16552    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16553        self.project = v.into();
16554        self
16555    }
16556
16557    /// Sets the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
16558    ///
16559    /// # Example
16560    /// ```ignore,no_run
16561    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16562    /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
16563    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_body(InstancesAcquireSsrsLeaseRequest::default()/* use setters */);
16564    /// ```
16565    pub fn set_body<T>(mut self, v: T) -> Self
16566    where
16567        T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
16568    {
16569        self.body = std::option::Option::Some(v.into());
16570        self
16571    }
16572
16573    /// Sets or clears the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
16574    ///
16575    /// # Example
16576    /// ```ignore,no_run
16577    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16578    /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
16579    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(Some(InstancesAcquireSsrsLeaseRequest::default()/* use setters */));
16580    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(None::<InstancesAcquireSsrsLeaseRequest>);
16581    /// ```
16582    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16583    where
16584        T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
16585    {
16586        self.body = v.map(|x| x.into());
16587        self
16588    }
16589}
16590
16591impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseRequest {
16592    fn typename() -> &'static str {
16593        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest"
16594    }
16595}
16596
16597/// Response for the acquire SSRS lease request.
16598#[derive(Clone, Default, PartialEq)]
16599#[non_exhaustive]
16600pub struct SqlInstancesAcquireSsrsLeaseResponse {
16601    /// The unique identifier for this operation.
16602    pub operation_id: std::string::String,
16603
16604    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16605}
16606
16607impl SqlInstancesAcquireSsrsLeaseResponse {
16608    pub fn new() -> Self {
16609        std::default::Default::default()
16610    }
16611
16612    /// Sets the value of [operation_id][crate::model::SqlInstancesAcquireSsrsLeaseResponse::operation_id].
16613    ///
16614    /// # Example
16615    /// ```ignore,no_run
16616    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseResponse;
16617    /// let x = SqlInstancesAcquireSsrsLeaseResponse::new().set_operation_id("example");
16618    /// ```
16619    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16620        self.operation_id = v.into();
16621        self
16622    }
16623}
16624
16625impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseResponse {
16626    fn typename() -> &'static str {
16627        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse"
16628    }
16629}
16630
16631/// Request to release a lease for SSRS.
16632#[derive(Clone, Default, PartialEq)]
16633#[non_exhaustive]
16634pub struct SqlInstancesReleaseSsrsLeaseRequest {
16635    /// Required. The Cloud SQL instance ID. This doesn't include the project ID.
16636    /// The instance ID contains lowercase letters, numbers, and hyphens, and it
16637    /// must start with a letter. This ID can have a maximum length of 98
16638    /// characters.
16639    pub instance: std::string::String,
16640
16641    /// Required. The project ID that contains the instance.
16642    pub project: std::string::String,
16643
16644    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16645}
16646
16647impl SqlInstancesReleaseSsrsLeaseRequest {
16648    pub fn new() -> Self {
16649        std::default::Default::default()
16650    }
16651
16652    /// Sets the value of [instance][crate::model::SqlInstancesReleaseSsrsLeaseRequest::instance].
16653    ///
16654    /// # Example
16655    /// ```ignore,no_run
16656    /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
16657    /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_instance("example");
16658    /// ```
16659    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16660        self.instance = v.into();
16661        self
16662    }
16663
16664    /// Sets the value of [project][crate::model::SqlInstancesReleaseSsrsLeaseRequest::project].
16665    ///
16666    /// # Example
16667    /// ```ignore,no_run
16668    /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
16669    /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_project("example");
16670    /// ```
16671    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16672        self.project = v.into();
16673        self
16674    }
16675}
16676
16677impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseRequest {
16678    fn typename() -> &'static str {
16679        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest"
16680    }
16681}
16682
16683/// Response for the release SSRS lease request.
16684#[derive(Clone, Default, PartialEq)]
16685#[non_exhaustive]
16686pub struct SqlInstancesReleaseSsrsLeaseResponse {
16687    /// The unique identifier for this operation.
16688    pub operation_id: std::string::String,
16689
16690    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16691}
16692
16693impl SqlInstancesReleaseSsrsLeaseResponse {
16694    pub fn new() -> Self {
16695        std::default::Default::default()
16696    }
16697
16698    /// Sets the value of [operation_id][crate::model::SqlInstancesReleaseSsrsLeaseResponse::operation_id].
16699    ///
16700    /// # Example
16701    /// ```ignore,no_run
16702    /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseResponse;
16703    /// let x = SqlInstancesReleaseSsrsLeaseResponse::new().set_operation_id("example");
16704    /// ```
16705    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16706        self.operation_id = v.into();
16707        self
16708    }
16709}
16710
16711impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseResponse {
16712    fn typename() -> &'static str {
16713        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse"
16714    }
16715}
16716
16717/// Request to perform a point in time restore on a Google Cloud Backup and
16718/// Disaster Recovery managed instance.
16719#[derive(Clone, Default, PartialEq)]
16720#[non_exhaustive]
16721pub struct SqlInstancesPointInTimeRestoreRequest {
16722    /// Required. The parent resource where you created this instance.
16723    /// Format: projects/{project}
16724    pub parent: std::string::String,
16725
16726    /// Required. The context for request to perform a PITR on a Google Cloud
16727    /// Backup and Disaster Recovery managed instance.
16728    pub context: std::option::Option<crate::model::PointInTimeRestoreContext>,
16729
16730    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16731}
16732
16733impl SqlInstancesPointInTimeRestoreRequest {
16734    pub fn new() -> Self {
16735        std::default::Default::default()
16736    }
16737
16738    /// Sets the value of [parent][crate::model::SqlInstancesPointInTimeRestoreRequest::parent].
16739    ///
16740    /// # Example
16741    /// ```ignore,no_run
16742    /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
16743    /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_parent("example");
16744    /// ```
16745    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16746        self.parent = v.into();
16747        self
16748    }
16749
16750    /// Sets the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
16751    ///
16752    /// # Example
16753    /// ```ignore,no_run
16754    /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
16755    /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
16756    /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_context(PointInTimeRestoreContext::default()/* use setters */);
16757    /// ```
16758    pub fn set_context<T>(mut self, v: T) -> Self
16759    where
16760        T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
16761    {
16762        self.context = std::option::Option::Some(v.into());
16763        self
16764    }
16765
16766    /// Sets or clears the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
16767    ///
16768    /// # Example
16769    /// ```ignore,no_run
16770    /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
16771    /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
16772    /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(Some(PointInTimeRestoreContext::default()/* use setters */));
16773    /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(None::<PointInTimeRestoreContext>);
16774    /// ```
16775    pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
16776    where
16777        T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
16778    {
16779        self.context = v.map(|x| x.into());
16780        self
16781    }
16782}
16783
16784impl wkt::message::Message for SqlInstancesPointInTimeRestoreRequest {
16785    fn typename() -> &'static str {
16786        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest"
16787    }
16788}
16789
16790/// Operations get request.
16791#[derive(Clone, Default, PartialEq)]
16792#[non_exhaustive]
16793pub struct SqlOperationsGetRequest {
16794    /// Required. Instance operation ID.
16795    pub operation: std::string::String,
16796
16797    /// Required. Project ID of the project that contains the instance.
16798    pub project: std::string::String,
16799
16800    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16801}
16802
16803impl SqlOperationsGetRequest {
16804    pub fn new() -> Self {
16805        std::default::Default::default()
16806    }
16807
16808    /// Sets the value of [operation][crate::model::SqlOperationsGetRequest::operation].
16809    ///
16810    /// # Example
16811    /// ```ignore,no_run
16812    /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
16813    /// let x = SqlOperationsGetRequest::new().set_operation("example");
16814    /// ```
16815    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16816        self.operation = v.into();
16817        self
16818    }
16819
16820    /// Sets the value of [project][crate::model::SqlOperationsGetRequest::project].
16821    ///
16822    /// # Example
16823    /// ```ignore,no_run
16824    /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
16825    /// let x = SqlOperationsGetRequest::new().set_project("example");
16826    /// ```
16827    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16828        self.project = v.into();
16829        self
16830    }
16831}
16832
16833impl wkt::message::Message for SqlOperationsGetRequest {
16834    fn typename() -> &'static str {
16835        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsGetRequest"
16836    }
16837}
16838
16839/// Operations list request.
16840#[derive(Clone, Default, PartialEq)]
16841#[non_exhaustive]
16842pub struct SqlOperationsListRequest {
16843    /// Cloud SQL instance ID. This does not include the project ID.
16844    pub instance: std::string::String,
16845
16846    /// Maximum number of operations per response.
16847    pub max_results: u32,
16848
16849    /// A previously-returned page token representing part of the larger set of
16850    /// results to view.
16851    pub page_token: std::string::String,
16852
16853    /// Project ID of the project that contains the instance.
16854    pub project: std::string::String,
16855
16856    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16857}
16858
16859impl SqlOperationsListRequest {
16860    pub fn new() -> Self {
16861        std::default::Default::default()
16862    }
16863
16864    /// Sets the value of [instance][crate::model::SqlOperationsListRequest::instance].
16865    ///
16866    /// # Example
16867    /// ```ignore,no_run
16868    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
16869    /// let x = SqlOperationsListRequest::new().set_instance("example");
16870    /// ```
16871    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16872        self.instance = v.into();
16873        self
16874    }
16875
16876    /// Sets the value of [max_results][crate::model::SqlOperationsListRequest::max_results].
16877    ///
16878    /// # Example
16879    /// ```ignore,no_run
16880    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
16881    /// let x = SqlOperationsListRequest::new().set_max_results(42_u32);
16882    /// ```
16883    pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
16884        self.max_results = v.into();
16885        self
16886    }
16887
16888    /// Sets the value of [page_token][crate::model::SqlOperationsListRequest::page_token].
16889    ///
16890    /// # Example
16891    /// ```ignore,no_run
16892    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
16893    /// let x = SqlOperationsListRequest::new().set_page_token("example");
16894    /// ```
16895    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16896        self.page_token = v.into();
16897        self
16898    }
16899
16900    /// Sets the value of [project][crate::model::SqlOperationsListRequest::project].
16901    ///
16902    /// # Example
16903    /// ```ignore,no_run
16904    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
16905    /// let x = SqlOperationsListRequest::new().set_project("example");
16906    /// ```
16907    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16908        self.project = v.into();
16909        self
16910    }
16911}
16912
16913impl wkt::message::Message for SqlOperationsListRequest {
16914    fn typename() -> &'static str {
16915        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsListRequest"
16916    }
16917}
16918
16919/// Operations list response.
16920#[derive(Clone, Default, PartialEq)]
16921#[non_exhaustive]
16922pub struct OperationsListResponse {
16923    /// This is always `sql#operationsList`.
16924    pub kind: std::string::String,
16925
16926    /// List of operation resources.
16927    pub items: std::vec::Vec<crate::model::Operation>,
16928
16929    /// The continuation token, used to page through large result sets. Provide
16930    /// this value in a subsequent request to return the next page of results.
16931    pub next_page_token: std::string::String,
16932
16933    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16934}
16935
16936impl OperationsListResponse {
16937    pub fn new() -> Self {
16938        std::default::Default::default()
16939    }
16940
16941    /// Sets the value of [kind][crate::model::OperationsListResponse::kind].
16942    ///
16943    /// # Example
16944    /// ```ignore,no_run
16945    /// # use google_cloud_sql_v1::model::OperationsListResponse;
16946    /// let x = OperationsListResponse::new().set_kind("example");
16947    /// ```
16948    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16949        self.kind = v.into();
16950        self
16951    }
16952
16953    /// Sets the value of [items][crate::model::OperationsListResponse::items].
16954    ///
16955    /// # Example
16956    /// ```ignore,no_run
16957    /// # use google_cloud_sql_v1::model::OperationsListResponse;
16958    /// use google_cloud_sql_v1::model::Operation;
16959    /// let x = OperationsListResponse::new()
16960    ///     .set_items([
16961    ///         Operation::default()/* use setters */,
16962    ///         Operation::default()/* use (different) setters */,
16963    ///     ]);
16964    /// ```
16965    pub fn set_items<T, V>(mut self, v: T) -> Self
16966    where
16967        T: std::iter::IntoIterator<Item = V>,
16968        V: std::convert::Into<crate::model::Operation>,
16969    {
16970        use std::iter::Iterator;
16971        self.items = v.into_iter().map(|i| i.into()).collect();
16972        self
16973    }
16974
16975    /// Sets the value of [next_page_token][crate::model::OperationsListResponse::next_page_token].
16976    ///
16977    /// # Example
16978    /// ```ignore,no_run
16979    /// # use google_cloud_sql_v1::model::OperationsListResponse;
16980    /// let x = OperationsListResponse::new().set_next_page_token("example");
16981    /// ```
16982    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16983        self.next_page_token = v.into();
16984        self
16985    }
16986}
16987
16988impl wkt::message::Message for OperationsListResponse {
16989    fn typename() -> &'static str {
16990        "type.googleapis.com/google.cloud.sql.v1.OperationsListResponse"
16991    }
16992}
16993
16994#[doc(hidden)]
16995impl gax::paginator::internal::PageableResponse for OperationsListResponse {
16996    type PageItem = crate::model::Operation;
16997
16998    fn items(self) -> std::vec::Vec<Self::PageItem> {
16999        self.items
17000    }
17001
17002    fn next_page_token(&self) -> std::string::String {
17003        use std::clone::Clone;
17004        self.next_page_token.clone()
17005    }
17006}
17007
17008/// Operations cancel request.
17009#[derive(Clone, Default, PartialEq)]
17010#[non_exhaustive]
17011pub struct SqlOperationsCancelRequest {
17012    /// Instance operation ID.
17013    pub operation: std::string::String,
17014
17015    /// Project ID of the project that contains the instance.
17016    pub project: std::string::String,
17017
17018    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17019}
17020
17021impl SqlOperationsCancelRequest {
17022    pub fn new() -> Self {
17023        std::default::Default::default()
17024    }
17025
17026    /// Sets the value of [operation][crate::model::SqlOperationsCancelRequest::operation].
17027    ///
17028    /// # Example
17029    /// ```ignore,no_run
17030    /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
17031    /// let x = SqlOperationsCancelRequest::new().set_operation("example");
17032    /// ```
17033    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17034        self.operation = v.into();
17035        self
17036    }
17037
17038    /// Sets the value of [project][crate::model::SqlOperationsCancelRequest::project].
17039    ///
17040    /// # Example
17041    /// ```ignore,no_run
17042    /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
17043    /// let x = SqlOperationsCancelRequest::new().set_project("example");
17044    /// ```
17045    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17046        self.project = v.into();
17047        self
17048    }
17049}
17050
17051impl wkt::message::Message for SqlOperationsCancelRequest {
17052    fn typename() -> &'static str {
17053        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsCancelRequest"
17054    }
17055}
17056
17057/// An entry for an Access Control list.
17058#[derive(Clone, Default, PartialEq)]
17059#[non_exhaustive]
17060pub struct AclEntry {
17061    /// The allowlisted value for the access control list.
17062    pub value: std::string::String,
17063
17064    /// The time when this access control entry expires in
17065    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
17066    /// `2012-11-15T16:19:00.094Z`.
17067    pub expiration_time: std::option::Option<wkt::Timestamp>,
17068
17069    /// Optional. A label to identify this entry.
17070    pub name: std::string::String,
17071
17072    /// This is always `sql#aclEntry`.
17073    pub kind: std::string::String,
17074
17075    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17076}
17077
17078impl AclEntry {
17079    pub fn new() -> Self {
17080        std::default::Default::default()
17081    }
17082
17083    /// Sets the value of [value][crate::model::AclEntry::value].
17084    ///
17085    /// # Example
17086    /// ```ignore,no_run
17087    /// # use google_cloud_sql_v1::model::AclEntry;
17088    /// let x = AclEntry::new().set_value("example");
17089    /// ```
17090    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17091        self.value = v.into();
17092        self
17093    }
17094
17095    /// Sets the value of [expiration_time][crate::model::AclEntry::expiration_time].
17096    ///
17097    /// # Example
17098    /// ```ignore,no_run
17099    /// # use google_cloud_sql_v1::model::AclEntry;
17100    /// use wkt::Timestamp;
17101    /// let x = AclEntry::new().set_expiration_time(Timestamp::default()/* use setters */);
17102    /// ```
17103    pub fn set_expiration_time<T>(mut self, v: T) -> Self
17104    where
17105        T: std::convert::Into<wkt::Timestamp>,
17106    {
17107        self.expiration_time = std::option::Option::Some(v.into());
17108        self
17109    }
17110
17111    /// Sets or clears the value of [expiration_time][crate::model::AclEntry::expiration_time].
17112    ///
17113    /// # Example
17114    /// ```ignore,no_run
17115    /// # use google_cloud_sql_v1::model::AclEntry;
17116    /// use wkt::Timestamp;
17117    /// let x = AclEntry::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
17118    /// let x = AclEntry::new().set_or_clear_expiration_time(None::<Timestamp>);
17119    /// ```
17120    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
17121    where
17122        T: std::convert::Into<wkt::Timestamp>,
17123    {
17124        self.expiration_time = v.map(|x| x.into());
17125        self
17126    }
17127
17128    /// Sets the value of [name][crate::model::AclEntry::name].
17129    ///
17130    /// # Example
17131    /// ```ignore,no_run
17132    /// # use google_cloud_sql_v1::model::AclEntry;
17133    /// let x = AclEntry::new().set_name("example");
17134    /// ```
17135    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17136        self.name = v.into();
17137        self
17138    }
17139
17140    /// Sets the value of [kind][crate::model::AclEntry::kind].
17141    ///
17142    /// # Example
17143    /// ```ignore,no_run
17144    /// # use google_cloud_sql_v1::model::AclEntry;
17145    /// let x = AclEntry::new().set_kind("example");
17146    /// ```
17147    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17148        self.kind = v.into();
17149        self
17150    }
17151}
17152
17153impl wkt::message::Message for AclEntry {
17154    fn typename() -> &'static str {
17155        "type.googleapis.com/google.cloud.sql.v1.AclEntry"
17156    }
17157}
17158
17159/// An Admin API warning message.
17160#[derive(Clone, Default, PartialEq)]
17161#[non_exhaustive]
17162pub struct ApiWarning {
17163    /// Code to uniquely identify the warning type.
17164    pub code: crate::model::api_warning::SqlApiWarningCode,
17165
17166    /// The warning message.
17167    pub message: std::string::String,
17168
17169    /// The region name for REGION_UNREACHABLE warning.
17170    pub region: std::string::String,
17171
17172    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17173}
17174
17175impl ApiWarning {
17176    pub fn new() -> Self {
17177        std::default::Default::default()
17178    }
17179
17180    /// Sets the value of [code][crate::model::ApiWarning::code].
17181    ///
17182    /// # Example
17183    /// ```ignore,no_run
17184    /// # use google_cloud_sql_v1::model::ApiWarning;
17185    /// use google_cloud_sql_v1::model::api_warning::SqlApiWarningCode;
17186    /// let x0 = ApiWarning::new().set_code(SqlApiWarningCode::RegionUnreachable);
17187    /// let x1 = ApiWarning::new().set_code(SqlApiWarningCode::MaxResultsExceedsLimit);
17188    /// let x2 = ApiWarning::new().set_code(SqlApiWarningCode::CompromisedCredentials);
17189    /// ```
17190    pub fn set_code<T: std::convert::Into<crate::model::api_warning::SqlApiWarningCode>>(
17191        mut self,
17192        v: T,
17193    ) -> Self {
17194        self.code = v.into();
17195        self
17196    }
17197
17198    /// Sets the value of [message][crate::model::ApiWarning::message].
17199    ///
17200    /// # Example
17201    /// ```ignore,no_run
17202    /// # use google_cloud_sql_v1::model::ApiWarning;
17203    /// let x = ApiWarning::new().set_message("example");
17204    /// ```
17205    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17206        self.message = v.into();
17207        self
17208    }
17209
17210    /// Sets the value of [region][crate::model::ApiWarning::region].
17211    ///
17212    /// # Example
17213    /// ```ignore,no_run
17214    /// # use google_cloud_sql_v1::model::ApiWarning;
17215    /// let x = ApiWarning::new().set_region("example");
17216    /// ```
17217    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17218        self.region = v.into();
17219        self
17220    }
17221}
17222
17223impl wkt::message::Message for ApiWarning {
17224    fn typename() -> &'static str {
17225        "type.googleapis.com/google.cloud.sql.v1.ApiWarning"
17226    }
17227}
17228
17229/// Defines additional types related to [ApiWarning].
17230pub mod api_warning {
17231    #[allow(unused_imports)]
17232    use super::*;
17233
17234    ///
17235    /// # Working with unknown values
17236    ///
17237    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17238    /// additional enum variants at any time. Adding new variants is not considered
17239    /// a breaking change. Applications should write their code in anticipation of:
17240    ///
17241    /// - New values appearing in future releases of the client library, **and**
17242    /// - New values received dynamically, without application changes.
17243    ///
17244    /// Please consult the [Working with enums] section in the user guide for some
17245    /// guidelines.
17246    ///
17247    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17248    #[derive(Clone, Debug, PartialEq)]
17249    #[non_exhaustive]
17250    pub enum SqlApiWarningCode {
17251        /// An unknown or unset warning type from Cloud SQL API.
17252        Unspecified,
17253        /// Warning when one or more regions are not reachable.  The returned result
17254        /// set may be incomplete.
17255        RegionUnreachable,
17256        /// Warning when user provided maxResults parameter exceeds the limit.  The
17257        /// returned result set may be incomplete.
17258        MaxResultsExceedsLimit,
17259        /// Warning when user tries to create/update a user with credentials that
17260        /// have previously been compromised by a public data breach.
17261        CompromisedCredentials,
17262        /// Warning when the operation succeeds but some non-critical workflow state
17263        /// failed.
17264        InternalStateFailure,
17265        /// If set, the enum was initialized with an unknown value.
17266        ///
17267        /// Applications can examine the value using [SqlApiWarningCode::value] or
17268        /// [SqlApiWarningCode::name].
17269        UnknownValue(sql_api_warning_code::UnknownValue),
17270    }
17271
17272    #[doc(hidden)]
17273    pub mod sql_api_warning_code {
17274        #[allow(unused_imports)]
17275        use super::*;
17276        #[derive(Clone, Debug, PartialEq)]
17277        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17278    }
17279
17280    impl SqlApiWarningCode {
17281        /// Gets the enum value.
17282        ///
17283        /// Returns `None` if the enum contains an unknown value deserialized from
17284        /// the string representation of enums.
17285        pub fn value(&self) -> std::option::Option<i32> {
17286            match self {
17287                Self::Unspecified => std::option::Option::Some(0),
17288                Self::RegionUnreachable => std::option::Option::Some(1),
17289                Self::MaxResultsExceedsLimit => std::option::Option::Some(2),
17290                Self::CompromisedCredentials => std::option::Option::Some(3),
17291                Self::InternalStateFailure => std::option::Option::Some(4),
17292                Self::UnknownValue(u) => u.0.value(),
17293            }
17294        }
17295
17296        /// Gets the enum value as a string.
17297        ///
17298        /// Returns `None` if the enum contains an unknown value deserialized from
17299        /// the integer representation of enums.
17300        pub fn name(&self) -> std::option::Option<&str> {
17301            match self {
17302                Self::Unspecified => std::option::Option::Some("SQL_API_WARNING_CODE_UNSPECIFIED"),
17303                Self::RegionUnreachable => std::option::Option::Some("REGION_UNREACHABLE"),
17304                Self::MaxResultsExceedsLimit => {
17305                    std::option::Option::Some("MAX_RESULTS_EXCEEDS_LIMIT")
17306                }
17307                Self::CompromisedCredentials => {
17308                    std::option::Option::Some("COMPROMISED_CREDENTIALS")
17309                }
17310                Self::InternalStateFailure => std::option::Option::Some("INTERNAL_STATE_FAILURE"),
17311                Self::UnknownValue(u) => u.0.name(),
17312            }
17313        }
17314    }
17315
17316    impl std::default::Default for SqlApiWarningCode {
17317        fn default() -> Self {
17318            use std::convert::From;
17319            Self::from(0)
17320        }
17321    }
17322
17323    impl std::fmt::Display for SqlApiWarningCode {
17324        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17325            wkt::internal::display_enum(f, self.name(), self.value())
17326        }
17327    }
17328
17329    impl std::convert::From<i32> for SqlApiWarningCode {
17330        fn from(value: i32) -> Self {
17331            match value {
17332                0 => Self::Unspecified,
17333                1 => Self::RegionUnreachable,
17334                2 => Self::MaxResultsExceedsLimit,
17335                3 => Self::CompromisedCredentials,
17336                4 => Self::InternalStateFailure,
17337                _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
17338                    wkt::internal::UnknownEnumValue::Integer(value),
17339                )),
17340            }
17341        }
17342    }
17343
17344    impl std::convert::From<&str> for SqlApiWarningCode {
17345        fn from(value: &str) -> Self {
17346            use std::string::ToString;
17347            match value {
17348                "SQL_API_WARNING_CODE_UNSPECIFIED" => Self::Unspecified,
17349                "REGION_UNREACHABLE" => Self::RegionUnreachable,
17350                "MAX_RESULTS_EXCEEDS_LIMIT" => Self::MaxResultsExceedsLimit,
17351                "COMPROMISED_CREDENTIALS" => Self::CompromisedCredentials,
17352                "INTERNAL_STATE_FAILURE" => Self::InternalStateFailure,
17353                _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
17354                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17355                )),
17356            }
17357        }
17358    }
17359
17360    impl serde::ser::Serialize for SqlApiWarningCode {
17361        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17362        where
17363            S: serde::Serializer,
17364        {
17365            match self {
17366                Self::Unspecified => serializer.serialize_i32(0),
17367                Self::RegionUnreachable => serializer.serialize_i32(1),
17368                Self::MaxResultsExceedsLimit => serializer.serialize_i32(2),
17369                Self::CompromisedCredentials => serializer.serialize_i32(3),
17370                Self::InternalStateFailure => serializer.serialize_i32(4),
17371                Self::UnknownValue(u) => u.0.serialize(serializer),
17372            }
17373        }
17374    }
17375
17376    impl<'de> serde::de::Deserialize<'de> for SqlApiWarningCode {
17377        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17378        where
17379            D: serde::Deserializer<'de>,
17380        {
17381            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlApiWarningCode>::new(
17382                ".google.cloud.sql.v1.ApiWarning.SqlApiWarningCode",
17383            ))
17384        }
17385    }
17386}
17387
17388/// We currently only support backup retention by specifying the number
17389/// of backups we will retain.
17390#[derive(Clone, Default, PartialEq)]
17391#[non_exhaustive]
17392pub struct BackupRetentionSettings {
17393    /// The unit that 'retained_backups' represents.
17394    pub retention_unit: crate::model::backup_retention_settings::RetentionUnit,
17395
17396    /// Depending on the value of retention_unit, this is used to determine
17397    /// if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
17398    /// retain this many backups.
17399    pub retained_backups: std::option::Option<wkt::Int32Value>,
17400
17401    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17402}
17403
17404impl BackupRetentionSettings {
17405    pub fn new() -> Self {
17406        std::default::Default::default()
17407    }
17408
17409    /// Sets the value of [retention_unit][crate::model::BackupRetentionSettings::retention_unit].
17410    ///
17411    /// # Example
17412    /// ```ignore,no_run
17413    /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17414    /// use google_cloud_sql_v1::model::backup_retention_settings::RetentionUnit;
17415    /// let x0 = BackupRetentionSettings::new().set_retention_unit(RetentionUnit::Count);
17416    /// ```
17417    pub fn set_retention_unit<
17418        T: std::convert::Into<crate::model::backup_retention_settings::RetentionUnit>,
17419    >(
17420        mut self,
17421        v: T,
17422    ) -> Self {
17423        self.retention_unit = v.into();
17424        self
17425    }
17426
17427    /// Sets the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
17428    ///
17429    /// # Example
17430    /// ```ignore,no_run
17431    /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17432    /// use wkt::Int32Value;
17433    /// let x = BackupRetentionSettings::new().set_retained_backups(Int32Value::default()/* use setters */);
17434    /// ```
17435    pub fn set_retained_backups<T>(mut self, v: T) -> Self
17436    where
17437        T: std::convert::Into<wkt::Int32Value>,
17438    {
17439        self.retained_backups = std::option::Option::Some(v.into());
17440        self
17441    }
17442
17443    /// Sets or clears the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
17444    ///
17445    /// # Example
17446    /// ```ignore,no_run
17447    /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17448    /// use wkt::Int32Value;
17449    /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(Some(Int32Value::default()/* use setters */));
17450    /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(None::<Int32Value>);
17451    /// ```
17452    pub fn set_or_clear_retained_backups<T>(mut self, v: std::option::Option<T>) -> Self
17453    where
17454        T: std::convert::Into<wkt::Int32Value>,
17455    {
17456        self.retained_backups = v.map(|x| x.into());
17457        self
17458    }
17459}
17460
17461impl wkt::message::Message for BackupRetentionSettings {
17462    fn typename() -> &'static str {
17463        "type.googleapis.com/google.cloud.sql.v1.BackupRetentionSettings"
17464    }
17465}
17466
17467/// Defines additional types related to [BackupRetentionSettings].
17468pub mod backup_retention_settings {
17469    #[allow(unused_imports)]
17470    use super::*;
17471
17472    /// The units that retained_backups specifies, we only support COUNT.
17473    ///
17474    /// # Working with unknown values
17475    ///
17476    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17477    /// additional enum variants at any time. Adding new variants is not considered
17478    /// a breaking change. Applications should write their code in anticipation of:
17479    ///
17480    /// - New values appearing in future releases of the client library, **and**
17481    /// - New values received dynamically, without application changes.
17482    ///
17483    /// Please consult the [Working with enums] section in the user guide for some
17484    /// guidelines.
17485    ///
17486    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17487    #[derive(Clone, Debug, PartialEq)]
17488    #[non_exhaustive]
17489    pub enum RetentionUnit {
17490        /// Backup retention unit is unspecified, will be treated as COUNT.
17491        Unspecified,
17492        /// Retention will be by count, eg. "retain the most recent 7 backups".
17493        Count,
17494        /// If set, the enum was initialized with an unknown value.
17495        ///
17496        /// Applications can examine the value using [RetentionUnit::value] or
17497        /// [RetentionUnit::name].
17498        UnknownValue(retention_unit::UnknownValue),
17499    }
17500
17501    #[doc(hidden)]
17502    pub mod retention_unit {
17503        #[allow(unused_imports)]
17504        use super::*;
17505        #[derive(Clone, Debug, PartialEq)]
17506        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17507    }
17508
17509    impl RetentionUnit {
17510        /// Gets the enum value.
17511        ///
17512        /// Returns `None` if the enum contains an unknown value deserialized from
17513        /// the string representation of enums.
17514        pub fn value(&self) -> std::option::Option<i32> {
17515            match self {
17516                Self::Unspecified => std::option::Option::Some(0),
17517                Self::Count => std::option::Option::Some(1),
17518                Self::UnknownValue(u) => u.0.value(),
17519            }
17520        }
17521
17522        /// Gets the enum value as a string.
17523        ///
17524        /// Returns `None` if the enum contains an unknown value deserialized from
17525        /// the integer representation of enums.
17526        pub fn name(&self) -> std::option::Option<&str> {
17527            match self {
17528                Self::Unspecified => std::option::Option::Some("RETENTION_UNIT_UNSPECIFIED"),
17529                Self::Count => std::option::Option::Some("COUNT"),
17530                Self::UnknownValue(u) => u.0.name(),
17531            }
17532        }
17533    }
17534
17535    impl std::default::Default for RetentionUnit {
17536        fn default() -> Self {
17537            use std::convert::From;
17538            Self::from(0)
17539        }
17540    }
17541
17542    impl std::fmt::Display for RetentionUnit {
17543        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17544            wkt::internal::display_enum(f, self.name(), self.value())
17545        }
17546    }
17547
17548    impl std::convert::From<i32> for RetentionUnit {
17549        fn from(value: i32) -> Self {
17550            match value {
17551                0 => Self::Unspecified,
17552                1 => Self::Count,
17553                _ => Self::UnknownValue(retention_unit::UnknownValue(
17554                    wkt::internal::UnknownEnumValue::Integer(value),
17555                )),
17556            }
17557        }
17558    }
17559
17560    impl std::convert::From<&str> for RetentionUnit {
17561        fn from(value: &str) -> Self {
17562            use std::string::ToString;
17563            match value {
17564                "RETENTION_UNIT_UNSPECIFIED" => Self::Unspecified,
17565                "COUNT" => Self::Count,
17566                _ => Self::UnknownValue(retention_unit::UnknownValue(
17567                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17568                )),
17569            }
17570        }
17571    }
17572
17573    impl serde::ser::Serialize for RetentionUnit {
17574        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17575        where
17576            S: serde::Serializer,
17577        {
17578            match self {
17579                Self::Unspecified => serializer.serialize_i32(0),
17580                Self::Count => serializer.serialize_i32(1),
17581                Self::UnknownValue(u) => u.0.serialize(serializer),
17582            }
17583        }
17584    }
17585
17586    impl<'de> serde::de::Deserialize<'de> for RetentionUnit {
17587        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17588        where
17589            D: serde::Deserializer<'de>,
17590        {
17591            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RetentionUnit>::new(
17592                ".google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit",
17593            ))
17594        }
17595    }
17596}
17597
17598/// Database instance backup configuration.
17599#[derive(Clone, Default, PartialEq)]
17600#[non_exhaustive]
17601pub struct BackupConfiguration {
17602    /// Start time for the daily backup configuration in UTC timezone in the 24
17603    /// hour format - `HH:MM`.
17604    pub start_time: std::string::String,
17605
17606    /// Whether this configuration is enabled.
17607    pub enabled: std::option::Option<wkt::BoolValue>,
17608
17609    /// This is always `sql#backupConfiguration`.
17610    pub kind: std::string::String,
17611
17612    /// (MySQL only) Whether binary log is enabled. If backup configuration is
17613    /// disabled, binarylog must be disabled as well.
17614    pub binary_log_enabled: std::option::Option<wkt::BoolValue>,
17615
17616    /// Reserved for future use.
17617    pub replication_log_archiving_enabled: std::option::Option<wkt::BoolValue>,
17618
17619    /// Location of the backup
17620    pub location: std::string::String,
17621
17622    /// Whether point in time recovery is enabled.
17623    pub point_in_time_recovery_enabled: std::option::Option<wkt::BoolValue>,
17624
17625    /// Backup retention settings.
17626    pub backup_retention_settings: std::option::Option<crate::model::BackupRetentionSettings>,
17627
17628    /// The number of days of transaction logs we retain for point in time
17629    /// restore, from 1-7.
17630    pub transaction_log_retention_days: std::option::Option<wkt::Int32Value>,
17631
17632    /// Output only. This value contains the storage location of transactional logs
17633    /// used to perform point-in-time recovery (PITR) for the database.
17634    pub transactional_log_storage_state:
17635        std::option::Option<crate::model::backup_configuration::TransactionalLogStorageState>,
17636
17637    /// Output only. Backup tier that manages the backups for the instance.
17638    pub backup_tier: std::option::Option<crate::model::backup_configuration::BackupTier>,
17639
17640    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17641}
17642
17643impl BackupConfiguration {
17644    pub fn new() -> Self {
17645        std::default::Default::default()
17646    }
17647
17648    /// Sets the value of [start_time][crate::model::BackupConfiguration::start_time].
17649    ///
17650    /// # Example
17651    /// ```ignore,no_run
17652    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17653    /// let x = BackupConfiguration::new().set_start_time("example");
17654    /// ```
17655    pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17656        self.start_time = v.into();
17657        self
17658    }
17659
17660    /// Sets the value of [enabled][crate::model::BackupConfiguration::enabled].
17661    ///
17662    /// # Example
17663    /// ```ignore,no_run
17664    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17665    /// use wkt::BoolValue;
17666    /// let x = BackupConfiguration::new().set_enabled(BoolValue::default()/* use setters */);
17667    /// ```
17668    pub fn set_enabled<T>(mut self, v: T) -> Self
17669    where
17670        T: std::convert::Into<wkt::BoolValue>,
17671    {
17672        self.enabled = std::option::Option::Some(v.into());
17673        self
17674    }
17675
17676    /// Sets or clears the value of [enabled][crate::model::BackupConfiguration::enabled].
17677    ///
17678    /// # Example
17679    /// ```ignore,no_run
17680    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17681    /// use wkt::BoolValue;
17682    /// let x = BackupConfiguration::new().set_or_clear_enabled(Some(BoolValue::default()/* use setters */));
17683    /// let x = BackupConfiguration::new().set_or_clear_enabled(None::<BoolValue>);
17684    /// ```
17685    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17686    where
17687        T: std::convert::Into<wkt::BoolValue>,
17688    {
17689        self.enabled = v.map(|x| x.into());
17690        self
17691    }
17692
17693    /// Sets the value of [kind][crate::model::BackupConfiguration::kind].
17694    ///
17695    /// # Example
17696    /// ```ignore,no_run
17697    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17698    /// let x = BackupConfiguration::new().set_kind("example");
17699    /// ```
17700    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17701        self.kind = v.into();
17702        self
17703    }
17704
17705    /// Sets the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
17706    ///
17707    /// # Example
17708    /// ```ignore,no_run
17709    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17710    /// use wkt::BoolValue;
17711    /// let x = BackupConfiguration::new().set_binary_log_enabled(BoolValue::default()/* use setters */);
17712    /// ```
17713    pub fn set_binary_log_enabled<T>(mut self, v: T) -> Self
17714    where
17715        T: std::convert::Into<wkt::BoolValue>,
17716    {
17717        self.binary_log_enabled = std::option::Option::Some(v.into());
17718        self
17719    }
17720
17721    /// Sets or clears the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
17722    ///
17723    /// # Example
17724    /// ```ignore,no_run
17725    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17726    /// use wkt::BoolValue;
17727    /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(Some(BoolValue::default()/* use setters */));
17728    /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(None::<BoolValue>);
17729    /// ```
17730    pub fn set_or_clear_binary_log_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17731    where
17732        T: std::convert::Into<wkt::BoolValue>,
17733    {
17734        self.binary_log_enabled = v.map(|x| x.into());
17735        self
17736    }
17737
17738    /// Sets the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
17739    ///
17740    /// # Example
17741    /// ```ignore,no_run
17742    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17743    /// use wkt::BoolValue;
17744    /// let x = BackupConfiguration::new().set_replication_log_archiving_enabled(BoolValue::default()/* use setters */);
17745    /// ```
17746    pub fn set_replication_log_archiving_enabled<T>(mut self, v: T) -> Self
17747    where
17748        T: std::convert::Into<wkt::BoolValue>,
17749    {
17750        self.replication_log_archiving_enabled = std::option::Option::Some(v.into());
17751        self
17752    }
17753
17754    /// Sets or clears the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
17755    ///
17756    /// # Example
17757    /// ```ignore,no_run
17758    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17759    /// use wkt::BoolValue;
17760    /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(Some(BoolValue::default()/* use setters */));
17761    /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(None::<BoolValue>);
17762    /// ```
17763    pub fn set_or_clear_replication_log_archiving_enabled<T>(
17764        mut self,
17765        v: std::option::Option<T>,
17766    ) -> Self
17767    where
17768        T: std::convert::Into<wkt::BoolValue>,
17769    {
17770        self.replication_log_archiving_enabled = v.map(|x| x.into());
17771        self
17772    }
17773
17774    /// Sets the value of [location][crate::model::BackupConfiguration::location].
17775    ///
17776    /// # Example
17777    /// ```ignore,no_run
17778    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17779    /// let x = BackupConfiguration::new().set_location("example");
17780    /// ```
17781    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17782        self.location = v.into();
17783        self
17784    }
17785
17786    /// Sets the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
17787    ///
17788    /// # Example
17789    /// ```ignore,no_run
17790    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17791    /// use wkt::BoolValue;
17792    /// let x = BackupConfiguration::new().set_point_in_time_recovery_enabled(BoolValue::default()/* use setters */);
17793    /// ```
17794    pub fn set_point_in_time_recovery_enabled<T>(mut self, v: T) -> Self
17795    where
17796        T: std::convert::Into<wkt::BoolValue>,
17797    {
17798        self.point_in_time_recovery_enabled = std::option::Option::Some(v.into());
17799        self
17800    }
17801
17802    /// Sets or clears the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
17803    ///
17804    /// # Example
17805    /// ```ignore,no_run
17806    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17807    /// use wkt::BoolValue;
17808    /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(Some(BoolValue::default()/* use setters */));
17809    /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(None::<BoolValue>);
17810    /// ```
17811    pub fn set_or_clear_point_in_time_recovery_enabled<T>(
17812        mut self,
17813        v: std::option::Option<T>,
17814    ) -> Self
17815    where
17816        T: std::convert::Into<wkt::BoolValue>,
17817    {
17818        self.point_in_time_recovery_enabled = v.map(|x| x.into());
17819        self
17820    }
17821
17822    /// Sets the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
17823    ///
17824    /// # Example
17825    /// ```ignore,no_run
17826    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17827    /// use google_cloud_sql_v1::model::BackupRetentionSettings;
17828    /// let x = BackupConfiguration::new().set_backup_retention_settings(BackupRetentionSettings::default()/* use setters */);
17829    /// ```
17830    pub fn set_backup_retention_settings<T>(mut self, v: T) -> Self
17831    where
17832        T: std::convert::Into<crate::model::BackupRetentionSettings>,
17833    {
17834        self.backup_retention_settings = std::option::Option::Some(v.into());
17835        self
17836    }
17837
17838    /// Sets or clears the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
17839    ///
17840    /// # Example
17841    /// ```ignore,no_run
17842    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17843    /// use google_cloud_sql_v1::model::BackupRetentionSettings;
17844    /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(Some(BackupRetentionSettings::default()/* use setters */));
17845    /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(None::<BackupRetentionSettings>);
17846    /// ```
17847    pub fn set_or_clear_backup_retention_settings<T>(mut self, v: std::option::Option<T>) -> Self
17848    where
17849        T: std::convert::Into<crate::model::BackupRetentionSettings>,
17850    {
17851        self.backup_retention_settings = v.map(|x| x.into());
17852        self
17853    }
17854
17855    /// Sets the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
17856    ///
17857    /// # Example
17858    /// ```ignore,no_run
17859    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17860    /// use wkt::Int32Value;
17861    /// let x = BackupConfiguration::new().set_transaction_log_retention_days(Int32Value::default()/* use setters */);
17862    /// ```
17863    pub fn set_transaction_log_retention_days<T>(mut self, v: T) -> Self
17864    where
17865        T: std::convert::Into<wkt::Int32Value>,
17866    {
17867        self.transaction_log_retention_days = std::option::Option::Some(v.into());
17868        self
17869    }
17870
17871    /// Sets or clears the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
17872    ///
17873    /// # Example
17874    /// ```ignore,no_run
17875    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17876    /// use wkt::Int32Value;
17877    /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(Some(Int32Value::default()/* use setters */));
17878    /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(None::<Int32Value>);
17879    /// ```
17880    pub fn set_or_clear_transaction_log_retention_days<T>(
17881        mut self,
17882        v: std::option::Option<T>,
17883    ) -> Self
17884    where
17885        T: std::convert::Into<wkt::Int32Value>,
17886    {
17887        self.transaction_log_retention_days = v.map(|x| x.into());
17888        self
17889    }
17890
17891    /// Sets the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
17892    ///
17893    /// # Example
17894    /// ```ignore,no_run
17895    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17896    /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
17897    /// let x0 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::Disk);
17898    /// let x1 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchingToCloudStorage);
17899    /// let x2 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchedToCloudStorage);
17900    /// ```
17901    pub fn set_transactional_log_storage_state<T>(mut self, v: T) -> Self
17902    where
17903        T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
17904    {
17905        self.transactional_log_storage_state = std::option::Option::Some(v.into());
17906        self
17907    }
17908
17909    /// Sets or clears the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
17910    ///
17911    /// # Example
17912    /// ```ignore,no_run
17913    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17914    /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
17915    /// let x0 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::Disk));
17916    /// let x1 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchingToCloudStorage));
17917    /// let x2 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchedToCloudStorage));
17918    /// let x_none = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(None::<TransactionalLogStorageState>);
17919    /// ```
17920    pub fn set_or_clear_transactional_log_storage_state<T>(
17921        mut self,
17922        v: std::option::Option<T>,
17923    ) -> Self
17924    where
17925        T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
17926    {
17927        self.transactional_log_storage_state = v.map(|x| x.into());
17928        self
17929    }
17930
17931    /// Sets the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
17932    ///
17933    /// # Example
17934    /// ```ignore,no_run
17935    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17936    /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
17937    /// let x0 = BackupConfiguration::new().set_backup_tier(BackupTier::Standard);
17938    /// let x1 = BackupConfiguration::new().set_backup_tier(BackupTier::Enhanced);
17939    /// ```
17940    pub fn set_backup_tier<T>(mut self, v: T) -> Self
17941    where
17942        T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
17943    {
17944        self.backup_tier = std::option::Option::Some(v.into());
17945        self
17946    }
17947
17948    /// Sets or clears the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
17949    ///
17950    /// # Example
17951    /// ```ignore,no_run
17952    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17953    /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
17954    /// let x0 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Standard));
17955    /// let x1 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Enhanced));
17956    /// let x_none = BackupConfiguration::new().set_or_clear_backup_tier(None::<BackupTier>);
17957    /// ```
17958    pub fn set_or_clear_backup_tier<T>(mut self, v: std::option::Option<T>) -> Self
17959    where
17960        T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
17961    {
17962        self.backup_tier = v.map(|x| x.into());
17963        self
17964    }
17965}
17966
17967impl wkt::message::Message for BackupConfiguration {
17968    fn typename() -> &'static str {
17969        "type.googleapis.com/google.cloud.sql.v1.BackupConfiguration"
17970    }
17971}
17972
17973/// Defines additional types related to [BackupConfiguration].
17974pub mod backup_configuration {
17975    #[allow(unused_imports)]
17976    use super::*;
17977
17978    /// This value contains the storage location of the transactional logs
17979    /// used to perform point-in-time recovery (PITR) for the database.
17980    ///
17981    /// # Working with unknown values
17982    ///
17983    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17984    /// additional enum variants at any time. Adding new variants is not considered
17985    /// a breaking change. Applications should write their code in anticipation of:
17986    ///
17987    /// - New values appearing in future releases of the client library, **and**
17988    /// - New values received dynamically, without application changes.
17989    ///
17990    /// Please consult the [Working with enums] section in the user guide for some
17991    /// guidelines.
17992    ///
17993    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17994    #[derive(Clone, Debug, PartialEq)]
17995    #[non_exhaustive]
17996    pub enum TransactionalLogStorageState {
17997        /// Unspecified.
17998        Unspecified,
17999        /// The transaction logs used for PITR for the instance are stored
18000        /// on a data disk.
18001        Disk,
18002        /// The transaction logs used for PITR for the instance are switching from
18003        /// being stored on a data disk to being stored in Cloud Storage.
18004        /// Only applicable to MySQL.
18005        SwitchingToCloudStorage,
18006        /// The transaction logs used for PITR for the instance are now stored
18007        /// in Cloud Storage. Previously, they were stored on a data disk.
18008        /// Only applicable to MySQL.
18009        SwitchedToCloudStorage,
18010        /// The transaction logs used for PITR for the instance are stored in
18011        /// Cloud Storage. Only applicable to MySQL and PostgreSQL.
18012        CloudStorage,
18013        /// If set, the enum was initialized with an unknown value.
18014        ///
18015        /// Applications can examine the value using [TransactionalLogStorageState::value] or
18016        /// [TransactionalLogStorageState::name].
18017        UnknownValue(transactional_log_storage_state::UnknownValue),
18018    }
18019
18020    #[doc(hidden)]
18021    pub mod transactional_log_storage_state {
18022        #[allow(unused_imports)]
18023        use super::*;
18024        #[derive(Clone, Debug, PartialEq)]
18025        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18026    }
18027
18028    impl TransactionalLogStorageState {
18029        /// Gets the enum value.
18030        ///
18031        /// Returns `None` if the enum contains an unknown value deserialized from
18032        /// the string representation of enums.
18033        pub fn value(&self) -> std::option::Option<i32> {
18034            match self {
18035                Self::Unspecified => std::option::Option::Some(0),
18036                Self::Disk => std::option::Option::Some(1),
18037                Self::SwitchingToCloudStorage => std::option::Option::Some(2),
18038                Self::SwitchedToCloudStorage => std::option::Option::Some(3),
18039                Self::CloudStorage => std::option::Option::Some(4),
18040                Self::UnknownValue(u) => u.0.value(),
18041            }
18042        }
18043
18044        /// Gets the enum value as a string.
18045        ///
18046        /// Returns `None` if the enum contains an unknown value deserialized from
18047        /// the integer representation of enums.
18048        pub fn name(&self) -> std::option::Option<&str> {
18049            match self {
18050                Self::Unspecified => {
18051                    std::option::Option::Some("TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED")
18052                }
18053                Self::Disk => std::option::Option::Some("DISK"),
18054                Self::SwitchingToCloudStorage => {
18055                    std::option::Option::Some("SWITCHING_TO_CLOUD_STORAGE")
18056                }
18057                Self::SwitchedToCloudStorage => {
18058                    std::option::Option::Some("SWITCHED_TO_CLOUD_STORAGE")
18059                }
18060                Self::CloudStorage => std::option::Option::Some("CLOUD_STORAGE"),
18061                Self::UnknownValue(u) => u.0.name(),
18062            }
18063        }
18064    }
18065
18066    impl std::default::Default for TransactionalLogStorageState {
18067        fn default() -> Self {
18068            use std::convert::From;
18069            Self::from(0)
18070        }
18071    }
18072
18073    impl std::fmt::Display for TransactionalLogStorageState {
18074        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18075            wkt::internal::display_enum(f, self.name(), self.value())
18076        }
18077    }
18078
18079    impl std::convert::From<i32> for TransactionalLogStorageState {
18080        fn from(value: i32) -> Self {
18081            match value {
18082                0 => Self::Unspecified,
18083                1 => Self::Disk,
18084                2 => Self::SwitchingToCloudStorage,
18085                3 => Self::SwitchedToCloudStorage,
18086                4 => Self::CloudStorage,
18087                _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
18088                    wkt::internal::UnknownEnumValue::Integer(value),
18089                )),
18090            }
18091        }
18092    }
18093
18094    impl std::convert::From<&str> for TransactionalLogStorageState {
18095        fn from(value: &str) -> Self {
18096            use std::string::ToString;
18097            match value {
18098                "TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED" => Self::Unspecified,
18099                "DISK" => Self::Disk,
18100                "SWITCHING_TO_CLOUD_STORAGE" => Self::SwitchingToCloudStorage,
18101                "SWITCHED_TO_CLOUD_STORAGE" => Self::SwitchedToCloudStorage,
18102                "CLOUD_STORAGE" => Self::CloudStorage,
18103                _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
18104                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18105                )),
18106            }
18107        }
18108    }
18109
18110    impl serde::ser::Serialize for TransactionalLogStorageState {
18111        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18112        where
18113            S: serde::Serializer,
18114        {
18115            match self {
18116                Self::Unspecified => serializer.serialize_i32(0),
18117                Self::Disk => serializer.serialize_i32(1),
18118                Self::SwitchingToCloudStorage => serializer.serialize_i32(2),
18119                Self::SwitchedToCloudStorage => serializer.serialize_i32(3),
18120                Self::CloudStorage => serializer.serialize_i32(4),
18121                Self::UnknownValue(u) => u.0.serialize(serializer),
18122            }
18123        }
18124    }
18125
18126    impl<'de> serde::de::Deserialize<'de> for TransactionalLogStorageState {
18127        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18128        where
18129            D: serde::Deserializer<'de>,
18130        {
18131            deserializer.deserialize_any(
18132                wkt::internal::EnumVisitor::<TransactionalLogStorageState>::new(
18133                    ".google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState",
18134                ),
18135            )
18136        }
18137    }
18138
18139    /// Backup tier that manages the backups for the instance.
18140    ///
18141    /// # Working with unknown values
18142    ///
18143    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18144    /// additional enum variants at any time. Adding new variants is not considered
18145    /// a breaking change. Applications should write their code in anticipation of:
18146    ///
18147    /// - New values appearing in future releases of the client library, **and**
18148    /// - New values received dynamically, without application changes.
18149    ///
18150    /// Please consult the [Working with enums] section in the user guide for some
18151    /// guidelines.
18152    ///
18153    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18154    #[derive(Clone, Debug, PartialEq)]
18155    #[non_exhaustive]
18156    pub enum BackupTier {
18157        /// Unspecified.
18158        Unspecified,
18159        /// Instance is managed by Cloud SQL.
18160        Standard,
18161        /// Deprecated: ADVANCED is deprecated. Please use ENHANCED instead.
18162        #[deprecated]
18163        Advanced,
18164        /// Instance is managed by Google Cloud Backup and DR Service.
18165        Enhanced,
18166        /// If set, the enum was initialized with an unknown value.
18167        ///
18168        /// Applications can examine the value using [BackupTier::value] or
18169        /// [BackupTier::name].
18170        UnknownValue(backup_tier::UnknownValue),
18171    }
18172
18173    #[doc(hidden)]
18174    pub mod backup_tier {
18175        #[allow(unused_imports)]
18176        use super::*;
18177        #[derive(Clone, Debug, PartialEq)]
18178        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18179    }
18180
18181    impl BackupTier {
18182        /// Gets the enum value.
18183        ///
18184        /// Returns `None` if the enum contains an unknown value deserialized from
18185        /// the string representation of enums.
18186        pub fn value(&self) -> std::option::Option<i32> {
18187            match self {
18188                Self::Unspecified => std::option::Option::Some(0),
18189                Self::Standard => std::option::Option::Some(1),
18190                Self::Advanced => std::option::Option::Some(2),
18191                Self::Enhanced => std::option::Option::Some(3),
18192                Self::UnknownValue(u) => u.0.value(),
18193            }
18194        }
18195
18196        /// Gets the enum value as a string.
18197        ///
18198        /// Returns `None` if the enum contains an unknown value deserialized from
18199        /// the integer representation of enums.
18200        pub fn name(&self) -> std::option::Option<&str> {
18201            match self {
18202                Self::Unspecified => std::option::Option::Some("BACKUP_TIER_UNSPECIFIED"),
18203                Self::Standard => std::option::Option::Some("STANDARD"),
18204                Self::Advanced => std::option::Option::Some("ADVANCED"),
18205                Self::Enhanced => std::option::Option::Some("ENHANCED"),
18206                Self::UnknownValue(u) => u.0.name(),
18207            }
18208        }
18209    }
18210
18211    impl std::default::Default for BackupTier {
18212        fn default() -> Self {
18213            use std::convert::From;
18214            Self::from(0)
18215        }
18216    }
18217
18218    impl std::fmt::Display for BackupTier {
18219        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18220            wkt::internal::display_enum(f, self.name(), self.value())
18221        }
18222    }
18223
18224    impl std::convert::From<i32> for BackupTier {
18225        fn from(value: i32) -> Self {
18226            match value {
18227                0 => Self::Unspecified,
18228                1 => Self::Standard,
18229                2 => Self::Advanced,
18230                3 => Self::Enhanced,
18231                _ => Self::UnknownValue(backup_tier::UnknownValue(
18232                    wkt::internal::UnknownEnumValue::Integer(value),
18233                )),
18234            }
18235        }
18236    }
18237
18238    impl std::convert::From<&str> for BackupTier {
18239        fn from(value: &str) -> Self {
18240            use std::string::ToString;
18241            match value {
18242                "BACKUP_TIER_UNSPECIFIED" => Self::Unspecified,
18243                "STANDARD" => Self::Standard,
18244                "ADVANCED" => Self::Advanced,
18245                "ENHANCED" => Self::Enhanced,
18246                _ => Self::UnknownValue(backup_tier::UnknownValue(
18247                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18248                )),
18249            }
18250        }
18251    }
18252
18253    impl serde::ser::Serialize for BackupTier {
18254        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18255        where
18256            S: serde::Serializer,
18257        {
18258            match self {
18259                Self::Unspecified => serializer.serialize_i32(0),
18260                Self::Standard => serializer.serialize_i32(1),
18261                Self::Advanced => serializer.serialize_i32(2),
18262                Self::Enhanced => serializer.serialize_i32(3),
18263                Self::UnknownValue(u) => u.0.serialize(serializer),
18264            }
18265        }
18266    }
18267
18268    impl<'de> serde::de::Deserialize<'de> for BackupTier {
18269        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18270        where
18271            D: serde::Deserializer<'de>,
18272        {
18273            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupTier>::new(
18274                ".google.cloud.sql.v1.BackupConfiguration.BackupTier",
18275            ))
18276        }
18277    }
18278}
18279
18280/// Perform disk shrink context.
18281#[derive(Clone, Default, PartialEq)]
18282#[non_exhaustive]
18283pub struct PerformDiskShrinkContext {
18284    /// The target disk shrink size in GigaBytes.
18285    pub target_size_gb: i64,
18286
18287    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18288}
18289
18290impl PerformDiskShrinkContext {
18291    pub fn new() -> Self {
18292        std::default::Default::default()
18293    }
18294
18295    /// Sets the value of [target_size_gb][crate::model::PerformDiskShrinkContext::target_size_gb].
18296    ///
18297    /// # Example
18298    /// ```ignore,no_run
18299    /// # use google_cloud_sql_v1::model::PerformDiskShrinkContext;
18300    /// let x = PerformDiskShrinkContext::new().set_target_size_gb(42);
18301    /// ```
18302    pub fn set_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18303        self.target_size_gb = v.into();
18304        self
18305    }
18306}
18307
18308impl wkt::message::Message for PerformDiskShrinkContext {
18309    fn typename() -> &'static str {
18310        "type.googleapis.com/google.cloud.sql.v1.PerformDiskShrinkContext"
18311    }
18312}
18313
18314/// Structured PreCheckResponse containing message, type, and required
18315/// actions.
18316#[derive(Clone, Default, PartialEq)]
18317#[non_exhaustive]
18318pub struct PreCheckResponse {
18319    /// The message to be displayed to the user.
18320    pub message: std::option::Option<std::string::String>,
18321
18322    /// The type of message whether it is an info, warning, or error.
18323    pub message_type: std::option::Option<crate::model::pre_check_response::MessageType>,
18324
18325    /// The actions that the user needs to take. Use repeated for multiple
18326    /// actions.
18327    pub actions_required: std::vec::Vec<std::string::String>,
18328
18329    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18330}
18331
18332impl PreCheckResponse {
18333    pub fn new() -> Self {
18334        std::default::Default::default()
18335    }
18336
18337    /// Sets the value of [message][crate::model::PreCheckResponse::message].
18338    ///
18339    /// # Example
18340    /// ```ignore,no_run
18341    /// # use google_cloud_sql_v1::model::PreCheckResponse;
18342    /// let x = PreCheckResponse::new().set_message("example");
18343    /// ```
18344    pub fn set_message<T>(mut self, v: T) -> Self
18345    where
18346        T: std::convert::Into<std::string::String>,
18347    {
18348        self.message = std::option::Option::Some(v.into());
18349        self
18350    }
18351
18352    /// Sets or clears the value of [message][crate::model::PreCheckResponse::message].
18353    ///
18354    /// # Example
18355    /// ```ignore,no_run
18356    /// # use google_cloud_sql_v1::model::PreCheckResponse;
18357    /// let x = PreCheckResponse::new().set_or_clear_message(Some("example"));
18358    /// let x = PreCheckResponse::new().set_or_clear_message(None::<String>);
18359    /// ```
18360    pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
18361    where
18362        T: std::convert::Into<std::string::String>,
18363    {
18364        self.message = v.map(|x| x.into());
18365        self
18366    }
18367
18368    /// Sets the value of [message_type][crate::model::PreCheckResponse::message_type].
18369    ///
18370    /// # Example
18371    /// ```ignore,no_run
18372    /// # use google_cloud_sql_v1::model::PreCheckResponse;
18373    /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
18374    /// let x0 = PreCheckResponse::new().set_message_type(MessageType::Info);
18375    /// let x1 = PreCheckResponse::new().set_message_type(MessageType::Warning);
18376    /// let x2 = PreCheckResponse::new().set_message_type(MessageType::Error);
18377    /// ```
18378    pub fn set_message_type<T>(mut self, v: T) -> Self
18379    where
18380        T: std::convert::Into<crate::model::pre_check_response::MessageType>,
18381    {
18382        self.message_type = std::option::Option::Some(v.into());
18383        self
18384    }
18385
18386    /// Sets or clears the value of [message_type][crate::model::PreCheckResponse::message_type].
18387    ///
18388    /// # Example
18389    /// ```ignore,no_run
18390    /// # use google_cloud_sql_v1::model::PreCheckResponse;
18391    /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
18392    /// let x0 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Info));
18393    /// let x1 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Warning));
18394    /// let x2 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Error));
18395    /// let x_none = PreCheckResponse::new().set_or_clear_message_type(None::<MessageType>);
18396    /// ```
18397    pub fn set_or_clear_message_type<T>(mut self, v: std::option::Option<T>) -> Self
18398    where
18399        T: std::convert::Into<crate::model::pre_check_response::MessageType>,
18400    {
18401        self.message_type = v.map(|x| x.into());
18402        self
18403    }
18404
18405    /// Sets the value of [actions_required][crate::model::PreCheckResponse::actions_required].
18406    ///
18407    /// # Example
18408    /// ```ignore,no_run
18409    /// # use google_cloud_sql_v1::model::PreCheckResponse;
18410    /// let x = PreCheckResponse::new().set_actions_required(["a", "b", "c"]);
18411    /// ```
18412    pub fn set_actions_required<T, V>(mut self, v: T) -> Self
18413    where
18414        T: std::iter::IntoIterator<Item = V>,
18415        V: std::convert::Into<std::string::String>,
18416    {
18417        use std::iter::Iterator;
18418        self.actions_required = v.into_iter().map(|i| i.into()).collect();
18419        self
18420    }
18421}
18422
18423impl wkt::message::Message for PreCheckResponse {
18424    fn typename() -> &'static str {
18425        "type.googleapis.com/google.cloud.sql.v1.PreCheckResponse"
18426    }
18427}
18428
18429/// Defines additional types related to [PreCheckResponse].
18430pub mod pre_check_response {
18431    #[allow(unused_imports)]
18432    use super::*;
18433
18434    /// The type of message which can be an info, a warning, or an error that
18435    /// requires user intervention.
18436    ///
18437    /// # Working with unknown values
18438    ///
18439    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18440    /// additional enum variants at any time. Adding new variants is not considered
18441    /// a breaking change. Applications should write their code in anticipation of:
18442    ///
18443    /// - New values appearing in future releases of the client library, **and**
18444    /// - New values received dynamically, without application changes.
18445    ///
18446    /// Please consult the [Working with enums] section in the user guide for some
18447    /// guidelines.
18448    ///
18449    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18450    #[derive(Clone, Debug, PartialEq)]
18451    #[non_exhaustive]
18452    pub enum MessageType {
18453        /// Default unspecified value to prevent unintended behavior changes.
18454        Unspecified,
18455        /// General informational messages that don't require action.
18456        Info,
18457        /// Warnings that might impact the upgrade but don't block it.
18458        Warning,
18459        /// Errors that a user must resolve before proceeding with the upgrade.
18460        Error,
18461        /// If set, the enum was initialized with an unknown value.
18462        ///
18463        /// Applications can examine the value using [MessageType::value] or
18464        /// [MessageType::name].
18465        UnknownValue(message_type::UnknownValue),
18466    }
18467
18468    #[doc(hidden)]
18469    pub mod message_type {
18470        #[allow(unused_imports)]
18471        use super::*;
18472        #[derive(Clone, Debug, PartialEq)]
18473        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18474    }
18475
18476    impl MessageType {
18477        /// Gets the enum value.
18478        ///
18479        /// Returns `None` if the enum contains an unknown value deserialized from
18480        /// the string representation of enums.
18481        pub fn value(&self) -> std::option::Option<i32> {
18482            match self {
18483                Self::Unspecified => std::option::Option::Some(0),
18484                Self::Info => std::option::Option::Some(1),
18485                Self::Warning => std::option::Option::Some(2),
18486                Self::Error => std::option::Option::Some(3),
18487                Self::UnknownValue(u) => u.0.value(),
18488            }
18489        }
18490
18491        /// Gets the enum value as a string.
18492        ///
18493        /// Returns `None` if the enum contains an unknown value deserialized from
18494        /// the integer representation of enums.
18495        pub fn name(&self) -> std::option::Option<&str> {
18496            match self {
18497                Self::Unspecified => std::option::Option::Some("MESSAGE_TYPE_UNSPECIFIED"),
18498                Self::Info => std::option::Option::Some("INFO"),
18499                Self::Warning => std::option::Option::Some("WARNING"),
18500                Self::Error => std::option::Option::Some("ERROR"),
18501                Self::UnknownValue(u) => u.0.name(),
18502            }
18503        }
18504    }
18505
18506    impl std::default::Default for MessageType {
18507        fn default() -> Self {
18508            use std::convert::From;
18509            Self::from(0)
18510        }
18511    }
18512
18513    impl std::fmt::Display for MessageType {
18514        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18515            wkt::internal::display_enum(f, self.name(), self.value())
18516        }
18517    }
18518
18519    impl std::convert::From<i32> for MessageType {
18520        fn from(value: i32) -> Self {
18521            match value {
18522                0 => Self::Unspecified,
18523                1 => Self::Info,
18524                2 => Self::Warning,
18525                3 => Self::Error,
18526                _ => Self::UnknownValue(message_type::UnknownValue(
18527                    wkt::internal::UnknownEnumValue::Integer(value),
18528                )),
18529            }
18530        }
18531    }
18532
18533    impl std::convert::From<&str> for MessageType {
18534        fn from(value: &str) -> Self {
18535            use std::string::ToString;
18536            match value {
18537                "MESSAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
18538                "INFO" => Self::Info,
18539                "WARNING" => Self::Warning,
18540                "ERROR" => Self::Error,
18541                _ => Self::UnknownValue(message_type::UnknownValue(
18542                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18543                )),
18544            }
18545        }
18546    }
18547
18548    impl serde::ser::Serialize for MessageType {
18549        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18550        where
18551            S: serde::Serializer,
18552        {
18553            match self {
18554                Self::Unspecified => serializer.serialize_i32(0),
18555                Self::Info => serializer.serialize_i32(1),
18556                Self::Warning => serializer.serialize_i32(2),
18557                Self::Error => serializer.serialize_i32(3),
18558                Self::UnknownValue(u) => u.0.serialize(serializer),
18559            }
18560        }
18561    }
18562
18563    impl<'de> serde::de::Deserialize<'de> for MessageType {
18564        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18565        where
18566            D: serde::Deserializer<'de>,
18567        {
18568            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MessageType>::new(
18569                ".google.cloud.sql.v1.PreCheckResponse.MessageType",
18570            ))
18571        }
18572    }
18573}
18574
18575/// Pre-check major version upgrade context.
18576#[derive(Clone, Default, PartialEq)]
18577#[non_exhaustive]
18578pub struct PreCheckMajorVersionUpgradeContext {
18579    /// Required. The target database version to upgrade to.
18580    pub target_database_version: crate::model::SqlDatabaseVersion,
18581
18582    /// Output only. The responses from the precheck operation.
18583    pub pre_check_response: std::vec::Vec<crate::model::PreCheckResponse>,
18584
18585    /// Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
18586    pub kind: std::string::String,
18587
18588    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18589}
18590
18591impl PreCheckMajorVersionUpgradeContext {
18592    pub fn new() -> Self {
18593        std::default::Default::default()
18594    }
18595
18596    /// Sets the value of [target_database_version][crate::model::PreCheckMajorVersionUpgradeContext::target_database_version].
18597    ///
18598    /// # Example
18599    /// ```ignore,no_run
18600    /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
18601    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
18602    /// let x0 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql56);
18603    /// let x1 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql57);
18604    /// let x2 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql80);
18605    /// ```
18606    pub fn set_target_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
18607        mut self,
18608        v: T,
18609    ) -> Self {
18610        self.target_database_version = v.into();
18611        self
18612    }
18613
18614    /// Sets the value of [pre_check_response][crate::model::PreCheckMajorVersionUpgradeContext::pre_check_response].
18615    ///
18616    /// # Example
18617    /// ```ignore,no_run
18618    /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
18619    /// use google_cloud_sql_v1::model::PreCheckResponse;
18620    /// let x = PreCheckMajorVersionUpgradeContext::new()
18621    ///     .set_pre_check_response([
18622    ///         PreCheckResponse::default()/* use setters */,
18623    ///         PreCheckResponse::default()/* use (different) setters */,
18624    ///     ]);
18625    /// ```
18626    pub fn set_pre_check_response<T, V>(mut self, v: T) -> Self
18627    where
18628        T: std::iter::IntoIterator<Item = V>,
18629        V: std::convert::Into<crate::model::PreCheckResponse>,
18630    {
18631        use std::iter::Iterator;
18632        self.pre_check_response = v.into_iter().map(|i| i.into()).collect();
18633        self
18634    }
18635
18636    /// Sets the value of [kind][crate::model::PreCheckMajorVersionUpgradeContext::kind].
18637    ///
18638    /// # Example
18639    /// ```ignore,no_run
18640    /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
18641    /// let x = PreCheckMajorVersionUpgradeContext::new().set_kind("example");
18642    /// ```
18643    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18644        self.kind = v.into();
18645        self
18646    }
18647}
18648
18649impl wkt::message::Message for PreCheckMajorVersionUpgradeContext {
18650    fn typename() -> &'static str {
18651        "type.googleapis.com/google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext"
18652    }
18653}
18654
18655/// Backup context.
18656#[derive(Clone, Default, PartialEq)]
18657#[non_exhaustive]
18658pub struct BackupContext {
18659    /// The identifier of the backup.
18660    pub backup_id: i64,
18661
18662    /// This is always `sql#backupContext`.
18663    pub kind: std::string::String,
18664
18665    /// The name of the backup.
18666    /// Format: projects/{project}/backups/{backup}
18667    pub name: std::string::String,
18668
18669    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18670}
18671
18672impl BackupContext {
18673    pub fn new() -> Self {
18674        std::default::Default::default()
18675    }
18676
18677    /// Sets the value of [backup_id][crate::model::BackupContext::backup_id].
18678    ///
18679    /// # Example
18680    /// ```ignore,no_run
18681    /// # use google_cloud_sql_v1::model::BackupContext;
18682    /// let x = BackupContext::new().set_backup_id(42);
18683    /// ```
18684    pub fn set_backup_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18685        self.backup_id = v.into();
18686        self
18687    }
18688
18689    /// Sets the value of [kind][crate::model::BackupContext::kind].
18690    ///
18691    /// # Example
18692    /// ```ignore,no_run
18693    /// # use google_cloud_sql_v1::model::BackupContext;
18694    /// let x = BackupContext::new().set_kind("example");
18695    /// ```
18696    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18697        self.kind = v.into();
18698        self
18699    }
18700
18701    /// Sets the value of [name][crate::model::BackupContext::name].
18702    ///
18703    /// # Example
18704    /// ```ignore,no_run
18705    /// # use google_cloud_sql_v1::model::BackupContext;
18706    /// let x = BackupContext::new().set_name("example");
18707    /// ```
18708    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18709        self.name = v.into();
18710        self
18711    }
18712}
18713
18714impl wkt::message::Message for BackupContext {
18715    fn typename() -> &'static str {
18716        "type.googleapis.com/google.cloud.sql.v1.BackupContext"
18717    }
18718}
18719
18720/// Represents a SQL database on the Cloud SQL instance.
18721#[derive(Clone, Default, PartialEq)]
18722#[non_exhaustive]
18723pub struct Database {
18724    /// This is always `sql#database`.
18725    pub kind: std::string::String,
18726
18727    /// The Cloud SQL charset value.
18728    pub charset: std::string::String,
18729
18730    /// The Cloud SQL collation value.
18731    pub collation: std::string::String,
18732
18733    /// This field is deprecated and will be removed from a future version of the
18734    /// API.
18735    pub etag: std::string::String,
18736
18737    /// The name of the database in the Cloud SQL instance. This does not include
18738    /// the project ID or instance name.
18739    pub name: std::string::String,
18740
18741    /// The name of the Cloud SQL instance. This does not include the project ID.
18742    pub instance: std::string::String,
18743
18744    /// The URI of this resource.
18745    pub self_link: std::string::String,
18746
18747    /// The project ID of the project containing the Cloud SQL database. The Google
18748    /// apps domain is prefixed if applicable.
18749    pub project: std::string::String,
18750
18751    pub database_details: std::option::Option<crate::model::database::DatabaseDetails>,
18752
18753    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18754}
18755
18756impl Database {
18757    pub fn new() -> Self {
18758        std::default::Default::default()
18759    }
18760
18761    /// Sets the value of [kind][crate::model::Database::kind].
18762    ///
18763    /// # Example
18764    /// ```ignore,no_run
18765    /// # use google_cloud_sql_v1::model::Database;
18766    /// let x = Database::new().set_kind("example");
18767    /// ```
18768    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18769        self.kind = v.into();
18770        self
18771    }
18772
18773    /// Sets the value of [charset][crate::model::Database::charset].
18774    ///
18775    /// # Example
18776    /// ```ignore,no_run
18777    /// # use google_cloud_sql_v1::model::Database;
18778    /// let x = Database::new().set_charset("example");
18779    /// ```
18780    pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18781        self.charset = v.into();
18782        self
18783    }
18784
18785    /// Sets the value of [collation][crate::model::Database::collation].
18786    ///
18787    /// # Example
18788    /// ```ignore,no_run
18789    /// # use google_cloud_sql_v1::model::Database;
18790    /// let x = Database::new().set_collation("example");
18791    /// ```
18792    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18793        self.collation = v.into();
18794        self
18795    }
18796
18797    /// Sets the value of [etag][crate::model::Database::etag].
18798    ///
18799    /// # Example
18800    /// ```ignore,no_run
18801    /// # use google_cloud_sql_v1::model::Database;
18802    /// let x = Database::new().set_etag("example");
18803    /// ```
18804    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18805        self.etag = v.into();
18806        self
18807    }
18808
18809    /// Sets the value of [name][crate::model::Database::name].
18810    ///
18811    /// # Example
18812    /// ```ignore,no_run
18813    /// # use google_cloud_sql_v1::model::Database;
18814    /// let x = Database::new().set_name("example");
18815    /// ```
18816    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18817        self.name = v.into();
18818        self
18819    }
18820
18821    /// Sets the value of [instance][crate::model::Database::instance].
18822    ///
18823    /// # Example
18824    /// ```ignore,no_run
18825    /// # use google_cloud_sql_v1::model::Database;
18826    /// let x = Database::new().set_instance("example");
18827    /// ```
18828    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18829        self.instance = v.into();
18830        self
18831    }
18832
18833    /// Sets the value of [self_link][crate::model::Database::self_link].
18834    ///
18835    /// # Example
18836    /// ```ignore,no_run
18837    /// # use google_cloud_sql_v1::model::Database;
18838    /// let x = Database::new().set_self_link("example");
18839    /// ```
18840    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18841        self.self_link = v.into();
18842        self
18843    }
18844
18845    /// Sets the value of [project][crate::model::Database::project].
18846    ///
18847    /// # Example
18848    /// ```ignore,no_run
18849    /// # use google_cloud_sql_v1::model::Database;
18850    /// let x = Database::new().set_project("example");
18851    /// ```
18852    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18853        self.project = v.into();
18854        self
18855    }
18856
18857    /// Sets the value of [database_details][crate::model::Database::database_details].
18858    ///
18859    /// Note that all the setters affecting `database_details` are mutually
18860    /// exclusive.
18861    ///
18862    /// # Example
18863    /// ```ignore,no_run
18864    /// # use google_cloud_sql_v1::model::Database;
18865    /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
18866    /// let x = Database::new().set_database_details(Some(
18867    ///     google_cloud_sql_v1::model::database::DatabaseDetails::SqlserverDatabaseDetails(SqlServerDatabaseDetails::default().into())));
18868    /// ```
18869    pub fn set_database_details<
18870        T: std::convert::Into<std::option::Option<crate::model::database::DatabaseDetails>>,
18871    >(
18872        mut self,
18873        v: T,
18874    ) -> Self {
18875        self.database_details = v.into();
18876        self
18877    }
18878
18879    /// The value of [database_details][crate::model::Database::database_details]
18880    /// if it holds a `SqlserverDatabaseDetails`, `None` if the field is not set or
18881    /// holds a different branch.
18882    pub fn sqlserver_database_details(
18883        &self,
18884    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerDatabaseDetails>> {
18885        #[allow(unreachable_patterns)]
18886        self.database_details.as_ref().and_then(|v| match v {
18887            crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v) => {
18888                std::option::Option::Some(v)
18889            }
18890            _ => std::option::Option::None,
18891        })
18892    }
18893
18894    /// Sets the value of [database_details][crate::model::Database::database_details]
18895    /// to hold a `SqlserverDatabaseDetails`.
18896    ///
18897    /// Note that all the setters affecting `database_details` are
18898    /// mutually exclusive.
18899    ///
18900    /// # Example
18901    /// ```ignore,no_run
18902    /// # use google_cloud_sql_v1::model::Database;
18903    /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
18904    /// let x = Database::new().set_sqlserver_database_details(SqlServerDatabaseDetails::default()/* use setters */);
18905    /// assert!(x.sqlserver_database_details().is_some());
18906    /// ```
18907    pub fn set_sqlserver_database_details<
18908        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerDatabaseDetails>>,
18909    >(
18910        mut self,
18911        v: T,
18912    ) -> Self {
18913        self.database_details = std::option::Option::Some(
18914            crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v.into()),
18915        );
18916        self
18917    }
18918}
18919
18920impl wkt::message::Message for Database {
18921    fn typename() -> &'static str {
18922        "type.googleapis.com/google.cloud.sql.v1.Database"
18923    }
18924}
18925
18926/// Defines additional types related to [Database].
18927pub mod database {
18928    #[allow(unused_imports)]
18929    use super::*;
18930
18931    #[derive(Clone, Debug, PartialEq)]
18932    #[non_exhaustive]
18933    pub enum DatabaseDetails {
18934        SqlserverDatabaseDetails(std::boxed::Box<crate::model::SqlServerDatabaseDetails>),
18935    }
18936}
18937
18938/// Represents a Sql Server database on the Cloud SQL instance.
18939#[derive(Clone, Default, PartialEq)]
18940#[non_exhaustive]
18941pub struct SqlServerDatabaseDetails {
18942    /// The version of SQL Server with which the database is to be made compatible
18943    pub compatibility_level: i32,
18944
18945    /// The recovery model of a SQL Server database
18946    pub recovery_model: std::string::String,
18947
18948    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18949}
18950
18951impl SqlServerDatabaseDetails {
18952    pub fn new() -> Self {
18953        std::default::Default::default()
18954    }
18955
18956    /// Sets the value of [compatibility_level][crate::model::SqlServerDatabaseDetails::compatibility_level].
18957    ///
18958    /// # Example
18959    /// ```ignore,no_run
18960    /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
18961    /// let x = SqlServerDatabaseDetails::new().set_compatibility_level(42);
18962    /// ```
18963    pub fn set_compatibility_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18964        self.compatibility_level = v.into();
18965        self
18966    }
18967
18968    /// Sets the value of [recovery_model][crate::model::SqlServerDatabaseDetails::recovery_model].
18969    ///
18970    /// # Example
18971    /// ```ignore,no_run
18972    /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
18973    /// let x = SqlServerDatabaseDetails::new().set_recovery_model("example");
18974    /// ```
18975    pub fn set_recovery_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18976        self.recovery_model = v.into();
18977        self
18978    }
18979}
18980
18981impl wkt::message::Message for SqlServerDatabaseDetails {
18982    fn typename() -> &'static str {
18983        "type.googleapis.com/google.cloud.sql.v1.SqlServerDatabaseDetails"
18984    }
18985}
18986
18987/// Database flags for Cloud SQL instances.
18988#[derive(Clone, Default, PartialEq)]
18989#[non_exhaustive]
18990pub struct DatabaseFlags {
18991    /// The name of the flag. These flags are passed at instance startup, so
18992    /// include both server options and system variables. Flags are
18993    /// specified with underscores, not hyphens. For more information, see
18994    /// [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
18995    /// in the Cloud SQL documentation.
18996    pub name: std::string::String,
18997
18998    /// The value of the flag. Boolean flags are set to `on` for true
18999    /// and `off` for false. This field must be omitted if the flag
19000    /// doesn't take a value.
19001    pub value: std::string::String,
19002
19003    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19004}
19005
19006impl DatabaseFlags {
19007    pub fn new() -> Self {
19008        std::default::Default::default()
19009    }
19010
19011    /// Sets the value of [name][crate::model::DatabaseFlags::name].
19012    ///
19013    /// # Example
19014    /// ```ignore,no_run
19015    /// # use google_cloud_sql_v1::model::DatabaseFlags;
19016    /// let x = DatabaseFlags::new().set_name("example");
19017    /// ```
19018    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19019        self.name = v.into();
19020        self
19021    }
19022
19023    /// Sets the value of [value][crate::model::DatabaseFlags::value].
19024    ///
19025    /// # Example
19026    /// ```ignore,no_run
19027    /// # use google_cloud_sql_v1::model::DatabaseFlags;
19028    /// let x = DatabaseFlags::new().set_value("example");
19029    /// ```
19030    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19031        self.value = v.into();
19032        self
19033    }
19034}
19035
19036impl wkt::message::Message for DatabaseFlags {
19037    fn typename() -> &'static str {
19038        "type.googleapis.com/google.cloud.sql.v1.DatabaseFlags"
19039    }
19040}
19041
19042/// MySQL-specific external server sync settings.
19043#[derive(Clone, Default, PartialEq)]
19044#[non_exhaustive]
19045pub struct MySqlSyncConfig {
19046    /// Flags to use for the initial dump.
19047    pub initial_sync_flags: std::vec::Vec<crate::model::SyncFlags>,
19048
19049    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19050}
19051
19052impl MySqlSyncConfig {
19053    pub fn new() -> Self {
19054        std::default::Default::default()
19055    }
19056
19057    /// Sets the value of [initial_sync_flags][crate::model::MySqlSyncConfig::initial_sync_flags].
19058    ///
19059    /// # Example
19060    /// ```ignore,no_run
19061    /// # use google_cloud_sql_v1::model::MySqlSyncConfig;
19062    /// use google_cloud_sql_v1::model::SyncFlags;
19063    /// let x = MySqlSyncConfig::new()
19064    ///     .set_initial_sync_flags([
19065    ///         SyncFlags::default()/* use setters */,
19066    ///         SyncFlags::default()/* use (different) setters */,
19067    ///     ]);
19068    /// ```
19069    pub fn set_initial_sync_flags<T, V>(mut self, v: T) -> Self
19070    where
19071        T: std::iter::IntoIterator<Item = V>,
19072        V: std::convert::Into<crate::model::SyncFlags>,
19073    {
19074        use std::iter::Iterator;
19075        self.initial_sync_flags = v.into_iter().map(|i| i.into()).collect();
19076        self
19077    }
19078}
19079
19080impl wkt::message::Message for MySqlSyncConfig {
19081    fn typename() -> &'static str {
19082        "type.googleapis.com/google.cloud.sql.v1.MySqlSyncConfig"
19083    }
19084}
19085
19086/// Initial sync flags for certain Cloud SQL APIs.
19087/// Currently used for the MySQL external server initial dump.
19088#[derive(Clone, Default, PartialEq)]
19089#[non_exhaustive]
19090pub struct SyncFlags {
19091    /// The name of the flag.
19092    pub name: std::string::String,
19093
19094    /// The value of the flag. This field must be omitted if the flag
19095    /// doesn't take a value.
19096    pub value: std::string::String,
19097
19098    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19099}
19100
19101impl SyncFlags {
19102    pub fn new() -> Self {
19103        std::default::Default::default()
19104    }
19105
19106    /// Sets the value of [name][crate::model::SyncFlags::name].
19107    ///
19108    /// # Example
19109    /// ```ignore,no_run
19110    /// # use google_cloud_sql_v1::model::SyncFlags;
19111    /// let x = SyncFlags::new().set_name("example");
19112    /// ```
19113    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19114        self.name = v.into();
19115        self
19116    }
19117
19118    /// Sets the value of [value][crate::model::SyncFlags::value].
19119    ///
19120    /// # Example
19121    /// ```ignore,no_run
19122    /// # use google_cloud_sql_v1::model::SyncFlags;
19123    /// let x = SyncFlags::new().set_value("example");
19124    /// ```
19125    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19126        self.value = v.into();
19127        self
19128    }
19129}
19130
19131impl wkt::message::Message for SyncFlags {
19132    fn typename() -> &'static str {
19133        "type.googleapis.com/google.cloud.sql.v1.SyncFlags"
19134    }
19135}
19136
19137/// Reference to another Cloud SQL instance.
19138#[derive(Clone, Default, PartialEq)]
19139#[non_exhaustive]
19140pub struct InstanceReference {
19141    /// The name of the Cloud SQL instance being referenced.
19142    /// This does not include the project ID.
19143    pub name: std::string::String,
19144
19145    /// The region of the Cloud SQL instance being referenced.
19146    pub region: std::string::String,
19147
19148    /// The project ID of the Cloud SQL instance being referenced.
19149    /// The default is the same project ID as the instance references it.
19150    pub project: std::string::String,
19151
19152    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19153}
19154
19155impl InstanceReference {
19156    pub fn new() -> Self {
19157        std::default::Default::default()
19158    }
19159
19160    /// Sets the value of [name][crate::model::InstanceReference::name].
19161    ///
19162    /// # Example
19163    /// ```ignore,no_run
19164    /// # use google_cloud_sql_v1::model::InstanceReference;
19165    /// let x = InstanceReference::new().set_name("example");
19166    /// ```
19167    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19168        self.name = v.into();
19169        self
19170    }
19171
19172    /// Sets the value of [region][crate::model::InstanceReference::region].
19173    ///
19174    /// # Example
19175    /// ```ignore,no_run
19176    /// # use google_cloud_sql_v1::model::InstanceReference;
19177    /// let x = InstanceReference::new().set_region("example");
19178    /// ```
19179    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19180        self.region = v.into();
19181        self
19182    }
19183
19184    /// Sets the value of [project][crate::model::InstanceReference::project].
19185    ///
19186    /// # Example
19187    /// ```ignore,no_run
19188    /// # use google_cloud_sql_v1::model::InstanceReference;
19189    /// let x = InstanceReference::new().set_project("example");
19190    /// ```
19191    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19192        self.project = v.into();
19193        self
19194    }
19195}
19196
19197impl wkt::message::Message for InstanceReference {
19198    fn typename() -> &'static str {
19199        "type.googleapis.com/google.cloud.sql.v1.InstanceReference"
19200    }
19201}
19202
19203/// Read-replica configuration for connecting to the on-premises primary
19204/// instance.
19205#[derive(Clone, Default, PartialEq)]
19206#[non_exhaustive]
19207pub struct DemoteMasterConfiguration {
19208    /// This is always `sql#demoteMasterConfiguration`.
19209    pub kind: std::string::String,
19210
19211    /// MySQL specific configuration when replicating from a MySQL on-premises
19212    /// primary instance. Replication configuration information such as the
19213    /// username, password, certificates, and keys are not stored in the instance
19214    /// metadata. The configuration information is used only to set up the
19215    /// replication connection and is stored by MySQL in a file named
19216    /// `master.info` in the data directory.
19217    pub mysql_replica_configuration:
19218        std::option::Option<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19219
19220    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19221}
19222
19223impl DemoteMasterConfiguration {
19224    pub fn new() -> Self {
19225        std::default::Default::default()
19226    }
19227
19228    /// Sets the value of [kind][crate::model::DemoteMasterConfiguration::kind].
19229    ///
19230    /// # Example
19231    /// ```ignore,no_run
19232    /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19233    /// let x = DemoteMasterConfiguration::new().set_kind("example");
19234    /// ```
19235    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19236        self.kind = v.into();
19237        self
19238    }
19239
19240    /// Sets the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
19241    ///
19242    /// # Example
19243    /// ```ignore,no_run
19244    /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19245    /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19246    /// let x = DemoteMasterConfiguration::new().set_mysql_replica_configuration(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */);
19247    /// ```
19248    pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
19249    where
19250        T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19251    {
19252        self.mysql_replica_configuration = std::option::Option::Some(v.into());
19253        self
19254    }
19255
19256    /// Sets or clears the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
19257    ///
19258    /// # Example
19259    /// ```ignore,no_run
19260    /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19261    /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19262    /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(Some(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */));
19263    /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(None::<DemoteMasterMySqlReplicaConfiguration>);
19264    /// ```
19265    pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
19266    where
19267        T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19268    {
19269        self.mysql_replica_configuration = v.map(|x| x.into());
19270        self
19271    }
19272}
19273
19274impl wkt::message::Message for DemoteMasterConfiguration {
19275    fn typename() -> &'static str {
19276        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterConfiguration"
19277    }
19278}
19279
19280/// Read-replica configuration specific to MySQL databases.
19281#[derive(Clone, Default, PartialEq)]
19282#[non_exhaustive]
19283pub struct DemoteMasterMySqlReplicaConfiguration {
19284    /// This is always `sql#demoteMasterMysqlReplicaConfiguration`.
19285    pub kind: std::string::String,
19286
19287    /// The username for the replication connection.
19288    pub username: std::string::String,
19289
19290    /// The password for the replication connection.
19291    pub password: std::string::String,
19292
19293    /// PEM representation of the replica's private key. The corresponding public
19294    /// key is encoded in the client's certificate. The format of the replica's
19295    /// private key can be either PKCS #1 or PKCS #8.
19296    pub client_key: std::string::String,
19297
19298    /// PEM representation of the replica's x509 certificate.
19299    pub client_certificate: std::string::String,
19300
19301    /// PEM representation of the trusted CA's x509 certificate.
19302    pub ca_certificate: std::string::String,
19303
19304    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19305}
19306
19307impl DemoteMasterMySqlReplicaConfiguration {
19308    pub fn new() -> Self {
19309        std::default::Default::default()
19310    }
19311
19312    /// Sets the value of [kind][crate::model::DemoteMasterMySqlReplicaConfiguration::kind].
19313    ///
19314    /// # Example
19315    /// ```ignore,no_run
19316    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19317    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_kind("example");
19318    /// ```
19319    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19320        self.kind = v.into();
19321        self
19322    }
19323
19324    /// Sets the value of [username][crate::model::DemoteMasterMySqlReplicaConfiguration::username].
19325    ///
19326    /// # Example
19327    /// ```ignore,no_run
19328    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19329    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_username("example");
19330    /// ```
19331    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19332        self.username = v.into();
19333        self
19334    }
19335
19336    /// Sets the value of [password][crate::model::DemoteMasterMySqlReplicaConfiguration::password].
19337    ///
19338    /// # Example
19339    /// ```ignore,no_run
19340    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19341    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_password("example");
19342    /// ```
19343    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19344        self.password = v.into();
19345        self
19346    }
19347
19348    /// Sets the value of [client_key][crate::model::DemoteMasterMySqlReplicaConfiguration::client_key].
19349    ///
19350    /// # Example
19351    /// ```ignore,no_run
19352    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19353    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_key("example");
19354    /// ```
19355    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19356        self.client_key = v.into();
19357        self
19358    }
19359
19360    /// Sets the value of [client_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::client_certificate].
19361    ///
19362    /// # Example
19363    /// ```ignore,no_run
19364    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19365    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_certificate("example");
19366    /// ```
19367    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
19368        mut self,
19369        v: T,
19370    ) -> Self {
19371        self.client_certificate = v.into();
19372        self
19373    }
19374
19375    /// Sets the value of [ca_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::ca_certificate].
19376    ///
19377    /// # Example
19378    /// ```ignore,no_run
19379    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19380    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_ca_certificate("example");
19381    /// ```
19382    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19383        self.ca_certificate = v.into();
19384        self
19385    }
19386}
19387
19388impl wkt::message::Message for DemoteMasterMySqlReplicaConfiguration {
19389    fn typename() -> &'static str {
19390        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration"
19391    }
19392}
19393
19394/// Database instance export context.
19395#[derive(Clone, Default, PartialEq)]
19396#[non_exhaustive]
19397pub struct ExportContext {
19398    /// The path to the file in Google Cloud Storage where the export will be
19399    /// stored. The URI is in the form `gs://bucketName/fileName`. If the file
19400    /// already exists, the request succeeds, but the operation fails. If
19401    /// `fileType` is `SQL` and the filename ends with .gz,
19402    /// the contents are compressed.
19403    pub uri: std::string::String,
19404
19405    /// Databases to be exported. <br /> `MySQL instances:` If
19406    /// `fileType` is `SQL` and no database is specified, all
19407    /// databases are exported, except for the `mysql` system database.
19408    /// If `fileType` is `CSV`, you can specify one database,
19409    /// either by using this property or by using the
19410    /// `csvExportOptions.selectQuery` property, which takes precedence
19411    /// over this property. <br /> `PostgreSQL instances:` If you don't specify a
19412    /// database by name, all user databases in the instance are exported.
19413    /// This excludes system databases and Cloud SQL databases used to manage
19414    /// internal operations. Exporting all user databases is only available for
19415    /// directory-formatted parallel export. If `fileType` is `CSV`,
19416    /// this database must match the one specified in the
19417    /// `csvExportOptions.selectQuery` property. <br /> `SQL Server
19418    /// instances:` You must specify one database to be exported, and the
19419    /// `fileType` must be `BAK`.
19420    pub databases: std::vec::Vec<std::string::String>,
19421
19422    /// This is always `sql#exportContext`.
19423    pub kind: std::string::String,
19424
19425    /// Options for exporting data as SQL statements.
19426    pub sql_export_options: std::option::Option<crate::model::export_context::SqlExportOptions>,
19427
19428    /// Options for exporting data as CSV. `MySQL` and `PostgreSQL`
19429    /// instances only.
19430    pub csv_export_options: std::option::Option<crate::model::export_context::SqlCsvExportOptions>,
19431
19432    /// The file type for the specified uri.
19433    pub file_type: crate::model::SqlFileType,
19434
19435    /// Whether to perform a serverless export.
19436    pub offload: std::option::Option<wkt::BoolValue>,
19437
19438    /// Options for exporting data as BAK files.
19439    pub bak_export_options: std::option::Option<crate::model::export_context::SqlBakExportOptions>,
19440
19441    /// Optional. Export parameters specific to SQL Server TDE certificates
19442    pub tde_export_options: std::option::Option<crate::model::export_context::SqlTdeExportOptions>,
19443
19444    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19445}
19446
19447impl ExportContext {
19448    pub fn new() -> Self {
19449        std::default::Default::default()
19450    }
19451
19452    /// Sets the value of [uri][crate::model::ExportContext::uri].
19453    ///
19454    /// # Example
19455    /// ```ignore,no_run
19456    /// # use google_cloud_sql_v1::model::ExportContext;
19457    /// let x = ExportContext::new().set_uri("example");
19458    /// ```
19459    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19460        self.uri = v.into();
19461        self
19462    }
19463
19464    /// Sets the value of [databases][crate::model::ExportContext::databases].
19465    ///
19466    /// # Example
19467    /// ```ignore,no_run
19468    /// # use google_cloud_sql_v1::model::ExportContext;
19469    /// let x = ExportContext::new().set_databases(["a", "b", "c"]);
19470    /// ```
19471    pub fn set_databases<T, V>(mut self, v: T) -> Self
19472    where
19473        T: std::iter::IntoIterator<Item = V>,
19474        V: std::convert::Into<std::string::String>,
19475    {
19476        use std::iter::Iterator;
19477        self.databases = v.into_iter().map(|i| i.into()).collect();
19478        self
19479    }
19480
19481    /// Sets the value of [kind][crate::model::ExportContext::kind].
19482    ///
19483    /// # Example
19484    /// ```ignore,no_run
19485    /// # use google_cloud_sql_v1::model::ExportContext;
19486    /// let x = ExportContext::new().set_kind("example");
19487    /// ```
19488    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19489        self.kind = v.into();
19490        self
19491    }
19492
19493    /// Sets the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
19494    ///
19495    /// # Example
19496    /// ```ignore,no_run
19497    /// # use google_cloud_sql_v1::model::ExportContext;
19498    /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19499    /// let x = ExportContext::new().set_sql_export_options(SqlExportOptions::default()/* use setters */);
19500    /// ```
19501    pub fn set_sql_export_options<T>(mut self, v: T) -> Self
19502    where
19503        T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
19504    {
19505        self.sql_export_options = std::option::Option::Some(v.into());
19506        self
19507    }
19508
19509    /// Sets or clears the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
19510    ///
19511    /// # Example
19512    /// ```ignore,no_run
19513    /// # use google_cloud_sql_v1::model::ExportContext;
19514    /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19515    /// let x = ExportContext::new().set_or_clear_sql_export_options(Some(SqlExportOptions::default()/* use setters */));
19516    /// let x = ExportContext::new().set_or_clear_sql_export_options(None::<SqlExportOptions>);
19517    /// ```
19518    pub fn set_or_clear_sql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19519    where
19520        T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
19521    {
19522        self.sql_export_options = v.map(|x| x.into());
19523        self
19524    }
19525
19526    /// Sets the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
19527    ///
19528    /// # Example
19529    /// ```ignore,no_run
19530    /// # use google_cloud_sql_v1::model::ExportContext;
19531    /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19532    /// let x = ExportContext::new().set_csv_export_options(SqlCsvExportOptions::default()/* use setters */);
19533    /// ```
19534    pub fn set_csv_export_options<T>(mut self, v: T) -> Self
19535    where
19536        T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
19537    {
19538        self.csv_export_options = std::option::Option::Some(v.into());
19539        self
19540    }
19541
19542    /// Sets or clears the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
19543    ///
19544    /// # Example
19545    /// ```ignore,no_run
19546    /// # use google_cloud_sql_v1::model::ExportContext;
19547    /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19548    /// let x = ExportContext::new().set_or_clear_csv_export_options(Some(SqlCsvExportOptions::default()/* use setters */));
19549    /// let x = ExportContext::new().set_or_clear_csv_export_options(None::<SqlCsvExportOptions>);
19550    /// ```
19551    pub fn set_or_clear_csv_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19552    where
19553        T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
19554    {
19555        self.csv_export_options = v.map(|x| x.into());
19556        self
19557    }
19558
19559    /// Sets the value of [file_type][crate::model::ExportContext::file_type].
19560    ///
19561    /// # Example
19562    /// ```ignore,no_run
19563    /// # use google_cloud_sql_v1::model::ExportContext;
19564    /// use google_cloud_sql_v1::model::SqlFileType;
19565    /// let x0 = ExportContext::new().set_file_type(SqlFileType::Sql);
19566    /// let x1 = ExportContext::new().set_file_type(SqlFileType::Csv);
19567    /// let x2 = ExportContext::new().set_file_type(SqlFileType::Bak);
19568    /// ```
19569    pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
19570        self.file_type = v.into();
19571        self
19572    }
19573
19574    /// Sets the value of [offload][crate::model::ExportContext::offload].
19575    ///
19576    /// # Example
19577    /// ```ignore,no_run
19578    /// # use google_cloud_sql_v1::model::ExportContext;
19579    /// use wkt::BoolValue;
19580    /// let x = ExportContext::new().set_offload(BoolValue::default()/* use setters */);
19581    /// ```
19582    pub fn set_offload<T>(mut self, v: T) -> Self
19583    where
19584        T: std::convert::Into<wkt::BoolValue>,
19585    {
19586        self.offload = std::option::Option::Some(v.into());
19587        self
19588    }
19589
19590    /// Sets or clears the value of [offload][crate::model::ExportContext::offload].
19591    ///
19592    /// # Example
19593    /// ```ignore,no_run
19594    /// # use google_cloud_sql_v1::model::ExportContext;
19595    /// use wkt::BoolValue;
19596    /// let x = ExportContext::new().set_or_clear_offload(Some(BoolValue::default()/* use setters */));
19597    /// let x = ExportContext::new().set_or_clear_offload(None::<BoolValue>);
19598    /// ```
19599    pub fn set_or_clear_offload<T>(mut self, v: std::option::Option<T>) -> Self
19600    where
19601        T: std::convert::Into<wkt::BoolValue>,
19602    {
19603        self.offload = v.map(|x| x.into());
19604        self
19605    }
19606
19607    /// Sets the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
19608    ///
19609    /// # Example
19610    /// ```ignore,no_run
19611    /// # use google_cloud_sql_v1::model::ExportContext;
19612    /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
19613    /// let x = ExportContext::new().set_bak_export_options(SqlBakExportOptions::default()/* use setters */);
19614    /// ```
19615    pub fn set_bak_export_options<T>(mut self, v: T) -> Self
19616    where
19617        T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
19618    {
19619        self.bak_export_options = std::option::Option::Some(v.into());
19620        self
19621    }
19622
19623    /// Sets or clears the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
19624    ///
19625    /// # Example
19626    /// ```ignore,no_run
19627    /// # use google_cloud_sql_v1::model::ExportContext;
19628    /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
19629    /// let x = ExportContext::new().set_or_clear_bak_export_options(Some(SqlBakExportOptions::default()/* use setters */));
19630    /// let x = ExportContext::new().set_or_clear_bak_export_options(None::<SqlBakExportOptions>);
19631    /// ```
19632    pub fn set_or_clear_bak_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19633    where
19634        T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
19635    {
19636        self.bak_export_options = v.map(|x| x.into());
19637        self
19638    }
19639
19640    /// Sets the value of [tde_export_options][crate::model::ExportContext::tde_export_options].
19641    ///
19642    /// # Example
19643    /// ```ignore,no_run
19644    /// # use google_cloud_sql_v1::model::ExportContext;
19645    /// use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
19646    /// let x = ExportContext::new().set_tde_export_options(SqlTdeExportOptions::default()/* use setters */);
19647    /// ```
19648    pub fn set_tde_export_options<T>(mut self, v: T) -> Self
19649    where
19650        T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
19651    {
19652        self.tde_export_options = std::option::Option::Some(v.into());
19653        self
19654    }
19655
19656    /// Sets or clears the value of [tde_export_options][crate::model::ExportContext::tde_export_options].
19657    ///
19658    /// # Example
19659    /// ```ignore,no_run
19660    /// # use google_cloud_sql_v1::model::ExportContext;
19661    /// use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
19662    /// let x = ExportContext::new().set_or_clear_tde_export_options(Some(SqlTdeExportOptions::default()/* use setters */));
19663    /// let x = ExportContext::new().set_or_clear_tde_export_options(None::<SqlTdeExportOptions>);
19664    /// ```
19665    pub fn set_or_clear_tde_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19666    where
19667        T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
19668    {
19669        self.tde_export_options = v.map(|x| x.into());
19670        self
19671    }
19672}
19673
19674impl wkt::message::Message for ExportContext {
19675    fn typename() -> &'static str {
19676        "type.googleapis.com/google.cloud.sql.v1.ExportContext"
19677    }
19678}
19679
19680/// Defines additional types related to [ExportContext].
19681pub mod export_context {
19682    #[allow(unused_imports)]
19683    use super::*;
19684
19685    #[derive(Clone, Default, PartialEq)]
19686    #[non_exhaustive]
19687    pub struct SqlCsvExportOptions {
19688        /// The select query used to extract the data.
19689        pub select_query: std::string::String,
19690
19691        /// Specifies the character that should appear before a data character that
19692        /// needs to be escaped.
19693        pub escape_character: std::string::String,
19694
19695        /// Specifies the quoting character to be used when a data value is quoted.
19696        pub quote_character: std::string::String,
19697
19698        /// Specifies the character that separates columns within each row (line) of
19699        /// the file.
19700        pub fields_terminated_by: std::string::String,
19701
19702        /// This is used to separate lines. If a line does not contain all fields,
19703        /// the rest of the columns are set to their default values.
19704        pub lines_terminated_by: std::string::String,
19705
19706        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19707    }
19708
19709    impl SqlCsvExportOptions {
19710        pub fn new() -> Self {
19711            std::default::Default::default()
19712        }
19713
19714        /// Sets the value of [select_query][crate::model::export_context::SqlCsvExportOptions::select_query].
19715        ///
19716        /// # Example
19717        /// ```ignore,no_run
19718        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19719        /// let x = SqlCsvExportOptions::new().set_select_query("example");
19720        /// ```
19721        pub fn set_select_query<T: std::convert::Into<std::string::String>>(
19722            mut self,
19723            v: T,
19724        ) -> Self {
19725            self.select_query = v.into();
19726            self
19727        }
19728
19729        /// Sets the value of [escape_character][crate::model::export_context::SqlCsvExportOptions::escape_character].
19730        ///
19731        /// # Example
19732        /// ```ignore,no_run
19733        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19734        /// let x = SqlCsvExportOptions::new().set_escape_character("example");
19735        /// ```
19736        pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
19737            mut self,
19738            v: T,
19739        ) -> Self {
19740            self.escape_character = v.into();
19741            self
19742        }
19743
19744        /// Sets the value of [quote_character][crate::model::export_context::SqlCsvExportOptions::quote_character].
19745        ///
19746        /// # Example
19747        /// ```ignore,no_run
19748        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19749        /// let x = SqlCsvExportOptions::new().set_quote_character("example");
19750        /// ```
19751        pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
19752            mut self,
19753            v: T,
19754        ) -> Self {
19755            self.quote_character = v.into();
19756            self
19757        }
19758
19759        /// Sets the value of [fields_terminated_by][crate::model::export_context::SqlCsvExportOptions::fields_terminated_by].
19760        ///
19761        /// # Example
19762        /// ```ignore,no_run
19763        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19764        /// let x = SqlCsvExportOptions::new().set_fields_terminated_by("example");
19765        /// ```
19766        pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
19767            mut self,
19768            v: T,
19769        ) -> Self {
19770            self.fields_terminated_by = v.into();
19771            self
19772        }
19773
19774        /// Sets the value of [lines_terminated_by][crate::model::export_context::SqlCsvExportOptions::lines_terminated_by].
19775        ///
19776        /// # Example
19777        /// ```ignore,no_run
19778        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19779        /// let x = SqlCsvExportOptions::new().set_lines_terminated_by("example");
19780        /// ```
19781        pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
19782            mut self,
19783            v: T,
19784        ) -> Self {
19785            self.lines_terminated_by = v.into();
19786            self
19787        }
19788    }
19789
19790    impl wkt::message::Message for SqlCsvExportOptions {
19791        fn typename() -> &'static str {
19792            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlCsvExportOptions"
19793        }
19794    }
19795
19796    #[derive(Clone, Default, PartialEq)]
19797    #[non_exhaustive]
19798    pub struct SqlExportOptions {
19799        /// Tables to export, or that were exported, from the specified database. If
19800        /// you specify tables, specify one and only one database. For PostgreSQL
19801        /// instances, you can specify only one table.
19802        pub tables: std::vec::Vec<std::string::String>,
19803
19804        /// Export only schemas.
19805        pub schema_only: std::option::Option<wkt::BoolValue>,
19806
19807        pub mysql_export_options: std::option::Option<
19808            crate::model::export_context::sql_export_options::MysqlExportOptions,
19809        >,
19810
19811        /// Optional. The number of threads to use for parallel export.
19812        pub threads: std::option::Option<wkt::Int32Value>,
19813
19814        /// Optional. Whether or not the export should be parallel.
19815        pub parallel: std::option::Option<wkt::BoolValue>,
19816
19817        /// Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
19818        pub postgres_export_options: std::option::Option<
19819            crate::model::export_context::sql_export_options::PostgresExportOptions,
19820        >,
19821
19822        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19823    }
19824
19825    impl SqlExportOptions {
19826        pub fn new() -> Self {
19827            std::default::Default::default()
19828        }
19829
19830        /// Sets the value of [tables][crate::model::export_context::SqlExportOptions::tables].
19831        ///
19832        /// # Example
19833        /// ```ignore,no_run
19834        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19835        /// let x = SqlExportOptions::new().set_tables(["a", "b", "c"]);
19836        /// ```
19837        pub fn set_tables<T, V>(mut self, v: T) -> Self
19838        where
19839            T: std::iter::IntoIterator<Item = V>,
19840            V: std::convert::Into<std::string::String>,
19841        {
19842            use std::iter::Iterator;
19843            self.tables = v.into_iter().map(|i| i.into()).collect();
19844            self
19845        }
19846
19847        /// Sets the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
19848        ///
19849        /// # Example
19850        /// ```ignore,no_run
19851        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19852        /// use wkt::BoolValue;
19853        /// let x = SqlExportOptions::new().set_schema_only(BoolValue::default()/* use setters */);
19854        /// ```
19855        pub fn set_schema_only<T>(mut self, v: T) -> Self
19856        where
19857            T: std::convert::Into<wkt::BoolValue>,
19858        {
19859            self.schema_only = std::option::Option::Some(v.into());
19860            self
19861        }
19862
19863        /// Sets or clears the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
19864        ///
19865        /// # Example
19866        /// ```ignore,no_run
19867        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19868        /// use wkt::BoolValue;
19869        /// let x = SqlExportOptions::new().set_or_clear_schema_only(Some(BoolValue::default()/* use setters */));
19870        /// let x = SqlExportOptions::new().set_or_clear_schema_only(None::<BoolValue>);
19871        /// ```
19872        pub fn set_or_clear_schema_only<T>(mut self, v: std::option::Option<T>) -> Self
19873        where
19874            T: std::convert::Into<wkt::BoolValue>,
19875        {
19876            self.schema_only = v.map(|x| x.into());
19877            self
19878        }
19879
19880        /// Sets the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
19881        ///
19882        /// # Example
19883        /// ```ignore,no_run
19884        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19885        /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
19886        /// let x = SqlExportOptions::new().set_mysql_export_options(MysqlExportOptions::default()/* use setters */);
19887        /// ```
19888        pub fn set_mysql_export_options<T>(mut self, v: T) -> Self
19889        where
19890            T: std::convert::Into<
19891                    crate::model::export_context::sql_export_options::MysqlExportOptions,
19892                >,
19893        {
19894            self.mysql_export_options = std::option::Option::Some(v.into());
19895            self
19896        }
19897
19898        /// Sets or clears the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
19899        ///
19900        /// # Example
19901        /// ```ignore,no_run
19902        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19903        /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
19904        /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(Some(MysqlExportOptions::default()/* use setters */));
19905        /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(None::<MysqlExportOptions>);
19906        /// ```
19907        pub fn set_or_clear_mysql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19908        where
19909            T: std::convert::Into<
19910                    crate::model::export_context::sql_export_options::MysqlExportOptions,
19911                >,
19912        {
19913            self.mysql_export_options = v.map(|x| x.into());
19914            self
19915        }
19916
19917        /// Sets the value of [threads][crate::model::export_context::SqlExportOptions::threads].
19918        ///
19919        /// # Example
19920        /// ```ignore,no_run
19921        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19922        /// use wkt::Int32Value;
19923        /// let x = SqlExportOptions::new().set_threads(Int32Value::default()/* use setters */);
19924        /// ```
19925        pub fn set_threads<T>(mut self, v: T) -> Self
19926        where
19927            T: std::convert::Into<wkt::Int32Value>,
19928        {
19929            self.threads = std::option::Option::Some(v.into());
19930            self
19931        }
19932
19933        /// Sets or clears the value of [threads][crate::model::export_context::SqlExportOptions::threads].
19934        ///
19935        /// # Example
19936        /// ```ignore,no_run
19937        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19938        /// use wkt::Int32Value;
19939        /// let x = SqlExportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
19940        /// let x = SqlExportOptions::new().set_or_clear_threads(None::<Int32Value>);
19941        /// ```
19942        pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
19943        where
19944            T: std::convert::Into<wkt::Int32Value>,
19945        {
19946            self.threads = v.map(|x| x.into());
19947            self
19948        }
19949
19950        /// Sets the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
19951        ///
19952        /// # Example
19953        /// ```ignore,no_run
19954        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19955        /// use wkt::BoolValue;
19956        /// let x = SqlExportOptions::new().set_parallel(BoolValue::default()/* use setters */);
19957        /// ```
19958        pub fn set_parallel<T>(mut self, v: T) -> Self
19959        where
19960            T: std::convert::Into<wkt::BoolValue>,
19961        {
19962            self.parallel = std::option::Option::Some(v.into());
19963            self
19964        }
19965
19966        /// Sets or clears the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
19967        ///
19968        /// # Example
19969        /// ```ignore,no_run
19970        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19971        /// use wkt::BoolValue;
19972        /// let x = SqlExportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
19973        /// let x = SqlExportOptions::new().set_or_clear_parallel(None::<BoolValue>);
19974        /// ```
19975        pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
19976        where
19977            T: std::convert::Into<wkt::BoolValue>,
19978        {
19979            self.parallel = v.map(|x| x.into());
19980            self
19981        }
19982
19983        /// Sets the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
19984        ///
19985        /// # Example
19986        /// ```ignore,no_run
19987        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19988        /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
19989        /// let x = SqlExportOptions::new().set_postgres_export_options(PostgresExportOptions::default()/* use setters */);
19990        /// ```
19991        pub fn set_postgres_export_options<T>(mut self, v: T) -> Self
19992        where
19993            T: std::convert::Into<
19994                    crate::model::export_context::sql_export_options::PostgresExportOptions,
19995                >,
19996        {
19997            self.postgres_export_options = std::option::Option::Some(v.into());
19998            self
19999        }
20000
20001        /// Sets or clears the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
20002        ///
20003        /// # Example
20004        /// ```ignore,no_run
20005        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20006        /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20007        /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(Some(PostgresExportOptions::default()/* use setters */));
20008        /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(None::<PostgresExportOptions>);
20009        /// ```
20010        pub fn set_or_clear_postgres_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20011        where
20012            T: std::convert::Into<
20013                    crate::model::export_context::sql_export_options::PostgresExportOptions,
20014                >,
20015        {
20016            self.postgres_export_options = v.map(|x| x.into());
20017            self
20018        }
20019    }
20020
20021    impl wkt::message::Message for SqlExportOptions {
20022        fn typename() -> &'static str {
20023            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions"
20024        }
20025    }
20026
20027    /// Defines additional types related to [SqlExportOptions].
20028    pub mod sql_export_options {
20029        #[allow(unused_imports)]
20030        use super::*;
20031
20032        /// Options for exporting from MySQL.
20033        #[derive(Clone, Default, PartialEq)]
20034        #[non_exhaustive]
20035        pub struct MysqlExportOptions {
20036            /// Option to include SQL statement required to set up replication. If set
20037            /// to `1`, the dump file includes a CHANGE MASTER TO statement with the
20038            /// binary log coordinates, and --set-gtid-purged is set to ON. If set to
20039            /// `2`, the CHANGE MASTER TO statement is written as a SQL comment and
20040            /// has no effect. If set to any value other than `1`, --set-gtid-purged
20041            /// is set to OFF.
20042            pub master_data: std::option::Option<wkt::Int32Value>,
20043
20044            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20045        }
20046
20047        impl MysqlExportOptions {
20048            pub fn new() -> Self {
20049                std::default::Default::default()
20050            }
20051
20052            /// Sets the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
20053            ///
20054            /// # Example
20055            /// ```ignore,no_run
20056            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20057            /// use wkt::Int32Value;
20058            /// let x = MysqlExportOptions::new().set_master_data(Int32Value::default()/* use setters */);
20059            /// ```
20060            pub fn set_master_data<T>(mut self, v: T) -> Self
20061            where
20062                T: std::convert::Into<wkt::Int32Value>,
20063            {
20064                self.master_data = std::option::Option::Some(v.into());
20065                self
20066            }
20067
20068            /// Sets or clears the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
20069            ///
20070            /// # Example
20071            /// ```ignore,no_run
20072            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20073            /// use wkt::Int32Value;
20074            /// let x = MysqlExportOptions::new().set_or_clear_master_data(Some(Int32Value::default()/* use setters */));
20075            /// let x = MysqlExportOptions::new().set_or_clear_master_data(None::<Int32Value>);
20076            /// ```
20077            pub fn set_or_clear_master_data<T>(mut self, v: std::option::Option<T>) -> Self
20078            where
20079                T: std::convert::Into<wkt::Int32Value>,
20080            {
20081                self.master_data = v.map(|x| x.into());
20082                self
20083            }
20084        }
20085
20086        impl wkt::message::Message for MysqlExportOptions {
20087            fn typename() -> &'static str {
20088                "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions"
20089            }
20090        }
20091
20092        /// Options for exporting from a Cloud SQL for PostgreSQL instance.
20093        #[derive(Clone, Default, PartialEq)]
20094        #[non_exhaustive]
20095        pub struct PostgresExportOptions {
20096            /// Optional. Use this option to include DROP \<code\>&lt;object&gt;\</code\>
20097            /// SQL statements. Use these statements to delete database objects before
20098            /// running the import operation.
20099            pub clean: std::option::Option<wkt::BoolValue>,
20100
20101            /// Optional. Option to include an IF EXISTS SQL statement with each DROP
20102            /// statement produced by clean.
20103            pub if_exists: std::option::Option<wkt::BoolValue>,
20104
20105            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20106        }
20107
20108        impl PostgresExportOptions {
20109            pub fn new() -> Self {
20110                std::default::Default::default()
20111            }
20112
20113            /// Sets the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
20114            ///
20115            /// # Example
20116            /// ```ignore,no_run
20117            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20118            /// use wkt::BoolValue;
20119            /// let x = PostgresExportOptions::new().set_clean(BoolValue::default()/* use setters */);
20120            /// ```
20121            pub fn set_clean<T>(mut self, v: T) -> Self
20122            where
20123                T: std::convert::Into<wkt::BoolValue>,
20124            {
20125                self.clean = std::option::Option::Some(v.into());
20126                self
20127            }
20128
20129            /// Sets or clears the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
20130            ///
20131            /// # Example
20132            /// ```ignore,no_run
20133            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20134            /// use wkt::BoolValue;
20135            /// let x = PostgresExportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
20136            /// let x = PostgresExportOptions::new().set_or_clear_clean(None::<BoolValue>);
20137            /// ```
20138            pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
20139            where
20140                T: std::convert::Into<wkt::BoolValue>,
20141            {
20142                self.clean = v.map(|x| x.into());
20143                self
20144            }
20145
20146            /// Sets the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
20147            ///
20148            /// # Example
20149            /// ```ignore,no_run
20150            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20151            /// use wkt::BoolValue;
20152            /// let x = PostgresExportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
20153            /// ```
20154            pub fn set_if_exists<T>(mut self, v: T) -> Self
20155            where
20156                T: std::convert::Into<wkt::BoolValue>,
20157            {
20158                self.if_exists = std::option::Option::Some(v.into());
20159                self
20160            }
20161
20162            /// Sets or clears the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
20163            ///
20164            /// # Example
20165            /// ```ignore,no_run
20166            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20167            /// use wkt::BoolValue;
20168            /// let x = PostgresExportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
20169            /// let x = PostgresExportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
20170            /// ```
20171            pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
20172            where
20173                T: std::convert::Into<wkt::BoolValue>,
20174            {
20175                self.if_exists = v.map(|x| x.into());
20176                self
20177            }
20178        }
20179
20180        impl wkt::message::Message for PostgresExportOptions {
20181            fn typename() -> &'static str {
20182                "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions"
20183            }
20184        }
20185    }
20186
20187    /// Options for exporting BAK files (SQL Server-only)
20188    #[derive(Clone, Default, PartialEq)]
20189    #[non_exhaustive]
20190    pub struct SqlBakExportOptions {
20191        /// Whether or not the export should be striped.
20192        pub striped: std::option::Option<wkt::BoolValue>,
20193
20194        /// Option for specifying how many stripes to use for the export.
20195        /// If blank, and the value of the striped field is true,
20196        /// the number of stripes is automatically chosen.
20197        pub stripe_count: std::option::Option<wkt::Int32Value>,
20198
20199        /// Type of this bak file will be export, FULL or DIFF, SQL Server only
20200        pub bak_type: crate::model::BakType,
20201
20202        /// Deprecated: copy_only is deprecated. Use differential_base instead
20203        #[deprecated]
20204        pub copy_only: std::option::Option<wkt::BoolValue>,
20205
20206        /// Whether or not the backup can be used as a differential base
20207        /// copy_only backup can not be served as differential base
20208        pub differential_base: std::option::Option<wkt::BoolValue>,
20209
20210        /// Optional. The begin timestamp when transaction log will be included in
20211        /// the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
20212        /// format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
20213        /// available logs from the beginning of retention period will be included.
20214        /// Only applied to Cloud SQL for SQL Server.
20215        pub export_log_start_time: std::option::Option<wkt::Timestamp>,
20216
20217        /// Optional. The end timestamp when transaction log will be included in the
20218        /// export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
20219        /// (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
20220        /// available logs until current time will be included. Only applied to Cloud
20221        /// SQL for SQL Server.
20222        pub export_log_end_time: std::option::Option<wkt::Timestamp>,
20223
20224        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20225    }
20226
20227    impl SqlBakExportOptions {
20228        pub fn new() -> Self {
20229            std::default::Default::default()
20230        }
20231
20232        /// Sets the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
20233        ///
20234        /// # Example
20235        /// ```ignore,no_run
20236        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20237        /// use wkt::BoolValue;
20238        /// let x = SqlBakExportOptions::new().set_striped(BoolValue::default()/* use setters */);
20239        /// ```
20240        pub fn set_striped<T>(mut self, v: T) -> Self
20241        where
20242            T: std::convert::Into<wkt::BoolValue>,
20243        {
20244            self.striped = std::option::Option::Some(v.into());
20245            self
20246        }
20247
20248        /// Sets or clears the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
20249        ///
20250        /// # Example
20251        /// ```ignore,no_run
20252        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20253        /// use wkt::BoolValue;
20254        /// let x = SqlBakExportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
20255        /// let x = SqlBakExportOptions::new().set_or_clear_striped(None::<BoolValue>);
20256        /// ```
20257        pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
20258        where
20259            T: std::convert::Into<wkt::BoolValue>,
20260        {
20261            self.striped = v.map(|x| x.into());
20262            self
20263        }
20264
20265        /// Sets the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
20266        ///
20267        /// # Example
20268        /// ```ignore,no_run
20269        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20270        /// use wkt::Int32Value;
20271        /// let x = SqlBakExportOptions::new().set_stripe_count(Int32Value::default()/* use setters */);
20272        /// ```
20273        pub fn set_stripe_count<T>(mut self, v: T) -> Self
20274        where
20275            T: std::convert::Into<wkt::Int32Value>,
20276        {
20277            self.stripe_count = std::option::Option::Some(v.into());
20278            self
20279        }
20280
20281        /// Sets or clears the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
20282        ///
20283        /// # Example
20284        /// ```ignore,no_run
20285        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20286        /// use wkt::Int32Value;
20287        /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(Some(Int32Value::default()/* use setters */));
20288        /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(None::<Int32Value>);
20289        /// ```
20290        pub fn set_or_clear_stripe_count<T>(mut self, v: std::option::Option<T>) -> Self
20291        where
20292            T: std::convert::Into<wkt::Int32Value>,
20293        {
20294            self.stripe_count = v.map(|x| x.into());
20295            self
20296        }
20297
20298        /// Sets the value of [bak_type][crate::model::export_context::SqlBakExportOptions::bak_type].
20299        ///
20300        /// # Example
20301        /// ```ignore,no_run
20302        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20303        /// use google_cloud_sql_v1::model::BakType;
20304        /// let x0 = SqlBakExportOptions::new().set_bak_type(BakType::Full);
20305        /// let x1 = SqlBakExportOptions::new().set_bak_type(BakType::Diff);
20306        /// let x2 = SqlBakExportOptions::new().set_bak_type(BakType::Tlog);
20307        /// ```
20308        pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
20309            self.bak_type = v.into();
20310            self
20311        }
20312
20313        /// Sets the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
20314        ///
20315        /// # Example
20316        /// ```ignore,no_run
20317        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20318        /// use wkt::BoolValue;
20319        /// let x = SqlBakExportOptions::new().set_copy_only(BoolValue::default()/* use setters */);
20320        /// ```
20321        #[deprecated]
20322        pub fn set_copy_only<T>(mut self, v: T) -> Self
20323        where
20324            T: std::convert::Into<wkt::BoolValue>,
20325        {
20326            self.copy_only = std::option::Option::Some(v.into());
20327            self
20328        }
20329
20330        /// Sets or clears the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
20331        ///
20332        /// # Example
20333        /// ```ignore,no_run
20334        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20335        /// use wkt::BoolValue;
20336        /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(Some(BoolValue::default()/* use setters */));
20337        /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(None::<BoolValue>);
20338        /// ```
20339        #[deprecated]
20340        pub fn set_or_clear_copy_only<T>(mut self, v: std::option::Option<T>) -> Self
20341        where
20342            T: std::convert::Into<wkt::BoolValue>,
20343        {
20344            self.copy_only = v.map(|x| x.into());
20345            self
20346        }
20347
20348        /// Sets the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
20349        ///
20350        /// # Example
20351        /// ```ignore,no_run
20352        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20353        /// use wkt::BoolValue;
20354        /// let x = SqlBakExportOptions::new().set_differential_base(BoolValue::default()/* use setters */);
20355        /// ```
20356        pub fn set_differential_base<T>(mut self, v: T) -> Self
20357        where
20358            T: std::convert::Into<wkt::BoolValue>,
20359        {
20360            self.differential_base = std::option::Option::Some(v.into());
20361            self
20362        }
20363
20364        /// Sets or clears the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
20365        ///
20366        /// # Example
20367        /// ```ignore,no_run
20368        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20369        /// use wkt::BoolValue;
20370        /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(Some(BoolValue::default()/* use setters */));
20371        /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(None::<BoolValue>);
20372        /// ```
20373        pub fn set_or_clear_differential_base<T>(mut self, v: std::option::Option<T>) -> Self
20374        where
20375            T: std::convert::Into<wkt::BoolValue>,
20376        {
20377            self.differential_base = v.map(|x| x.into());
20378            self
20379        }
20380
20381        /// Sets the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
20382        ///
20383        /// # Example
20384        /// ```ignore,no_run
20385        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20386        /// use wkt::Timestamp;
20387        /// let x = SqlBakExportOptions::new().set_export_log_start_time(Timestamp::default()/* use setters */);
20388        /// ```
20389        pub fn set_export_log_start_time<T>(mut self, v: T) -> Self
20390        where
20391            T: std::convert::Into<wkt::Timestamp>,
20392        {
20393            self.export_log_start_time = std::option::Option::Some(v.into());
20394            self
20395        }
20396
20397        /// Sets or clears the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
20398        ///
20399        /// # Example
20400        /// ```ignore,no_run
20401        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20402        /// use wkt::Timestamp;
20403        /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(Some(Timestamp::default()/* use setters */));
20404        /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(None::<Timestamp>);
20405        /// ```
20406        pub fn set_or_clear_export_log_start_time<T>(mut self, v: std::option::Option<T>) -> Self
20407        where
20408            T: std::convert::Into<wkt::Timestamp>,
20409        {
20410            self.export_log_start_time = v.map(|x| x.into());
20411            self
20412        }
20413
20414        /// Sets the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
20415        ///
20416        /// # Example
20417        /// ```ignore,no_run
20418        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20419        /// use wkt::Timestamp;
20420        /// let x = SqlBakExportOptions::new().set_export_log_end_time(Timestamp::default()/* use setters */);
20421        /// ```
20422        pub fn set_export_log_end_time<T>(mut self, v: T) -> Self
20423        where
20424            T: std::convert::Into<wkt::Timestamp>,
20425        {
20426            self.export_log_end_time = std::option::Option::Some(v.into());
20427            self
20428        }
20429
20430        /// Sets or clears the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
20431        ///
20432        /// # Example
20433        /// ```ignore,no_run
20434        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20435        /// use wkt::Timestamp;
20436        /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(Some(Timestamp::default()/* use setters */));
20437        /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(None::<Timestamp>);
20438        /// ```
20439        pub fn set_or_clear_export_log_end_time<T>(mut self, v: std::option::Option<T>) -> Self
20440        where
20441            T: std::convert::Into<wkt::Timestamp>,
20442        {
20443            self.export_log_end_time = v.map(|x| x.into());
20444            self
20445        }
20446    }
20447
20448    impl wkt::message::Message for SqlBakExportOptions {
20449        fn typename() -> &'static str {
20450            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlBakExportOptions"
20451        }
20452    }
20453
20454    #[derive(Clone, Default, PartialEq)]
20455    #[non_exhaustive]
20456    pub struct SqlTdeExportOptions {
20457        /// Required. Path to the TDE certificate public key
20458        /// in the form gs://bucketName/fileName.
20459        /// The instance must have write access to the bucket.
20460        /// Applicable only for SQL Server instances.
20461        pub certificate_path: std::string::String,
20462
20463        /// Required. Path to the TDE certificate private key
20464        /// in the form gs://bucketName/fileName.
20465        /// The instance must have write access to the location.
20466        /// Applicable only for SQL Server instances.
20467        pub private_key_path: std::string::String,
20468
20469        /// Required. Password that encrypts the private key.
20470        pub private_key_password: std::string::String,
20471
20472        /// Required. Certificate name.
20473        /// Applicable only for SQL Server instances.
20474        pub name: std::string::String,
20475
20476        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20477    }
20478
20479    impl SqlTdeExportOptions {
20480        pub fn new() -> Self {
20481            std::default::Default::default()
20482        }
20483
20484        /// Sets the value of [certificate_path][crate::model::export_context::SqlTdeExportOptions::certificate_path].
20485        ///
20486        /// # Example
20487        /// ```ignore,no_run
20488        /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20489        /// let x = SqlTdeExportOptions::new().set_certificate_path("example");
20490        /// ```
20491        pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
20492            mut self,
20493            v: T,
20494        ) -> Self {
20495            self.certificate_path = v.into();
20496            self
20497        }
20498
20499        /// Sets the value of [private_key_path][crate::model::export_context::SqlTdeExportOptions::private_key_path].
20500        ///
20501        /// # Example
20502        /// ```ignore,no_run
20503        /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20504        /// let x = SqlTdeExportOptions::new().set_private_key_path("example");
20505        /// ```
20506        pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
20507            mut self,
20508            v: T,
20509        ) -> Self {
20510            self.private_key_path = v.into();
20511            self
20512        }
20513
20514        /// Sets the value of [private_key_password][crate::model::export_context::SqlTdeExportOptions::private_key_password].
20515        ///
20516        /// # Example
20517        /// ```ignore,no_run
20518        /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20519        /// let x = SqlTdeExportOptions::new().set_private_key_password("example");
20520        /// ```
20521        pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
20522            mut self,
20523            v: T,
20524        ) -> Self {
20525            self.private_key_password = v.into();
20526            self
20527        }
20528
20529        /// Sets the value of [name][crate::model::export_context::SqlTdeExportOptions::name].
20530        ///
20531        /// # Example
20532        /// ```ignore,no_run
20533        /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20534        /// let x = SqlTdeExportOptions::new().set_name("example");
20535        /// ```
20536        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20537            self.name = v.into();
20538            self
20539        }
20540    }
20541
20542    impl wkt::message::Message for SqlTdeExportOptions {
20543        fn typename() -> &'static str {
20544            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlTdeExportOptions"
20545        }
20546    }
20547}
20548
20549/// Database instance import context.
20550#[derive(Clone, Default, PartialEq)]
20551#[non_exhaustive]
20552pub struct ImportContext {
20553    /// Path to the import file in Cloud Storage, in the form
20554    /// `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
20555    /// when `fileType` is `SQL`. The instance must have
20556    /// write permissions to the bucket and read access to the file.
20557    pub uri: std::string::String,
20558
20559    /// The target database for the import. If `fileType` is `SQL`, this field
20560    /// is required only if the import file does not specify a database, and is
20561    /// overridden by any database specification in the import file. For entire
20562    /// instance parallel import operations, the database is overridden by the
20563    /// database name stored in subdirectory name. If
20564    /// `fileType` is `CSV`, one database must be specified.
20565    pub database: std::string::String,
20566
20567    /// This is always `sql#importContext`.
20568    pub kind: std::string::String,
20569
20570    /// The file type for the specified uri.\`SQL`: The file
20571    /// contains SQL statements. \`CSV`: The file contains CSV data.
20572    pub file_type: crate::model::SqlFileType,
20573
20574    /// Options for importing data as CSV.
20575    pub csv_import_options: std::option::Option<crate::model::import_context::SqlCsvImportOptions>,
20576
20577    /// The PostgreSQL user for this import operation. PostgreSQL instances only.
20578    pub import_user: std::string::String,
20579
20580    /// Import parameters specific to SQL Server .BAK files
20581    pub bak_import_options: std::option::Option<crate::model::import_context::SqlBakImportOptions>,
20582
20583    /// Optional. Options for importing data from SQL statements.
20584    pub sql_import_options: std::option::Option<crate::model::import_context::SqlImportOptions>,
20585
20586    /// Optional. Import parameters specific to SQL Server TDE certificates
20587    pub tde_import_options: std::option::Option<crate::model::import_context::SqlTdeImportOptions>,
20588
20589    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20590}
20591
20592impl ImportContext {
20593    pub fn new() -> Self {
20594        std::default::Default::default()
20595    }
20596
20597    /// Sets the value of [uri][crate::model::ImportContext::uri].
20598    ///
20599    /// # Example
20600    /// ```ignore,no_run
20601    /// # use google_cloud_sql_v1::model::ImportContext;
20602    /// let x = ImportContext::new().set_uri("example");
20603    /// ```
20604    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20605        self.uri = v.into();
20606        self
20607    }
20608
20609    /// Sets the value of [database][crate::model::ImportContext::database].
20610    ///
20611    /// # Example
20612    /// ```ignore,no_run
20613    /// # use google_cloud_sql_v1::model::ImportContext;
20614    /// let x = ImportContext::new().set_database("example");
20615    /// ```
20616    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20617        self.database = v.into();
20618        self
20619    }
20620
20621    /// Sets the value of [kind][crate::model::ImportContext::kind].
20622    ///
20623    /// # Example
20624    /// ```ignore,no_run
20625    /// # use google_cloud_sql_v1::model::ImportContext;
20626    /// let x = ImportContext::new().set_kind("example");
20627    /// ```
20628    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20629        self.kind = v.into();
20630        self
20631    }
20632
20633    /// Sets the value of [file_type][crate::model::ImportContext::file_type].
20634    ///
20635    /// # Example
20636    /// ```ignore,no_run
20637    /// # use google_cloud_sql_v1::model::ImportContext;
20638    /// use google_cloud_sql_v1::model::SqlFileType;
20639    /// let x0 = ImportContext::new().set_file_type(SqlFileType::Sql);
20640    /// let x1 = ImportContext::new().set_file_type(SqlFileType::Csv);
20641    /// let x2 = ImportContext::new().set_file_type(SqlFileType::Bak);
20642    /// ```
20643    pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
20644        self.file_type = v.into();
20645        self
20646    }
20647
20648    /// Sets the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
20649    ///
20650    /// # Example
20651    /// ```ignore,no_run
20652    /// # use google_cloud_sql_v1::model::ImportContext;
20653    /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
20654    /// let x = ImportContext::new().set_csv_import_options(SqlCsvImportOptions::default()/* use setters */);
20655    /// ```
20656    pub fn set_csv_import_options<T>(mut self, v: T) -> Self
20657    where
20658        T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
20659    {
20660        self.csv_import_options = std::option::Option::Some(v.into());
20661        self
20662    }
20663
20664    /// Sets or clears the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
20665    ///
20666    /// # Example
20667    /// ```ignore,no_run
20668    /// # use google_cloud_sql_v1::model::ImportContext;
20669    /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
20670    /// let x = ImportContext::new().set_or_clear_csv_import_options(Some(SqlCsvImportOptions::default()/* use setters */));
20671    /// let x = ImportContext::new().set_or_clear_csv_import_options(None::<SqlCsvImportOptions>);
20672    /// ```
20673    pub fn set_or_clear_csv_import_options<T>(mut self, v: std::option::Option<T>) -> Self
20674    where
20675        T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
20676    {
20677        self.csv_import_options = v.map(|x| x.into());
20678        self
20679    }
20680
20681    /// Sets the value of [import_user][crate::model::ImportContext::import_user].
20682    ///
20683    /// # Example
20684    /// ```ignore,no_run
20685    /// # use google_cloud_sql_v1::model::ImportContext;
20686    /// let x = ImportContext::new().set_import_user("example");
20687    /// ```
20688    pub fn set_import_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20689        self.import_user = v.into();
20690        self
20691    }
20692
20693    /// Sets the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
20694    ///
20695    /// # Example
20696    /// ```ignore,no_run
20697    /// # use google_cloud_sql_v1::model::ImportContext;
20698    /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
20699    /// let x = ImportContext::new().set_bak_import_options(SqlBakImportOptions::default()/* use setters */);
20700    /// ```
20701    pub fn set_bak_import_options<T>(mut self, v: T) -> Self
20702    where
20703        T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
20704    {
20705        self.bak_import_options = std::option::Option::Some(v.into());
20706        self
20707    }
20708
20709    /// Sets or clears the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
20710    ///
20711    /// # Example
20712    /// ```ignore,no_run
20713    /// # use google_cloud_sql_v1::model::ImportContext;
20714    /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
20715    /// let x = ImportContext::new().set_or_clear_bak_import_options(Some(SqlBakImportOptions::default()/* use setters */));
20716    /// let x = ImportContext::new().set_or_clear_bak_import_options(None::<SqlBakImportOptions>);
20717    /// ```
20718    pub fn set_or_clear_bak_import_options<T>(mut self, v: std::option::Option<T>) -> Self
20719    where
20720        T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
20721    {
20722        self.bak_import_options = v.map(|x| x.into());
20723        self
20724    }
20725
20726    /// Sets the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
20727    ///
20728    /// # Example
20729    /// ```ignore,no_run
20730    /// # use google_cloud_sql_v1::model::ImportContext;
20731    /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20732    /// let x = ImportContext::new().set_sql_import_options(SqlImportOptions::default()/* use setters */);
20733    /// ```
20734    pub fn set_sql_import_options<T>(mut self, v: T) -> Self
20735    where
20736        T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
20737    {
20738        self.sql_import_options = std::option::Option::Some(v.into());
20739        self
20740    }
20741
20742    /// Sets or clears the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
20743    ///
20744    /// # Example
20745    /// ```ignore,no_run
20746    /// # use google_cloud_sql_v1::model::ImportContext;
20747    /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20748    /// let x = ImportContext::new().set_or_clear_sql_import_options(Some(SqlImportOptions::default()/* use setters */));
20749    /// let x = ImportContext::new().set_or_clear_sql_import_options(None::<SqlImportOptions>);
20750    /// ```
20751    pub fn set_or_clear_sql_import_options<T>(mut self, v: std::option::Option<T>) -> Self
20752    where
20753        T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
20754    {
20755        self.sql_import_options = v.map(|x| x.into());
20756        self
20757    }
20758
20759    /// Sets the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
20760    ///
20761    /// # Example
20762    /// ```ignore,no_run
20763    /// # use google_cloud_sql_v1::model::ImportContext;
20764    /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
20765    /// let x = ImportContext::new().set_tde_import_options(SqlTdeImportOptions::default()/* use setters */);
20766    /// ```
20767    pub fn set_tde_import_options<T>(mut self, v: T) -> Self
20768    where
20769        T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
20770    {
20771        self.tde_import_options = std::option::Option::Some(v.into());
20772        self
20773    }
20774
20775    /// Sets or clears the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
20776    ///
20777    /// # Example
20778    /// ```ignore,no_run
20779    /// # use google_cloud_sql_v1::model::ImportContext;
20780    /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
20781    /// let x = ImportContext::new().set_or_clear_tde_import_options(Some(SqlTdeImportOptions::default()/* use setters */));
20782    /// let x = ImportContext::new().set_or_clear_tde_import_options(None::<SqlTdeImportOptions>);
20783    /// ```
20784    pub fn set_or_clear_tde_import_options<T>(mut self, v: std::option::Option<T>) -> Self
20785    where
20786        T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
20787    {
20788        self.tde_import_options = v.map(|x| x.into());
20789        self
20790    }
20791}
20792
20793impl wkt::message::Message for ImportContext {
20794    fn typename() -> &'static str {
20795        "type.googleapis.com/google.cloud.sql.v1.ImportContext"
20796    }
20797}
20798
20799/// Defines additional types related to [ImportContext].
20800pub mod import_context {
20801    #[allow(unused_imports)]
20802    use super::*;
20803
20804    #[derive(Clone, Default, PartialEq)]
20805    #[non_exhaustive]
20806    pub struct SqlImportOptions {
20807        /// Optional. The number of threads to use for parallel import.
20808        pub threads: std::option::Option<wkt::Int32Value>,
20809
20810        /// Optional. Whether or not the import should be parallel.
20811        pub parallel: std::option::Option<wkt::BoolValue>,
20812
20813        /// Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
20814        pub postgres_import_options: std::option::Option<
20815            crate::model::import_context::sql_import_options::PostgresImportOptions,
20816        >,
20817
20818        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20819    }
20820
20821    impl SqlImportOptions {
20822        pub fn new() -> Self {
20823            std::default::Default::default()
20824        }
20825
20826        /// Sets the value of [threads][crate::model::import_context::SqlImportOptions::threads].
20827        ///
20828        /// # Example
20829        /// ```ignore,no_run
20830        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20831        /// use wkt::Int32Value;
20832        /// let x = SqlImportOptions::new().set_threads(Int32Value::default()/* use setters */);
20833        /// ```
20834        pub fn set_threads<T>(mut self, v: T) -> Self
20835        where
20836            T: std::convert::Into<wkt::Int32Value>,
20837        {
20838            self.threads = std::option::Option::Some(v.into());
20839            self
20840        }
20841
20842        /// Sets or clears the value of [threads][crate::model::import_context::SqlImportOptions::threads].
20843        ///
20844        /// # Example
20845        /// ```ignore,no_run
20846        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20847        /// use wkt::Int32Value;
20848        /// let x = SqlImportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
20849        /// let x = SqlImportOptions::new().set_or_clear_threads(None::<Int32Value>);
20850        /// ```
20851        pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
20852        where
20853            T: std::convert::Into<wkt::Int32Value>,
20854        {
20855            self.threads = v.map(|x| x.into());
20856            self
20857        }
20858
20859        /// Sets the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
20860        ///
20861        /// # Example
20862        /// ```ignore,no_run
20863        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20864        /// use wkt::BoolValue;
20865        /// let x = SqlImportOptions::new().set_parallel(BoolValue::default()/* use setters */);
20866        /// ```
20867        pub fn set_parallel<T>(mut self, v: T) -> Self
20868        where
20869            T: std::convert::Into<wkt::BoolValue>,
20870        {
20871            self.parallel = std::option::Option::Some(v.into());
20872            self
20873        }
20874
20875        /// Sets or clears the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
20876        ///
20877        /// # Example
20878        /// ```ignore,no_run
20879        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20880        /// use wkt::BoolValue;
20881        /// let x = SqlImportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
20882        /// let x = SqlImportOptions::new().set_or_clear_parallel(None::<BoolValue>);
20883        /// ```
20884        pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
20885        where
20886            T: std::convert::Into<wkt::BoolValue>,
20887        {
20888            self.parallel = v.map(|x| x.into());
20889            self
20890        }
20891
20892        /// Sets the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
20893        ///
20894        /// # Example
20895        /// ```ignore,no_run
20896        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20897        /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
20898        /// let x = SqlImportOptions::new().set_postgres_import_options(PostgresImportOptions::default()/* use setters */);
20899        /// ```
20900        pub fn set_postgres_import_options<T>(mut self, v: T) -> Self
20901        where
20902            T: std::convert::Into<
20903                    crate::model::import_context::sql_import_options::PostgresImportOptions,
20904                >,
20905        {
20906            self.postgres_import_options = std::option::Option::Some(v.into());
20907            self
20908        }
20909
20910        /// Sets or clears the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
20911        ///
20912        /// # Example
20913        /// ```ignore,no_run
20914        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20915        /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
20916        /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(Some(PostgresImportOptions::default()/* use setters */));
20917        /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(None::<PostgresImportOptions>);
20918        /// ```
20919        pub fn set_or_clear_postgres_import_options<T>(mut self, v: std::option::Option<T>) -> Self
20920        where
20921            T: std::convert::Into<
20922                    crate::model::import_context::sql_import_options::PostgresImportOptions,
20923                >,
20924        {
20925            self.postgres_import_options = v.map(|x| x.into());
20926            self
20927        }
20928    }
20929
20930    impl wkt::message::Message for SqlImportOptions {
20931        fn typename() -> &'static str {
20932            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions"
20933        }
20934    }
20935
20936    /// Defines additional types related to [SqlImportOptions].
20937    pub mod sql_import_options {
20938        #[allow(unused_imports)]
20939        use super::*;
20940
20941        #[derive(Clone, Default, PartialEq)]
20942        #[non_exhaustive]
20943        pub struct PostgresImportOptions {
20944            /// Optional. The --clean flag for the pg_restore utility. This flag
20945            /// applies only if you enabled Cloud SQL to import files in parallel.
20946            pub clean: std::option::Option<wkt::BoolValue>,
20947
20948            /// Optional. The --if-exists flag for the pg_restore utility. This flag
20949            /// applies only if you enabled Cloud SQL to import files in parallel.
20950            pub if_exists: std::option::Option<wkt::BoolValue>,
20951
20952            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20953        }
20954
20955        impl PostgresImportOptions {
20956            pub fn new() -> Self {
20957                std::default::Default::default()
20958            }
20959
20960            /// Sets the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
20961            ///
20962            /// # Example
20963            /// ```ignore,no_run
20964            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
20965            /// use wkt::BoolValue;
20966            /// let x = PostgresImportOptions::new().set_clean(BoolValue::default()/* use setters */);
20967            /// ```
20968            pub fn set_clean<T>(mut self, v: T) -> Self
20969            where
20970                T: std::convert::Into<wkt::BoolValue>,
20971            {
20972                self.clean = std::option::Option::Some(v.into());
20973                self
20974            }
20975
20976            /// Sets or clears the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
20977            ///
20978            /// # Example
20979            /// ```ignore,no_run
20980            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
20981            /// use wkt::BoolValue;
20982            /// let x = PostgresImportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
20983            /// let x = PostgresImportOptions::new().set_or_clear_clean(None::<BoolValue>);
20984            /// ```
20985            pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
20986            where
20987                T: std::convert::Into<wkt::BoolValue>,
20988            {
20989                self.clean = v.map(|x| x.into());
20990                self
20991            }
20992
20993            /// Sets the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
20994            ///
20995            /// # Example
20996            /// ```ignore,no_run
20997            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
20998            /// use wkt::BoolValue;
20999            /// let x = PostgresImportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
21000            /// ```
21001            pub fn set_if_exists<T>(mut self, v: T) -> Self
21002            where
21003                T: std::convert::Into<wkt::BoolValue>,
21004            {
21005                self.if_exists = std::option::Option::Some(v.into());
21006                self
21007            }
21008
21009            /// Sets or clears the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
21010            ///
21011            /// # Example
21012            /// ```ignore,no_run
21013            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21014            /// use wkt::BoolValue;
21015            /// let x = PostgresImportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
21016            /// let x = PostgresImportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
21017            /// ```
21018            pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
21019            where
21020                T: std::convert::Into<wkt::BoolValue>,
21021            {
21022                self.if_exists = v.map(|x| x.into());
21023                self
21024            }
21025        }
21026
21027        impl wkt::message::Message for PostgresImportOptions {
21028            fn typename() -> &'static str {
21029                "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions"
21030            }
21031        }
21032    }
21033
21034    #[derive(Clone, Default, PartialEq)]
21035    #[non_exhaustive]
21036    pub struct SqlCsvImportOptions {
21037        /// The table to which CSV data is imported.
21038        pub table: std::string::String,
21039
21040        /// The columns to which CSV data is imported. If not specified, all columns
21041        /// of the database table are loaded with CSV data.
21042        pub columns: std::vec::Vec<std::string::String>,
21043
21044        /// Specifies the character that should appear before a data character that
21045        /// needs to be escaped.
21046        pub escape_character: std::string::String,
21047
21048        /// Specifies the quoting character to be used when a data value is quoted.
21049        pub quote_character: std::string::String,
21050
21051        /// Specifies the character that separates columns within each row (line) of
21052        /// the file.
21053        pub fields_terminated_by: std::string::String,
21054
21055        /// This is used to separate lines. If a line does not contain all fields,
21056        /// the rest of the columns are set to their default values.
21057        pub lines_terminated_by: std::string::String,
21058
21059        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21060    }
21061
21062    impl SqlCsvImportOptions {
21063        pub fn new() -> Self {
21064            std::default::Default::default()
21065        }
21066
21067        /// Sets the value of [table][crate::model::import_context::SqlCsvImportOptions::table].
21068        ///
21069        /// # Example
21070        /// ```ignore,no_run
21071        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21072        /// let x = SqlCsvImportOptions::new().set_table("example");
21073        /// ```
21074        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21075            self.table = v.into();
21076            self
21077        }
21078
21079        /// Sets the value of [columns][crate::model::import_context::SqlCsvImportOptions::columns].
21080        ///
21081        /// # Example
21082        /// ```ignore,no_run
21083        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21084        /// let x = SqlCsvImportOptions::new().set_columns(["a", "b", "c"]);
21085        /// ```
21086        pub fn set_columns<T, V>(mut self, v: T) -> Self
21087        where
21088            T: std::iter::IntoIterator<Item = V>,
21089            V: std::convert::Into<std::string::String>,
21090        {
21091            use std::iter::Iterator;
21092            self.columns = v.into_iter().map(|i| i.into()).collect();
21093            self
21094        }
21095
21096        /// Sets the value of [escape_character][crate::model::import_context::SqlCsvImportOptions::escape_character].
21097        ///
21098        /// # Example
21099        /// ```ignore,no_run
21100        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21101        /// let x = SqlCsvImportOptions::new().set_escape_character("example");
21102        /// ```
21103        pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
21104            mut self,
21105            v: T,
21106        ) -> Self {
21107            self.escape_character = v.into();
21108            self
21109        }
21110
21111        /// Sets the value of [quote_character][crate::model::import_context::SqlCsvImportOptions::quote_character].
21112        ///
21113        /// # Example
21114        /// ```ignore,no_run
21115        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21116        /// let x = SqlCsvImportOptions::new().set_quote_character("example");
21117        /// ```
21118        pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
21119            mut self,
21120            v: T,
21121        ) -> Self {
21122            self.quote_character = v.into();
21123            self
21124        }
21125
21126        /// Sets the value of [fields_terminated_by][crate::model::import_context::SqlCsvImportOptions::fields_terminated_by].
21127        ///
21128        /// # Example
21129        /// ```ignore,no_run
21130        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21131        /// let x = SqlCsvImportOptions::new().set_fields_terminated_by("example");
21132        /// ```
21133        pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
21134            mut self,
21135            v: T,
21136        ) -> Self {
21137            self.fields_terminated_by = v.into();
21138            self
21139        }
21140
21141        /// Sets the value of [lines_terminated_by][crate::model::import_context::SqlCsvImportOptions::lines_terminated_by].
21142        ///
21143        /// # Example
21144        /// ```ignore,no_run
21145        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21146        /// let x = SqlCsvImportOptions::new().set_lines_terminated_by("example");
21147        /// ```
21148        pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
21149            mut self,
21150            v: T,
21151        ) -> Self {
21152            self.lines_terminated_by = v.into();
21153            self
21154        }
21155    }
21156
21157    impl wkt::message::Message for SqlCsvImportOptions {
21158        fn typename() -> &'static str {
21159            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlCsvImportOptions"
21160        }
21161    }
21162
21163    #[derive(Clone, Default, PartialEq)]
21164    #[non_exhaustive]
21165    pub struct SqlBakImportOptions {
21166        pub encryption_options: std::option::Option<
21167            crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21168        >,
21169
21170        /// Whether or not the backup set being restored is striped.
21171        /// Applies only to Cloud SQL for SQL Server.
21172        pub striped: std::option::Option<wkt::BoolValue>,
21173
21174        /// Whether or not the backup importing will restore database
21175        /// with NORECOVERY option.
21176        /// Applies only to Cloud SQL for SQL Server.
21177        pub no_recovery: std::option::Option<wkt::BoolValue>,
21178
21179        /// Whether or not the backup importing request will just bring database
21180        /// online without downloading Bak content only one of "no_recovery" and
21181        /// "recovery_only" can be true otherwise error will return. Applies only to
21182        /// Cloud SQL for SQL Server.
21183        pub recovery_only: std::option::Option<wkt::BoolValue>,
21184
21185        /// Type of the bak content, FULL or DIFF
21186        pub bak_type: crate::model::BakType,
21187
21188        /// Optional. The timestamp when the import should stop. This timestamp is in
21189        /// the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
21190        /// `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
21191        /// keyword and applies to Cloud SQL for SQL Server only.
21192        pub stop_at: std::option::Option<wkt::Timestamp>,
21193
21194        /// Optional. The marked transaction where the import should stop. This field
21195        /// is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
21196        /// Server only.
21197        pub stop_at_mark: std::string::String,
21198
21199        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21200    }
21201
21202    impl SqlBakImportOptions {
21203        pub fn new() -> Self {
21204            std::default::Default::default()
21205        }
21206
21207        /// Sets the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
21208        ///
21209        /// # Example
21210        /// ```ignore,no_run
21211        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21212        /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21213        /// let x = SqlBakImportOptions::new().set_encryption_options(EncryptionOptions::default()/* use setters */);
21214        /// ```
21215        pub fn set_encryption_options<T>(mut self, v: T) -> Self
21216        where
21217            T: std::convert::Into<
21218                    crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21219                >,
21220        {
21221            self.encryption_options = std::option::Option::Some(v.into());
21222            self
21223        }
21224
21225        /// Sets or clears the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
21226        ///
21227        /// # Example
21228        /// ```ignore,no_run
21229        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21230        /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21231        /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(Some(EncryptionOptions::default()/* use setters */));
21232        /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(None::<EncryptionOptions>);
21233        /// ```
21234        pub fn set_or_clear_encryption_options<T>(mut self, v: std::option::Option<T>) -> Self
21235        where
21236            T: std::convert::Into<
21237                    crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21238                >,
21239        {
21240            self.encryption_options = v.map(|x| x.into());
21241            self
21242        }
21243
21244        /// Sets the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
21245        ///
21246        /// # Example
21247        /// ```ignore,no_run
21248        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21249        /// use wkt::BoolValue;
21250        /// let x = SqlBakImportOptions::new().set_striped(BoolValue::default()/* use setters */);
21251        /// ```
21252        pub fn set_striped<T>(mut self, v: T) -> Self
21253        where
21254            T: std::convert::Into<wkt::BoolValue>,
21255        {
21256            self.striped = std::option::Option::Some(v.into());
21257            self
21258        }
21259
21260        /// Sets or clears the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
21261        ///
21262        /// # Example
21263        /// ```ignore,no_run
21264        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21265        /// use wkt::BoolValue;
21266        /// let x = SqlBakImportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
21267        /// let x = SqlBakImportOptions::new().set_or_clear_striped(None::<BoolValue>);
21268        /// ```
21269        pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
21270        where
21271            T: std::convert::Into<wkt::BoolValue>,
21272        {
21273            self.striped = v.map(|x| x.into());
21274            self
21275        }
21276
21277        /// Sets the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
21278        ///
21279        /// # Example
21280        /// ```ignore,no_run
21281        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21282        /// use wkt::BoolValue;
21283        /// let x = SqlBakImportOptions::new().set_no_recovery(BoolValue::default()/* use setters */);
21284        /// ```
21285        pub fn set_no_recovery<T>(mut self, v: T) -> Self
21286        where
21287            T: std::convert::Into<wkt::BoolValue>,
21288        {
21289            self.no_recovery = std::option::Option::Some(v.into());
21290            self
21291        }
21292
21293        /// Sets or clears the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
21294        ///
21295        /// # Example
21296        /// ```ignore,no_run
21297        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21298        /// use wkt::BoolValue;
21299        /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(Some(BoolValue::default()/* use setters */));
21300        /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(None::<BoolValue>);
21301        /// ```
21302        pub fn set_or_clear_no_recovery<T>(mut self, v: std::option::Option<T>) -> Self
21303        where
21304            T: std::convert::Into<wkt::BoolValue>,
21305        {
21306            self.no_recovery = v.map(|x| x.into());
21307            self
21308        }
21309
21310        /// Sets the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
21311        ///
21312        /// # Example
21313        /// ```ignore,no_run
21314        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21315        /// use wkt::BoolValue;
21316        /// let x = SqlBakImportOptions::new().set_recovery_only(BoolValue::default()/* use setters */);
21317        /// ```
21318        pub fn set_recovery_only<T>(mut self, v: T) -> Self
21319        where
21320            T: std::convert::Into<wkt::BoolValue>,
21321        {
21322            self.recovery_only = std::option::Option::Some(v.into());
21323            self
21324        }
21325
21326        /// Sets or clears the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
21327        ///
21328        /// # Example
21329        /// ```ignore,no_run
21330        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21331        /// use wkt::BoolValue;
21332        /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(Some(BoolValue::default()/* use setters */));
21333        /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(None::<BoolValue>);
21334        /// ```
21335        pub fn set_or_clear_recovery_only<T>(mut self, v: std::option::Option<T>) -> Self
21336        where
21337            T: std::convert::Into<wkt::BoolValue>,
21338        {
21339            self.recovery_only = v.map(|x| x.into());
21340            self
21341        }
21342
21343        /// Sets the value of [bak_type][crate::model::import_context::SqlBakImportOptions::bak_type].
21344        ///
21345        /// # Example
21346        /// ```ignore,no_run
21347        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21348        /// use google_cloud_sql_v1::model::BakType;
21349        /// let x0 = SqlBakImportOptions::new().set_bak_type(BakType::Full);
21350        /// let x1 = SqlBakImportOptions::new().set_bak_type(BakType::Diff);
21351        /// let x2 = SqlBakImportOptions::new().set_bak_type(BakType::Tlog);
21352        /// ```
21353        pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
21354            self.bak_type = v.into();
21355            self
21356        }
21357
21358        /// Sets the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
21359        ///
21360        /// # Example
21361        /// ```ignore,no_run
21362        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21363        /// use wkt::Timestamp;
21364        /// let x = SqlBakImportOptions::new().set_stop_at(Timestamp::default()/* use setters */);
21365        /// ```
21366        pub fn set_stop_at<T>(mut self, v: T) -> Self
21367        where
21368            T: std::convert::Into<wkt::Timestamp>,
21369        {
21370            self.stop_at = std::option::Option::Some(v.into());
21371            self
21372        }
21373
21374        /// Sets or clears the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
21375        ///
21376        /// # Example
21377        /// ```ignore,no_run
21378        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21379        /// use wkt::Timestamp;
21380        /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(Some(Timestamp::default()/* use setters */));
21381        /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(None::<Timestamp>);
21382        /// ```
21383        pub fn set_or_clear_stop_at<T>(mut self, v: std::option::Option<T>) -> Self
21384        where
21385            T: std::convert::Into<wkt::Timestamp>,
21386        {
21387            self.stop_at = v.map(|x| x.into());
21388            self
21389        }
21390
21391        /// Sets the value of [stop_at_mark][crate::model::import_context::SqlBakImportOptions::stop_at_mark].
21392        ///
21393        /// # Example
21394        /// ```ignore,no_run
21395        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21396        /// let x = SqlBakImportOptions::new().set_stop_at_mark("example");
21397        /// ```
21398        pub fn set_stop_at_mark<T: std::convert::Into<std::string::String>>(
21399            mut self,
21400            v: T,
21401        ) -> Self {
21402            self.stop_at_mark = v.into();
21403            self
21404        }
21405    }
21406
21407    impl wkt::message::Message for SqlBakImportOptions {
21408        fn typename() -> &'static str {
21409            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions"
21410        }
21411    }
21412
21413    /// Defines additional types related to [SqlBakImportOptions].
21414    pub mod sql_bak_import_options {
21415        #[allow(unused_imports)]
21416        use super::*;
21417
21418        #[derive(Clone, Default, PartialEq)]
21419        #[non_exhaustive]
21420        pub struct EncryptionOptions {
21421            /// Path to the Certificate (.cer) in Cloud Storage, in the form
21422            /// `gs://bucketName/fileName`. The instance must have
21423            /// write permissions to the bucket and read access to the file.
21424            pub cert_path: std::string::String,
21425
21426            /// Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
21427            /// form `gs://bucketName/fileName`. The instance must have
21428            /// write permissions to the bucket and read access to the file.
21429            pub pvk_path: std::string::String,
21430
21431            /// Password that encrypts the private key
21432            pub pvk_password: std::string::String,
21433
21434            /// Optional. Whether the imported file remains encrypted.
21435            pub keep_encrypted: std::option::Option<wkt::BoolValue>,
21436
21437            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21438        }
21439
21440        impl EncryptionOptions {
21441            pub fn new() -> Self {
21442                std::default::Default::default()
21443            }
21444
21445            /// Sets the value of [cert_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::cert_path].
21446            ///
21447            /// # Example
21448            /// ```ignore,no_run
21449            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21450            /// let x = EncryptionOptions::new().set_cert_path("example");
21451            /// ```
21452            pub fn set_cert_path<T: std::convert::Into<std::string::String>>(
21453                mut self,
21454                v: T,
21455            ) -> Self {
21456                self.cert_path = v.into();
21457                self
21458            }
21459
21460            /// Sets the value of [pvk_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_path].
21461            ///
21462            /// # Example
21463            /// ```ignore,no_run
21464            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21465            /// let x = EncryptionOptions::new().set_pvk_path("example");
21466            /// ```
21467            pub fn set_pvk_path<T: std::convert::Into<std::string::String>>(
21468                mut self,
21469                v: T,
21470            ) -> Self {
21471                self.pvk_path = v.into();
21472                self
21473            }
21474
21475            /// Sets the value of [pvk_password][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_password].
21476            ///
21477            /// # Example
21478            /// ```ignore,no_run
21479            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21480            /// let x = EncryptionOptions::new().set_pvk_password("example");
21481            /// ```
21482            pub fn set_pvk_password<T: std::convert::Into<std::string::String>>(
21483                mut self,
21484                v: T,
21485            ) -> Self {
21486                self.pvk_password = v.into();
21487                self
21488            }
21489
21490            /// Sets the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
21491            ///
21492            /// # Example
21493            /// ```ignore,no_run
21494            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21495            /// use wkt::BoolValue;
21496            /// let x = EncryptionOptions::new().set_keep_encrypted(BoolValue::default()/* use setters */);
21497            /// ```
21498            pub fn set_keep_encrypted<T>(mut self, v: T) -> Self
21499            where
21500                T: std::convert::Into<wkt::BoolValue>,
21501            {
21502                self.keep_encrypted = std::option::Option::Some(v.into());
21503                self
21504            }
21505
21506            /// Sets or clears the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
21507            ///
21508            /// # Example
21509            /// ```ignore,no_run
21510            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21511            /// use wkt::BoolValue;
21512            /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(Some(BoolValue::default()/* use setters */));
21513            /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(None::<BoolValue>);
21514            /// ```
21515            pub fn set_or_clear_keep_encrypted<T>(mut self, v: std::option::Option<T>) -> Self
21516            where
21517                T: std::convert::Into<wkt::BoolValue>,
21518            {
21519                self.keep_encrypted = v.map(|x| x.into());
21520                self
21521            }
21522        }
21523
21524        impl wkt::message::Message for EncryptionOptions {
21525            fn typename() -> &'static str {
21526                "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions"
21527            }
21528        }
21529    }
21530
21531    #[derive(Clone, Default, PartialEq)]
21532    #[non_exhaustive]
21533    pub struct SqlTdeImportOptions {
21534        /// Required. Path to the TDE certificate public key
21535        /// in the form gs://bucketName/fileName.
21536        /// The instance must have read access to the file.
21537        /// Applicable only for SQL Server instances.
21538        pub certificate_path: std::string::String,
21539
21540        /// Required. Path to the TDE certificate private key
21541        /// in the form gs://bucketName/fileName.
21542        /// The instance must have read access to the file.
21543        /// Applicable only for SQL Server instances.
21544        pub private_key_path: std::string::String,
21545
21546        /// Required. Password that encrypts the private key.
21547        pub private_key_password: std::string::String,
21548
21549        /// Required. Certificate name.
21550        /// Applicable only for SQL Server instances.
21551        pub name: std::string::String,
21552
21553        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21554    }
21555
21556    impl SqlTdeImportOptions {
21557        pub fn new() -> Self {
21558            std::default::Default::default()
21559        }
21560
21561        /// Sets the value of [certificate_path][crate::model::import_context::SqlTdeImportOptions::certificate_path].
21562        ///
21563        /// # Example
21564        /// ```ignore,no_run
21565        /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21566        /// let x = SqlTdeImportOptions::new().set_certificate_path("example");
21567        /// ```
21568        pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
21569            mut self,
21570            v: T,
21571        ) -> Self {
21572            self.certificate_path = v.into();
21573            self
21574        }
21575
21576        /// Sets the value of [private_key_path][crate::model::import_context::SqlTdeImportOptions::private_key_path].
21577        ///
21578        /// # Example
21579        /// ```ignore,no_run
21580        /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21581        /// let x = SqlTdeImportOptions::new().set_private_key_path("example");
21582        /// ```
21583        pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
21584            mut self,
21585            v: T,
21586        ) -> Self {
21587            self.private_key_path = v.into();
21588            self
21589        }
21590
21591        /// Sets the value of [private_key_password][crate::model::import_context::SqlTdeImportOptions::private_key_password].
21592        ///
21593        /// # Example
21594        /// ```ignore,no_run
21595        /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21596        /// let x = SqlTdeImportOptions::new().set_private_key_password("example");
21597        /// ```
21598        pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
21599            mut self,
21600            v: T,
21601        ) -> Self {
21602            self.private_key_password = v.into();
21603            self
21604        }
21605
21606        /// Sets the value of [name][crate::model::import_context::SqlTdeImportOptions::name].
21607        ///
21608        /// # Example
21609        /// ```ignore,no_run
21610        /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21611        /// let x = SqlTdeImportOptions::new().set_name("example");
21612        /// ```
21613        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21614            self.name = v.into();
21615            self
21616        }
21617    }
21618
21619    impl wkt::message::Message for SqlTdeImportOptions {
21620        fn typename() -> &'static str {
21621            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlTdeImportOptions"
21622        }
21623    }
21624}
21625
21626/// IP Management configuration.
21627#[derive(Clone, Default, PartialEq)]
21628#[non_exhaustive]
21629pub struct IpConfiguration {
21630    /// Whether the instance is assigned a public IP address or not.
21631    pub ipv4_enabled: std::option::Option<wkt::BoolValue>,
21632
21633    /// The resource link for the VPC network from which the Cloud SQL instance is
21634    /// accessible for private IP. For example,
21635    /// `/projects/myProject/global/networks/default`. This setting can
21636    /// be updated, but it cannot be removed after it is set.
21637    pub private_network: std::string::String,
21638
21639    /// Use `ssl_mode` instead.
21640    ///
21641    /// Whether SSL/TLS connections over IP are enforced.
21642    /// If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
21643    /// For SSL/TLS connections, the client certificate won't be verified. If
21644    /// set to true, then only allow connections encrypted with SSL/TLS and with
21645    /// valid client certificates. If you want to enforce SSL/TLS without enforcing
21646    /// the requirement for valid client certificates, then use the `ssl_mode` flag
21647    /// instead of the `require_ssl` flag.
21648    pub require_ssl: std::option::Option<wkt::BoolValue>,
21649
21650    /// The list of external networks that are allowed to connect to the instance
21651    /// using the IP. In 'CIDR' notation, also known as 'slash' notation (for
21652    /// example: `157.197.200.0/24`).
21653    pub authorized_networks: std::vec::Vec<crate::model::AclEntry>,
21654
21655    /// The name of the allocated ip range for the private ip Cloud SQL instance.
21656    /// For example: "google-managed-services-default". If set, the instance ip
21657    /// will be created in the allocated range. The range name must comply with
21658    /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
21659    /// must be 1-63 characters long and match the regular expression
21660    /// `[a-z]([-a-z0-9]*[a-z0-9])?.`
21661    pub allocated_ip_range: std::string::String,
21662
21663    /// Controls connectivity to private IP instances from Google services,
21664    /// such as BigQuery.
21665    pub enable_private_path_for_google_cloud_services: std::option::Option<wkt::BoolValue>,
21666
21667    /// Specify how SSL/TLS is enforced in database connections. If you must use
21668    /// the `require_ssl` flag for backward compatibility, then only the following
21669    /// value pairs are valid:
21670    ///
21671    /// For PostgreSQL and MySQL:
21672    ///
21673    /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
21674    /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
21675    /// * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
21676    ///
21677    /// For SQL Server:
21678    ///
21679    /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
21680    /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
21681    ///
21682    /// The value of `ssl_mode` has priority over the value of `require_ssl`.
21683    ///
21684    /// For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
21685    /// `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
21686    /// connections, while `require_ssl=false` means accept both non-SSL
21687    /// and SSL connections. In this case, MySQL and PostgreSQL databases respect
21688    /// `ssl_mode` and accepts only SSL connections.
21689    pub ssl_mode: crate::model::ip_configuration::SslMode,
21690
21691    /// PSC settings for this instance.
21692    pub psc_config: std::option::Option<crate::model::PscConfig>,
21693
21694    /// Specify what type of CA is used for the server certificate.
21695    pub server_ca_mode: std::option::Option<crate::model::ip_configuration::CaMode>,
21696
21697    /// Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
21698    pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
21699
21700    /// Optional. The resource name of the server CA pool for an instance with
21701    /// `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
21702    /// Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
21703    pub server_ca_pool: std::option::Option<std::string::String>,
21704
21705    /// Optional. Controls the automatic server certificate rotation feature. This
21706    /// feature is disabled by default. When enabled, the server certificate will
21707    /// be automatically rotated during Cloud SQL scheduled maintenance or
21708    /// self-service maintenance updates up to six months before it expires. This
21709    /// setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
21710    /// or CUSTOMER_MANAGED_CAS_CA.
21711    pub server_certificate_rotation_mode:
21712        std::option::Option<crate::model::ip_configuration::ServerCertificateRotationMode>,
21713
21714    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21715}
21716
21717impl IpConfiguration {
21718    pub fn new() -> Self {
21719        std::default::Default::default()
21720    }
21721
21722    /// Sets the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
21723    ///
21724    /// # Example
21725    /// ```ignore,no_run
21726    /// # use google_cloud_sql_v1::model::IpConfiguration;
21727    /// use wkt::BoolValue;
21728    /// let x = IpConfiguration::new().set_ipv4_enabled(BoolValue::default()/* use setters */);
21729    /// ```
21730    pub fn set_ipv4_enabled<T>(mut self, v: T) -> Self
21731    where
21732        T: std::convert::Into<wkt::BoolValue>,
21733    {
21734        self.ipv4_enabled = std::option::Option::Some(v.into());
21735        self
21736    }
21737
21738    /// Sets or clears the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
21739    ///
21740    /// # Example
21741    /// ```ignore,no_run
21742    /// # use google_cloud_sql_v1::model::IpConfiguration;
21743    /// use wkt::BoolValue;
21744    /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(Some(BoolValue::default()/* use setters */));
21745    /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(None::<BoolValue>);
21746    /// ```
21747    pub fn set_or_clear_ipv4_enabled<T>(mut self, v: std::option::Option<T>) -> Self
21748    where
21749        T: std::convert::Into<wkt::BoolValue>,
21750    {
21751        self.ipv4_enabled = v.map(|x| x.into());
21752        self
21753    }
21754
21755    /// Sets the value of [private_network][crate::model::IpConfiguration::private_network].
21756    ///
21757    /// # Example
21758    /// ```ignore,no_run
21759    /// # use google_cloud_sql_v1::model::IpConfiguration;
21760    /// let x = IpConfiguration::new().set_private_network("example");
21761    /// ```
21762    pub fn set_private_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21763        self.private_network = v.into();
21764        self
21765    }
21766
21767    /// Sets the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
21768    ///
21769    /// # Example
21770    /// ```ignore,no_run
21771    /// # use google_cloud_sql_v1::model::IpConfiguration;
21772    /// use wkt::BoolValue;
21773    /// let x = IpConfiguration::new().set_require_ssl(BoolValue::default()/* use setters */);
21774    /// ```
21775    pub fn set_require_ssl<T>(mut self, v: T) -> Self
21776    where
21777        T: std::convert::Into<wkt::BoolValue>,
21778    {
21779        self.require_ssl = std::option::Option::Some(v.into());
21780        self
21781    }
21782
21783    /// Sets or clears the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
21784    ///
21785    /// # Example
21786    /// ```ignore,no_run
21787    /// # use google_cloud_sql_v1::model::IpConfiguration;
21788    /// use wkt::BoolValue;
21789    /// let x = IpConfiguration::new().set_or_clear_require_ssl(Some(BoolValue::default()/* use setters */));
21790    /// let x = IpConfiguration::new().set_or_clear_require_ssl(None::<BoolValue>);
21791    /// ```
21792    pub fn set_or_clear_require_ssl<T>(mut self, v: std::option::Option<T>) -> Self
21793    where
21794        T: std::convert::Into<wkt::BoolValue>,
21795    {
21796        self.require_ssl = v.map(|x| x.into());
21797        self
21798    }
21799
21800    /// Sets the value of [authorized_networks][crate::model::IpConfiguration::authorized_networks].
21801    ///
21802    /// # Example
21803    /// ```ignore,no_run
21804    /// # use google_cloud_sql_v1::model::IpConfiguration;
21805    /// use google_cloud_sql_v1::model::AclEntry;
21806    /// let x = IpConfiguration::new()
21807    ///     .set_authorized_networks([
21808    ///         AclEntry::default()/* use setters */,
21809    ///         AclEntry::default()/* use (different) setters */,
21810    ///     ]);
21811    /// ```
21812    pub fn set_authorized_networks<T, V>(mut self, v: T) -> Self
21813    where
21814        T: std::iter::IntoIterator<Item = V>,
21815        V: std::convert::Into<crate::model::AclEntry>,
21816    {
21817        use std::iter::Iterator;
21818        self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
21819        self
21820    }
21821
21822    /// Sets the value of [allocated_ip_range][crate::model::IpConfiguration::allocated_ip_range].
21823    ///
21824    /// # Example
21825    /// ```ignore,no_run
21826    /// # use google_cloud_sql_v1::model::IpConfiguration;
21827    /// let x = IpConfiguration::new().set_allocated_ip_range("example");
21828    /// ```
21829    pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
21830        mut self,
21831        v: T,
21832    ) -> Self {
21833        self.allocated_ip_range = v.into();
21834        self
21835    }
21836
21837    /// Sets the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
21838    ///
21839    /// # Example
21840    /// ```ignore,no_run
21841    /// # use google_cloud_sql_v1::model::IpConfiguration;
21842    /// use wkt::BoolValue;
21843    /// let x = IpConfiguration::new().set_enable_private_path_for_google_cloud_services(BoolValue::default()/* use setters */);
21844    /// ```
21845    pub fn set_enable_private_path_for_google_cloud_services<T>(mut self, v: T) -> Self
21846    where
21847        T: std::convert::Into<wkt::BoolValue>,
21848    {
21849        self.enable_private_path_for_google_cloud_services = std::option::Option::Some(v.into());
21850        self
21851    }
21852
21853    /// Sets or clears the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
21854    ///
21855    /// # Example
21856    /// ```ignore,no_run
21857    /// # use google_cloud_sql_v1::model::IpConfiguration;
21858    /// use wkt::BoolValue;
21859    /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(Some(BoolValue::default()/* use setters */));
21860    /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(None::<BoolValue>);
21861    /// ```
21862    pub fn set_or_clear_enable_private_path_for_google_cloud_services<T>(
21863        mut self,
21864        v: std::option::Option<T>,
21865    ) -> Self
21866    where
21867        T: std::convert::Into<wkt::BoolValue>,
21868    {
21869        self.enable_private_path_for_google_cloud_services = v.map(|x| x.into());
21870        self
21871    }
21872
21873    /// Sets the value of [ssl_mode][crate::model::IpConfiguration::ssl_mode].
21874    ///
21875    /// # Example
21876    /// ```ignore,no_run
21877    /// # use google_cloud_sql_v1::model::IpConfiguration;
21878    /// use google_cloud_sql_v1::model::ip_configuration::SslMode;
21879    /// let x0 = IpConfiguration::new().set_ssl_mode(SslMode::AllowUnencryptedAndEncrypted);
21880    /// let x1 = IpConfiguration::new().set_ssl_mode(SslMode::EncryptedOnly);
21881    /// let x2 = IpConfiguration::new().set_ssl_mode(SslMode::TrustedClientCertificateRequired);
21882    /// ```
21883    pub fn set_ssl_mode<T: std::convert::Into<crate::model::ip_configuration::SslMode>>(
21884        mut self,
21885        v: T,
21886    ) -> Self {
21887        self.ssl_mode = v.into();
21888        self
21889    }
21890
21891    /// Sets the value of [psc_config][crate::model::IpConfiguration::psc_config].
21892    ///
21893    /// # Example
21894    /// ```ignore,no_run
21895    /// # use google_cloud_sql_v1::model::IpConfiguration;
21896    /// use google_cloud_sql_v1::model::PscConfig;
21897    /// let x = IpConfiguration::new().set_psc_config(PscConfig::default()/* use setters */);
21898    /// ```
21899    pub fn set_psc_config<T>(mut self, v: T) -> Self
21900    where
21901        T: std::convert::Into<crate::model::PscConfig>,
21902    {
21903        self.psc_config = std::option::Option::Some(v.into());
21904        self
21905    }
21906
21907    /// Sets or clears the value of [psc_config][crate::model::IpConfiguration::psc_config].
21908    ///
21909    /// # Example
21910    /// ```ignore,no_run
21911    /// # use google_cloud_sql_v1::model::IpConfiguration;
21912    /// use google_cloud_sql_v1::model::PscConfig;
21913    /// let x = IpConfiguration::new().set_or_clear_psc_config(Some(PscConfig::default()/* use setters */));
21914    /// let x = IpConfiguration::new().set_or_clear_psc_config(None::<PscConfig>);
21915    /// ```
21916    pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
21917    where
21918        T: std::convert::Into<crate::model::PscConfig>,
21919    {
21920        self.psc_config = v.map(|x| x.into());
21921        self
21922    }
21923
21924    /// Sets the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
21925    ///
21926    /// # Example
21927    /// ```ignore,no_run
21928    /// # use google_cloud_sql_v1::model::IpConfiguration;
21929    /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
21930    /// let x0 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
21931    /// let x1 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
21932    /// let x2 = IpConfiguration::new().set_server_ca_mode(CaMode::CustomerManagedCasCa);
21933    /// ```
21934    pub fn set_server_ca_mode<T>(mut self, v: T) -> Self
21935    where
21936        T: std::convert::Into<crate::model::ip_configuration::CaMode>,
21937    {
21938        self.server_ca_mode = std::option::Option::Some(v.into());
21939        self
21940    }
21941
21942    /// Sets or clears the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
21943    ///
21944    /// # Example
21945    /// ```ignore,no_run
21946    /// # use google_cloud_sql_v1::model::IpConfiguration;
21947    /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
21948    /// let x0 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedInternalCa));
21949    /// let x1 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedCasCa));
21950    /// let x2 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::CustomerManagedCasCa));
21951    /// let x_none = IpConfiguration::new().set_or_clear_server_ca_mode(None::<CaMode>);
21952    /// ```
21953    pub fn set_or_clear_server_ca_mode<T>(mut self, v: std::option::Option<T>) -> Self
21954    where
21955        T: std::convert::Into<crate::model::ip_configuration::CaMode>,
21956    {
21957        self.server_ca_mode = v.map(|x| x.into());
21958        self
21959    }
21960
21961    /// Sets the value of [custom_subject_alternative_names][crate::model::IpConfiguration::custom_subject_alternative_names].
21962    ///
21963    /// # Example
21964    /// ```ignore,no_run
21965    /// # use google_cloud_sql_v1::model::IpConfiguration;
21966    /// let x = IpConfiguration::new().set_custom_subject_alternative_names(["a", "b", "c"]);
21967    /// ```
21968    pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
21969    where
21970        T: std::iter::IntoIterator<Item = V>,
21971        V: std::convert::Into<std::string::String>,
21972    {
21973        use std::iter::Iterator;
21974        self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
21975        self
21976    }
21977
21978    /// Sets the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
21979    ///
21980    /// # Example
21981    /// ```ignore,no_run
21982    /// # use google_cloud_sql_v1::model::IpConfiguration;
21983    /// let x = IpConfiguration::new().set_server_ca_pool("example");
21984    /// ```
21985    pub fn set_server_ca_pool<T>(mut self, v: T) -> Self
21986    where
21987        T: std::convert::Into<std::string::String>,
21988    {
21989        self.server_ca_pool = std::option::Option::Some(v.into());
21990        self
21991    }
21992
21993    /// Sets or clears the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
21994    ///
21995    /// # Example
21996    /// ```ignore,no_run
21997    /// # use google_cloud_sql_v1::model::IpConfiguration;
21998    /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(Some("example"));
21999    /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(None::<String>);
22000    /// ```
22001    pub fn set_or_clear_server_ca_pool<T>(mut self, v: std::option::Option<T>) -> Self
22002    where
22003        T: std::convert::Into<std::string::String>,
22004    {
22005        self.server_ca_pool = v.map(|x| x.into());
22006        self
22007    }
22008
22009    /// Sets the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
22010    ///
22011    /// # Example
22012    /// ```ignore,no_run
22013    /// # use google_cloud_sql_v1::model::IpConfiguration;
22014    /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
22015    /// let x0 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::NoAutomaticRotation);
22016    /// let x1 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance);
22017    /// ```
22018    pub fn set_server_certificate_rotation_mode<T>(mut self, v: T) -> Self
22019    where
22020        T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
22021    {
22022        self.server_certificate_rotation_mode = std::option::Option::Some(v.into());
22023        self
22024    }
22025
22026    /// Sets or clears the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
22027    ///
22028    /// # Example
22029    /// ```ignore,no_run
22030    /// # use google_cloud_sql_v1::model::IpConfiguration;
22031    /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
22032    /// let x0 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::NoAutomaticRotation));
22033    /// let x1 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance));
22034    /// let x_none = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(None::<ServerCertificateRotationMode>);
22035    /// ```
22036    pub fn set_or_clear_server_certificate_rotation_mode<T>(
22037        mut self,
22038        v: std::option::Option<T>,
22039    ) -> Self
22040    where
22041        T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
22042    {
22043        self.server_certificate_rotation_mode = v.map(|x| x.into());
22044        self
22045    }
22046}
22047
22048impl wkt::message::Message for IpConfiguration {
22049    fn typename() -> &'static str {
22050        "type.googleapis.com/google.cloud.sql.v1.IpConfiguration"
22051    }
22052}
22053
22054/// Defines additional types related to [IpConfiguration].
22055pub mod ip_configuration {
22056    #[allow(unused_imports)]
22057    use super::*;
22058
22059    /// The SSL options for database connections.
22060    ///
22061    /// # Working with unknown values
22062    ///
22063    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22064    /// additional enum variants at any time. Adding new variants is not considered
22065    /// a breaking change. Applications should write their code in anticipation of:
22066    ///
22067    /// - New values appearing in future releases of the client library, **and**
22068    /// - New values received dynamically, without application changes.
22069    ///
22070    /// Please consult the [Working with enums] section in the user guide for some
22071    /// guidelines.
22072    ///
22073    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22074    #[derive(Clone, Debug, PartialEq)]
22075    #[non_exhaustive]
22076    pub enum SslMode {
22077        /// The SSL mode is unknown.
22078        Unspecified,
22079        /// Allow non-SSL/non-TLS and SSL/TLS connections.
22080        /// For SSL connections to MySQL and PostgreSQL, the client certificate
22081        /// isn't verified.
22082        ///
22083        /// When this value is used, the legacy `require_ssl` flag must be false or
22084        /// cleared to avoid a conflict between the values of the two flags.
22085        AllowUnencryptedAndEncrypted,
22086        /// Only allow connections encrypted with SSL/TLS.
22087        /// For SSL connections to MySQL and PostgreSQL, the client certificate
22088        /// isn't verified.
22089        ///
22090        /// When this value is used, the legacy `require_ssl` flag must be false or
22091        /// cleared to avoid a conflict between the values of the two flags.
22092        EncryptedOnly,
22093        /// Only allow connections encrypted with SSL/TLS and with valid
22094        /// client certificates.
22095        ///
22096        /// When this value is used, the legacy `require_ssl` flag must be true or
22097        /// cleared to avoid the conflict between values of two flags.
22098        /// PostgreSQL clients or users that connect using IAM database
22099        /// authentication must use either the
22100        /// [Cloud SQL Auth
22101        /// Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
22102        /// [Cloud SQL
22103        /// Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
22104        /// to enforce client identity verification.
22105        ///
22106        /// Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
22107        TrustedClientCertificateRequired,
22108        /// If set, the enum was initialized with an unknown value.
22109        ///
22110        /// Applications can examine the value using [SslMode::value] or
22111        /// [SslMode::name].
22112        UnknownValue(ssl_mode::UnknownValue),
22113    }
22114
22115    #[doc(hidden)]
22116    pub mod ssl_mode {
22117        #[allow(unused_imports)]
22118        use super::*;
22119        #[derive(Clone, Debug, PartialEq)]
22120        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22121    }
22122
22123    impl SslMode {
22124        /// Gets the enum value.
22125        ///
22126        /// Returns `None` if the enum contains an unknown value deserialized from
22127        /// the string representation of enums.
22128        pub fn value(&self) -> std::option::Option<i32> {
22129            match self {
22130                Self::Unspecified => std::option::Option::Some(0),
22131                Self::AllowUnencryptedAndEncrypted => std::option::Option::Some(1),
22132                Self::EncryptedOnly => std::option::Option::Some(2),
22133                Self::TrustedClientCertificateRequired => std::option::Option::Some(3),
22134                Self::UnknownValue(u) => u.0.value(),
22135            }
22136        }
22137
22138        /// Gets the enum value as a string.
22139        ///
22140        /// Returns `None` if the enum contains an unknown value deserialized from
22141        /// the integer representation of enums.
22142        pub fn name(&self) -> std::option::Option<&str> {
22143            match self {
22144                Self::Unspecified => std::option::Option::Some("SSL_MODE_UNSPECIFIED"),
22145                Self::AllowUnencryptedAndEncrypted => {
22146                    std::option::Option::Some("ALLOW_UNENCRYPTED_AND_ENCRYPTED")
22147                }
22148                Self::EncryptedOnly => std::option::Option::Some("ENCRYPTED_ONLY"),
22149                Self::TrustedClientCertificateRequired => {
22150                    std::option::Option::Some("TRUSTED_CLIENT_CERTIFICATE_REQUIRED")
22151                }
22152                Self::UnknownValue(u) => u.0.name(),
22153            }
22154        }
22155    }
22156
22157    impl std::default::Default for SslMode {
22158        fn default() -> Self {
22159            use std::convert::From;
22160            Self::from(0)
22161        }
22162    }
22163
22164    impl std::fmt::Display for SslMode {
22165        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22166            wkt::internal::display_enum(f, self.name(), self.value())
22167        }
22168    }
22169
22170    impl std::convert::From<i32> for SslMode {
22171        fn from(value: i32) -> Self {
22172            match value {
22173                0 => Self::Unspecified,
22174                1 => Self::AllowUnencryptedAndEncrypted,
22175                2 => Self::EncryptedOnly,
22176                3 => Self::TrustedClientCertificateRequired,
22177                _ => Self::UnknownValue(ssl_mode::UnknownValue(
22178                    wkt::internal::UnknownEnumValue::Integer(value),
22179                )),
22180            }
22181        }
22182    }
22183
22184    impl std::convert::From<&str> for SslMode {
22185        fn from(value: &str) -> Self {
22186            use std::string::ToString;
22187            match value {
22188                "SSL_MODE_UNSPECIFIED" => Self::Unspecified,
22189                "ALLOW_UNENCRYPTED_AND_ENCRYPTED" => Self::AllowUnencryptedAndEncrypted,
22190                "ENCRYPTED_ONLY" => Self::EncryptedOnly,
22191                "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" => Self::TrustedClientCertificateRequired,
22192                _ => Self::UnknownValue(ssl_mode::UnknownValue(
22193                    wkt::internal::UnknownEnumValue::String(value.to_string()),
22194                )),
22195            }
22196        }
22197    }
22198
22199    impl serde::ser::Serialize for SslMode {
22200        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22201        where
22202            S: serde::Serializer,
22203        {
22204            match self {
22205                Self::Unspecified => serializer.serialize_i32(0),
22206                Self::AllowUnencryptedAndEncrypted => serializer.serialize_i32(1),
22207                Self::EncryptedOnly => serializer.serialize_i32(2),
22208                Self::TrustedClientCertificateRequired => serializer.serialize_i32(3),
22209                Self::UnknownValue(u) => u.0.serialize(serializer),
22210            }
22211        }
22212    }
22213
22214    impl<'de> serde::de::Deserialize<'de> for SslMode {
22215        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22216        where
22217            D: serde::Deserializer<'de>,
22218        {
22219            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslMode>::new(
22220                ".google.cloud.sql.v1.IpConfiguration.SslMode",
22221            ))
22222        }
22223    }
22224
22225    /// Various Certificate Authority (CA) modes for certificate signing.
22226    ///
22227    /// # Working with unknown values
22228    ///
22229    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22230    /// additional enum variants at any time. Adding new variants is not considered
22231    /// a breaking change. Applications should write their code in anticipation of:
22232    ///
22233    /// - New values appearing in future releases of the client library, **and**
22234    /// - New values received dynamically, without application changes.
22235    ///
22236    /// Please consult the [Working with enums] section in the user guide for some
22237    /// guidelines.
22238    ///
22239    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22240    #[derive(Clone, Debug, PartialEq)]
22241    #[non_exhaustive]
22242    pub enum CaMode {
22243        /// CA mode is unspecified. It is effectively the same as
22244        /// `GOOGLE_MANAGED_INTERNAL_CA`.
22245        Unspecified,
22246        /// Google-managed self-signed internal CA.
22247        GoogleManagedInternalCa,
22248        /// Google-managed regional CA part of root CA hierarchy hosted on Google
22249        /// Cloud's Certificate Authority Service (CAS).
22250        GoogleManagedCasCa,
22251        /// Customer-managed CA hosted on Google Cloud's Certificate Authority
22252        /// Service (CAS).
22253        CustomerManagedCasCa,
22254        /// If set, the enum was initialized with an unknown value.
22255        ///
22256        /// Applications can examine the value using [CaMode::value] or
22257        /// [CaMode::name].
22258        UnknownValue(ca_mode::UnknownValue),
22259    }
22260
22261    #[doc(hidden)]
22262    pub mod ca_mode {
22263        #[allow(unused_imports)]
22264        use super::*;
22265        #[derive(Clone, Debug, PartialEq)]
22266        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22267    }
22268
22269    impl CaMode {
22270        /// Gets the enum value.
22271        ///
22272        /// Returns `None` if the enum contains an unknown value deserialized from
22273        /// the string representation of enums.
22274        pub fn value(&self) -> std::option::Option<i32> {
22275            match self {
22276                Self::Unspecified => std::option::Option::Some(0),
22277                Self::GoogleManagedInternalCa => std::option::Option::Some(1),
22278                Self::GoogleManagedCasCa => std::option::Option::Some(2),
22279                Self::CustomerManagedCasCa => std::option::Option::Some(3),
22280                Self::UnknownValue(u) => u.0.value(),
22281            }
22282        }
22283
22284        /// Gets the enum value as a string.
22285        ///
22286        /// Returns `None` if the enum contains an unknown value deserialized from
22287        /// the integer representation of enums.
22288        pub fn name(&self) -> std::option::Option<&str> {
22289            match self {
22290                Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
22291                Self::GoogleManagedInternalCa => {
22292                    std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
22293                }
22294                Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
22295                Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
22296                Self::UnknownValue(u) => u.0.name(),
22297            }
22298        }
22299    }
22300
22301    impl std::default::Default for CaMode {
22302        fn default() -> Self {
22303            use std::convert::From;
22304            Self::from(0)
22305        }
22306    }
22307
22308    impl std::fmt::Display for CaMode {
22309        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22310            wkt::internal::display_enum(f, self.name(), self.value())
22311        }
22312    }
22313
22314    impl std::convert::From<i32> for CaMode {
22315        fn from(value: i32) -> Self {
22316            match value {
22317                0 => Self::Unspecified,
22318                1 => Self::GoogleManagedInternalCa,
22319                2 => Self::GoogleManagedCasCa,
22320                3 => Self::CustomerManagedCasCa,
22321                _ => Self::UnknownValue(ca_mode::UnknownValue(
22322                    wkt::internal::UnknownEnumValue::Integer(value),
22323                )),
22324            }
22325        }
22326    }
22327
22328    impl std::convert::From<&str> for CaMode {
22329        fn from(value: &str) -> Self {
22330            use std::string::ToString;
22331            match value {
22332                "CA_MODE_UNSPECIFIED" => Self::Unspecified,
22333                "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
22334                "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
22335                "CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
22336                _ => Self::UnknownValue(ca_mode::UnknownValue(
22337                    wkt::internal::UnknownEnumValue::String(value.to_string()),
22338                )),
22339            }
22340        }
22341    }
22342
22343    impl serde::ser::Serialize for CaMode {
22344        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22345        where
22346            S: serde::Serializer,
22347        {
22348            match self {
22349                Self::Unspecified => serializer.serialize_i32(0),
22350                Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
22351                Self::GoogleManagedCasCa => serializer.serialize_i32(2),
22352                Self::CustomerManagedCasCa => serializer.serialize_i32(3),
22353                Self::UnknownValue(u) => u.0.serialize(serializer),
22354            }
22355        }
22356    }
22357
22358    impl<'de> serde::de::Deserialize<'de> for CaMode {
22359        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22360        where
22361            D: serde::Deserializer<'de>,
22362        {
22363            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
22364                ".google.cloud.sql.v1.IpConfiguration.CaMode",
22365            ))
22366        }
22367    }
22368
22369    /// Settings for automatic server certificate rotation.
22370    ///
22371    /// # Working with unknown values
22372    ///
22373    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22374    /// additional enum variants at any time. Adding new variants is not considered
22375    /// a breaking change. Applications should write their code in anticipation of:
22376    ///
22377    /// - New values appearing in future releases of the client library, **and**
22378    /// - New values received dynamically, without application changes.
22379    ///
22380    /// Please consult the [Working with enums] section in the user guide for some
22381    /// guidelines.
22382    ///
22383    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22384    #[derive(Clone, Debug, PartialEq)]
22385    #[non_exhaustive]
22386    pub enum ServerCertificateRotationMode {
22387        /// Unspecified: no automatic server certificate rotation.
22388        Unspecified,
22389        /// No automatic server certificate rotation. The user must [manage server
22390        /// certificate
22391        /// rotation](/sql/docs/mysql/manage-ssl-instance#rotate-server-certificate-cas)
22392        /// on their side.
22393        NoAutomaticRotation,
22394        /// Automatic server certificate rotation during Cloud SQL scheduled
22395        /// maintenance or self-service maintenance updates. Requires
22396        /// `server_ca_mode` to be `GOOGLE_MANAGED_CAS_CA` or
22397        /// `CUSTOMER_MANAGED_CAS_CA`.
22398        AutomaticRotationDuringMaintenance,
22399        /// If set, the enum was initialized with an unknown value.
22400        ///
22401        /// Applications can examine the value using [ServerCertificateRotationMode::value] or
22402        /// [ServerCertificateRotationMode::name].
22403        UnknownValue(server_certificate_rotation_mode::UnknownValue),
22404    }
22405
22406    #[doc(hidden)]
22407    pub mod server_certificate_rotation_mode {
22408        #[allow(unused_imports)]
22409        use super::*;
22410        #[derive(Clone, Debug, PartialEq)]
22411        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22412    }
22413
22414    impl ServerCertificateRotationMode {
22415        /// Gets the enum value.
22416        ///
22417        /// Returns `None` if the enum contains an unknown value deserialized from
22418        /// the string representation of enums.
22419        pub fn value(&self) -> std::option::Option<i32> {
22420            match self {
22421                Self::Unspecified => std::option::Option::Some(0),
22422                Self::NoAutomaticRotation => std::option::Option::Some(1),
22423                Self::AutomaticRotationDuringMaintenance => std::option::Option::Some(2),
22424                Self::UnknownValue(u) => u.0.value(),
22425            }
22426        }
22427
22428        /// Gets the enum value as a string.
22429        ///
22430        /// Returns `None` if the enum contains an unknown value deserialized from
22431        /// the integer representation of enums.
22432        pub fn name(&self) -> std::option::Option<&str> {
22433            match self {
22434                Self::Unspecified => {
22435                    std::option::Option::Some("SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED")
22436                }
22437                Self::NoAutomaticRotation => std::option::Option::Some("NO_AUTOMATIC_ROTATION"),
22438                Self::AutomaticRotationDuringMaintenance => {
22439                    std::option::Option::Some("AUTOMATIC_ROTATION_DURING_MAINTENANCE")
22440                }
22441                Self::UnknownValue(u) => u.0.name(),
22442            }
22443        }
22444    }
22445
22446    impl std::default::Default for ServerCertificateRotationMode {
22447        fn default() -> Self {
22448            use std::convert::From;
22449            Self::from(0)
22450        }
22451    }
22452
22453    impl std::fmt::Display for ServerCertificateRotationMode {
22454        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22455            wkt::internal::display_enum(f, self.name(), self.value())
22456        }
22457    }
22458
22459    impl std::convert::From<i32> for ServerCertificateRotationMode {
22460        fn from(value: i32) -> Self {
22461            match value {
22462                0 => Self::Unspecified,
22463                1 => Self::NoAutomaticRotation,
22464                2 => Self::AutomaticRotationDuringMaintenance,
22465                _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
22466                    wkt::internal::UnknownEnumValue::Integer(value),
22467                )),
22468            }
22469        }
22470    }
22471
22472    impl std::convert::From<&str> for ServerCertificateRotationMode {
22473        fn from(value: &str) -> Self {
22474            use std::string::ToString;
22475            match value {
22476                "SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED" => Self::Unspecified,
22477                "NO_AUTOMATIC_ROTATION" => Self::NoAutomaticRotation,
22478                "AUTOMATIC_ROTATION_DURING_MAINTENANCE" => Self::AutomaticRotationDuringMaintenance,
22479                _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
22480                    wkt::internal::UnknownEnumValue::String(value.to_string()),
22481                )),
22482            }
22483        }
22484    }
22485
22486    impl serde::ser::Serialize for ServerCertificateRotationMode {
22487        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22488        where
22489            S: serde::Serializer,
22490        {
22491            match self {
22492                Self::Unspecified => serializer.serialize_i32(0),
22493                Self::NoAutomaticRotation => serializer.serialize_i32(1),
22494                Self::AutomaticRotationDuringMaintenance => serializer.serialize_i32(2),
22495                Self::UnknownValue(u) => u.0.serialize(serializer),
22496            }
22497        }
22498    }
22499
22500    impl<'de> serde::de::Deserialize<'de> for ServerCertificateRotationMode {
22501        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22502        where
22503            D: serde::Deserializer<'de>,
22504        {
22505            deserializer.deserialize_any(
22506                wkt::internal::EnumVisitor::<ServerCertificateRotationMode>::new(
22507                    ".google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode",
22508                ),
22509            )
22510        }
22511    }
22512}
22513
22514/// PSC settings for a Cloud SQL instance.
22515#[derive(Clone, Default, PartialEq)]
22516#[non_exhaustive]
22517pub struct PscConfig {
22518    /// Whether PSC connectivity is enabled for this instance.
22519    pub psc_enabled: std::option::Option<bool>,
22520
22521    /// Optional. The list of consumer projects that are allow-listed for PSC
22522    /// connections to this instance. This instance can be connected to with PSC
22523    /// from any network in these projects.
22524    ///
22525    /// Each consumer project in this list may be represented by a project number
22526    /// (numeric) or by a project id (alphanumeric).
22527    pub allowed_consumer_projects: std::vec::Vec<std::string::String>,
22528
22529    /// Optional. The list of settings for requested Private Service Connect
22530    /// consumer endpoints that can be used to connect to this Cloud SQL instance.
22531    pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
22532
22533    /// Optional. The network attachment of the consumer network that the
22534    /// Private Service Connect enabled Cloud SQL instance is
22535    /// authorized to connect via PSC interface.
22536    /// format: projects/PROJECT/regions/REGION/networkAttachments/ID
22537    pub network_attachment_uri: std::string::String,
22538
22539    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22540}
22541
22542impl PscConfig {
22543    pub fn new() -> Self {
22544        std::default::Default::default()
22545    }
22546
22547    /// Sets the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
22548    ///
22549    /// # Example
22550    /// ```ignore,no_run
22551    /// # use google_cloud_sql_v1::model::PscConfig;
22552    /// let x = PscConfig::new().set_psc_enabled(true);
22553    /// ```
22554    pub fn set_psc_enabled<T>(mut self, v: T) -> Self
22555    where
22556        T: std::convert::Into<bool>,
22557    {
22558        self.psc_enabled = std::option::Option::Some(v.into());
22559        self
22560    }
22561
22562    /// Sets or clears the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
22563    ///
22564    /// # Example
22565    /// ```ignore,no_run
22566    /// # use google_cloud_sql_v1::model::PscConfig;
22567    /// let x = PscConfig::new().set_or_clear_psc_enabled(Some(false));
22568    /// let x = PscConfig::new().set_or_clear_psc_enabled(None::<bool>);
22569    /// ```
22570    pub fn set_or_clear_psc_enabled<T>(mut self, v: std::option::Option<T>) -> Self
22571    where
22572        T: std::convert::Into<bool>,
22573    {
22574        self.psc_enabled = v.map(|x| x.into());
22575        self
22576    }
22577
22578    /// Sets the value of [allowed_consumer_projects][crate::model::PscConfig::allowed_consumer_projects].
22579    ///
22580    /// # Example
22581    /// ```ignore,no_run
22582    /// # use google_cloud_sql_v1::model::PscConfig;
22583    /// let x = PscConfig::new().set_allowed_consumer_projects(["a", "b", "c"]);
22584    /// ```
22585    pub fn set_allowed_consumer_projects<T, V>(mut self, v: T) -> Self
22586    where
22587        T: std::iter::IntoIterator<Item = V>,
22588        V: std::convert::Into<std::string::String>,
22589    {
22590        use std::iter::Iterator;
22591        self.allowed_consumer_projects = v.into_iter().map(|i| i.into()).collect();
22592        self
22593    }
22594
22595    /// Sets the value of [psc_auto_connections][crate::model::PscConfig::psc_auto_connections].
22596    ///
22597    /// # Example
22598    /// ```ignore,no_run
22599    /// # use google_cloud_sql_v1::model::PscConfig;
22600    /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22601    /// let x = PscConfig::new()
22602    ///     .set_psc_auto_connections([
22603    ///         PscAutoConnectionConfig::default()/* use setters */,
22604    ///         PscAutoConnectionConfig::default()/* use (different) setters */,
22605    ///     ]);
22606    /// ```
22607    pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
22608    where
22609        T: std::iter::IntoIterator<Item = V>,
22610        V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
22611    {
22612        use std::iter::Iterator;
22613        self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
22614        self
22615    }
22616
22617    /// Sets the value of [network_attachment_uri][crate::model::PscConfig::network_attachment_uri].
22618    ///
22619    /// # Example
22620    /// ```ignore,no_run
22621    /// # use google_cloud_sql_v1::model::PscConfig;
22622    /// let x = PscConfig::new().set_network_attachment_uri("example");
22623    /// ```
22624    pub fn set_network_attachment_uri<T: std::convert::Into<std::string::String>>(
22625        mut self,
22626        v: T,
22627    ) -> Self {
22628        self.network_attachment_uri = v.into();
22629        self
22630    }
22631}
22632
22633impl wkt::message::Message for PscConfig {
22634    fn typename() -> &'static str {
22635        "type.googleapis.com/google.cloud.sql.v1.PscConfig"
22636    }
22637}
22638
22639/// Settings for an automatically-setup Private Service Connect consumer endpoint
22640/// that is used to connect to a Cloud SQL instance.
22641#[derive(Clone, Default, PartialEq)]
22642#[non_exhaustive]
22643pub struct PscAutoConnectionConfig {
22644    /// Optional. This is the project ID of consumer service project of this
22645    /// consumer endpoint.
22646    ///
22647    /// Optional. This is only applicable if consumer_network is a shared vpc
22648    /// network.
22649    pub consumer_project: std::string::String,
22650
22651    /// Optional. The consumer network of this consumer endpoint. This must be a
22652    /// resource path that includes both the host project and the network name.
22653    ///
22654    /// For example, `projects/project1/global/networks/network1`.
22655    ///
22656    /// The consumer host project of this network might be different from the
22657    /// consumer service project.
22658    pub consumer_network: std::string::String,
22659
22660    /// The IP address of the consumer endpoint.
22661    pub ip_address: std::option::Option<std::string::String>,
22662
22663    /// The connection status of the consumer endpoint.
22664    pub status: std::option::Option<std::string::String>,
22665
22666    /// The connection policy status of the consumer network.
22667    pub consumer_network_status: std::option::Option<std::string::String>,
22668
22669    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22670}
22671
22672impl PscAutoConnectionConfig {
22673    pub fn new() -> Self {
22674        std::default::Default::default()
22675    }
22676
22677    /// Sets the value of [consumer_project][crate::model::PscAutoConnectionConfig::consumer_project].
22678    ///
22679    /// # Example
22680    /// ```ignore,no_run
22681    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22682    /// let x = PscAutoConnectionConfig::new().set_consumer_project("example");
22683    /// ```
22684    pub fn set_consumer_project<T: std::convert::Into<std::string::String>>(
22685        mut self,
22686        v: T,
22687    ) -> Self {
22688        self.consumer_project = v.into();
22689        self
22690    }
22691
22692    /// Sets the value of [consumer_network][crate::model::PscAutoConnectionConfig::consumer_network].
22693    ///
22694    /// # Example
22695    /// ```ignore,no_run
22696    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22697    /// let x = PscAutoConnectionConfig::new().set_consumer_network("example");
22698    /// ```
22699    pub fn set_consumer_network<T: std::convert::Into<std::string::String>>(
22700        mut self,
22701        v: T,
22702    ) -> Self {
22703        self.consumer_network = v.into();
22704        self
22705    }
22706
22707    /// Sets the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
22708    ///
22709    /// # Example
22710    /// ```ignore,no_run
22711    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22712    /// let x = PscAutoConnectionConfig::new().set_ip_address("example");
22713    /// ```
22714    pub fn set_ip_address<T>(mut self, v: T) -> Self
22715    where
22716        T: std::convert::Into<std::string::String>,
22717    {
22718        self.ip_address = std::option::Option::Some(v.into());
22719        self
22720    }
22721
22722    /// Sets or clears the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
22723    ///
22724    /// # Example
22725    /// ```ignore,no_run
22726    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22727    /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(Some("example"));
22728    /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(None::<String>);
22729    /// ```
22730    pub fn set_or_clear_ip_address<T>(mut self, v: std::option::Option<T>) -> Self
22731    where
22732        T: std::convert::Into<std::string::String>,
22733    {
22734        self.ip_address = v.map(|x| x.into());
22735        self
22736    }
22737
22738    /// Sets the value of [status][crate::model::PscAutoConnectionConfig::status].
22739    ///
22740    /// # Example
22741    /// ```ignore,no_run
22742    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22743    /// let x = PscAutoConnectionConfig::new().set_status("example");
22744    /// ```
22745    pub fn set_status<T>(mut self, v: T) -> Self
22746    where
22747        T: std::convert::Into<std::string::String>,
22748    {
22749        self.status = std::option::Option::Some(v.into());
22750        self
22751    }
22752
22753    /// Sets or clears the value of [status][crate::model::PscAutoConnectionConfig::status].
22754    ///
22755    /// # Example
22756    /// ```ignore,no_run
22757    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22758    /// let x = PscAutoConnectionConfig::new().set_or_clear_status(Some("example"));
22759    /// let x = PscAutoConnectionConfig::new().set_or_clear_status(None::<String>);
22760    /// ```
22761    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
22762    where
22763        T: std::convert::Into<std::string::String>,
22764    {
22765        self.status = v.map(|x| x.into());
22766        self
22767    }
22768
22769    /// Sets the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
22770    ///
22771    /// # Example
22772    /// ```ignore,no_run
22773    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22774    /// let x = PscAutoConnectionConfig::new().set_consumer_network_status("example");
22775    /// ```
22776    pub fn set_consumer_network_status<T>(mut self, v: T) -> Self
22777    where
22778        T: std::convert::Into<std::string::String>,
22779    {
22780        self.consumer_network_status = std::option::Option::Some(v.into());
22781        self
22782    }
22783
22784    /// Sets or clears the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
22785    ///
22786    /// # Example
22787    /// ```ignore,no_run
22788    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22789    /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(Some("example"));
22790    /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(None::<String>);
22791    /// ```
22792    pub fn set_or_clear_consumer_network_status<T>(mut self, v: std::option::Option<T>) -> Self
22793    where
22794        T: std::convert::Into<std::string::String>,
22795    {
22796        self.consumer_network_status = v.map(|x| x.into());
22797        self
22798    }
22799}
22800
22801impl wkt::message::Message for PscAutoConnectionConfig {
22802    fn typename() -> &'static str {
22803        "type.googleapis.com/google.cloud.sql.v1.PscAutoConnectionConfig"
22804    }
22805}
22806
22807/// Preferred location. This specifies where a Cloud SQL instance is located.
22808/// Note that if the preferred location is not available, the instance will be
22809/// located as close as possible within the region. Only one location may be
22810/// specified.
22811#[derive(Clone, Default, PartialEq)]
22812#[non_exhaustive]
22813pub struct LocationPreference {
22814    /// The App Engine application to follow, it must be in the same region as the
22815    /// Cloud SQL instance. WARNING: Changing this might restart the instance.
22816    #[deprecated]
22817    pub follow_gae_application: std::string::String,
22818
22819    /// The preferred Compute Engine zone (for example: us-central1-a,
22820    /// us-central1-b, etc.). WARNING: Changing this might restart the instance.
22821    pub zone: std::string::String,
22822
22823    /// The preferred Compute Engine zone for the secondary/failover
22824    /// (for example: us-central1-a, us-central1-b, etc.).
22825    /// To disable this field, set it to 'no_secondary_zone'.
22826    pub secondary_zone: std::string::String,
22827
22828    /// This is always `sql#locationPreference`.
22829    pub kind: std::string::String,
22830
22831    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22832}
22833
22834impl LocationPreference {
22835    pub fn new() -> Self {
22836        std::default::Default::default()
22837    }
22838
22839    /// Sets the value of [follow_gae_application][crate::model::LocationPreference::follow_gae_application].
22840    ///
22841    /// # Example
22842    /// ```ignore,no_run
22843    /// # use google_cloud_sql_v1::model::LocationPreference;
22844    /// let x = LocationPreference::new().set_follow_gae_application("example");
22845    /// ```
22846    #[deprecated]
22847    pub fn set_follow_gae_application<T: std::convert::Into<std::string::String>>(
22848        mut self,
22849        v: T,
22850    ) -> Self {
22851        self.follow_gae_application = v.into();
22852        self
22853    }
22854
22855    /// Sets the value of [zone][crate::model::LocationPreference::zone].
22856    ///
22857    /// # Example
22858    /// ```ignore,no_run
22859    /// # use google_cloud_sql_v1::model::LocationPreference;
22860    /// let x = LocationPreference::new().set_zone("example");
22861    /// ```
22862    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22863        self.zone = v.into();
22864        self
22865    }
22866
22867    /// Sets the value of [secondary_zone][crate::model::LocationPreference::secondary_zone].
22868    ///
22869    /// # Example
22870    /// ```ignore,no_run
22871    /// # use google_cloud_sql_v1::model::LocationPreference;
22872    /// let x = LocationPreference::new().set_secondary_zone("example");
22873    /// ```
22874    pub fn set_secondary_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22875        self.secondary_zone = v.into();
22876        self
22877    }
22878
22879    /// Sets the value of [kind][crate::model::LocationPreference::kind].
22880    ///
22881    /// # Example
22882    /// ```ignore,no_run
22883    /// # use google_cloud_sql_v1::model::LocationPreference;
22884    /// let x = LocationPreference::new().set_kind("example");
22885    /// ```
22886    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22887        self.kind = v.into();
22888        self
22889    }
22890}
22891
22892impl wkt::message::Message for LocationPreference {
22893    fn typename() -> &'static str {
22894        "type.googleapis.com/google.cloud.sql.v1.LocationPreference"
22895    }
22896}
22897
22898/// Maintenance window. This specifies when a Cloud SQL instance is
22899/// restarted for system maintenance purposes.
22900#[derive(Clone, Default, PartialEq)]
22901#[non_exhaustive]
22902pub struct MaintenanceWindow {
22903    /// Hour of day - 0 to 23. Specify in the UTC time zone.
22904    pub hour: std::option::Option<wkt::Int32Value>,
22905
22906    /// Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
22907    /// `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
22908    /// Returned in output as an integer, 1 to 7, where `1` equals Monday.
22909    pub day: std::option::Option<wkt::Int32Value>,
22910
22911    /// Maintenance timing settings: `canary`, `stable`, or `week5`.
22912    /// For more information, see [About maintenance on Cloud SQL
22913    /// instances](https://cloud.google.com/sql/docs/mysql/maintenance).
22914    pub update_track: crate::model::SqlUpdateTrack,
22915
22916    /// This is always `sql#maintenanceWindow`.
22917    pub kind: std::string::String,
22918
22919    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22920}
22921
22922impl MaintenanceWindow {
22923    pub fn new() -> Self {
22924        std::default::Default::default()
22925    }
22926
22927    /// Sets the value of [hour][crate::model::MaintenanceWindow::hour].
22928    ///
22929    /// # Example
22930    /// ```ignore,no_run
22931    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
22932    /// use wkt::Int32Value;
22933    /// let x = MaintenanceWindow::new().set_hour(Int32Value::default()/* use setters */);
22934    /// ```
22935    pub fn set_hour<T>(mut self, v: T) -> Self
22936    where
22937        T: std::convert::Into<wkt::Int32Value>,
22938    {
22939        self.hour = std::option::Option::Some(v.into());
22940        self
22941    }
22942
22943    /// Sets or clears the value of [hour][crate::model::MaintenanceWindow::hour].
22944    ///
22945    /// # Example
22946    /// ```ignore,no_run
22947    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
22948    /// use wkt::Int32Value;
22949    /// let x = MaintenanceWindow::new().set_or_clear_hour(Some(Int32Value::default()/* use setters */));
22950    /// let x = MaintenanceWindow::new().set_or_clear_hour(None::<Int32Value>);
22951    /// ```
22952    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
22953    where
22954        T: std::convert::Into<wkt::Int32Value>,
22955    {
22956        self.hour = v.map(|x| x.into());
22957        self
22958    }
22959
22960    /// Sets the value of [day][crate::model::MaintenanceWindow::day].
22961    ///
22962    /// # Example
22963    /// ```ignore,no_run
22964    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
22965    /// use wkt::Int32Value;
22966    /// let x = MaintenanceWindow::new().set_day(Int32Value::default()/* use setters */);
22967    /// ```
22968    pub fn set_day<T>(mut self, v: T) -> Self
22969    where
22970        T: std::convert::Into<wkt::Int32Value>,
22971    {
22972        self.day = std::option::Option::Some(v.into());
22973        self
22974    }
22975
22976    /// Sets or clears the value of [day][crate::model::MaintenanceWindow::day].
22977    ///
22978    /// # Example
22979    /// ```ignore,no_run
22980    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
22981    /// use wkt::Int32Value;
22982    /// let x = MaintenanceWindow::new().set_or_clear_day(Some(Int32Value::default()/* use setters */));
22983    /// let x = MaintenanceWindow::new().set_or_clear_day(None::<Int32Value>);
22984    /// ```
22985    pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
22986    where
22987        T: std::convert::Into<wkt::Int32Value>,
22988    {
22989        self.day = v.map(|x| x.into());
22990        self
22991    }
22992
22993    /// Sets the value of [update_track][crate::model::MaintenanceWindow::update_track].
22994    ///
22995    /// # Example
22996    /// ```ignore,no_run
22997    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
22998    /// use google_cloud_sql_v1::model::SqlUpdateTrack;
22999    /// let x0 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Canary);
23000    /// let x1 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Stable);
23001    /// let x2 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Week5);
23002    /// ```
23003    pub fn set_update_track<T: std::convert::Into<crate::model::SqlUpdateTrack>>(
23004        mut self,
23005        v: T,
23006    ) -> Self {
23007        self.update_track = v.into();
23008        self
23009    }
23010
23011    /// Sets the value of [kind][crate::model::MaintenanceWindow::kind].
23012    ///
23013    /// # Example
23014    /// ```ignore,no_run
23015    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23016    /// let x = MaintenanceWindow::new().set_kind("example");
23017    /// ```
23018    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23019        self.kind = v.into();
23020        self
23021    }
23022}
23023
23024impl wkt::message::Message for MaintenanceWindow {
23025    fn typename() -> &'static str {
23026        "type.googleapis.com/google.cloud.sql.v1.MaintenanceWindow"
23027    }
23028}
23029
23030/// Deny maintenance Periods. This specifies a date range during when all CSA
23031/// rollout will be denied.
23032#[derive(Clone, Default, PartialEq)]
23033#[non_exhaustive]
23034pub struct DenyMaintenancePeriod {
23035    /// "deny maintenance period" start date. If the year of the start date is
23036    /// empty, the year of the end date also must be empty. In this case, it means
23037    /// the deny maintenance period recurs every year. The date is in format
23038    /// yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
23039    pub start_date: std::string::String,
23040
23041    /// "deny maintenance period" end date. If the year of the end date is empty,
23042    /// the year of the start date also must be empty. In this case, it means the
23043    /// no maintenance interval recurs every year. The date is in format yyyy-mm-dd
23044    /// i.e., 2020-11-01, or mm-dd, i.e., 11-01
23045    pub end_date: std::string::String,
23046
23047    /// Time in UTC when the "deny maintenance period" starts on start_date and
23048    /// ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
23049    pub time: std::string::String,
23050
23051    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23052}
23053
23054impl DenyMaintenancePeriod {
23055    pub fn new() -> Self {
23056        std::default::Default::default()
23057    }
23058
23059    /// Sets the value of [start_date][crate::model::DenyMaintenancePeriod::start_date].
23060    ///
23061    /// # Example
23062    /// ```ignore,no_run
23063    /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23064    /// let x = DenyMaintenancePeriod::new().set_start_date("example");
23065    /// ```
23066    pub fn set_start_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23067        self.start_date = v.into();
23068        self
23069    }
23070
23071    /// Sets the value of [end_date][crate::model::DenyMaintenancePeriod::end_date].
23072    ///
23073    /// # Example
23074    /// ```ignore,no_run
23075    /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23076    /// let x = DenyMaintenancePeriod::new().set_end_date("example");
23077    /// ```
23078    pub fn set_end_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23079        self.end_date = v.into();
23080        self
23081    }
23082
23083    /// Sets the value of [time][crate::model::DenyMaintenancePeriod::time].
23084    ///
23085    /// # Example
23086    /// ```ignore,no_run
23087    /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23088    /// let x = DenyMaintenancePeriod::new().set_time("example");
23089    /// ```
23090    pub fn set_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23091        self.time = v.into();
23092        self
23093    }
23094}
23095
23096impl wkt::message::Message for DenyMaintenancePeriod {
23097    fn typename() -> &'static str {
23098        "type.googleapis.com/google.cloud.sql.v1.DenyMaintenancePeriod"
23099    }
23100}
23101
23102/// Insights configuration. This specifies when Cloud SQL Insights feature is
23103/// enabled and optional configuration.
23104#[derive(Clone, Default, PartialEq)]
23105#[non_exhaustive]
23106pub struct InsightsConfig {
23107    /// Whether Query Insights feature is enabled.
23108    pub query_insights_enabled: bool,
23109
23110    /// Whether Query Insights will record client address when enabled.
23111    pub record_client_address: bool,
23112
23113    /// Whether Query Insights will record application tags from query when
23114    /// enabled.
23115    pub record_application_tags: bool,
23116
23117    /// Maximum query length stored in bytes. Default value: 1024 bytes.
23118    /// Range: 256-4500 bytes. Query lengths greater than this field value will be
23119    /// truncated to this value. When unset, query length will be the default
23120    /// value. Changing query length will restart the database.
23121    pub query_string_length: std::option::Option<wkt::Int32Value>,
23122
23123    /// Number of query execution plans captured by Insights per minute
23124    /// for all queries combined. Default is 5.
23125    pub query_plans_per_minute: std::option::Option<wkt::Int32Value>,
23126
23127    /// Optional. Whether enhanced query insights feature is enabled.
23128    pub enhanced_query_insights_enabled: std::option::Option<wkt::BoolValue>,
23129
23130    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23131}
23132
23133impl InsightsConfig {
23134    pub fn new() -> Self {
23135        std::default::Default::default()
23136    }
23137
23138    /// Sets the value of [query_insights_enabled][crate::model::InsightsConfig::query_insights_enabled].
23139    ///
23140    /// # Example
23141    /// ```ignore,no_run
23142    /// # use google_cloud_sql_v1::model::InsightsConfig;
23143    /// let x = InsightsConfig::new().set_query_insights_enabled(true);
23144    /// ```
23145    pub fn set_query_insights_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23146        self.query_insights_enabled = v.into();
23147        self
23148    }
23149
23150    /// Sets the value of [record_client_address][crate::model::InsightsConfig::record_client_address].
23151    ///
23152    /// # Example
23153    /// ```ignore,no_run
23154    /// # use google_cloud_sql_v1::model::InsightsConfig;
23155    /// let x = InsightsConfig::new().set_record_client_address(true);
23156    /// ```
23157    pub fn set_record_client_address<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23158        self.record_client_address = v.into();
23159        self
23160    }
23161
23162    /// Sets the value of [record_application_tags][crate::model::InsightsConfig::record_application_tags].
23163    ///
23164    /// # Example
23165    /// ```ignore,no_run
23166    /// # use google_cloud_sql_v1::model::InsightsConfig;
23167    /// let x = InsightsConfig::new().set_record_application_tags(true);
23168    /// ```
23169    pub fn set_record_application_tags<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23170        self.record_application_tags = v.into();
23171        self
23172    }
23173
23174    /// Sets the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
23175    ///
23176    /// # Example
23177    /// ```ignore,no_run
23178    /// # use google_cloud_sql_v1::model::InsightsConfig;
23179    /// use wkt::Int32Value;
23180    /// let x = InsightsConfig::new().set_query_string_length(Int32Value::default()/* use setters */);
23181    /// ```
23182    pub fn set_query_string_length<T>(mut self, v: T) -> Self
23183    where
23184        T: std::convert::Into<wkt::Int32Value>,
23185    {
23186        self.query_string_length = std::option::Option::Some(v.into());
23187        self
23188    }
23189
23190    /// Sets or clears the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
23191    ///
23192    /// # Example
23193    /// ```ignore,no_run
23194    /// # use google_cloud_sql_v1::model::InsightsConfig;
23195    /// use wkt::Int32Value;
23196    /// let x = InsightsConfig::new().set_or_clear_query_string_length(Some(Int32Value::default()/* use setters */));
23197    /// let x = InsightsConfig::new().set_or_clear_query_string_length(None::<Int32Value>);
23198    /// ```
23199    pub fn set_or_clear_query_string_length<T>(mut self, v: std::option::Option<T>) -> Self
23200    where
23201        T: std::convert::Into<wkt::Int32Value>,
23202    {
23203        self.query_string_length = v.map(|x| x.into());
23204        self
23205    }
23206
23207    /// Sets the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
23208    ///
23209    /// # Example
23210    /// ```ignore,no_run
23211    /// # use google_cloud_sql_v1::model::InsightsConfig;
23212    /// use wkt::Int32Value;
23213    /// let x = InsightsConfig::new().set_query_plans_per_minute(Int32Value::default()/* use setters */);
23214    /// ```
23215    pub fn set_query_plans_per_minute<T>(mut self, v: T) -> Self
23216    where
23217        T: std::convert::Into<wkt::Int32Value>,
23218    {
23219        self.query_plans_per_minute = std::option::Option::Some(v.into());
23220        self
23221    }
23222
23223    /// Sets or clears the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
23224    ///
23225    /// # Example
23226    /// ```ignore,no_run
23227    /// # use google_cloud_sql_v1::model::InsightsConfig;
23228    /// use wkt::Int32Value;
23229    /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(Some(Int32Value::default()/* use setters */));
23230    /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(None::<Int32Value>);
23231    /// ```
23232    pub fn set_or_clear_query_plans_per_minute<T>(mut self, v: std::option::Option<T>) -> Self
23233    where
23234        T: std::convert::Into<wkt::Int32Value>,
23235    {
23236        self.query_plans_per_minute = v.map(|x| x.into());
23237        self
23238    }
23239
23240    /// Sets the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
23241    ///
23242    /// # Example
23243    /// ```ignore,no_run
23244    /// # use google_cloud_sql_v1::model::InsightsConfig;
23245    /// use wkt::BoolValue;
23246    /// let x = InsightsConfig::new().set_enhanced_query_insights_enabled(BoolValue::default()/* use setters */);
23247    /// ```
23248    pub fn set_enhanced_query_insights_enabled<T>(mut self, v: T) -> Self
23249    where
23250        T: std::convert::Into<wkt::BoolValue>,
23251    {
23252        self.enhanced_query_insights_enabled = std::option::Option::Some(v.into());
23253        self
23254    }
23255
23256    /// Sets or clears the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
23257    ///
23258    /// # Example
23259    /// ```ignore,no_run
23260    /// # use google_cloud_sql_v1::model::InsightsConfig;
23261    /// use wkt::BoolValue;
23262    /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(Some(BoolValue::default()/* use setters */));
23263    /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(None::<BoolValue>);
23264    /// ```
23265    pub fn set_or_clear_enhanced_query_insights_enabled<T>(
23266        mut self,
23267        v: std::option::Option<T>,
23268    ) -> Self
23269    where
23270        T: std::convert::Into<wkt::BoolValue>,
23271    {
23272        self.enhanced_query_insights_enabled = v.map(|x| x.into());
23273        self
23274    }
23275}
23276
23277impl wkt::message::Message for InsightsConfig {
23278    fn typename() -> &'static str {
23279        "type.googleapis.com/google.cloud.sql.v1.InsightsConfig"
23280    }
23281}
23282
23283/// Read-replica configuration specific to MySQL databases.
23284#[derive(Clone, Default, PartialEq)]
23285#[non_exhaustive]
23286pub struct MySqlReplicaConfiguration {
23287    /// Path to a SQL dump file in Google Cloud Storage from which the replica
23288    /// instance is to be created. The URI is in the form gs://bucketName/fileName.
23289    /// Compressed gzip files (.gz) are also supported.
23290    /// Dumps have the binlog co-ordinates from which replication
23291    /// begins. This can be accomplished by setting --master-data to 1 when using
23292    /// mysqldump.
23293    pub dump_file_path: std::string::String,
23294
23295    /// The username for the replication connection.
23296    pub username: std::string::String,
23297
23298    /// The password for the replication connection.
23299    pub password: std::string::String,
23300
23301    /// Seconds to wait between connect retries. MySQL's default is 60 seconds.
23302    pub connect_retry_interval: std::option::Option<wkt::Int32Value>,
23303
23304    /// Interval in milliseconds between replication heartbeats.
23305    pub master_heartbeat_period: std::option::Option<wkt::Int64Value>,
23306
23307    /// PEM representation of the trusted CA's x509 certificate.
23308    pub ca_certificate: std::string::String,
23309
23310    /// PEM representation of the replica's x509 certificate.
23311    pub client_certificate: std::string::String,
23312
23313    /// PEM representation of the replica's private key. The corresponding public
23314    /// key is encoded in the client's certificate.
23315    pub client_key: std::string::String,
23316
23317    /// A list of permissible ciphers to use for SSL encryption.
23318    pub ssl_cipher: std::string::String,
23319
23320    /// Whether or not to check the primary instance's Common Name value in the
23321    /// certificate that it sends during the SSL handshake.
23322    pub verify_server_certificate: std::option::Option<wkt::BoolValue>,
23323
23324    /// This is always `sql#mysqlReplicaConfiguration`.
23325    pub kind: std::string::String,
23326
23327    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23328}
23329
23330impl MySqlReplicaConfiguration {
23331    pub fn new() -> Self {
23332        std::default::Default::default()
23333    }
23334
23335    /// Sets the value of [dump_file_path][crate::model::MySqlReplicaConfiguration::dump_file_path].
23336    ///
23337    /// # Example
23338    /// ```ignore,no_run
23339    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23340    /// let x = MySqlReplicaConfiguration::new().set_dump_file_path("example");
23341    /// ```
23342    pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23343        self.dump_file_path = v.into();
23344        self
23345    }
23346
23347    /// Sets the value of [username][crate::model::MySqlReplicaConfiguration::username].
23348    ///
23349    /// # Example
23350    /// ```ignore,no_run
23351    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23352    /// let x = MySqlReplicaConfiguration::new().set_username("example");
23353    /// ```
23354    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23355        self.username = v.into();
23356        self
23357    }
23358
23359    /// Sets the value of [password][crate::model::MySqlReplicaConfiguration::password].
23360    ///
23361    /// # Example
23362    /// ```ignore,no_run
23363    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23364    /// let x = MySqlReplicaConfiguration::new().set_password("example");
23365    /// ```
23366    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23367        self.password = v.into();
23368        self
23369    }
23370
23371    /// Sets the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
23372    ///
23373    /// # Example
23374    /// ```ignore,no_run
23375    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23376    /// use wkt::Int32Value;
23377    /// let x = MySqlReplicaConfiguration::new().set_connect_retry_interval(Int32Value::default()/* use setters */);
23378    /// ```
23379    pub fn set_connect_retry_interval<T>(mut self, v: T) -> Self
23380    where
23381        T: std::convert::Into<wkt::Int32Value>,
23382    {
23383        self.connect_retry_interval = std::option::Option::Some(v.into());
23384        self
23385    }
23386
23387    /// Sets or clears the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
23388    ///
23389    /// # Example
23390    /// ```ignore,no_run
23391    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23392    /// use wkt::Int32Value;
23393    /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(Some(Int32Value::default()/* use setters */));
23394    /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(None::<Int32Value>);
23395    /// ```
23396    pub fn set_or_clear_connect_retry_interval<T>(mut self, v: std::option::Option<T>) -> Self
23397    where
23398        T: std::convert::Into<wkt::Int32Value>,
23399    {
23400        self.connect_retry_interval = v.map(|x| x.into());
23401        self
23402    }
23403
23404    /// Sets the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
23405    ///
23406    /// # Example
23407    /// ```ignore,no_run
23408    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23409    /// use wkt::Int64Value;
23410    /// let x = MySqlReplicaConfiguration::new().set_master_heartbeat_period(Int64Value::default()/* use setters */);
23411    /// ```
23412    pub fn set_master_heartbeat_period<T>(mut self, v: T) -> Self
23413    where
23414        T: std::convert::Into<wkt::Int64Value>,
23415    {
23416        self.master_heartbeat_period = std::option::Option::Some(v.into());
23417        self
23418    }
23419
23420    /// Sets or clears the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
23421    ///
23422    /// # Example
23423    /// ```ignore,no_run
23424    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23425    /// use wkt::Int64Value;
23426    /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(Some(Int64Value::default()/* use setters */));
23427    /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(None::<Int64Value>);
23428    /// ```
23429    pub fn set_or_clear_master_heartbeat_period<T>(mut self, v: std::option::Option<T>) -> Self
23430    where
23431        T: std::convert::Into<wkt::Int64Value>,
23432    {
23433        self.master_heartbeat_period = v.map(|x| x.into());
23434        self
23435    }
23436
23437    /// Sets the value of [ca_certificate][crate::model::MySqlReplicaConfiguration::ca_certificate].
23438    ///
23439    /// # Example
23440    /// ```ignore,no_run
23441    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23442    /// let x = MySqlReplicaConfiguration::new().set_ca_certificate("example");
23443    /// ```
23444    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23445        self.ca_certificate = v.into();
23446        self
23447    }
23448
23449    /// Sets the value of [client_certificate][crate::model::MySqlReplicaConfiguration::client_certificate].
23450    ///
23451    /// # Example
23452    /// ```ignore,no_run
23453    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23454    /// let x = MySqlReplicaConfiguration::new().set_client_certificate("example");
23455    /// ```
23456    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
23457        mut self,
23458        v: T,
23459    ) -> Self {
23460        self.client_certificate = v.into();
23461        self
23462    }
23463
23464    /// Sets the value of [client_key][crate::model::MySqlReplicaConfiguration::client_key].
23465    ///
23466    /// # Example
23467    /// ```ignore,no_run
23468    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23469    /// let x = MySqlReplicaConfiguration::new().set_client_key("example");
23470    /// ```
23471    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23472        self.client_key = v.into();
23473        self
23474    }
23475
23476    /// Sets the value of [ssl_cipher][crate::model::MySqlReplicaConfiguration::ssl_cipher].
23477    ///
23478    /// # Example
23479    /// ```ignore,no_run
23480    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23481    /// let x = MySqlReplicaConfiguration::new().set_ssl_cipher("example");
23482    /// ```
23483    pub fn set_ssl_cipher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23484        self.ssl_cipher = v.into();
23485        self
23486    }
23487
23488    /// Sets the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
23489    ///
23490    /// # Example
23491    /// ```ignore,no_run
23492    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23493    /// use wkt::BoolValue;
23494    /// let x = MySqlReplicaConfiguration::new().set_verify_server_certificate(BoolValue::default()/* use setters */);
23495    /// ```
23496    pub fn set_verify_server_certificate<T>(mut self, v: T) -> Self
23497    where
23498        T: std::convert::Into<wkt::BoolValue>,
23499    {
23500        self.verify_server_certificate = std::option::Option::Some(v.into());
23501        self
23502    }
23503
23504    /// Sets or clears the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
23505    ///
23506    /// # Example
23507    /// ```ignore,no_run
23508    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23509    /// use wkt::BoolValue;
23510    /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(Some(BoolValue::default()/* use setters */));
23511    /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(None::<BoolValue>);
23512    /// ```
23513    pub fn set_or_clear_verify_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
23514    where
23515        T: std::convert::Into<wkt::BoolValue>,
23516    {
23517        self.verify_server_certificate = v.map(|x| x.into());
23518        self
23519    }
23520
23521    /// Sets the value of [kind][crate::model::MySqlReplicaConfiguration::kind].
23522    ///
23523    /// # Example
23524    /// ```ignore,no_run
23525    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23526    /// let x = MySqlReplicaConfiguration::new().set_kind("example");
23527    /// ```
23528    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23529        self.kind = v.into();
23530        self
23531    }
23532}
23533
23534impl wkt::message::Message for MySqlReplicaConfiguration {
23535    fn typename() -> &'static str {
23536        "type.googleapis.com/google.cloud.sql.v1.MySqlReplicaConfiguration"
23537    }
23538}
23539
23540/// Disk encryption configuration for an instance.
23541#[derive(Clone, Default, PartialEq)]
23542#[non_exhaustive]
23543pub struct DiskEncryptionConfiguration {
23544    /// Resource name of KMS key for disk encryption
23545    pub kms_key_name: std::string::String,
23546
23547    /// This is always `sql#diskEncryptionConfiguration`.
23548    pub kind: std::string::String,
23549
23550    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23551}
23552
23553impl DiskEncryptionConfiguration {
23554    pub fn new() -> Self {
23555        std::default::Default::default()
23556    }
23557
23558    /// Sets the value of [kms_key_name][crate::model::DiskEncryptionConfiguration::kms_key_name].
23559    ///
23560    /// # Example
23561    /// ```ignore,no_run
23562    /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
23563    /// let x = DiskEncryptionConfiguration::new().set_kms_key_name("example");
23564    /// ```
23565    pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23566        self.kms_key_name = v.into();
23567        self
23568    }
23569
23570    /// Sets the value of [kind][crate::model::DiskEncryptionConfiguration::kind].
23571    ///
23572    /// # Example
23573    /// ```ignore,no_run
23574    /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
23575    /// let x = DiskEncryptionConfiguration::new().set_kind("example");
23576    /// ```
23577    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23578        self.kind = v.into();
23579        self
23580    }
23581}
23582
23583impl wkt::message::Message for DiskEncryptionConfiguration {
23584    fn typename() -> &'static str {
23585        "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionConfiguration"
23586    }
23587}
23588
23589/// Disk encryption status for an instance.
23590#[derive(Clone, Default, PartialEq)]
23591#[non_exhaustive]
23592pub struct DiskEncryptionStatus {
23593    /// KMS key version used to encrypt the Cloud SQL instance resource
23594    pub kms_key_version_name: std::string::String,
23595
23596    /// This is always `sql#diskEncryptionStatus`.
23597    pub kind: std::string::String,
23598
23599    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23600}
23601
23602impl DiskEncryptionStatus {
23603    pub fn new() -> Self {
23604        std::default::Default::default()
23605    }
23606
23607    /// Sets the value of [kms_key_version_name][crate::model::DiskEncryptionStatus::kms_key_version_name].
23608    ///
23609    /// # Example
23610    /// ```ignore,no_run
23611    /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
23612    /// let x = DiskEncryptionStatus::new().set_kms_key_version_name("example");
23613    /// ```
23614    pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
23615        mut self,
23616        v: T,
23617    ) -> Self {
23618        self.kms_key_version_name = v.into();
23619        self
23620    }
23621
23622    /// Sets the value of [kind][crate::model::DiskEncryptionStatus::kind].
23623    ///
23624    /// # Example
23625    /// ```ignore,no_run
23626    /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
23627    /// let x = DiskEncryptionStatus::new().set_kind("example");
23628    /// ```
23629    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23630        self.kind = v.into();
23631        self
23632    }
23633}
23634
23635impl wkt::message::Message for DiskEncryptionStatus {
23636    fn typename() -> &'static str {
23637        "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionStatus"
23638    }
23639}
23640
23641/// Database instance IP mapping
23642#[derive(Clone, Default, PartialEq)]
23643#[non_exhaustive]
23644pub struct IpMapping {
23645    /// The type of this IP address. A `PRIMARY` address is a public address that
23646    /// can accept incoming connections. A `PRIVATE` address is a private address
23647    /// that can accept incoming connections. An `OUTGOING` address is the source
23648    /// address of connections originating from the instance, if supported.
23649    pub r#type: crate::model::SqlIpAddressType,
23650
23651    /// The IP address assigned.
23652    pub ip_address: std::string::String,
23653
23654    /// The due time for this IP to be retired in
23655    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
23656    /// `2012-11-15T16:19:00.094Z`. This field is only available when
23657    /// the IP is scheduled to be retired.
23658    pub time_to_retire: std::option::Option<wkt::Timestamp>,
23659
23660    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23661}
23662
23663impl IpMapping {
23664    pub fn new() -> Self {
23665        std::default::Default::default()
23666    }
23667
23668    /// Sets the value of [r#type][crate::model::IpMapping::type].
23669    ///
23670    /// # Example
23671    /// ```ignore,no_run
23672    /// # use google_cloud_sql_v1::model::IpMapping;
23673    /// use google_cloud_sql_v1::model::SqlIpAddressType;
23674    /// let x0 = IpMapping::new().set_type(SqlIpAddressType::Primary);
23675    /// let x1 = IpMapping::new().set_type(SqlIpAddressType::Outgoing);
23676    /// let x2 = IpMapping::new().set_type(SqlIpAddressType::Private);
23677    /// ```
23678    pub fn set_type<T: std::convert::Into<crate::model::SqlIpAddressType>>(mut self, v: T) -> Self {
23679        self.r#type = v.into();
23680        self
23681    }
23682
23683    /// Sets the value of [ip_address][crate::model::IpMapping::ip_address].
23684    ///
23685    /// # Example
23686    /// ```ignore,no_run
23687    /// # use google_cloud_sql_v1::model::IpMapping;
23688    /// let x = IpMapping::new().set_ip_address("example");
23689    /// ```
23690    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23691        self.ip_address = v.into();
23692        self
23693    }
23694
23695    /// Sets the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
23696    ///
23697    /// # Example
23698    /// ```ignore,no_run
23699    /// # use google_cloud_sql_v1::model::IpMapping;
23700    /// use wkt::Timestamp;
23701    /// let x = IpMapping::new().set_time_to_retire(Timestamp::default()/* use setters */);
23702    /// ```
23703    pub fn set_time_to_retire<T>(mut self, v: T) -> Self
23704    where
23705        T: std::convert::Into<wkt::Timestamp>,
23706    {
23707        self.time_to_retire = std::option::Option::Some(v.into());
23708        self
23709    }
23710
23711    /// Sets or clears the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
23712    ///
23713    /// # Example
23714    /// ```ignore,no_run
23715    /// # use google_cloud_sql_v1::model::IpMapping;
23716    /// use wkt::Timestamp;
23717    /// let x = IpMapping::new().set_or_clear_time_to_retire(Some(Timestamp::default()/* use setters */));
23718    /// let x = IpMapping::new().set_or_clear_time_to_retire(None::<Timestamp>);
23719    /// ```
23720    pub fn set_or_clear_time_to_retire<T>(mut self, v: std::option::Option<T>) -> Self
23721    where
23722        T: std::convert::Into<wkt::Timestamp>,
23723    {
23724        self.time_to_retire = v.map(|x| x.into());
23725        self
23726    }
23727}
23728
23729impl wkt::message::Message for IpMapping {
23730    fn typename() -> &'static str {
23731        "type.googleapis.com/google.cloud.sql.v1.IpMapping"
23732    }
23733}
23734
23735/// The sub operation type based on the operation type.
23736#[derive(Clone, Default, PartialEq)]
23737#[non_exhaustive]
23738pub struct SqlSubOperationType {
23739    /// Sub operation details corresponding to the operation type.
23740    pub sub_operation_details:
23741        std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
23742
23743    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23744}
23745
23746impl SqlSubOperationType {
23747    pub fn new() -> Self {
23748        std::default::Default::default()
23749    }
23750
23751    /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details].
23752    ///
23753    /// Note that all the setters affecting `sub_operation_details` are mutually
23754    /// exclusive.
23755    ///
23756    /// # Example
23757    /// ```ignore,no_run
23758    /// # use google_cloud_sql_v1::model::SqlSubOperationType;
23759    /// use google_cloud_sql_v1::model::SqlMaintenanceType;
23760    /// let x0 = SqlSubOperationType::new().set_sub_operation_details(Some(
23761    ///     google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceMaintenance)));
23762    /// let x1 = SqlSubOperationType::new().set_sub_operation_details(Some(
23763    ///     google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::ReplicaIncludedMaintenance)));
23764    /// let x2 = SqlSubOperationType::new().set_sub_operation_details(Some(
23765    ///     google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceSelfServiceMaintenance)));
23766    /// ```
23767    pub fn set_sub_operation_details<
23768        T: std::convert::Into<
23769                std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
23770            >,
23771    >(
23772        mut self,
23773        v: T,
23774    ) -> Self {
23775        self.sub_operation_details = v.into();
23776        self
23777    }
23778
23779    /// The value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
23780    /// if it holds a `MaintenanceType`, `None` if the field is not set or
23781    /// holds a different branch.
23782    pub fn maintenance_type(&self) -> std::option::Option<&crate::model::SqlMaintenanceType> {
23783        #[allow(unreachable_patterns)]
23784        self.sub_operation_details.as_ref().and_then(|v| match v {
23785            crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v) => {
23786                std::option::Option::Some(v)
23787            }
23788            _ => std::option::Option::None,
23789        })
23790    }
23791
23792    /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
23793    /// to hold a `MaintenanceType`.
23794    ///
23795    /// Note that all the setters affecting `sub_operation_details` are
23796    /// mutually exclusive.
23797    ///
23798    /// # Example
23799    /// ```ignore,no_run
23800    /// # use google_cloud_sql_v1::model::SqlSubOperationType;
23801    /// use google_cloud_sql_v1::model::SqlMaintenanceType;
23802    /// let x0 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceMaintenance);
23803    /// let x1 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::ReplicaIncludedMaintenance);
23804    /// let x2 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceSelfServiceMaintenance);
23805    /// assert!(x0.maintenance_type().is_some());
23806    /// assert!(x1.maintenance_type().is_some());
23807    /// assert!(x2.maintenance_type().is_some());
23808    /// ```
23809    pub fn set_maintenance_type<T: std::convert::Into<crate::model::SqlMaintenanceType>>(
23810        mut self,
23811        v: T,
23812    ) -> Self {
23813        self.sub_operation_details = std::option::Option::Some(
23814            crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v.into()),
23815        );
23816        self
23817    }
23818}
23819
23820impl wkt::message::Message for SqlSubOperationType {
23821    fn typename() -> &'static str {
23822        "type.googleapis.com/google.cloud.sql.v1.SqlSubOperationType"
23823    }
23824}
23825
23826/// Defines additional types related to [SqlSubOperationType].
23827pub mod sql_sub_operation_type {
23828    #[allow(unused_imports)]
23829    use super::*;
23830
23831    /// Sub operation details corresponding to the operation type.
23832    #[derive(Clone, Debug, PartialEq)]
23833    #[non_exhaustive]
23834    pub enum SubOperationDetails {
23835        /// The type of maintenance to be performed on the instance.
23836        MaintenanceType(crate::model::SqlMaintenanceType),
23837    }
23838}
23839
23840/// An Operation resource.&nbsp;For successful operations that return an
23841/// Operation resource, only the fields relevant to the operation are populated
23842/// in the resource.
23843#[derive(Clone, Default, PartialEq)]
23844#[non_exhaustive]
23845pub struct Operation {
23846    /// This is always `sql#operation`.
23847    pub kind: std::string::String,
23848
23849    pub target_link: std::string::String,
23850
23851    /// The status of an operation.
23852    pub status: crate::model::operation::SqlOperationStatus,
23853
23854    /// The email address of the user who initiated this operation.
23855    pub user: std::string::String,
23856
23857    /// The time this operation was enqueued in UTC timezone in [RFC
23858    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
23859    /// `2012-11-15T16:19:00.094Z`.
23860    pub insert_time: std::option::Option<wkt::Timestamp>,
23861
23862    /// The time this operation actually started in UTC timezone in [RFC
23863    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
23864    /// `2012-11-15T16:19:00.094Z`.
23865    pub start_time: std::option::Option<wkt::Timestamp>,
23866
23867    /// The time this operation finished in UTC timezone in [RFC
23868    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
23869    /// `2012-11-15T16:19:00.094Z`.
23870    pub end_time: std::option::Option<wkt::Timestamp>,
23871
23872    /// If errors occurred during processing of this operation, this field will be
23873    /// populated.
23874    pub error: std::option::Option<crate::model::OperationErrors>,
23875
23876    /// An Admin API warning message.
23877    pub api_warning: std::option::Option<crate::model::ApiWarning>,
23878
23879    /// The type of the operation. Valid values are:
23880    ///
23881    /// * `CREATE`
23882    /// * `DELETE`
23883    /// * `UPDATE`
23884    /// * `RESTART`
23885    /// * `IMPORT`
23886    /// * `EXPORT`
23887    /// * `BACKUP_VOLUME`
23888    /// * `RESTORE_VOLUME`
23889    /// * `CREATE_USER`
23890    /// * `DELETE_USER`
23891    /// * `CREATE_DATABASE`
23892    /// * `DELETE_DATABASE`
23893    pub operation_type: crate::model::operation::SqlOperationType,
23894
23895    /// The context for import operation, if applicable.
23896    pub import_context: std::option::Option<crate::model::ImportContext>,
23897
23898    /// The context for export operation, if applicable.
23899    pub export_context: std::option::Option<crate::model::ExportContext>,
23900
23901    /// The context for backup operation, if applicable.
23902    pub backup_context: std::option::Option<crate::model::BackupContext>,
23903
23904    /// This field is only populated when the operation_type is
23905    /// PRE_CHECK_MAJOR_VERSION_UPGRADE.
23906    /// The PreCheckMajorVersionUpgradeContext message itself contains the details
23907    /// for that pre-check, such as the target database version for the upgrade
23908    /// and the results of the check (including any warnings or errors found).
23909    pub pre_check_major_version_upgrade_context:
23910        std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
23911
23912    /// An identifier that uniquely identifies the operation. You can use this
23913    /// identifier to retrieve the Operations resource that has information about
23914    /// the operation.
23915    pub name: std::string::String,
23916
23917    /// Name of the resource on which this operation runs.
23918    pub target_id: std::string::String,
23919
23920    /// The URI of this resource.
23921    pub self_link: std::string::String,
23922
23923    /// The project ID of the target instance related to this operation.
23924    pub target_project: std::string::String,
23925
23926    /// The context for acquire SSRS lease operation, if applicable.
23927    pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
23928
23929    /// Optional. The sub operation based on the operation type.
23930    pub sub_operation_type: std::option::Option<crate::model::SqlSubOperationType>,
23931
23932    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23933}
23934
23935impl Operation {
23936    pub fn new() -> Self {
23937        std::default::Default::default()
23938    }
23939
23940    /// Sets the value of [kind][crate::model::Operation::kind].
23941    ///
23942    /// # Example
23943    /// ```ignore,no_run
23944    /// # use google_cloud_sql_v1::model::Operation;
23945    /// let x = Operation::new().set_kind("example");
23946    /// ```
23947    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23948        self.kind = v.into();
23949        self
23950    }
23951
23952    /// Sets the value of [target_link][crate::model::Operation::target_link].
23953    ///
23954    /// # Example
23955    /// ```ignore,no_run
23956    /// # use google_cloud_sql_v1::model::Operation;
23957    /// let x = Operation::new().set_target_link("example");
23958    /// ```
23959    pub fn set_target_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23960        self.target_link = v.into();
23961        self
23962    }
23963
23964    /// Sets the value of [status][crate::model::Operation::status].
23965    ///
23966    /// # Example
23967    /// ```ignore,no_run
23968    /// # use google_cloud_sql_v1::model::Operation;
23969    /// use google_cloud_sql_v1::model::operation::SqlOperationStatus;
23970    /// let x0 = Operation::new().set_status(SqlOperationStatus::Pending);
23971    /// let x1 = Operation::new().set_status(SqlOperationStatus::Running);
23972    /// let x2 = Operation::new().set_status(SqlOperationStatus::Done);
23973    /// ```
23974    pub fn set_status<T: std::convert::Into<crate::model::operation::SqlOperationStatus>>(
23975        mut self,
23976        v: T,
23977    ) -> Self {
23978        self.status = v.into();
23979        self
23980    }
23981
23982    /// Sets the value of [user][crate::model::Operation::user].
23983    ///
23984    /// # Example
23985    /// ```ignore,no_run
23986    /// # use google_cloud_sql_v1::model::Operation;
23987    /// let x = Operation::new().set_user("example");
23988    /// ```
23989    pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23990        self.user = v.into();
23991        self
23992    }
23993
23994    /// Sets the value of [insert_time][crate::model::Operation::insert_time].
23995    ///
23996    /// # Example
23997    /// ```ignore,no_run
23998    /// # use google_cloud_sql_v1::model::Operation;
23999    /// use wkt::Timestamp;
24000    /// let x = Operation::new().set_insert_time(Timestamp::default()/* use setters */);
24001    /// ```
24002    pub fn set_insert_time<T>(mut self, v: T) -> Self
24003    where
24004        T: std::convert::Into<wkt::Timestamp>,
24005    {
24006        self.insert_time = std::option::Option::Some(v.into());
24007        self
24008    }
24009
24010    /// Sets or clears the value of [insert_time][crate::model::Operation::insert_time].
24011    ///
24012    /// # Example
24013    /// ```ignore,no_run
24014    /// # use google_cloud_sql_v1::model::Operation;
24015    /// use wkt::Timestamp;
24016    /// let x = Operation::new().set_or_clear_insert_time(Some(Timestamp::default()/* use setters */));
24017    /// let x = Operation::new().set_or_clear_insert_time(None::<Timestamp>);
24018    /// ```
24019    pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
24020    where
24021        T: std::convert::Into<wkt::Timestamp>,
24022    {
24023        self.insert_time = v.map(|x| x.into());
24024        self
24025    }
24026
24027    /// Sets the value of [start_time][crate::model::Operation::start_time].
24028    ///
24029    /// # Example
24030    /// ```ignore,no_run
24031    /// # use google_cloud_sql_v1::model::Operation;
24032    /// use wkt::Timestamp;
24033    /// let x = Operation::new().set_start_time(Timestamp::default()/* use setters */);
24034    /// ```
24035    pub fn set_start_time<T>(mut self, v: T) -> Self
24036    where
24037        T: std::convert::Into<wkt::Timestamp>,
24038    {
24039        self.start_time = std::option::Option::Some(v.into());
24040        self
24041    }
24042
24043    /// Sets or clears the value of [start_time][crate::model::Operation::start_time].
24044    ///
24045    /// # Example
24046    /// ```ignore,no_run
24047    /// # use google_cloud_sql_v1::model::Operation;
24048    /// use wkt::Timestamp;
24049    /// let x = Operation::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
24050    /// let x = Operation::new().set_or_clear_start_time(None::<Timestamp>);
24051    /// ```
24052    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
24053    where
24054        T: std::convert::Into<wkt::Timestamp>,
24055    {
24056        self.start_time = v.map(|x| x.into());
24057        self
24058    }
24059
24060    /// Sets the value of [end_time][crate::model::Operation::end_time].
24061    ///
24062    /// # Example
24063    /// ```ignore,no_run
24064    /// # use google_cloud_sql_v1::model::Operation;
24065    /// use wkt::Timestamp;
24066    /// let x = Operation::new().set_end_time(Timestamp::default()/* use setters */);
24067    /// ```
24068    pub fn set_end_time<T>(mut self, v: T) -> Self
24069    where
24070        T: std::convert::Into<wkt::Timestamp>,
24071    {
24072        self.end_time = std::option::Option::Some(v.into());
24073        self
24074    }
24075
24076    /// Sets or clears the value of [end_time][crate::model::Operation::end_time].
24077    ///
24078    /// # Example
24079    /// ```ignore,no_run
24080    /// # use google_cloud_sql_v1::model::Operation;
24081    /// use wkt::Timestamp;
24082    /// let x = Operation::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
24083    /// let x = Operation::new().set_or_clear_end_time(None::<Timestamp>);
24084    /// ```
24085    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
24086    where
24087        T: std::convert::Into<wkt::Timestamp>,
24088    {
24089        self.end_time = v.map(|x| x.into());
24090        self
24091    }
24092
24093    /// Sets the value of [error][crate::model::Operation::error].
24094    ///
24095    /// # Example
24096    /// ```ignore,no_run
24097    /// # use google_cloud_sql_v1::model::Operation;
24098    /// use google_cloud_sql_v1::model::OperationErrors;
24099    /// let x = Operation::new().set_error(OperationErrors::default()/* use setters */);
24100    /// ```
24101    pub fn set_error<T>(mut self, v: T) -> Self
24102    where
24103        T: std::convert::Into<crate::model::OperationErrors>,
24104    {
24105        self.error = std::option::Option::Some(v.into());
24106        self
24107    }
24108
24109    /// Sets or clears the value of [error][crate::model::Operation::error].
24110    ///
24111    /// # Example
24112    /// ```ignore,no_run
24113    /// # use google_cloud_sql_v1::model::Operation;
24114    /// use google_cloud_sql_v1::model::OperationErrors;
24115    /// let x = Operation::new().set_or_clear_error(Some(OperationErrors::default()/* use setters */));
24116    /// let x = Operation::new().set_or_clear_error(None::<OperationErrors>);
24117    /// ```
24118    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
24119    where
24120        T: std::convert::Into<crate::model::OperationErrors>,
24121    {
24122        self.error = v.map(|x| x.into());
24123        self
24124    }
24125
24126    /// Sets the value of [api_warning][crate::model::Operation::api_warning].
24127    ///
24128    /// # Example
24129    /// ```ignore,no_run
24130    /// # use google_cloud_sql_v1::model::Operation;
24131    /// use google_cloud_sql_v1::model::ApiWarning;
24132    /// let x = Operation::new().set_api_warning(ApiWarning::default()/* use setters */);
24133    /// ```
24134    pub fn set_api_warning<T>(mut self, v: T) -> Self
24135    where
24136        T: std::convert::Into<crate::model::ApiWarning>,
24137    {
24138        self.api_warning = std::option::Option::Some(v.into());
24139        self
24140    }
24141
24142    /// Sets or clears the value of [api_warning][crate::model::Operation::api_warning].
24143    ///
24144    /// # Example
24145    /// ```ignore,no_run
24146    /// # use google_cloud_sql_v1::model::Operation;
24147    /// use google_cloud_sql_v1::model::ApiWarning;
24148    /// let x = Operation::new().set_or_clear_api_warning(Some(ApiWarning::default()/* use setters */));
24149    /// let x = Operation::new().set_or_clear_api_warning(None::<ApiWarning>);
24150    /// ```
24151    pub fn set_or_clear_api_warning<T>(mut self, v: std::option::Option<T>) -> Self
24152    where
24153        T: std::convert::Into<crate::model::ApiWarning>,
24154    {
24155        self.api_warning = v.map(|x| x.into());
24156        self
24157    }
24158
24159    /// Sets the value of [operation_type][crate::model::Operation::operation_type].
24160    ///
24161    /// # Example
24162    /// ```ignore,no_run
24163    /// # use google_cloud_sql_v1::model::Operation;
24164    /// use google_cloud_sql_v1::model::operation::SqlOperationType;
24165    /// let x0 = Operation::new().set_operation_type(SqlOperationType::Import);
24166    /// let x1 = Operation::new().set_operation_type(SqlOperationType::Export);
24167    /// let x2 = Operation::new().set_operation_type(SqlOperationType::Create);
24168    /// ```
24169    pub fn set_operation_type<T: std::convert::Into<crate::model::operation::SqlOperationType>>(
24170        mut self,
24171        v: T,
24172    ) -> Self {
24173        self.operation_type = v.into();
24174        self
24175    }
24176
24177    /// Sets the value of [import_context][crate::model::Operation::import_context].
24178    ///
24179    /// # Example
24180    /// ```ignore,no_run
24181    /// # use google_cloud_sql_v1::model::Operation;
24182    /// use google_cloud_sql_v1::model::ImportContext;
24183    /// let x = Operation::new().set_import_context(ImportContext::default()/* use setters */);
24184    /// ```
24185    pub fn set_import_context<T>(mut self, v: T) -> Self
24186    where
24187        T: std::convert::Into<crate::model::ImportContext>,
24188    {
24189        self.import_context = std::option::Option::Some(v.into());
24190        self
24191    }
24192
24193    /// Sets or clears the value of [import_context][crate::model::Operation::import_context].
24194    ///
24195    /// # Example
24196    /// ```ignore,no_run
24197    /// # use google_cloud_sql_v1::model::Operation;
24198    /// use google_cloud_sql_v1::model::ImportContext;
24199    /// let x = Operation::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
24200    /// let x = Operation::new().set_or_clear_import_context(None::<ImportContext>);
24201    /// ```
24202    pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
24203    where
24204        T: std::convert::Into<crate::model::ImportContext>,
24205    {
24206        self.import_context = v.map(|x| x.into());
24207        self
24208    }
24209
24210    /// Sets the value of [export_context][crate::model::Operation::export_context].
24211    ///
24212    /// # Example
24213    /// ```ignore,no_run
24214    /// # use google_cloud_sql_v1::model::Operation;
24215    /// use google_cloud_sql_v1::model::ExportContext;
24216    /// let x = Operation::new().set_export_context(ExportContext::default()/* use setters */);
24217    /// ```
24218    pub fn set_export_context<T>(mut self, v: T) -> Self
24219    where
24220        T: std::convert::Into<crate::model::ExportContext>,
24221    {
24222        self.export_context = std::option::Option::Some(v.into());
24223        self
24224    }
24225
24226    /// Sets or clears the value of [export_context][crate::model::Operation::export_context].
24227    ///
24228    /// # Example
24229    /// ```ignore,no_run
24230    /// # use google_cloud_sql_v1::model::Operation;
24231    /// use google_cloud_sql_v1::model::ExportContext;
24232    /// let x = Operation::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
24233    /// let x = Operation::new().set_or_clear_export_context(None::<ExportContext>);
24234    /// ```
24235    pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
24236    where
24237        T: std::convert::Into<crate::model::ExportContext>,
24238    {
24239        self.export_context = v.map(|x| x.into());
24240        self
24241    }
24242
24243    /// Sets the value of [backup_context][crate::model::Operation::backup_context].
24244    ///
24245    /// # Example
24246    /// ```ignore,no_run
24247    /// # use google_cloud_sql_v1::model::Operation;
24248    /// use google_cloud_sql_v1::model::BackupContext;
24249    /// let x = Operation::new().set_backup_context(BackupContext::default()/* use setters */);
24250    /// ```
24251    pub fn set_backup_context<T>(mut self, v: T) -> Self
24252    where
24253        T: std::convert::Into<crate::model::BackupContext>,
24254    {
24255        self.backup_context = std::option::Option::Some(v.into());
24256        self
24257    }
24258
24259    /// Sets or clears the value of [backup_context][crate::model::Operation::backup_context].
24260    ///
24261    /// # Example
24262    /// ```ignore,no_run
24263    /// # use google_cloud_sql_v1::model::Operation;
24264    /// use google_cloud_sql_v1::model::BackupContext;
24265    /// let x = Operation::new().set_or_clear_backup_context(Some(BackupContext::default()/* use setters */));
24266    /// let x = Operation::new().set_or_clear_backup_context(None::<BackupContext>);
24267    /// ```
24268    pub fn set_or_clear_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
24269    where
24270        T: std::convert::Into<crate::model::BackupContext>,
24271    {
24272        self.backup_context = v.map(|x| x.into());
24273        self
24274    }
24275
24276    /// Sets the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
24277    ///
24278    /// # Example
24279    /// ```ignore,no_run
24280    /// # use google_cloud_sql_v1::model::Operation;
24281    /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
24282    /// let x = Operation::new().set_pre_check_major_version_upgrade_context(PreCheckMajorVersionUpgradeContext::default()/* use setters */);
24283    /// ```
24284    pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
24285    where
24286        T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
24287    {
24288        self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
24289        self
24290    }
24291
24292    /// Sets or clears the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
24293    ///
24294    /// # Example
24295    /// ```ignore,no_run
24296    /// # use google_cloud_sql_v1::model::Operation;
24297    /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
24298    /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(Some(PreCheckMajorVersionUpgradeContext::default()/* use setters */));
24299    /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(None::<PreCheckMajorVersionUpgradeContext>);
24300    /// ```
24301    pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
24302        mut self,
24303        v: std::option::Option<T>,
24304    ) -> Self
24305    where
24306        T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
24307    {
24308        self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
24309        self
24310    }
24311
24312    /// Sets the value of [name][crate::model::Operation::name].
24313    ///
24314    /// # Example
24315    /// ```ignore,no_run
24316    /// # use google_cloud_sql_v1::model::Operation;
24317    /// let x = Operation::new().set_name("example");
24318    /// ```
24319    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24320        self.name = v.into();
24321        self
24322    }
24323
24324    /// Sets the value of [target_id][crate::model::Operation::target_id].
24325    ///
24326    /// # Example
24327    /// ```ignore,no_run
24328    /// # use google_cloud_sql_v1::model::Operation;
24329    /// let x = Operation::new().set_target_id("example");
24330    /// ```
24331    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24332        self.target_id = v.into();
24333        self
24334    }
24335
24336    /// Sets the value of [self_link][crate::model::Operation::self_link].
24337    ///
24338    /// # Example
24339    /// ```ignore,no_run
24340    /// # use google_cloud_sql_v1::model::Operation;
24341    /// let x = Operation::new().set_self_link("example");
24342    /// ```
24343    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24344        self.self_link = v.into();
24345        self
24346    }
24347
24348    /// Sets the value of [target_project][crate::model::Operation::target_project].
24349    ///
24350    /// # Example
24351    /// ```ignore,no_run
24352    /// # use google_cloud_sql_v1::model::Operation;
24353    /// let x = Operation::new().set_target_project("example");
24354    /// ```
24355    pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24356        self.target_project = v.into();
24357        self
24358    }
24359
24360    /// Sets the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
24361    ///
24362    /// # Example
24363    /// ```ignore,no_run
24364    /// # use google_cloud_sql_v1::model::Operation;
24365    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
24366    /// let x = Operation::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
24367    /// ```
24368    pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
24369    where
24370        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
24371    {
24372        self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
24373        self
24374    }
24375
24376    /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
24377    ///
24378    /// # Example
24379    /// ```ignore,no_run
24380    /// # use google_cloud_sql_v1::model::Operation;
24381    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
24382    /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
24383    /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
24384    /// ```
24385    pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
24386    where
24387        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
24388    {
24389        self.acquire_ssrs_lease_context = v.map(|x| x.into());
24390        self
24391    }
24392
24393    /// Sets the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
24394    ///
24395    /// # Example
24396    /// ```ignore,no_run
24397    /// # use google_cloud_sql_v1::model::Operation;
24398    /// use google_cloud_sql_v1::model::SqlSubOperationType;
24399    /// let x = Operation::new().set_sub_operation_type(SqlSubOperationType::default()/* use setters */);
24400    /// ```
24401    pub fn set_sub_operation_type<T>(mut self, v: T) -> Self
24402    where
24403        T: std::convert::Into<crate::model::SqlSubOperationType>,
24404    {
24405        self.sub_operation_type = std::option::Option::Some(v.into());
24406        self
24407    }
24408
24409    /// Sets or clears the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
24410    ///
24411    /// # Example
24412    /// ```ignore,no_run
24413    /// # use google_cloud_sql_v1::model::Operation;
24414    /// use google_cloud_sql_v1::model::SqlSubOperationType;
24415    /// let x = Operation::new().set_or_clear_sub_operation_type(Some(SqlSubOperationType::default()/* use setters */));
24416    /// let x = Operation::new().set_or_clear_sub_operation_type(None::<SqlSubOperationType>);
24417    /// ```
24418    pub fn set_or_clear_sub_operation_type<T>(mut self, v: std::option::Option<T>) -> Self
24419    where
24420        T: std::convert::Into<crate::model::SqlSubOperationType>,
24421    {
24422        self.sub_operation_type = v.map(|x| x.into());
24423        self
24424    }
24425}
24426
24427impl wkt::message::Message for Operation {
24428    fn typename() -> &'static str {
24429        "type.googleapis.com/google.cloud.sql.v1.Operation"
24430    }
24431}
24432
24433/// Defines additional types related to [Operation].
24434pub mod operation {
24435    #[allow(unused_imports)]
24436    use super::*;
24437
24438    /// The type of Cloud SQL operation.
24439    ///
24440    /// # Working with unknown values
24441    ///
24442    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24443    /// additional enum variants at any time. Adding new variants is not considered
24444    /// a breaking change. Applications should write their code in anticipation of:
24445    ///
24446    /// - New values appearing in future releases of the client library, **and**
24447    /// - New values received dynamically, without application changes.
24448    ///
24449    /// Please consult the [Working with enums] section in the user guide for some
24450    /// guidelines.
24451    ///
24452    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24453    #[derive(Clone, Debug, PartialEq)]
24454    #[non_exhaustive]
24455    pub enum SqlOperationType {
24456        /// Unknown operation type.
24457        Unspecified,
24458        /// Imports data into a Cloud SQL instance.
24459        Import,
24460        /// Exports data from a Cloud SQL instance to a Cloud Storage
24461        /// bucket.
24462        Export,
24463        /// Creates a new Cloud SQL instance.
24464        Create,
24465        /// Updates the settings of a Cloud SQL instance.
24466        Update,
24467        /// Deletes a Cloud SQL instance.
24468        Delete,
24469        /// Restarts the Cloud SQL instance.
24470        Restart,
24471        #[deprecated]
24472        Backup,
24473        #[deprecated]
24474        Snapshot,
24475        /// Performs instance backup.
24476        BackupVolume,
24477        /// Deletes an instance backup.
24478        DeleteVolume,
24479        /// Restores an instance backup.
24480        RestoreVolume,
24481        /// Injects a privileged user in mysql for MOB instances.
24482        InjectUser,
24483        /// Clones a Cloud SQL instance.
24484        Clone,
24485        /// Stops replication on a Cloud SQL read replica instance.
24486        StopReplica,
24487        /// Starts replication on a Cloud SQL read replica instance.
24488        StartReplica,
24489        /// Promotes a Cloud SQL replica instance.
24490        PromoteReplica,
24491        /// Creates a Cloud SQL replica instance.
24492        CreateReplica,
24493        /// Creates a new user in a Cloud SQL instance.
24494        CreateUser,
24495        /// Deletes a user from a Cloud SQL instance.
24496        DeleteUser,
24497        /// Updates an existing user in a Cloud SQL instance. If a user with the
24498        /// specified username doesn't exist, a new user is created.
24499        UpdateUser,
24500        /// Creates a database in the Cloud SQL instance.
24501        CreateDatabase,
24502        /// Deletes a database in the Cloud SQL instance.
24503        DeleteDatabase,
24504        /// Updates a database in the Cloud SQL instance.
24505        UpdateDatabase,
24506        /// Performs failover of an HA-enabled Cloud SQL
24507        /// failover replica.
24508        Failover,
24509        /// Deletes the backup taken by a backup run.
24510        DeleteBackup,
24511        RecreateReplica,
24512        /// Truncates a general or slow log table in MySQL.
24513        TruncateLog,
24514        /// Demotes the stand-alone instance to be a Cloud SQL
24515        /// read replica for an external database server.
24516        DemoteMaster,
24517        /// Indicates that the instance is currently in maintenance. Maintenance
24518        /// typically causes the instance to be unavailable for 1-3 minutes.
24519        Maintenance,
24520        /// This field is deprecated, and will be removed in future version of API.
24521        #[deprecated]
24522        EnablePrivateIp,
24523        #[deprecated]
24524        DeferMaintenance,
24525        /// Creates clone instance.
24526        #[deprecated]
24527        CreateClone,
24528        /// Reschedule maintenance to another time.
24529        RescheduleMaintenance,
24530        /// Starts external sync of a Cloud SQL EM replica to an external primary
24531        /// instance.
24532        StartExternalSync,
24533        /// Recovers logs from an instance's old data disk.
24534        LogCleanup,
24535        /// Performs auto-restart of an HA-enabled Cloud SQL database for auto
24536        /// recovery.
24537        AutoRestart,
24538        /// Re-encrypts CMEK instances with latest key version.
24539        Reencrypt,
24540        /// Switches the roles of the primary and replica pair. The target instance
24541        /// should be the replica.
24542        Switchover,
24543        /// Update a backup.
24544        UpdateBackup,
24545        /// Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
24546        AcquireSsrsLease,
24547        /// Release a lease for the setup of SQL Server Reporting Services (SSRS).
24548        ReleaseSsrsLease,
24549        /// Reconfigures old primary after a promote replica operation. Effect of a
24550        /// promote operation to the old primary is executed in this operation,
24551        /// asynchronously from the promote replica operation executed to the
24552        /// replica.
24553        ReconfigureOldPrimary,
24554        /// Indicates that the instance, its read replicas, and its cascading
24555        /// replicas are in maintenance. Maintenance typically gets initiated on
24556        /// groups of replicas first, followed by the primary instance. For each
24557        /// instance, maintenance typically causes the instance to be unavailable for
24558        /// 1-3 minutes.
24559        #[deprecated]
24560        ClusterMaintenance,
24561        /// Indicates that the instance (and any of its replicas) are currently in
24562        /// maintenance. This is initiated as a self-service request by using SSM.
24563        /// Maintenance typically causes the instance to be unavailable for 1-3
24564        /// minutes.
24565        #[deprecated]
24566        SelfServiceMaintenance,
24567        /// Switches a primary instance to a replica. This operation runs as part of
24568        /// a switchover operation to the original primary instance.
24569        SwitchoverToReplica,
24570        /// Updates the major version of a Cloud SQL instance.
24571        MajorVersionUpgrade,
24572        /// Deprecated: ADVANCED_BACKUP is deprecated. Use ENHANCED_BACKUP instead.
24573        #[deprecated]
24574        AdvancedBackup,
24575        /// Changes the BackupTier of a Cloud SQL instance.
24576        ManageBackup,
24577        /// Creates a backup for an Enhanced BackupTier Cloud SQL instance.
24578        EnhancedBackup,
24579        /// Repairs entire read pool or specified read pool nodes in the read pool.
24580        RepairReadPool,
24581        /// Creates a Cloud SQL read pool instance.
24582        CreateReadPool,
24583        /// If set, the enum was initialized with an unknown value.
24584        ///
24585        /// Applications can examine the value using [SqlOperationType::value] or
24586        /// [SqlOperationType::name].
24587        UnknownValue(sql_operation_type::UnknownValue),
24588    }
24589
24590    #[doc(hidden)]
24591    pub mod sql_operation_type {
24592        #[allow(unused_imports)]
24593        use super::*;
24594        #[derive(Clone, Debug, PartialEq)]
24595        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24596    }
24597
24598    impl SqlOperationType {
24599        /// Gets the enum value.
24600        ///
24601        /// Returns `None` if the enum contains an unknown value deserialized from
24602        /// the string representation of enums.
24603        pub fn value(&self) -> std::option::Option<i32> {
24604            match self {
24605                Self::Unspecified => std::option::Option::Some(0),
24606                Self::Import => std::option::Option::Some(1),
24607                Self::Export => std::option::Option::Some(2),
24608                Self::Create => std::option::Option::Some(3),
24609                Self::Update => std::option::Option::Some(4),
24610                Self::Delete => std::option::Option::Some(5),
24611                Self::Restart => std::option::Option::Some(6),
24612                Self::Backup => std::option::Option::Some(7),
24613                Self::Snapshot => std::option::Option::Some(8),
24614                Self::BackupVolume => std::option::Option::Some(9),
24615                Self::DeleteVolume => std::option::Option::Some(10),
24616                Self::RestoreVolume => std::option::Option::Some(11),
24617                Self::InjectUser => std::option::Option::Some(12),
24618                Self::Clone => std::option::Option::Some(14),
24619                Self::StopReplica => std::option::Option::Some(15),
24620                Self::StartReplica => std::option::Option::Some(16),
24621                Self::PromoteReplica => std::option::Option::Some(17),
24622                Self::CreateReplica => std::option::Option::Some(18),
24623                Self::CreateUser => std::option::Option::Some(19),
24624                Self::DeleteUser => std::option::Option::Some(20),
24625                Self::UpdateUser => std::option::Option::Some(21),
24626                Self::CreateDatabase => std::option::Option::Some(22),
24627                Self::DeleteDatabase => std::option::Option::Some(23),
24628                Self::UpdateDatabase => std::option::Option::Some(24),
24629                Self::Failover => std::option::Option::Some(25),
24630                Self::DeleteBackup => std::option::Option::Some(26),
24631                Self::RecreateReplica => std::option::Option::Some(27),
24632                Self::TruncateLog => std::option::Option::Some(28),
24633                Self::DemoteMaster => std::option::Option::Some(29),
24634                Self::Maintenance => std::option::Option::Some(30),
24635                Self::EnablePrivateIp => std::option::Option::Some(31),
24636                Self::DeferMaintenance => std::option::Option::Some(32),
24637                Self::CreateClone => std::option::Option::Some(33),
24638                Self::RescheduleMaintenance => std::option::Option::Some(34),
24639                Self::StartExternalSync => std::option::Option::Some(35),
24640                Self::LogCleanup => std::option::Option::Some(36),
24641                Self::AutoRestart => std::option::Option::Some(37),
24642                Self::Reencrypt => std::option::Option::Some(38),
24643                Self::Switchover => std::option::Option::Some(39),
24644                Self::UpdateBackup => std::option::Option::Some(40),
24645                Self::AcquireSsrsLease => std::option::Option::Some(42),
24646                Self::ReleaseSsrsLease => std::option::Option::Some(43),
24647                Self::ReconfigureOldPrimary => std::option::Option::Some(44),
24648                Self::ClusterMaintenance => std::option::Option::Some(45),
24649                Self::SelfServiceMaintenance => std::option::Option::Some(46),
24650                Self::SwitchoverToReplica => std::option::Option::Some(47),
24651                Self::MajorVersionUpgrade => std::option::Option::Some(48),
24652                Self::AdvancedBackup => std::option::Option::Some(49),
24653                Self::ManageBackup => std::option::Option::Some(50),
24654                Self::EnhancedBackup => std::option::Option::Some(51),
24655                Self::RepairReadPool => std::option::Option::Some(52),
24656                Self::CreateReadPool => std::option::Option::Some(53),
24657                Self::UnknownValue(u) => u.0.value(),
24658            }
24659        }
24660
24661        /// Gets the enum value as a string.
24662        ///
24663        /// Returns `None` if the enum contains an unknown value deserialized from
24664        /// the integer representation of enums.
24665        pub fn name(&self) -> std::option::Option<&str> {
24666            match self {
24667                Self::Unspecified => std::option::Option::Some("SQL_OPERATION_TYPE_UNSPECIFIED"),
24668                Self::Import => std::option::Option::Some("IMPORT"),
24669                Self::Export => std::option::Option::Some("EXPORT"),
24670                Self::Create => std::option::Option::Some("CREATE"),
24671                Self::Update => std::option::Option::Some("UPDATE"),
24672                Self::Delete => std::option::Option::Some("DELETE"),
24673                Self::Restart => std::option::Option::Some("RESTART"),
24674                Self::Backup => std::option::Option::Some("BACKUP"),
24675                Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
24676                Self::BackupVolume => std::option::Option::Some("BACKUP_VOLUME"),
24677                Self::DeleteVolume => std::option::Option::Some("DELETE_VOLUME"),
24678                Self::RestoreVolume => std::option::Option::Some("RESTORE_VOLUME"),
24679                Self::InjectUser => std::option::Option::Some("INJECT_USER"),
24680                Self::Clone => std::option::Option::Some("CLONE"),
24681                Self::StopReplica => std::option::Option::Some("STOP_REPLICA"),
24682                Self::StartReplica => std::option::Option::Some("START_REPLICA"),
24683                Self::PromoteReplica => std::option::Option::Some("PROMOTE_REPLICA"),
24684                Self::CreateReplica => std::option::Option::Some("CREATE_REPLICA"),
24685                Self::CreateUser => std::option::Option::Some("CREATE_USER"),
24686                Self::DeleteUser => std::option::Option::Some("DELETE_USER"),
24687                Self::UpdateUser => std::option::Option::Some("UPDATE_USER"),
24688                Self::CreateDatabase => std::option::Option::Some("CREATE_DATABASE"),
24689                Self::DeleteDatabase => std::option::Option::Some("DELETE_DATABASE"),
24690                Self::UpdateDatabase => std::option::Option::Some("UPDATE_DATABASE"),
24691                Self::Failover => std::option::Option::Some("FAILOVER"),
24692                Self::DeleteBackup => std::option::Option::Some("DELETE_BACKUP"),
24693                Self::RecreateReplica => std::option::Option::Some("RECREATE_REPLICA"),
24694                Self::TruncateLog => std::option::Option::Some("TRUNCATE_LOG"),
24695                Self::DemoteMaster => std::option::Option::Some("DEMOTE_MASTER"),
24696                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
24697                Self::EnablePrivateIp => std::option::Option::Some("ENABLE_PRIVATE_IP"),
24698                Self::DeferMaintenance => std::option::Option::Some("DEFER_MAINTENANCE"),
24699                Self::CreateClone => std::option::Option::Some("CREATE_CLONE"),
24700                Self::RescheduleMaintenance => std::option::Option::Some("RESCHEDULE_MAINTENANCE"),
24701                Self::StartExternalSync => std::option::Option::Some("START_EXTERNAL_SYNC"),
24702                Self::LogCleanup => std::option::Option::Some("LOG_CLEANUP"),
24703                Self::AutoRestart => std::option::Option::Some("AUTO_RESTART"),
24704                Self::Reencrypt => std::option::Option::Some("REENCRYPT"),
24705                Self::Switchover => std::option::Option::Some("SWITCHOVER"),
24706                Self::UpdateBackup => std::option::Option::Some("UPDATE_BACKUP"),
24707                Self::AcquireSsrsLease => std::option::Option::Some("ACQUIRE_SSRS_LEASE"),
24708                Self::ReleaseSsrsLease => std::option::Option::Some("RELEASE_SSRS_LEASE"),
24709                Self::ReconfigureOldPrimary => std::option::Option::Some("RECONFIGURE_OLD_PRIMARY"),
24710                Self::ClusterMaintenance => std::option::Option::Some("CLUSTER_MAINTENANCE"),
24711                Self::SelfServiceMaintenance => {
24712                    std::option::Option::Some("SELF_SERVICE_MAINTENANCE")
24713                }
24714                Self::SwitchoverToReplica => std::option::Option::Some("SWITCHOVER_TO_REPLICA"),
24715                Self::MajorVersionUpgrade => std::option::Option::Some("MAJOR_VERSION_UPGRADE"),
24716                Self::AdvancedBackup => std::option::Option::Some("ADVANCED_BACKUP"),
24717                Self::ManageBackup => std::option::Option::Some("MANAGE_BACKUP"),
24718                Self::EnhancedBackup => std::option::Option::Some("ENHANCED_BACKUP"),
24719                Self::RepairReadPool => std::option::Option::Some("REPAIR_READ_POOL"),
24720                Self::CreateReadPool => std::option::Option::Some("CREATE_READ_POOL"),
24721                Self::UnknownValue(u) => u.0.name(),
24722            }
24723        }
24724    }
24725
24726    impl std::default::Default for SqlOperationType {
24727        fn default() -> Self {
24728            use std::convert::From;
24729            Self::from(0)
24730        }
24731    }
24732
24733    impl std::fmt::Display for SqlOperationType {
24734        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24735            wkt::internal::display_enum(f, self.name(), self.value())
24736        }
24737    }
24738
24739    impl std::convert::From<i32> for SqlOperationType {
24740        fn from(value: i32) -> Self {
24741            match value {
24742                0 => Self::Unspecified,
24743                1 => Self::Import,
24744                2 => Self::Export,
24745                3 => Self::Create,
24746                4 => Self::Update,
24747                5 => Self::Delete,
24748                6 => Self::Restart,
24749                7 => Self::Backup,
24750                8 => Self::Snapshot,
24751                9 => Self::BackupVolume,
24752                10 => Self::DeleteVolume,
24753                11 => Self::RestoreVolume,
24754                12 => Self::InjectUser,
24755                14 => Self::Clone,
24756                15 => Self::StopReplica,
24757                16 => Self::StartReplica,
24758                17 => Self::PromoteReplica,
24759                18 => Self::CreateReplica,
24760                19 => Self::CreateUser,
24761                20 => Self::DeleteUser,
24762                21 => Self::UpdateUser,
24763                22 => Self::CreateDatabase,
24764                23 => Self::DeleteDatabase,
24765                24 => Self::UpdateDatabase,
24766                25 => Self::Failover,
24767                26 => Self::DeleteBackup,
24768                27 => Self::RecreateReplica,
24769                28 => Self::TruncateLog,
24770                29 => Self::DemoteMaster,
24771                30 => Self::Maintenance,
24772                31 => Self::EnablePrivateIp,
24773                32 => Self::DeferMaintenance,
24774                33 => Self::CreateClone,
24775                34 => Self::RescheduleMaintenance,
24776                35 => Self::StartExternalSync,
24777                36 => Self::LogCleanup,
24778                37 => Self::AutoRestart,
24779                38 => Self::Reencrypt,
24780                39 => Self::Switchover,
24781                40 => Self::UpdateBackup,
24782                42 => Self::AcquireSsrsLease,
24783                43 => Self::ReleaseSsrsLease,
24784                44 => Self::ReconfigureOldPrimary,
24785                45 => Self::ClusterMaintenance,
24786                46 => Self::SelfServiceMaintenance,
24787                47 => Self::SwitchoverToReplica,
24788                48 => Self::MajorVersionUpgrade,
24789                49 => Self::AdvancedBackup,
24790                50 => Self::ManageBackup,
24791                51 => Self::EnhancedBackup,
24792                52 => Self::RepairReadPool,
24793                53 => Self::CreateReadPool,
24794                _ => Self::UnknownValue(sql_operation_type::UnknownValue(
24795                    wkt::internal::UnknownEnumValue::Integer(value),
24796                )),
24797            }
24798        }
24799    }
24800
24801    impl std::convert::From<&str> for SqlOperationType {
24802        fn from(value: &str) -> Self {
24803            use std::string::ToString;
24804            match value {
24805                "SQL_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
24806                "IMPORT" => Self::Import,
24807                "EXPORT" => Self::Export,
24808                "CREATE" => Self::Create,
24809                "UPDATE" => Self::Update,
24810                "DELETE" => Self::Delete,
24811                "RESTART" => Self::Restart,
24812                "BACKUP" => Self::Backup,
24813                "SNAPSHOT" => Self::Snapshot,
24814                "BACKUP_VOLUME" => Self::BackupVolume,
24815                "DELETE_VOLUME" => Self::DeleteVolume,
24816                "RESTORE_VOLUME" => Self::RestoreVolume,
24817                "INJECT_USER" => Self::InjectUser,
24818                "CLONE" => Self::Clone,
24819                "STOP_REPLICA" => Self::StopReplica,
24820                "START_REPLICA" => Self::StartReplica,
24821                "PROMOTE_REPLICA" => Self::PromoteReplica,
24822                "CREATE_REPLICA" => Self::CreateReplica,
24823                "CREATE_USER" => Self::CreateUser,
24824                "DELETE_USER" => Self::DeleteUser,
24825                "UPDATE_USER" => Self::UpdateUser,
24826                "CREATE_DATABASE" => Self::CreateDatabase,
24827                "DELETE_DATABASE" => Self::DeleteDatabase,
24828                "UPDATE_DATABASE" => Self::UpdateDatabase,
24829                "FAILOVER" => Self::Failover,
24830                "DELETE_BACKUP" => Self::DeleteBackup,
24831                "RECREATE_REPLICA" => Self::RecreateReplica,
24832                "TRUNCATE_LOG" => Self::TruncateLog,
24833                "DEMOTE_MASTER" => Self::DemoteMaster,
24834                "MAINTENANCE" => Self::Maintenance,
24835                "ENABLE_PRIVATE_IP" => Self::EnablePrivateIp,
24836                "DEFER_MAINTENANCE" => Self::DeferMaintenance,
24837                "CREATE_CLONE" => Self::CreateClone,
24838                "RESCHEDULE_MAINTENANCE" => Self::RescheduleMaintenance,
24839                "START_EXTERNAL_SYNC" => Self::StartExternalSync,
24840                "LOG_CLEANUP" => Self::LogCleanup,
24841                "AUTO_RESTART" => Self::AutoRestart,
24842                "REENCRYPT" => Self::Reencrypt,
24843                "SWITCHOVER" => Self::Switchover,
24844                "UPDATE_BACKUP" => Self::UpdateBackup,
24845                "ACQUIRE_SSRS_LEASE" => Self::AcquireSsrsLease,
24846                "RELEASE_SSRS_LEASE" => Self::ReleaseSsrsLease,
24847                "RECONFIGURE_OLD_PRIMARY" => Self::ReconfigureOldPrimary,
24848                "CLUSTER_MAINTENANCE" => Self::ClusterMaintenance,
24849                "SELF_SERVICE_MAINTENANCE" => Self::SelfServiceMaintenance,
24850                "SWITCHOVER_TO_REPLICA" => Self::SwitchoverToReplica,
24851                "MAJOR_VERSION_UPGRADE" => Self::MajorVersionUpgrade,
24852                "ADVANCED_BACKUP" => Self::AdvancedBackup,
24853                "MANAGE_BACKUP" => Self::ManageBackup,
24854                "ENHANCED_BACKUP" => Self::EnhancedBackup,
24855                "REPAIR_READ_POOL" => Self::RepairReadPool,
24856                "CREATE_READ_POOL" => Self::CreateReadPool,
24857                _ => Self::UnknownValue(sql_operation_type::UnknownValue(
24858                    wkt::internal::UnknownEnumValue::String(value.to_string()),
24859                )),
24860            }
24861        }
24862    }
24863
24864    impl serde::ser::Serialize for SqlOperationType {
24865        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24866        where
24867            S: serde::Serializer,
24868        {
24869            match self {
24870                Self::Unspecified => serializer.serialize_i32(0),
24871                Self::Import => serializer.serialize_i32(1),
24872                Self::Export => serializer.serialize_i32(2),
24873                Self::Create => serializer.serialize_i32(3),
24874                Self::Update => serializer.serialize_i32(4),
24875                Self::Delete => serializer.serialize_i32(5),
24876                Self::Restart => serializer.serialize_i32(6),
24877                Self::Backup => serializer.serialize_i32(7),
24878                Self::Snapshot => serializer.serialize_i32(8),
24879                Self::BackupVolume => serializer.serialize_i32(9),
24880                Self::DeleteVolume => serializer.serialize_i32(10),
24881                Self::RestoreVolume => serializer.serialize_i32(11),
24882                Self::InjectUser => serializer.serialize_i32(12),
24883                Self::Clone => serializer.serialize_i32(14),
24884                Self::StopReplica => serializer.serialize_i32(15),
24885                Self::StartReplica => serializer.serialize_i32(16),
24886                Self::PromoteReplica => serializer.serialize_i32(17),
24887                Self::CreateReplica => serializer.serialize_i32(18),
24888                Self::CreateUser => serializer.serialize_i32(19),
24889                Self::DeleteUser => serializer.serialize_i32(20),
24890                Self::UpdateUser => serializer.serialize_i32(21),
24891                Self::CreateDatabase => serializer.serialize_i32(22),
24892                Self::DeleteDatabase => serializer.serialize_i32(23),
24893                Self::UpdateDatabase => serializer.serialize_i32(24),
24894                Self::Failover => serializer.serialize_i32(25),
24895                Self::DeleteBackup => serializer.serialize_i32(26),
24896                Self::RecreateReplica => serializer.serialize_i32(27),
24897                Self::TruncateLog => serializer.serialize_i32(28),
24898                Self::DemoteMaster => serializer.serialize_i32(29),
24899                Self::Maintenance => serializer.serialize_i32(30),
24900                Self::EnablePrivateIp => serializer.serialize_i32(31),
24901                Self::DeferMaintenance => serializer.serialize_i32(32),
24902                Self::CreateClone => serializer.serialize_i32(33),
24903                Self::RescheduleMaintenance => serializer.serialize_i32(34),
24904                Self::StartExternalSync => serializer.serialize_i32(35),
24905                Self::LogCleanup => serializer.serialize_i32(36),
24906                Self::AutoRestart => serializer.serialize_i32(37),
24907                Self::Reencrypt => serializer.serialize_i32(38),
24908                Self::Switchover => serializer.serialize_i32(39),
24909                Self::UpdateBackup => serializer.serialize_i32(40),
24910                Self::AcquireSsrsLease => serializer.serialize_i32(42),
24911                Self::ReleaseSsrsLease => serializer.serialize_i32(43),
24912                Self::ReconfigureOldPrimary => serializer.serialize_i32(44),
24913                Self::ClusterMaintenance => serializer.serialize_i32(45),
24914                Self::SelfServiceMaintenance => serializer.serialize_i32(46),
24915                Self::SwitchoverToReplica => serializer.serialize_i32(47),
24916                Self::MajorVersionUpgrade => serializer.serialize_i32(48),
24917                Self::AdvancedBackup => serializer.serialize_i32(49),
24918                Self::ManageBackup => serializer.serialize_i32(50),
24919                Self::EnhancedBackup => serializer.serialize_i32(51),
24920                Self::RepairReadPool => serializer.serialize_i32(52),
24921                Self::CreateReadPool => serializer.serialize_i32(53),
24922                Self::UnknownValue(u) => u.0.serialize(serializer),
24923            }
24924        }
24925    }
24926
24927    impl<'de> serde::de::Deserialize<'de> for SqlOperationType {
24928        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24929        where
24930            D: serde::Deserializer<'de>,
24931        {
24932            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationType>::new(
24933                ".google.cloud.sql.v1.Operation.SqlOperationType",
24934            ))
24935        }
24936    }
24937
24938    /// The status of an operation.
24939    ///
24940    /// # Working with unknown values
24941    ///
24942    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24943    /// additional enum variants at any time. Adding new variants is not considered
24944    /// a breaking change. Applications should write their code in anticipation of:
24945    ///
24946    /// - New values appearing in future releases of the client library, **and**
24947    /// - New values received dynamically, without application changes.
24948    ///
24949    /// Please consult the [Working with enums] section in the user guide for some
24950    /// guidelines.
24951    ///
24952    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24953    #[derive(Clone, Debug, PartialEq)]
24954    #[non_exhaustive]
24955    pub enum SqlOperationStatus {
24956        /// The state of the operation is unknown.
24957        Unspecified,
24958        /// The operation has been queued, but has not started yet.
24959        Pending,
24960        /// The operation is running.
24961        Running,
24962        /// The operation completed.
24963        Done,
24964        /// If set, the enum was initialized with an unknown value.
24965        ///
24966        /// Applications can examine the value using [SqlOperationStatus::value] or
24967        /// [SqlOperationStatus::name].
24968        UnknownValue(sql_operation_status::UnknownValue),
24969    }
24970
24971    #[doc(hidden)]
24972    pub mod sql_operation_status {
24973        #[allow(unused_imports)]
24974        use super::*;
24975        #[derive(Clone, Debug, PartialEq)]
24976        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24977    }
24978
24979    impl SqlOperationStatus {
24980        /// Gets the enum value.
24981        ///
24982        /// Returns `None` if the enum contains an unknown value deserialized from
24983        /// the string representation of enums.
24984        pub fn value(&self) -> std::option::Option<i32> {
24985            match self {
24986                Self::Unspecified => std::option::Option::Some(0),
24987                Self::Pending => std::option::Option::Some(1),
24988                Self::Running => std::option::Option::Some(2),
24989                Self::Done => std::option::Option::Some(3),
24990                Self::UnknownValue(u) => u.0.value(),
24991            }
24992        }
24993
24994        /// Gets the enum value as a string.
24995        ///
24996        /// Returns `None` if the enum contains an unknown value deserialized from
24997        /// the integer representation of enums.
24998        pub fn name(&self) -> std::option::Option<&str> {
24999            match self {
25000                Self::Unspecified => std::option::Option::Some("SQL_OPERATION_STATUS_UNSPECIFIED"),
25001                Self::Pending => std::option::Option::Some("PENDING"),
25002                Self::Running => std::option::Option::Some("RUNNING"),
25003                Self::Done => std::option::Option::Some("DONE"),
25004                Self::UnknownValue(u) => u.0.name(),
25005            }
25006        }
25007    }
25008
25009    impl std::default::Default for SqlOperationStatus {
25010        fn default() -> Self {
25011            use std::convert::From;
25012            Self::from(0)
25013        }
25014    }
25015
25016    impl std::fmt::Display for SqlOperationStatus {
25017        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25018            wkt::internal::display_enum(f, self.name(), self.value())
25019        }
25020    }
25021
25022    impl std::convert::From<i32> for SqlOperationStatus {
25023        fn from(value: i32) -> Self {
25024            match value {
25025                0 => Self::Unspecified,
25026                1 => Self::Pending,
25027                2 => Self::Running,
25028                3 => Self::Done,
25029                _ => Self::UnknownValue(sql_operation_status::UnknownValue(
25030                    wkt::internal::UnknownEnumValue::Integer(value),
25031                )),
25032            }
25033        }
25034    }
25035
25036    impl std::convert::From<&str> for SqlOperationStatus {
25037        fn from(value: &str) -> Self {
25038            use std::string::ToString;
25039            match value {
25040                "SQL_OPERATION_STATUS_UNSPECIFIED" => Self::Unspecified,
25041                "PENDING" => Self::Pending,
25042                "RUNNING" => Self::Running,
25043                "DONE" => Self::Done,
25044                _ => Self::UnknownValue(sql_operation_status::UnknownValue(
25045                    wkt::internal::UnknownEnumValue::String(value.to_string()),
25046                )),
25047            }
25048        }
25049    }
25050
25051    impl serde::ser::Serialize for SqlOperationStatus {
25052        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25053        where
25054            S: serde::Serializer,
25055        {
25056            match self {
25057                Self::Unspecified => serializer.serialize_i32(0),
25058                Self::Pending => serializer.serialize_i32(1),
25059                Self::Running => serializer.serialize_i32(2),
25060                Self::Done => serializer.serialize_i32(3),
25061                Self::UnknownValue(u) => u.0.serialize(serializer),
25062            }
25063        }
25064    }
25065
25066    impl<'de> serde::de::Deserialize<'de> for SqlOperationStatus {
25067        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25068        where
25069            D: serde::Deserializer<'de>,
25070        {
25071            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationStatus>::new(
25072                ".google.cloud.sql.v1.Operation.SqlOperationStatus",
25073            ))
25074        }
25075    }
25076}
25077
25078/// Database instance operation error.
25079#[derive(Clone, Default, PartialEq)]
25080#[non_exhaustive]
25081pub struct OperationError {
25082    /// This is always `sql#operationError`.
25083    pub kind: std::string::String,
25084
25085    /// Identifies the specific error that occurred.
25086    pub code: std::string::String,
25087
25088    /// Additional information about the error encountered.
25089    pub message: std::string::String,
25090
25091    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25092}
25093
25094impl OperationError {
25095    pub fn new() -> Self {
25096        std::default::Default::default()
25097    }
25098
25099    /// Sets the value of [kind][crate::model::OperationError::kind].
25100    ///
25101    /// # Example
25102    /// ```ignore,no_run
25103    /// # use google_cloud_sql_v1::model::OperationError;
25104    /// let x = OperationError::new().set_kind("example");
25105    /// ```
25106    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25107        self.kind = v.into();
25108        self
25109    }
25110
25111    /// Sets the value of [code][crate::model::OperationError::code].
25112    ///
25113    /// # Example
25114    /// ```ignore,no_run
25115    /// # use google_cloud_sql_v1::model::OperationError;
25116    /// let x = OperationError::new().set_code("example");
25117    /// ```
25118    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25119        self.code = v.into();
25120        self
25121    }
25122
25123    /// Sets the value of [message][crate::model::OperationError::message].
25124    ///
25125    /// # Example
25126    /// ```ignore,no_run
25127    /// # use google_cloud_sql_v1::model::OperationError;
25128    /// let x = OperationError::new().set_message("example");
25129    /// ```
25130    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25131        self.message = v.into();
25132        self
25133    }
25134}
25135
25136impl wkt::message::Message for OperationError {
25137    fn typename() -> &'static str {
25138        "type.googleapis.com/google.cloud.sql.v1.OperationError"
25139    }
25140}
25141
25142/// Database instance operation errors list wrapper.
25143#[derive(Clone, Default, PartialEq)]
25144#[non_exhaustive]
25145pub struct OperationErrors {
25146    /// This is always `sql#operationErrors`.
25147    pub kind: std::string::String,
25148
25149    /// The list of errors encountered while processing this operation.
25150    pub errors: std::vec::Vec<crate::model::OperationError>,
25151
25152    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25153}
25154
25155impl OperationErrors {
25156    pub fn new() -> Self {
25157        std::default::Default::default()
25158    }
25159
25160    /// Sets the value of [kind][crate::model::OperationErrors::kind].
25161    ///
25162    /// # Example
25163    /// ```ignore,no_run
25164    /// # use google_cloud_sql_v1::model::OperationErrors;
25165    /// let x = OperationErrors::new().set_kind("example");
25166    /// ```
25167    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25168        self.kind = v.into();
25169        self
25170    }
25171
25172    /// Sets the value of [errors][crate::model::OperationErrors::errors].
25173    ///
25174    /// # Example
25175    /// ```ignore,no_run
25176    /// # use google_cloud_sql_v1::model::OperationErrors;
25177    /// use google_cloud_sql_v1::model::OperationError;
25178    /// let x = OperationErrors::new()
25179    ///     .set_errors([
25180    ///         OperationError::default()/* use setters */,
25181    ///         OperationError::default()/* use (different) setters */,
25182    ///     ]);
25183    /// ```
25184    pub fn set_errors<T, V>(mut self, v: T) -> Self
25185    where
25186        T: std::iter::IntoIterator<Item = V>,
25187        V: std::convert::Into<crate::model::OperationError>,
25188    {
25189        use std::iter::Iterator;
25190        self.errors = v.into_iter().map(|i| i.into()).collect();
25191        self
25192    }
25193}
25194
25195impl wkt::message::Message for OperationErrors {
25196    fn typename() -> &'static str {
25197        "type.googleapis.com/google.cloud.sql.v1.OperationErrors"
25198    }
25199}
25200
25201/// Database instance local user password validation policy.
25202/// This message defines the password policy for local database users.
25203/// When enabled, it enforces constraints on password complexity, length,
25204/// and reuse. Keep this policy enabled to help prevent unauthorized access.
25205#[derive(Clone, Default, PartialEq)]
25206#[non_exhaustive]
25207pub struct PasswordValidationPolicy {
25208    /// Minimum number of characters allowed.
25209    pub min_length: std::option::Option<wkt::Int32Value>,
25210
25211    /// The complexity of the password.
25212    pub complexity: crate::model::password_validation_policy::Complexity,
25213
25214    /// Number of previous passwords that cannot be reused.
25215    pub reuse_interval: std::option::Option<wkt::Int32Value>,
25216
25217    /// Disallow username as a part of the password.
25218    pub disallow_username_substring: std::option::Option<wkt::BoolValue>,
25219
25220    /// Minimum interval after which the password can be changed. This flag is only
25221    /// supported for PostgreSQL.
25222    pub password_change_interval: std::option::Option<wkt::Duration>,
25223
25224    /// Whether to enable the password policy or not. When enabled, passwords must
25225    /// meet complexity requirements. Keep this policy enabled to help prevent
25226    /// unauthorized access. Disabling this policy allows weak passwords.
25227    pub enable_password_policy: std::option::Option<wkt::BoolValue>,
25228
25229    /// This field is deprecated and will be removed in a future version of the
25230    /// API.
25231    #[deprecated]
25232    pub disallow_compromised_credentials: std::option::Option<wkt::BoolValue>,
25233
25234    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25235}
25236
25237impl PasswordValidationPolicy {
25238    pub fn new() -> Self {
25239        std::default::Default::default()
25240    }
25241
25242    /// Sets the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
25243    ///
25244    /// # Example
25245    /// ```ignore,no_run
25246    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25247    /// use wkt::Int32Value;
25248    /// let x = PasswordValidationPolicy::new().set_min_length(Int32Value::default()/* use setters */);
25249    /// ```
25250    pub fn set_min_length<T>(mut self, v: T) -> Self
25251    where
25252        T: std::convert::Into<wkt::Int32Value>,
25253    {
25254        self.min_length = std::option::Option::Some(v.into());
25255        self
25256    }
25257
25258    /// Sets or clears the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
25259    ///
25260    /// # Example
25261    /// ```ignore,no_run
25262    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25263    /// use wkt::Int32Value;
25264    /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(Some(Int32Value::default()/* use setters */));
25265    /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(None::<Int32Value>);
25266    /// ```
25267    pub fn set_or_clear_min_length<T>(mut self, v: std::option::Option<T>) -> Self
25268    where
25269        T: std::convert::Into<wkt::Int32Value>,
25270    {
25271        self.min_length = v.map(|x| x.into());
25272        self
25273    }
25274
25275    /// Sets the value of [complexity][crate::model::PasswordValidationPolicy::complexity].
25276    ///
25277    /// # Example
25278    /// ```ignore,no_run
25279    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25280    /// use google_cloud_sql_v1::model::password_validation_policy::Complexity;
25281    /// let x0 = PasswordValidationPolicy::new().set_complexity(Complexity::Default);
25282    /// ```
25283    pub fn set_complexity<
25284        T: std::convert::Into<crate::model::password_validation_policy::Complexity>,
25285    >(
25286        mut self,
25287        v: T,
25288    ) -> Self {
25289        self.complexity = v.into();
25290        self
25291    }
25292
25293    /// Sets the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
25294    ///
25295    /// # Example
25296    /// ```ignore,no_run
25297    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25298    /// use wkt::Int32Value;
25299    /// let x = PasswordValidationPolicy::new().set_reuse_interval(Int32Value::default()/* use setters */);
25300    /// ```
25301    pub fn set_reuse_interval<T>(mut self, v: T) -> Self
25302    where
25303        T: std::convert::Into<wkt::Int32Value>,
25304    {
25305        self.reuse_interval = std::option::Option::Some(v.into());
25306        self
25307    }
25308
25309    /// Sets or clears the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
25310    ///
25311    /// # Example
25312    /// ```ignore,no_run
25313    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25314    /// use wkt::Int32Value;
25315    /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(Some(Int32Value::default()/* use setters */));
25316    /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(None::<Int32Value>);
25317    /// ```
25318    pub fn set_or_clear_reuse_interval<T>(mut self, v: std::option::Option<T>) -> Self
25319    where
25320        T: std::convert::Into<wkt::Int32Value>,
25321    {
25322        self.reuse_interval = v.map(|x| x.into());
25323        self
25324    }
25325
25326    /// Sets the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
25327    ///
25328    /// # Example
25329    /// ```ignore,no_run
25330    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25331    /// use wkt::BoolValue;
25332    /// let x = PasswordValidationPolicy::new().set_disallow_username_substring(BoolValue::default()/* use setters */);
25333    /// ```
25334    pub fn set_disallow_username_substring<T>(mut self, v: T) -> Self
25335    where
25336        T: std::convert::Into<wkt::BoolValue>,
25337    {
25338        self.disallow_username_substring = std::option::Option::Some(v.into());
25339        self
25340    }
25341
25342    /// Sets or clears the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
25343    ///
25344    /// # Example
25345    /// ```ignore,no_run
25346    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25347    /// use wkt::BoolValue;
25348    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(Some(BoolValue::default()/* use setters */));
25349    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(None::<BoolValue>);
25350    /// ```
25351    pub fn set_or_clear_disallow_username_substring<T>(mut self, v: std::option::Option<T>) -> Self
25352    where
25353        T: std::convert::Into<wkt::BoolValue>,
25354    {
25355        self.disallow_username_substring = v.map(|x| x.into());
25356        self
25357    }
25358
25359    /// Sets the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
25360    ///
25361    /// # Example
25362    /// ```ignore,no_run
25363    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25364    /// use wkt::Duration;
25365    /// let x = PasswordValidationPolicy::new().set_password_change_interval(Duration::default()/* use setters */);
25366    /// ```
25367    pub fn set_password_change_interval<T>(mut self, v: T) -> Self
25368    where
25369        T: std::convert::Into<wkt::Duration>,
25370    {
25371        self.password_change_interval = std::option::Option::Some(v.into());
25372        self
25373    }
25374
25375    /// Sets or clears the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
25376    ///
25377    /// # Example
25378    /// ```ignore,no_run
25379    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25380    /// use wkt::Duration;
25381    /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(Some(Duration::default()/* use setters */));
25382    /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(None::<Duration>);
25383    /// ```
25384    pub fn set_or_clear_password_change_interval<T>(mut self, v: std::option::Option<T>) -> Self
25385    where
25386        T: std::convert::Into<wkt::Duration>,
25387    {
25388        self.password_change_interval = v.map(|x| x.into());
25389        self
25390    }
25391
25392    /// Sets the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
25393    ///
25394    /// # Example
25395    /// ```ignore,no_run
25396    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25397    /// use wkt::BoolValue;
25398    /// let x = PasswordValidationPolicy::new().set_enable_password_policy(BoolValue::default()/* use setters */);
25399    /// ```
25400    pub fn set_enable_password_policy<T>(mut self, v: T) -> Self
25401    where
25402        T: std::convert::Into<wkt::BoolValue>,
25403    {
25404        self.enable_password_policy = std::option::Option::Some(v.into());
25405        self
25406    }
25407
25408    /// Sets or clears the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
25409    ///
25410    /// # Example
25411    /// ```ignore,no_run
25412    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25413    /// use wkt::BoolValue;
25414    /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(Some(BoolValue::default()/* use setters */));
25415    /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(None::<BoolValue>);
25416    /// ```
25417    pub fn set_or_clear_enable_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
25418    where
25419        T: std::convert::Into<wkt::BoolValue>,
25420    {
25421        self.enable_password_policy = v.map(|x| x.into());
25422        self
25423    }
25424
25425    /// Sets the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
25426    ///
25427    /// # Example
25428    /// ```ignore,no_run
25429    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25430    /// use wkt::BoolValue;
25431    /// let x = PasswordValidationPolicy::new().set_disallow_compromised_credentials(BoolValue::default()/* use setters */);
25432    /// ```
25433    #[deprecated]
25434    pub fn set_disallow_compromised_credentials<T>(mut self, v: T) -> Self
25435    where
25436        T: std::convert::Into<wkt::BoolValue>,
25437    {
25438        self.disallow_compromised_credentials = std::option::Option::Some(v.into());
25439        self
25440    }
25441
25442    /// Sets or clears the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
25443    ///
25444    /// # Example
25445    /// ```ignore,no_run
25446    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25447    /// use wkt::BoolValue;
25448    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(Some(BoolValue::default()/* use setters */));
25449    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(None::<BoolValue>);
25450    /// ```
25451    #[deprecated]
25452    pub fn set_or_clear_disallow_compromised_credentials<T>(
25453        mut self,
25454        v: std::option::Option<T>,
25455    ) -> Self
25456    where
25457        T: std::convert::Into<wkt::BoolValue>,
25458    {
25459        self.disallow_compromised_credentials = v.map(|x| x.into());
25460        self
25461    }
25462}
25463
25464impl wkt::message::Message for PasswordValidationPolicy {
25465    fn typename() -> &'static str {
25466        "type.googleapis.com/google.cloud.sql.v1.PasswordValidationPolicy"
25467    }
25468}
25469
25470/// Defines additional types related to [PasswordValidationPolicy].
25471pub mod password_validation_policy {
25472    #[allow(unused_imports)]
25473    use super::*;
25474
25475    /// The complexity choices of the password.
25476    ///
25477    /// # Working with unknown values
25478    ///
25479    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25480    /// additional enum variants at any time. Adding new variants is not considered
25481    /// a breaking change. Applications should write their code in anticipation of:
25482    ///
25483    /// - New values appearing in future releases of the client library, **and**
25484    /// - New values received dynamically, without application changes.
25485    ///
25486    /// Please consult the [Working with enums] section in the user guide for some
25487    /// guidelines.
25488    ///
25489    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
25490    #[derive(Clone, Debug, PartialEq)]
25491    #[non_exhaustive]
25492    pub enum Complexity {
25493        /// Complexity check is not specified.
25494        Unspecified,
25495        /// A combination of lowercase, uppercase, numeric, and non-alphanumeric
25496        /// characters.
25497        Default,
25498        /// If set, the enum was initialized with an unknown value.
25499        ///
25500        /// Applications can examine the value using [Complexity::value] or
25501        /// [Complexity::name].
25502        UnknownValue(complexity::UnknownValue),
25503    }
25504
25505    #[doc(hidden)]
25506    pub mod complexity {
25507        #[allow(unused_imports)]
25508        use super::*;
25509        #[derive(Clone, Debug, PartialEq)]
25510        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25511    }
25512
25513    impl Complexity {
25514        /// Gets the enum value.
25515        ///
25516        /// Returns `None` if the enum contains an unknown value deserialized from
25517        /// the string representation of enums.
25518        pub fn value(&self) -> std::option::Option<i32> {
25519            match self {
25520                Self::Unspecified => std::option::Option::Some(0),
25521                Self::Default => std::option::Option::Some(1),
25522                Self::UnknownValue(u) => u.0.value(),
25523            }
25524        }
25525
25526        /// Gets the enum value as a string.
25527        ///
25528        /// Returns `None` if the enum contains an unknown value deserialized from
25529        /// the integer representation of enums.
25530        pub fn name(&self) -> std::option::Option<&str> {
25531            match self {
25532                Self::Unspecified => std::option::Option::Some("COMPLEXITY_UNSPECIFIED"),
25533                Self::Default => std::option::Option::Some("COMPLEXITY_DEFAULT"),
25534                Self::UnknownValue(u) => u.0.name(),
25535            }
25536        }
25537    }
25538
25539    impl std::default::Default for Complexity {
25540        fn default() -> Self {
25541            use std::convert::From;
25542            Self::from(0)
25543        }
25544    }
25545
25546    impl std::fmt::Display for Complexity {
25547        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25548            wkt::internal::display_enum(f, self.name(), self.value())
25549        }
25550    }
25551
25552    impl std::convert::From<i32> for Complexity {
25553        fn from(value: i32) -> Self {
25554            match value {
25555                0 => Self::Unspecified,
25556                1 => Self::Default,
25557                _ => Self::UnknownValue(complexity::UnknownValue(
25558                    wkt::internal::UnknownEnumValue::Integer(value),
25559                )),
25560            }
25561        }
25562    }
25563
25564    impl std::convert::From<&str> for Complexity {
25565        fn from(value: &str) -> Self {
25566            use std::string::ToString;
25567            match value {
25568                "COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
25569                "COMPLEXITY_DEFAULT" => Self::Default,
25570                _ => Self::UnknownValue(complexity::UnknownValue(
25571                    wkt::internal::UnknownEnumValue::String(value.to_string()),
25572                )),
25573            }
25574        }
25575    }
25576
25577    impl serde::ser::Serialize for Complexity {
25578        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25579        where
25580            S: serde::Serializer,
25581        {
25582            match self {
25583                Self::Unspecified => serializer.serialize_i32(0),
25584                Self::Default => serializer.serialize_i32(1),
25585                Self::UnknownValue(u) => u.0.serialize(serializer),
25586            }
25587        }
25588    }
25589
25590    impl<'de> serde::de::Deserialize<'de> for Complexity {
25591        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25592        where
25593            D: serde::Deserializer<'de>,
25594        {
25595            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Complexity>::new(
25596                ".google.cloud.sql.v1.PasswordValidationPolicy.Complexity",
25597            ))
25598        }
25599    }
25600}
25601
25602/// Data cache configurations.
25603#[derive(Clone, Default, PartialEq)]
25604#[non_exhaustive]
25605pub struct DataCacheConfig {
25606    /// Whether data cache is enabled for the instance.
25607    pub data_cache_enabled: bool,
25608
25609    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25610}
25611
25612impl DataCacheConfig {
25613    pub fn new() -> Self {
25614        std::default::Default::default()
25615    }
25616
25617    /// Sets the value of [data_cache_enabled][crate::model::DataCacheConfig::data_cache_enabled].
25618    ///
25619    /// # Example
25620    /// ```ignore,no_run
25621    /// # use google_cloud_sql_v1::model::DataCacheConfig;
25622    /// let x = DataCacheConfig::new().set_data_cache_enabled(true);
25623    /// ```
25624    pub fn set_data_cache_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
25625        self.data_cache_enabled = v.into();
25626        self
25627    }
25628}
25629
25630impl wkt::message::Message for DataCacheConfig {
25631    fn typename() -> &'static str {
25632        "type.googleapis.com/google.cloud.sql.v1.DataCacheConfig"
25633    }
25634}
25635
25636/// Config used to determine the final backup settings for the instance.
25637#[derive(Clone, Default, PartialEq)]
25638#[non_exhaustive]
25639pub struct FinalBackupConfig {
25640    /// Whether the final backup is enabled for the instance.
25641    pub enabled: std::option::Option<bool>,
25642
25643    /// The number of days to retain the final backup after the instance deletion.
25644    /// The final backup will be purged at (time_of_instance_deletion +
25645    /// retention_days).
25646    pub retention_days: std::option::Option<i32>,
25647
25648    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25649}
25650
25651impl FinalBackupConfig {
25652    pub fn new() -> Self {
25653        std::default::Default::default()
25654    }
25655
25656    /// Sets the value of [enabled][crate::model::FinalBackupConfig::enabled].
25657    ///
25658    /// # Example
25659    /// ```ignore,no_run
25660    /// # use google_cloud_sql_v1::model::FinalBackupConfig;
25661    /// let x = FinalBackupConfig::new().set_enabled(true);
25662    /// ```
25663    pub fn set_enabled<T>(mut self, v: T) -> Self
25664    where
25665        T: std::convert::Into<bool>,
25666    {
25667        self.enabled = std::option::Option::Some(v.into());
25668        self
25669    }
25670
25671    /// Sets or clears the value of [enabled][crate::model::FinalBackupConfig::enabled].
25672    ///
25673    /// # Example
25674    /// ```ignore,no_run
25675    /// # use google_cloud_sql_v1::model::FinalBackupConfig;
25676    /// let x = FinalBackupConfig::new().set_or_clear_enabled(Some(false));
25677    /// let x = FinalBackupConfig::new().set_or_clear_enabled(None::<bool>);
25678    /// ```
25679    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
25680    where
25681        T: std::convert::Into<bool>,
25682    {
25683        self.enabled = v.map(|x| x.into());
25684        self
25685    }
25686
25687    /// Sets the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
25688    ///
25689    /// # Example
25690    /// ```ignore,no_run
25691    /// # use google_cloud_sql_v1::model::FinalBackupConfig;
25692    /// let x = FinalBackupConfig::new().set_retention_days(42);
25693    /// ```
25694    pub fn set_retention_days<T>(mut self, v: T) -> Self
25695    where
25696        T: std::convert::Into<i32>,
25697    {
25698        self.retention_days = std::option::Option::Some(v.into());
25699        self
25700    }
25701
25702    /// Sets or clears the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
25703    ///
25704    /// # Example
25705    /// ```ignore,no_run
25706    /// # use google_cloud_sql_v1::model::FinalBackupConfig;
25707    /// let x = FinalBackupConfig::new().set_or_clear_retention_days(Some(42));
25708    /// let x = FinalBackupConfig::new().set_or_clear_retention_days(None::<i32>);
25709    /// ```
25710    pub fn set_or_clear_retention_days<T>(mut self, v: std::option::Option<T>) -> Self
25711    where
25712        T: std::convert::Into<i32>,
25713    {
25714        self.retention_days = v.map(|x| x.into());
25715        self
25716    }
25717}
25718
25719impl wkt::message::Message for FinalBackupConfig {
25720    fn typename() -> &'static str {
25721        "type.googleapis.com/google.cloud.sql.v1.FinalBackupConfig"
25722    }
25723}
25724
25725/// Database instance settings.
25726#[derive(Clone, Default, PartialEq)]
25727#[non_exhaustive]
25728pub struct Settings {
25729    /// The version of instance settings. This is a required field for update
25730    /// method to make sure concurrent updates are handled properly. During update,
25731    /// use the most recent settingsVersion value for this instance and do not try
25732    /// to update this value.
25733    pub settings_version: std::option::Option<wkt::Int64Value>,
25734
25735    /// The App Engine app IDs that can access this instance.
25736    /// (Deprecated) Applied to First Generation instances only.
25737    #[deprecated]
25738    pub authorized_gae_applications: std::vec::Vec<std::string::String>,
25739
25740    /// The tier (or machine type) for this instance, for example
25741    /// `db-custom-1-3840`. WARNING: Changing this restarts the instance.
25742    pub tier: std::string::String,
25743
25744    /// This is always `sql#settings`.
25745    pub kind: std::string::String,
25746
25747    /// User-provided labels, represented as a dictionary where each label is a
25748    /// single key value pair.
25749    pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
25750
25751    /// Availability type. Potential values:
25752    ///
25753    /// * `ZONAL`: The instance serves data from only one zone. Outages in that
25754    ///   zone affect data accessibility.
25755    /// * `REGIONAL`: The instance can serve data from more than one zone in a
25756    ///   region (it is highly available)./
25757    ///
25758    /// For more information, see [Overview of the High Availability
25759    /// Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
25760    pub availability_type: crate::model::SqlAvailabilityType,
25761
25762    /// The pricing plan for this instance. This can be either `PER_USE` or
25763    /// `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
25764    pub pricing_plan: crate::model::SqlPricingPlan,
25765
25766    /// The type of replication this instance uses. This can be either
25767    /// `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
25768    /// applicable to First Generation instances.
25769    #[deprecated]
25770    pub replication_type: crate::model::SqlReplicationType,
25771
25772    /// The maximum size to which storage capacity can be automatically increased.
25773    /// The default value is 0, which specifies that there is no limit.
25774    pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
25775
25776    /// The activation policy specifies when the instance is activated; it is
25777    /// applicable only when the instance state is RUNNABLE. Valid values:
25778    ///
25779    /// * `ALWAYS`: The instance is on, and remains so even in the absence of
25780    ///   connection requests.
25781    /// * `NEVER`: The instance is off; it is not activated, even if a
25782    ///   connection request arrives.
25783    pub activation_policy: crate::model::settings::SqlActivationPolicy,
25784
25785    /// The settings for IP Management. This allows to enable or disable the
25786    /// instance IP and manage which external networks can connect to the instance.
25787    /// The IPv4 address cannot be disabled for Second Generation instances.
25788    pub ip_configuration: std::option::Option<crate::model::IpConfiguration>,
25789
25790    /// Configuration to increase storage size automatically. The default value is
25791    /// true.
25792    pub storage_auto_resize: std::option::Option<wkt::BoolValue>,
25793
25794    /// The location preference settings. This allows the instance to be located as
25795    /// near as possible to either an App Engine app or Compute Engine zone for
25796    /// better performance. App Engine co-location was only applicable to First
25797    /// Generation instances.
25798    pub location_preference: std::option::Option<crate::model::LocationPreference>,
25799
25800    /// The database flags passed to the instance at startup.
25801    pub database_flags: std::vec::Vec<crate::model::DatabaseFlags>,
25802
25803    /// The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
25804    /// First Generation instances.
25805    pub data_disk_type: crate::model::SqlDataDiskType,
25806
25807    /// The maintenance window for this instance. This specifies when the instance
25808    /// can be restarted for maintenance purposes.
25809    pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,
25810
25811    /// The daily backup configuration for the instance.
25812    pub backup_configuration: std::option::Option<crate::model::BackupConfiguration>,
25813
25814    /// Configuration specific to read replica instances. Indicates whether
25815    /// replication is enabled or not. WARNING: Changing this restarts the
25816    /// instance.
25817    pub database_replication_enabled: std::option::Option<wkt::BoolValue>,
25818
25819    /// Configuration specific to read replica instances. Indicates whether
25820    /// database flags for crash-safe replication are enabled. This property was
25821    /// only applicable to First Generation instances.
25822    #[deprecated]
25823    pub crash_safe_replication_enabled: std::option::Option<wkt::BoolValue>,
25824
25825    /// The size of data disk, in GB. The data disk size minimum is 10GB.
25826    pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
25827
25828    /// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
25829    pub active_directory_config: std::option::Option<crate::model::SqlActiveDirectoryConfig>,
25830
25831    /// The name of server Instance collation.
25832    pub collation: std::string::String,
25833
25834    /// Deny maintenance periods
25835    pub deny_maintenance_periods: std::vec::Vec<crate::model::DenyMaintenancePeriod>,
25836
25837    /// Insights configuration, for now relevant only for Postgres.
25838    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
25839
25840    /// The local user password validation policy of the instance.
25841    pub password_validation_policy: std::option::Option<crate::model::PasswordValidationPolicy>,
25842
25843    /// SQL Server specific audit configuration.
25844    pub sql_server_audit_config: std::option::Option<crate::model::SqlServerAuditConfig>,
25845
25846    /// Optional. The edition of the instance.
25847    pub edition: crate::model::settings::Edition,
25848
25849    /// Specifies if connections must use Cloud SQL connectors.
25850    /// Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
25851    /// can be connected without Cloud SQL
25852    /// Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
25853    /// Connectors).
25854    ///
25855    /// Note that using REQUIRED disables all existing authorized networks. If
25856    /// this field is not specified when creating a new instance, NOT_REQUIRED is
25857    /// used. If this field is not specified when patching or updating an existing
25858    /// instance, it is left unchanged in the instance.
25859    pub connector_enforcement: crate::model::settings::ConnectorEnforcement,
25860
25861    /// Configuration to protect against accidental instance deletion.
25862    pub deletion_protection_enabled: std::option::Option<wkt::BoolValue>,
25863
25864    /// Server timezone, relevant only for Cloud SQL for SQL Server.
25865    pub time_zone: std::string::String,
25866
25867    /// Specifies advanced machine configuration for the instances relevant only
25868    /// for SQL Server.
25869    pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
25870
25871    /// Configuration for data cache.
25872    pub data_cache_config: std::option::Option<crate::model::DataCacheConfig>,
25873
25874    /// Optional. Configuration value for recreation of replica after certain
25875    /// replication lag
25876    pub replication_lag_max_seconds: std::option::Option<wkt::Int32Value>,
25877
25878    /// Optional. When this parameter is set to true, Cloud SQL instances can
25879    /// connect to Vertex AI to pass requests for real-time predictions and
25880    /// insights to the AI. The default value is false. This applies only to Cloud
25881    /// SQL for MySQL and Cloud SQL for PostgreSQL instances.
25882    pub enable_google_ml_integration: std::option::Option<wkt::BoolValue>,
25883
25884    /// Optional. By default, Cloud SQL instances have schema extraction disabled
25885    /// for Dataplex. When this parameter is set to true, schema extraction for
25886    /// Dataplex on Cloud SQL instances is activated.
25887    pub enable_dataplex_integration: std::option::Option<wkt::BoolValue>,
25888
25889    /// Optional. When this parameter is set to true, Cloud SQL retains backups of
25890    /// the instance even after the instance is deleted. The ON_DEMAND backup will
25891    /// be retained until customer deletes the backup or the project. The AUTOMATED
25892    /// backup will be retained based on the backups retention setting.
25893    pub retain_backups_on_delete: std::option::Option<wkt::BoolValue>,
25894
25895    /// Optional. Provisioned number of I/O operations per second for the data
25896    /// disk. This field is only used for hyperdisk-balanced disk types.
25897    pub data_disk_provisioned_iops: std::option::Option<i64>,
25898
25899    /// Optional. Provisioned throughput measured in MiB per second for the data
25900    /// disk. This field is only used for hyperdisk-balanced disk types.
25901    pub data_disk_provisioned_throughput: std::option::Option<i64>,
25902
25903    /// Optional. The managed connection pooling configuration for the instance.
25904    pub connection_pool_config: std::option::Option<crate::model::ConnectionPoolConfig>,
25905
25906    /// Optional. The final backup configuration for the instance.
25907    pub final_backup_config: std::option::Option<crate::model::FinalBackupConfig>,
25908
25909    /// Optional. The read pool auto-scale configuration for the instance.
25910    pub read_pool_auto_scale_config: std::option::Option<crate::model::ReadPoolAutoScaleConfig>,
25911
25912    /// Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
25913    /// parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
25914    /// versions. The MySQL version must be 8.0.35 or higher.
25915    pub auto_upgrade_enabled: std::option::Option<bool>,
25916
25917    /// Optional. The Microsoft Entra ID configuration for the SQL Server instance.
25918    pub entraid_config: std::option::Option<crate::model::SqlServerEntraIdConfig>,
25919
25920    /// This parameter controls whether to allow using ExecuteSql API to connect to
25921    /// the instance. Not allowed by default.
25922    pub data_api_access: std::option::Option<crate::model::settings::DataApiAccess>,
25923
25924    /// Optional. Configuration for Performance Capture, provides diagnostic
25925    /// metrics during high load situations.
25926    pub performance_capture_config: std::option::Option<crate::model::PerformanceCaptureConfig>,
25927
25928    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25929}
25930
25931impl Settings {
25932    pub fn new() -> Self {
25933        std::default::Default::default()
25934    }
25935
25936    /// Sets the value of [settings_version][crate::model::Settings::settings_version].
25937    ///
25938    /// # Example
25939    /// ```ignore,no_run
25940    /// # use google_cloud_sql_v1::model::Settings;
25941    /// use wkt::Int64Value;
25942    /// let x = Settings::new().set_settings_version(Int64Value::default()/* use setters */);
25943    /// ```
25944    pub fn set_settings_version<T>(mut self, v: T) -> Self
25945    where
25946        T: std::convert::Into<wkt::Int64Value>,
25947    {
25948        self.settings_version = std::option::Option::Some(v.into());
25949        self
25950    }
25951
25952    /// Sets or clears the value of [settings_version][crate::model::Settings::settings_version].
25953    ///
25954    /// # Example
25955    /// ```ignore,no_run
25956    /// # use google_cloud_sql_v1::model::Settings;
25957    /// use wkt::Int64Value;
25958    /// let x = Settings::new().set_or_clear_settings_version(Some(Int64Value::default()/* use setters */));
25959    /// let x = Settings::new().set_or_clear_settings_version(None::<Int64Value>);
25960    /// ```
25961    pub fn set_or_clear_settings_version<T>(mut self, v: std::option::Option<T>) -> Self
25962    where
25963        T: std::convert::Into<wkt::Int64Value>,
25964    {
25965        self.settings_version = v.map(|x| x.into());
25966        self
25967    }
25968
25969    /// Sets the value of [authorized_gae_applications][crate::model::Settings::authorized_gae_applications].
25970    ///
25971    /// # Example
25972    /// ```ignore,no_run
25973    /// # use google_cloud_sql_v1::model::Settings;
25974    /// let x = Settings::new().set_authorized_gae_applications(["a", "b", "c"]);
25975    /// ```
25976    #[deprecated]
25977    pub fn set_authorized_gae_applications<T, V>(mut self, v: T) -> Self
25978    where
25979        T: std::iter::IntoIterator<Item = V>,
25980        V: std::convert::Into<std::string::String>,
25981    {
25982        use std::iter::Iterator;
25983        self.authorized_gae_applications = v.into_iter().map(|i| i.into()).collect();
25984        self
25985    }
25986
25987    /// Sets the value of [tier][crate::model::Settings::tier].
25988    ///
25989    /// # Example
25990    /// ```ignore,no_run
25991    /// # use google_cloud_sql_v1::model::Settings;
25992    /// let x = Settings::new().set_tier("example");
25993    /// ```
25994    pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25995        self.tier = v.into();
25996        self
25997    }
25998
25999    /// Sets the value of [kind][crate::model::Settings::kind].
26000    ///
26001    /// # Example
26002    /// ```ignore,no_run
26003    /// # use google_cloud_sql_v1::model::Settings;
26004    /// let x = Settings::new().set_kind("example");
26005    /// ```
26006    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26007        self.kind = v.into();
26008        self
26009    }
26010
26011    /// Sets the value of [user_labels][crate::model::Settings::user_labels].
26012    ///
26013    /// # Example
26014    /// ```ignore,no_run
26015    /// # use google_cloud_sql_v1::model::Settings;
26016    /// let x = Settings::new().set_user_labels([
26017    ///     ("key0", "abc"),
26018    ///     ("key1", "xyz"),
26019    /// ]);
26020    /// ```
26021    pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
26022    where
26023        T: std::iter::IntoIterator<Item = (K, V)>,
26024        K: std::convert::Into<std::string::String>,
26025        V: std::convert::Into<std::string::String>,
26026    {
26027        use std::iter::Iterator;
26028        self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
26029        self
26030    }
26031
26032    /// Sets the value of [availability_type][crate::model::Settings::availability_type].
26033    ///
26034    /// # Example
26035    /// ```ignore,no_run
26036    /// # use google_cloud_sql_v1::model::Settings;
26037    /// use google_cloud_sql_v1::model::SqlAvailabilityType;
26038    /// let x0 = Settings::new().set_availability_type(SqlAvailabilityType::Zonal);
26039    /// let x1 = Settings::new().set_availability_type(SqlAvailabilityType::Regional);
26040    /// ```
26041    pub fn set_availability_type<T: std::convert::Into<crate::model::SqlAvailabilityType>>(
26042        mut self,
26043        v: T,
26044    ) -> Self {
26045        self.availability_type = v.into();
26046        self
26047    }
26048
26049    /// Sets the value of [pricing_plan][crate::model::Settings::pricing_plan].
26050    ///
26051    /// # Example
26052    /// ```ignore,no_run
26053    /// # use google_cloud_sql_v1::model::Settings;
26054    /// use google_cloud_sql_v1::model::SqlPricingPlan;
26055    /// let x0 = Settings::new().set_pricing_plan(SqlPricingPlan::Package);
26056    /// let x1 = Settings::new().set_pricing_plan(SqlPricingPlan::PerUse);
26057    /// ```
26058    pub fn set_pricing_plan<T: std::convert::Into<crate::model::SqlPricingPlan>>(
26059        mut self,
26060        v: T,
26061    ) -> Self {
26062        self.pricing_plan = v.into();
26063        self
26064    }
26065
26066    /// Sets the value of [replication_type][crate::model::Settings::replication_type].
26067    ///
26068    /// # Example
26069    /// ```ignore,no_run
26070    /// # use google_cloud_sql_v1::model::Settings;
26071    /// use google_cloud_sql_v1::model::SqlReplicationType;
26072    /// let x0 = Settings::new().set_replication_type(SqlReplicationType::Synchronous);
26073    /// let x1 = Settings::new().set_replication_type(SqlReplicationType::Asynchronous);
26074    /// ```
26075    #[deprecated]
26076    pub fn set_replication_type<T: std::convert::Into<crate::model::SqlReplicationType>>(
26077        mut self,
26078        v: T,
26079    ) -> Self {
26080        self.replication_type = v.into();
26081        self
26082    }
26083
26084    /// Sets the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
26085    ///
26086    /// # Example
26087    /// ```ignore,no_run
26088    /// # use google_cloud_sql_v1::model::Settings;
26089    /// use wkt::Int64Value;
26090    /// let x = Settings::new().set_storage_auto_resize_limit(Int64Value::default()/* use setters */);
26091    /// ```
26092    pub fn set_storage_auto_resize_limit<T>(mut self, v: T) -> Self
26093    where
26094        T: std::convert::Into<wkt::Int64Value>,
26095    {
26096        self.storage_auto_resize_limit = std::option::Option::Some(v.into());
26097        self
26098    }
26099
26100    /// Sets or clears the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
26101    ///
26102    /// # Example
26103    /// ```ignore,no_run
26104    /// # use google_cloud_sql_v1::model::Settings;
26105    /// use wkt::Int64Value;
26106    /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(Some(Int64Value::default()/* use setters */));
26107    /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(None::<Int64Value>);
26108    /// ```
26109    pub fn set_or_clear_storage_auto_resize_limit<T>(mut self, v: std::option::Option<T>) -> Self
26110    where
26111        T: std::convert::Into<wkt::Int64Value>,
26112    {
26113        self.storage_auto_resize_limit = v.map(|x| x.into());
26114        self
26115    }
26116
26117    /// Sets the value of [activation_policy][crate::model::Settings::activation_policy].
26118    ///
26119    /// # Example
26120    /// ```ignore,no_run
26121    /// # use google_cloud_sql_v1::model::Settings;
26122    /// use google_cloud_sql_v1::model::settings::SqlActivationPolicy;
26123    /// let x0 = Settings::new().set_activation_policy(SqlActivationPolicy::Always);
26124    /// let x1 = Settings::new().set_activation_policy(SqlActivationPolicy::Never);
26125    /// ```
26126    pub fn set_activation_policy<
26127        T: std::convert::Into<crate::model::settings::SqlActivationPolicy>,
26128    >(
26129        mut self,
26130        v: T,
26131    ) -> Self {
26132        self.activation_policy = v.into();
26133        self
26134    }
26135
26136    /// Sets the value of [ip_configuration][crate::model::Settings::ip_configuration].
26137    ///
26138    /// # Example
26139    /// ```ignore,no_run
26140    /// # use google_cloud_sql_v1::model::Settings;
26141    /// use google_cloud_sql_v1::model::IpConfiguration;
26142    /// let x = Settings::new().set_ip_configuration(IpConfiguration::default()/* use setters */);
26143    /// ```
26144    pub fn set_ip_configuration<T>(mut self, v: T) -> Self
26145    where
26146        T: std::convert::Into<crate::model::IpConfiguration>,
26147    {
26148        self.ip_configuration = std::option::Option::Some(v.into());
26149        self
26150    }
26151
26152    /// Sets or clears the value of [ip_configuration][crate::model::Settings::ip_configuration].
26153    ///
26154    /// # Example
26155    /// ```ignore,no_run
26156    /// # use google_cloud_sql_v1::model::Settings;
26157    /// use google_cloud_sql_v1::model::IpConfiguration;
26158    /// let x = Settings::new().set_or_clear_ip_configuration(Some(IpConfiguration::default()/* use setters */));
26159    /// let x = Settings::new().set_or_clear_ip_configuration(None::<IpConfiguration>);
26160    /// ```
26161    pub fn set_or_clear_ip_configuration<T>(mut self, v: std::option::Option<T>) -> Self
26162    where
26163        T: std::convert::Into<crate::model::IpConfiguration>,
26164    {
26165        self.ip_configuration = v.map(|x| x.into());
26166        self
26167    }
26168
26169    /// Sets the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
26170    ///
26171    /// # Example
26172    /// ```ignore,no_run
26173    /// # use google_cloud_sql_v1::model::Settings;
26174    /// use wkt::BoolValue;
26175    /// let x = Settings::new().set_storage_auto_resize(BoolValue::default()/* use setters */);
26176    /// ```
26177    pub fn set_storage_auto_resize<T>(mut self, v: T) -> Self
26178    where
26179        T: std::convert::Into<wkt::BoolValue>,
26180    {
26181        self.storage_auto_resize = std::option::Option::Some(v.into());
26182        self
26183    }
26184
26185    /// Sets or clears the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
26186    ///
26187    /// # Example
26188    /// ```ignore,no_run
26189    /// # use google_cloud_sql_v1::model::Settings;
26190    /// use wkt::BoolValue;
26191    /// let x = Settings::new().set_or_clear_storage_auto_resize(Some(BoolValue::default()/* use setters */));
26192    /// let x = Settings::new().set_or_clear_storage_auto_resize(None::<BoolValue>);
26193    /// ```
26194    pub fn set_or_clear_storage_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
26195    where
26196        T: std::convert::Into<wkt::BoolValue>,
26197    {
26198        self.storage_auto_resize = v.map(|x| x.into());
26199        self
26200    }
26201
26202    /// Sets the value of [location_preference][crate::model::Settings::location_preference].
26203    ///
26204    /// # Example
26205    /// ```ignore,no_run
26206    /// # use google_cloud_sql_v1::model::Settings;
26207    /// use google_cloud_sql_v1::model::LocationPreference;
26208    /// let x = Settings::new().set_location_preference(LocationPreference::default()/* use setters */);
26209    /// ```
26210    pub fn set_location_preference<T>(mut self, v: T) -> Self
26211    where
26212        T: std::convert::Into<crate::model::LocationPreference>,
26213    {
26214        self.location_preference = std::option::Option::Some(v.into());
26215        self
26216    }
26217
26218    /// Sets or clears the value of [location_preference][crate::model::Settings::location_preference].
26219    ///
26220    /// # Example
26221    /// ```ignore,no_run
26222    /// # use google_cloud_sql_v1::model::Settings;
26223    /// use google_cloud_sql_v1::model::LocationPreference;
26224    /// let x = Settings::new().set_or_clear_location_preference(Some(LocationPreference::default()/* use setters */));
26225    /// let x = Settings::new().set_or_clear_location_preference(None::<LocationPreference>);
26226    /// ```
26227    pub fn set_or_clear_location_preference<T>(mut self, v: std::option::Option<T>) -> Self
26228    where
26229        T: std::convert::Into<crate::model::LocationPreference>,
26230    {
26231        self.location_preference = v.map(|x| x.into());
26232        self
26233    }
26234
26235    /// Sets the value of [database_flags][crate::model::Settings::database_flags].
26236    ///
26237    /// # Example
26238    /// ```ignore,no_run
26239    /// # use google_cloud_sql_v1::model::Settings;
26240    /// use google_cloud_sql_v1::model::DatabaseFlags;
26241    /// let x = Settings::new()
26242    ///     .set_database_flags([
26243    ///         DatabaseFlags::default()/* use setters */,
26244    ///         DatabaseFlags::default()/* use (different) setters */,
26245    ///     ]);
26246    /// ```
26247    pub fn set_database_flags<T, V>(mut self, v: T) -> Self
26248    where
26249        T: std::iter::IntoIterator<Item = V>,
26250        V: std::convert::Into<crate::model::DatabaseFlags>,
26251    {
26252        use std::iter::Iterator;
26253        self.database_flags = v.into_iter().map(|i| i.into()).collect();
26254        self
26255    }
26256
26257    /// Sets the value of [data_disk_type][crate::model::Settings::data_disk_type].
26258    ///
26259    /// # Example
26260    /// ```ignore,no_run
26261    /// # use google_cloud_sql_v1::model::Settings;
26262    /// use google_cloud_sql_v1::model::SqlDataDiskType;
26263    /// let x0 = Settings::new().set_data_disk_type(SqlDataDiskType::PdSsd);
26264    /// let x1 = Settings::new().set_data_disk_type(SqlDataDiskType::PdHdd);
26265    /// let x2 = Settings::new().set_data_disk_type(SqlDataDiskType::HyperdiskBalanced);
26266    /// ```
26267    pub fn set_data_disk_type<T: std::convert::Into<crate::model::SqlDataDiskType>>(
26268        mut self,
26269        v: T,
26270    ) -> Self {
26271        self.data_disk_type = v.into();
26272        self
26273    }
26274
26275    /// Sets the value of [maintenance_window][crate::model::Settings::maintenance_window].
26276    ///
26277    /// # Example
26278    /// ```ignore,no_run
26279    /// # use google_cloud_sql_v1::model::Settings;
26280    /// use google_cloud_sql_v1::model::MaintenanceWindow;
26281    /// let x = Settings::new().set_maintenance_window(MaintenanceWindow::default()/* use setters */);
26282    /// ```
26283    pub fn set_maintenance_window<T>(mut self, v: T) -> Self
26284    where
26285        T: std::convert::Into<crate::model::MaintenanceWindow>,
26286    {
26287        self.maintenance_window = std::option::Option::Some(v.into());
26288        self
26289    }
26290
26291    /// Sets or clears the value of [maintenance_window][crate::model::Settings::maintenance_window].
26292    ///
26293    /// # Example
26294    /// ```ignore,no_run
26295    /// # use google_cloud_sql_v1::model::Settings;
26296    /// use google_cloud_sql_v1::model::MaintenanceWindow;
26297    /// let x = Settings::new().set_or_clear_maintenance_window(Some(MaintenanceWindow::default()/* use setters */));
26298    /// let x = Settings::new().set_or_clear_maintenance_window(None::<MaintenanceWindow>);
26299    /// ```
26300    pub fn set_or_clear_maintenance_window<T>(mut self, v: std::option::Option<T>) -> Self
26301    where
26302        T: std::convert::Into<crate::model::MaintenanceWindow>,
26303    {
26304        self.maintenance_window = v.map(|x| x.into());
26305        self
26306    }
26307
26308    /// Sets the value of [backup_configuration][crate::model::Settings::backup_configuration].
26309    ///
26310    /// # Example
26311    /// ```ignore,no_run
26312    /// # use google_cloud_sql_v1::model::Settings;
26313    /// use google_cloud_sql_v1::model::BackupConfiguration;
26314    /// let x = Settings::new().set_backup_configuration(BackupConfiguration::default()/* use setters */);
26315    /// ```
26316    pub fn set_backup_configuration<T>(mut self, v: T) -> Self
26317    where
26318        T: std::convert::Into<crate::model::BackupConfiguration>,
26319    {
26320        self.backup_configuration = std::option::Option::Some(v.into());
26321        self
26322    }
26323
26324    /// Sets or clears the value of [backup_configuration][crate::model::Settings::backup_configuration].
26325    ///
26326    /// # Example
26327    /// ```ignore,no_run
26328    /// # use google_cloud_sql_v1::model::Settings;
26329    /// use google_cloud_sql_v1::model::BackupConfiguration;
26330    /// let x = Settings::new().set_or_clear_backup_configuration(Some(BackupConfiguration::default()/* use setters */));
26331    /// let x = Settings::new().set_or_clear_backup_configuration(None::<BackupConfiguration>);
26332    /// ```
26333    pub fn set_or_clear_backup_configuration<T>(mut self, v: std::option::Option<T>) -> Self
26334    where
26335        T: std::convert::Into<crate::model::BackupConfiguration>,
26336    {
26337        self.backup_configuration = v.map(|x| x.into());
26338        self
26339    }
26340
26341    /// Sets the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
26342    ///
26343    /// # Example
26344    /// ```ignore,no_run
26345    /// # use google_cloud_sql_v1::model::Settings;
26346    /// use wkt::BoolValue;
26347    /// let x = Settings::new().set_database_replication_enabled(BoolValue::default()/* use setters */);
26348    /// ```
26349    pub fn set_database_replication_enabled<T>(mut self, v: T) -> Self
26350    where
26351        T: std::convert::Into<wkt::BoolValue>,
26352    {
26353        self.database_replication_enabled = std::option::Option::Some(v.into());
26354        self
26355    }
26356
26357    /// Sets or clears the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
26358    ///
26359    /// # Example
26360    /// ```ignore,no_run
26361    /// # use google_cloud_sql_v1::model::Settings;
26362    /// use wkt::BoolValue;
26363    /// let x = Settings::new().set_or_clear_database_replication_enabled(Some(BoolValue::default()/* use setters */));
26364    /// let x = Settings::new().set_or_clear_database_replication_enabled(None::<BoolValue>);
26365    /// ```
26366    pub fn set_or_clear_database_replication_enabled<T>(mut self, v: std::option::Option<T>) -> Self
26367    where
26368        T: std::convert::Into<wkt::BoolValue>,
26369    {
26370        self.database_replication_enabled = v.map(|x| x.into());
26371        self
26372    }
26373
26374    /// Sets the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
26375    ///
26376    /// # Example
26377    /// ```ignore,no_run
26378    /// # use google_cloud_sql_v1::model::Settings;
26379    /// use wkt::BoolValue;
26380    /// let x = Settings::new().set_crash_safe_replication_enabled(BoolValue::default()/* use setters */);
26381    /// ```
26382    #[deprecated]
26383    pub fn set_crash_safe_replication_enabled<T>(mut self, v: T) -> Self
26384    where
26385        T: std::convert::Into<wkt::BoolValue>,
26386    {
26387        self.crash_safe_replication_enabled = std::option::Option::Some(v.into());
26388        self
26389    }
26390
26391    /// Sets or clears the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
26392    ///
26393    /// # Example
26394    /// ```ignore,no_run
26395    /// # use google_cloud_sql_v1::model::Settings;
26396    /// use wkt::BoolValue;
26397    /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(Some(BoolValue::default()/* use setters */));
26398    /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(None::<BoolValue>);
26399    /// ```
26400    #[deprecated]
26401    pub fn set_or_clear_crash_safe_replication_enabled<T>(
26402        mut self,
26403        v: std::option::Option<T>,
26404    ) -> Self
26405    where
26406        T: std::convert::Into<wkt::BoolValue>,
26407    {
26408        self.crash_safe_replication_enabled = v.map(|x| x.into());
26409        self
26410    }
26411
26412    /// Sets the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
26413    ///
26414    /// # Example
26415    /// ```ignore,no_run
26416    /// # use google_cloud_sql_v1::model::Settings;
26417    /// use wkt::Int64Value;
26418    /// let x = Settings::new().set_data_disk_size_gb(Int64Value::default()/* use setters */);
26419    /// ```
26420    pub fn set_data_disk_size_gb<T>(mut self, v: T) -> Self
26421    where
26422        T: std::convert::Into<wkt::Int64Value>,
26423    {
26424        self.data_disk_size_gb = std::option::Option::Some(v.into());
26425        self
26426    }
26427
26428    /// Sets or clears the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
26429    ///
26430    /// # Example
26431    /// ```ignore,no_run
26432    /// # use google_cloud_sql_v1::model::Settings;
26433    /// use wkt::Int64Value;
26434    /// let x = Settings::new().set_or_clear_data_disk_size_gb(Some(Int64Value::default()/* use setters */));
26435    /// let x = Settings::new().set_or_clear_data_disk_size_gb(None::<Int64Value>);
26436    /// ```
26437    pub fn set_or_clear_data_disk_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
26438    where
26439        T: std::convert::Into<wkt::Int64Value>,
26440    {
26441        self.data_disk_size_gb = v.map(|x| x.into());
26442        self
26443    }
26444
26445    /// Sets the value of [active_directory_config][crate::model::Settings::active_directory_config].
26446    ///
26447    /// # Example
26448    /// ```ignore,no_run
26449    /// # use google_cloud_sql_v1::model::Settings;
26450    /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
26451    /// let x = Settings::new().set_active_directory_config(SqlActiveDirectoryConfig::default()/* use setters */);
26452    /// ```
26453    pub fn set_active_directory_config<T>(mut self, v: T) -> Self
26454    where
26455        T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
26456    {
26457        self.active_directory_config = std::option::Option::Some(v.into());
26458        self
26459    }
26460
26461    /// Sets or clears the value of [active_directory_config][crate::model::Settings::active_directory_config].
26462    ///
26463    /// # Example
26464    /// ```ignore,no_run
26465    /// # use google_cloud_sql_v1::model::Settings;
26466    /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
26467    /// let x = Settings::new().set_or_clear_active_directory_config(Some(SqlActiveDirectoryConfig::default()/* use setters */));
26468    /// let x = Settings::new().set_or_clear_active_directory_config(None::<SqlActiveDirectoryConfig>);
26469    /// ```
26470    pub fn set_or_clear_active_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
26471    where
26472        T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
26473    {
26474        self.active_directory_config = v.map(|x| x.into());
26475        self
26476    }
26477
26478    /// Sets the value of [collation][crate::model::Settings::collation].
26479    ///
26480    /// # Example
26481    /// ```ignore,no_run
26482    /// # use google_cloud_sql_v1::model::Settings;
26483    /// let x = Settings::new().set_collation("example");
26484    /// ```
26485    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26486        self.collation = v.into();
26487        self
26488    }
26489
26490    /// Sets the value of [deny_maintenance_periods][crate::model::Settings::deny_maintenance_periods].
26491    ///
26492    /// # Example
26493    /// ```ignore,no_run
26494    /// # use google_cloud_sql_v1::model::Settings;
26495    /// use google_cloud_sql_v1::model::DenyMaintenancePeriod;
26496    /// let x = Settings::new()
26497    ///     .set_deny_maintenance_periods([
26498    ///         DenyMaintenancePeriod::default()/* use setters */,
26499    ///         DenyMaintenancePeriod::default()/* use (different) setters */,
26500    ///     ]);
26501    /// ```
26502    pub fn set_deny_maintenance_periods<T, V>(mut self, v: T) -> Self
26503    where
26504        T: std::iter::IntoIterator<Item = V>,
26505        V: std::convert::Into<crate::model::DenyMaintenancePeriod>,
26506    {
26507        use std::iter::Iterator;
26508        self.deny_maintenance_periods = v.into_iter().map(|i| i.into()).collect();
26509        self
26510    }
26511
26512    /// Sets the value of [insights_config][crate::model::Settings::insights_config].
26513    ///
26514    /// # Example
26515    /// ```ignore,no_run
26516    /// # use google_cloud_sql_v1::model::Settings;
26517    /// use google_cloud_sql_v1::model::InsightsConfig;
26518    /// let x = Settings::new().set_insights_config(InsightsConfig::default()/* use setters */);
26519    /// ```
26520    pub fn set_insights_config<T>(mut self, v: T) -> Self
26521    where
26522        T: std::convert::Into<crate::model::InsightsConfig>,
26523    {
26524        self.insights_config = std::option::Option::Some(v.into());
26525        self
26526    }
26527
26528    /// Sets or clears the value of [insights_config][crate::model::Settings::insights_config].
26529    ///
26530    /// # Example
26531    /// ```ignore,no_run
26532    /// # use google_cloud_sql_v1::model::Settings;
26533    /// use google_cloud_sql_v1::model::InsightsConfig;
26534    /// let x = Settings::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
26535    /// let x = Settings::new().set_or_clear_insights_config(None::<InsightsConfig>);
26536    /// ```
26537    pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
26538    where
26539        T: std::convert::Into<crate::model::InsightsConfig>,
26540    {
26541        self.insights_config = v.map(|x| x.into());
26542        self
26543    }
26544
26545    /// Sets the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
26546    ///
26547    /// # Example
26548    /// ```ignore,no_run
26549    /// # use google_cloud_sql_v1::model::Settings;
26550    /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
26551    /// let x = Settings::new().set_password_validation_policy(PasswordValidationPolicy::default()/* use setters */);
26552    /// ```
26553    pub fn set_password_validation_policy<T>(mut self, v: T) -> Self
26554    where
26555        T: std::convert::Into<crate::model::PasswordValidationPolicy>,
26556    {
26557        self.password_validation_policy = std::option::Option::Some(v.into());
26558        self
26559    }
26560
26561    /// Sets or clears the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
26562    ///
26563    /// # Example
26564    /// ```ignore,no_run
26565    /// # use google_cloud_sql_v1::model::Settings;
26566    /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
26567    /// let x = Settings::new().set_or_clear_password_validation_policy(Some(PasswordValidationPolicy::default()/* use setters */));
26568    /// let x = Settings::new().set_or_clear_password_validation_policy(None::<PasswordValidationPolicy>);
26569    /// ```
26570    pub fn set_or_clear_password_validation_policy<T>(mut self, v: std::option::Option<T>) -> Self
26571    where
26572        T: std::convert::Into<crate::model::PasswordValidationPolicy>,
26573    {
26574        self.password_validation_policy = v.map(|x| x.into());
26575        self
26576    }
26577
26578    /// Sets the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
26579    ///
26580    /// # Example
26581    /// ```ignore,no_run
26582    /// # use google_cloud_sql_v1::model::Settings;
26583    /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
26584    /// let x = Settings::new().set_sql_server_audit_config(SqlServerAuditConfig::default()/* use setters */);
26585    /// ```
26586    pub fn set_sql_server_audit_config<T>(mut self, v: T) -> Self
26587    where
26588        T: std::convert::Into<crate::model::SqlServerAuditConfig>,
26589    {
26590        self.sql_server_audit_config = std::option::Option::Some(v.into());
26591        self
26592    }
26593
26594    /// Sets or clears the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
26595    ///
26596    /// # Example
26597    /// ```ignore,no_run
26598    /// # use google_cloud_sql_v1::model::Settings;
26599    /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
26600    /// let x = Settings::new().set_or_clear_sql_server_audit_config(Some(SqlServerAuditConfig::default()/* use setters */));
26601    /// let x = Settings::new().set_or_clear_sql_server_audit_config(None::<SqlServerAuditConfig>);
26602    /// ```
26603    pub fn set_or_clear_sql_server_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
26604    where
26605        T: std::convert::Into<crate::model::SqlServerAuditConfig>,
26606    {
26607        self.sql_server_audit_config = v.map(|x| x.into());
26608        self
26609    }
26610
26611    /// Sets the value of [edition][crate::model::Settings::edition].
26612    ///
26613    /// # Example
26614    /// ```ignore,no_run
26615    /// # use google_cloud_sql_v1::model::Settings;
26616    /// use google_cloud_sql_v1::model::settings::Edition;
26617    /// let x0 = Settings::new().set_edition(Edition::Enterprise);
26618    /// let x1 = Settings::new().set_edition(Edition::EnterprisePlus);
26619    /// ```
26620    pub fn set_edition<T: std::convert::Into<crate::model::settings::Edition>>(
26621        mut self,
26622        v: T,
26623    ) -> Self {
26624        self.edition = v.into();
26625        self
26626    }
26627
26628    /// Sets the value of [connector_enforcement][crate::model::Settings::connector_enforcement].
26629    ///
26630    /// # Example
26631    /// ```ignore,no_run
26632    /// # use google_cloud_sql_v1::model::Settings;
26633    /// use google_cloud_sql_v1::model::settings::ConnectorEnforcement;
26634    /// let x0 = Settings::new().set_connector_enforcement(ConnectorEnforcement::NotRequired);
26635    /// let x1 = Settings::new().set_connector_enforcement(ConnectorEnforcement::Required);
26636    /// ```
26637    pub fn set_connector_enforcement<
26638        T: std::convert::Into<crate::model::settings::ConnectorEnforcement>,
26639    >(
26640        mut self,
26641        v: T,
26642    ) -> Self {
26643        self.connector_enforcement = v.into();
26644        self
26645    }
26646
26647    /// Sets the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
26648    ///
26649    /// # Example
26650    /// ```ignore,no_run
26651    /// # use google_cloud_sql_v1::model::Settings;
26652    /// use wkt::BoolValue;
26653    /// let x = Settings::new().set_deletion_protection_enabled(BoolValue::default()/* use setters */);
26654    /// ```
26655    pub fn set_deletion_protection_enabled<T>(mut self, v: T) -> Self
26656    where
26657        T: std::convert::Into<wkt::BoolValue>,
26658    {
26659        self.deletion_protection_enabled = std::option::Option::Some(v.into());
26660        self
26661    }
26662
26663    /// Sets or clears the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
26664    ///
26665    /// # Example
26666    /// ```ignore,no_run
26667    /// # use google_cloud_sql_v1::model::Settings;
26668    /// use wkt::BoolValue;
26669    /// let x = Settings::new().set_or_clear_deletion_protection_enabled(Some(BoolValue::default()/* use setters */));
26670    /// let x = Settings::new().set_or_clear_deletion_protection_enabled(None::<BoolValue>);
26671    /// ```
26672    pub fn set_or_clear_deletion_protection_enabled<T>(mut self, v: std::option::Option<T>) -> Self
26673    where
26674        T: std::convert::Into<wkt::BoolValue>,
26675    {
26676        self.deletion_protection_enabled = v.map(|x| x.into());
26677        self
26678    }
26679
26680    /// Sets the value of [time_zone][crate::model::Settings::time_zone].
26681    ///
26682    /// # Example
26683    /// ```ignore,no_run
26684    /// # use google_cloud_sql_v1::model::Settings;
26685    /// let x = Settings::new().set_time_zone("example");
26686    /// ```
26687    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26688        self.time_zone = v.into();
26689        self
26690    }
26691
26692    /// Sets the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
26693    ///
26694    /// # Example
26695    /// ```ignore,no_run
26696    /// # use google_cloud_sql_v1::model::Settings;
26697    /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
26698    /// let x = Settings::new().set_advanced_machine_features(AdvancedMachineFeatures::default()/* use setters */);
26699    /// ```
26700    pub fn set_advanced_machine_features<T>(mut self, v: T) -> Self
26701    where
26702        T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
26703    {
26704        self.advanced_machine_features = std::option::Option::Some(v.into());
26705        self
26706    }
26707
26708    /// Sets or clears the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
26709    ///
26710    /// # Example
26711    /// ```ignore,no_run
26712    /// # use google_cloud_sql_v1::model::Settings;
26713    /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
26714    /// let x = Settings::new().set_or_clear_advanced_machine_features(Some(AdvancedMachineFeatures::default()/* use setters */));
26715    /// let x = Settings::new().set_or_clear_advanced_machine_features(None::<AdvancedMachineFeatures>);
26716    /// ```
26717    pub fn set_or_clear_advanced_machine_features<T>(mut self, v: std::option::Option<T>) -> Self
26718    where
26719        T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
26720    {
26721        self.advanced_machine_features = v.map(|x| x.into());
26722        self
26723    }
26724
26725    /// Sets the value of [data_cache_config][crate::model::Settings::data_cache_config].
26726    ///
26727    /// # Example
26728    /// ```ignore,no_run
26729    /// # use google_cloud_sql_v1::model::Settings;
26730    /// use google_cloud_sql_v1::model::DataCacheConfig;
26731    /// let x = Settings::new().set_data_cache_config(DataCacheConfig::default()/* use setters */);
26732    /// ```
26733    pub fn set_data_cache_config<T>(mut self, v: T) -> Self
26734    where
26735        T: std::convert::Into<crate::model::DataCacheConfig>,
26736    {
26737        self.data_cache_config = std::option::Option::Some(v.into());
26738        self
26739    }
26740
26741    /// Sets or clears the value of [data_cache_config][crate::model::Settings::data_cache_config].
26742    ///
26743    /// # Example
26744    /// ```ignore,no_run
26745    /// # use google_cloud_sql_v1::model::Settings;
26746    /// use google_cloud_sql_v1::model::DataCacheConfig;
26747    /// let x = Settings::new().set_or_clear_data_cache_config(Some(DataCacheConfig::default()/* use setters */));
26748    /// let x = Settings::new().set_or_clear_data_cache_config(None::<DataCacheConfig>);
26749    /// ```
26750    pub fn set_or_clear_data_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
26751    where
26752        T: std::convert::Into<crate::model::DataCacheConfig>,
26753    {
26754        self.data_cache_config = v.map(|x| x.into());
26755        self
26756    }
26757
26758    /// Sets the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
26759    ///
26760    /// # Example
26761    /// ```ignore,no_run
26762    /// # use google_cloud_sql_v1::model::Settings;
26763    /// use wkt::Int32Value;
26764    /// let x = Settings::new().set_replication_lag_max_seconds(Int32Value::default()/* use setters */);
26765    /// ```
26766    pub fn set_replication_lag_max_seconds<T>(mut self, v: T) -> Self
26767    where
26768        T: std::convert::Into<wkt::Int32Value>,
26769    {
26770        self.replication_lag_max_seconds = std::option::Option::Some(v.into());
26771        self
26772    }
26773
26774    /// Sets or clears the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
26775    ///
26776    /// # Example
26777    /// ```ignore,no_run
26778    /// # use google_cloud_sql_v1::model::Settings;
26779    /// use wkt::Int32Value;
26780    /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(Some(Int32Value::default()/* use setters */));
26781    /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(None::<Int32Value>);
26782    /// ```
26783    pub fn set_or_clear_replication_lag_max_seconds<T>(mut self, v: std::option::Option<T>) -> Self
26784    where
26785        T: std::convert::Into<wkt::Int32Value>,
26786    {
26787        self.replication_lag_max_seconds = v.map(|x| x.into());
26788        self
26789    }
26790
26791    /// Sets the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
26792    ///
26793    /// # Example
26794    /// ```ignore,no_run
26795    /// # use google_cloud_sql_v1::model::Settings;
26796    /// use wkt::BoolValue;
26797    /// let x = Settings::new().set_enable_google_ml_integration(BoolValue::default()/* use setters */);
26798    /// ```
26799    pub fn set_enable_google_ml_integration<T>(mut self, v: T) -> Self
26800    where
26801        T: std::convert::Into<wkt::BoolValue>,
26802    {
26803        self.enable_google_ml_integration = std::option::Option::Some(v.into());
26804        self
26805    }
26806
26807    /// Sets or clears the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
26808    ///
26809    /// # Example
26810    /// ```ignore,no_run
26811    /// # use google_cloud_sql_v1::model::Settings;
26812    /// use wkt::BoolValue;
26813    /// let x = Settings::new().set_or_clear_enable_google_ml_integration(Some(BoolValue::default()/* use setters */));
26814    /// let x = Settings::new().set_or_clear_enable_google_ml_integration(None::<BoolValue>);
26815    /// ```
26816    pub fn set_or_clear_enable_google_ml_integration<T>(mut self, v: std::option::Option<T>) -> Self
26817    where
26818        T: std::convert::Into<wkt::BoolValue>,
26819    {
26820        self.enable_google_ml_integration = v.map(|x| x.into());
26821        self
26822    }
26823
26824    /// Sets the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
26825    ///
26826    /// # Example
26827    /// ```ignore,no_run
26828    /// # use google_cloud_sql_v1::model::Settings;
26829    /// use wkt::BoolValue;
26830    /// let x = Settings::new().set_enable_dataplex_integration(BoolValue::default()/* use setters */);
26831    /// ```
26832    pub fn set_enable_dataplex_integration<T>(mut self, v: T) -> Self
26833    where
26834        T: std::convert::Into<wkt::BoolValue>,
26835    {
26836        self.enable_dataplex_integration = std::option::Option::Some(v.into());
26837        self
26838    }
26839
26840    /// Sets or clears the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
26841    ///
26842    /// # Example
26843    /// ```ignore,no_run
26844    /// # use google_cloud_sql_v1::model::Settings;
26845    /// use wkt::BoolValue;
26846    /// let x = Settings::new().set_or_clear_enable_dataplex_integration(Some(BoolValue::default()/* use setters */));
26847    /// let x = Settings::new().set_or_clear_enable_dataplex_integration(None::<BoolValue>);
26848    /// ```
26849    pub fn set_or_clear_enable_dataplex_integration<T>(mut self, v: std::option::Option<T>) -> Self
26850    where
26851        T: std::convert::Into<wkt::BoolValue>,
26852    {
26853        self.enable_dataplex_integration = v.map(|x| x.into());
26854        self
26855    }
26856
26857    /// Sets the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
26858    ///
26859    /// # Example
26860    /// ```ignore,no_run
26861    /// # use google_cloud_sql_v1::model::Settings;
26862    /// use wkt::BoolValue;
26863    /// let x = Settings::new().set_retain_backups_on_delete(BoolValue::default()/* use setters */);
26864    /// ```
26865    pub fn set_retain_backups_on_delete<T>(mut self, v: T) -> Self
26866    where
26867        T: std::convert::Into<wkt::BoolValue>,
26868    {
26869        self.retain_backups_on_delete = std::option::Option::Some(v.into());
26870        self
26871    }
26872
26873    /// Sets or clears the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
26874    ///
26875    /// # Example
26876    /// ```ignore,no_run
26877    /// # use google_cloud_sql_v1::model::Settings;
26878    /// use wkt::BoolValue;
26879    /// let x = Settings::new().set_or_clear_retain_backups_on_delete(Some(BoolValue::default()/* use setters */));
26880    /// let x = Settings::new().set_or_clear_retain_backups_on_delete(None::<BoolValue>);
26881    /// ```
26882    pub fn set_or_clear_retain_backups_on_delete<T>(mut self, v: std::option::Option<T>) -> Self
26883    where
26884        T: std::convert::Into<wkt::BoolValue>,
26885    {
26886        self.retain_backups_on_delete = v.map(|x| x.into());
26887        self
26888    }
26889
26890    /// Sets the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
26891    ///
26892    /// # Example
26893    /// ```ignore,no_run
26894    /// # use google_cloud_sql_v1::model::Settings;
26895    /// let x = Settings::new().set_data_disk_provisioned_iops(42);
26896    /// ```
26897    pub fn set_data_disk_provisioned_iops<T>(mut self, v: T) -> Self
26898    where
26899        T: std::convert::Into<i64>,
26900    {
26901        self.data_disk_provisioned_iops = std::option::Option::Some(v.into());
26902        self
26903    }
26904
26905    /// Sets or clears the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
26906    ///
26907    /// # Example
26908    /// ```ignore,no_run
26909    /// # use google_cloud_sql_v1::model::Settings;
26910    /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(Some(42));
26911    /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(None::<i32>);
26912    /// ```
26913    pub fn set_or_clear_data_disk_provisioned_iops<T>(mut self, v: std::option::Option<T>) -> Self
26914    where
26915        T: std::convert::Into<i64>,
26916    {
26917        self.data_disk_provisioned_iops = v.map(|x| x.into());
26918        self
26919    }
26920
26921    /// Sets the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
26922    ///
26923    /// # Example
26924    /// ```ignore,no_run
26925    /// # use google_cloud_sql_v1::model::Settings;
26926    /// let x = Settings::new().set_data_disk_provisioned_throughput(42);
26927    /// ```
26928    pub fn set_data_disk_provisioned_throughput<T>(mut self, v: T) -> Self
26929    where
26930        T: std::convert::Into<i64>,
26931    {
26932        self.data_disk_provisioned_throughput = std::option::Option::Some(v.into());
26933        self
26934    }
26935
26936    /// Sets or clears the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
26937    ///
26938    /// # Example
26939    /// ```ignore,no_run
26940    /// # use google_cloud_sql_v1::model::Settings;
26941    /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(Some(42));
26942    /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(None::<i32>);
26943    /// ```
26944    pub fn set_or_clear_data_disk_provisioned_throughput<T>(
26945        mut self,
26946        v: std::option::Option<T>,
26947    ) -> Self
26948    where
26949        T: std::convert::Into<i64>,
26950    {
26951        self.data_disk_provisioned_throughput = v.map(|x| x.into());
26952        self
26953    }
26954
26955    /// Sets the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
26956    ///
26957    /// # Example
26958    /// ```ignore,no_run
26959    /// # use google_cloud_sql_v1::model::Settings;
26960    /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
26961    /// let x = Settings::new().set_connection_pool_config(ConnectionPoolConfig::default()/* use setters */);
26962    /// ```
26963    pub fn set_connection_pool_config<T>(mut self, v: T) -> Self
26964    where
26965        T: std::convert::Into<crate::model::ConnectionPoolConfig>,
26966    {
26967        self.connection_pool_config = std::option::Option::Some(v.into());
26968        self
26969    }
26970
26971    /// Sets or clears the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
26972    ///
26973    /// # Example
26974    /// ```ignore,no_run
26975    /// # use google_cloud_sql_v1::model::Settings;
26976    /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
26977    /// let x = Settings::new().set_or_clear_connection_pool_config(Some(ConnectionPoolConfig::default()/* use setters */));
26978    /// let x = Settings::new().set_or_clear_connection_pool_config(None::<ConnectionPoolConfig>);
26979    /// ```
26980    pub fn set_or_clear_connection_pool_config<T>(mut self, v: std::option::Option<T>) -> Self
26981    where
26982        T: std::convert::Into<crate::model::ConnectionPoolConfig>,
26983    {
26984        self.connection_pool_config = v.map(|x| x.into());
26985        self
26986    }
26987
26988    /// Sets the value of [final_backup_config][crate::model::Settings::final_backup_config].
26989    ///
26990    /// # Example
26991    /// ```ignore,no_run
26992    /// # use google_cloud_sql_v1::model::Settings;
26993    /// use google_cloud_sql_v1::model::FinalBackupConfig;
26994    /// let x = Settings::new().set_final_backup_config(FinalBackupConfig::default()/* use setters */);
26995    /// ```
26996    pub fn set_final_backup_config<T>(mut self, v: T) -> Self
26997    where
26998        T: std::convert::Into<crate::model::FinalBackupConfig>,
26999    {
27000        self.final_backup_config = std::option::Option::Some(v.into());
27001        self
27002    }
27003
27004    /// Sets or clears the value of [final_backup_config][crate::model::Settings::final_backup_config].
27005    ///
27006    /// # Example
27007    /// ```ignore,no_run
27008    /// # use google_cloud_sql_v1::model::Settings;
27009    /// use google_cloud_sql_v1::model::FinalBackupConfig;
27010    /// let x = Settings::new().set_or_clear_final_backup_config(Some(FinalBackupConfig::default()/* use setters */));
27011    /// let x = Settings::new().set_or_clear_final_backup_config(None::<FinalBackupConfig>);
27012    /// ```
27013    pub fn set_or_clear_final_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
27014    where
27015        T: std::convert::Into<crate::model::FinalBackupConfig>,
27016    {
27017        self.final_backup_config = v.map(|x| x.into());
27018        self
27019    }
27020
27021    /// Sets the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
27022    ///
27023    /// # Example
27024    /// ```ignore,no_run
27025    /// # use google_cloud_sql_v1::model::Settings;
27026    /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
27027    /// let x = Settings::new().set_read_pool_auto_scale_config(ReadPoolAutoScaleConfig::default()/* use setters */);
27028    /// ```
27029    pub fn set_read_pool_auto_scale_config<T>(mut self, v: T) -> Self
27030    where
27031        T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
27032    {
27033        self.read_pool_auto_scale_config = std::option::Option::Some(v.into());
27034        self
27035    }
27036
27037    /// Sets or clears the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
27038    ///
27039    /// # Example
27040    /// ```ignore,no_run
27041    /// # use google_cloud_sql_v1::model::Settings;
27042    /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
27043    /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(Some(ReadPoolAutoScaleConfig::default()/* use setters */));
27044    /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(None::<ReadPoolAutoScaleConfig>);
27045    /// ```
27046    pub fn set_or_clear_read_pool_auto_scale_config<T>(mut self, v: std::option::Option<T>) -> Self
27047    where
27048        T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
27049    {
27050        self.read_pool_auto_scale_config = v.map(|x| x.into());
27051        self
27052    }
27053
27054    /// Sets the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
27055    ///
27056    /// # Example
27057    /// ```ignore,no_run
27058    /// # use google_cloud_sql_v1::model::Settings;
27059    /// let x = Settings::new().set_auto_upgrade_enabled(true);
27060    /// ```
27061    pub fn set_auto_upgrade_enabled<T>(mut self, v: T) -> Self
27062    where
27063        T: std::convert::Into<bool>,
27064    {
27065        self.auto_upgrade_enabled = std::option::Option::Some(v.into());
27066        self
27067    }
27068
27069    /// Sets or clears the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
27070    ///
27071    /// # Example
27072    /// ```ignore,no_run
27073    /// # use google_cloud_sql_v1::model::Settings;
27074    /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(Some(false));
27075    /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(None::<bool>);
27076    /// ```
27077    pub fn set_or_clear_auto_upgrade_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27078    where
27079        T: std::convert::Into<bool>,
27080    {
27081        self.auto_upgrade_enabled = v.map(|x| x.into());
27082        self
27083    }
27084
27085    /// Sets the value of [entraid_config][crate::model::Settings::entraid_config].
27086    ///
27087    /// # Example
27088    /// ```ignore,no_run
27089    /// # use google_cloud_sql_v1::model::Settings;
27090    /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
27091    /// let x = Settings::new().set_entraid_config(SqlServerEntraIdConfig::default()/* use setters */);
27092    /// ```
27093    pub fn set_entraid_config<T>(mut self, v: T) -> Self
27094    where
27095        T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
27096    {
27097        self.entraid_config = std::option::Option::Some(v.into());
27098        self
27099    }
27100
27101    /// Sets or clears the value of [entraid_config][crate::model::Settings::entraid_config].
27102    ///
27103    /// # Example
27104    /// ```ignore,no_run
27105    /// # use google_cloud_sql_v1::model::Settings;
27106    /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
27107    /// let x = Settings::new().set_or_clear_entraid_config(Some(SqlServerEntraIdConfig::default()/* use setters */));
27108    /// let x = Settings::new().set_or_clear_entraid_config(None::<SqlServerEntraIdConfig>);
27109    /// ```
27110    pub fn set_or_clear_entraid_config<T>(mut self, v: std::option::Option<T>) -> Self
27111    where
27112        T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
27113    {
27114        self.entraid_config = v.map(|x| x.into());
27115        self
27116    }
27117
27118    /// Sets the value of [data_api_access][crate::model::Settings::data_api_access].
27119    ///
27120    /// # Example
27121    /// ```ignore,no_run
27122    /// # use google_cloud_sql_v1::model::Settings;
27123    /// use google_cloud_sql_v1::model::settings::DataApiAccess;
27124    /// let x0 = Settings::new().set_data_api_access(DataApiAccess::DisallowDataApi);
27125    /// let x1 = Settings::new().set_data_api_access(DataApiAccess::AllowDataApi);
27126    /// ```
27127    pub fn set_data_api_access<T>(mut self, v: T) -> Self
27128    where
27129        T: std::convert::Into<crate::model::settings::DataApiAccess>,
27130    {
27131        self.data_api_access = std::option::Option::Some(v.into());
27132        self
27133    }
27134
27135    /// Sets or clears the value of [data_api_access][crate::model::Settings::data_api_access].
27136    ///
27137    /// # Example
27138    /// ```ignore,no_run
27139    /// # use google_cloud_sql_v1::model::Settings;
27140    /// use google_cloud_sql_v1::model::settings::DataApiAccess;
27141    /// let x0 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::DisallowDataApi));
27142    /// let x1 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::AllowDataApi));
27143    /// let x_none = Settings::new().set_or_clear_data_api_access(None::<DataApiAccess>);
27144    /// ```
27145    pub fn set_or_clear_data_api_access<T>(mut self, v: std::option::Option<T>) -> Self
27146    where
27147        T: std::convert::Into<crate::model::settings::DataApiAccess>,
27148    {
27149        self.data_api_access = v.map(|x| x.into());
27150        self
27151    }
27152
27153    /// Sets the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
27154    ///
27155    /// # Example
27156    /// ```ignore,no_run
27157    /// # use google_cloud_sql_v1::model::Settings;
27158    /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27159    /// let x = Settings::new().set_performance_capture_config(PerformanceCaptureConfig::default()/* use setters */);
27160    /// ```
27161    pub fn set_performance_capture_config<T>(mut self, v: T) -> Self
27162    where
27163        T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
27164    {
27165        self.performance_capture_config = std::option::Option::Some(v.into());
27166        self
27167    }
27168
27169    /// Sets or clears the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
27170    ///
27171    /// # Example
27172    /// ```ignore,no_run
27173    /// # use google_cloud_sql_v1::model::Settings;
27174    /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27175    /// let x = Settings::new().set_or_clear_performance_capture_config(Some(PerformanceCaptureConfig::default()/* use setters */));
27176    /// let x = Settings::new().set_or_clear_performance_capture_config(None::<PerformanceCaptureConfig>);
27177    /// ```
27178    pub fn set_or_clear_performance_capture_config<T>(mut self, v: std::option::Option<T>) -> Self
27179    where
27180        T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
27181    {
27182        self.performance_capture_config = v.map(|x| x.into());
27183        self
27184    }
27185}
27186
27187impl wkt::message::Message for Settings {
27188    fn typename() -> &'static str {
27189        "type.googleapis.com/google.cloud.sql.v1.Settings"
27190    }
27191}
27192
27193/// Defines additional types related to [Settings].
27194pub mod settings {
27195    #[allow(unused_imports)]
27196    use super::*;
27197
27198    /// Specifies when the instance is activated.
27199    ///
27200    /// # Working with unknown values
27201    ///
27202    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27203    /// additional enum variants at any time. Adding new variants is not considered
27204    /// a breaking change. Applications should write their code in anticipation of:
27205    ///
27206    /// - New values appearing in future releases of the client library, **and**
27207    /// - New values received dynamically, without application changes.
27208    ///
27209    /// Please consult the [Working with enums] section in the user guide for some
27210    /// guidelines.
27211    ///
27212    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27213    #[derive(Clone, Debug, PartialEq)]
27214    #[non_exhaustive]
27215    pub enum SqlActivationPolicy {
27216        /// Unknown activation plan.
27217        Unspecified,
27218        /// The instance is always up and running.
27219        Always,
27220        /// The instance never starts.
27221        Never,
27222        /// The instance starts upon receiving requests.
27223        #[deprecated]
27224        OnDemand,
27225        /// If set, the enum was initialized with an unknown value.
27226        ///
27227        /// Applications can examine the value using [SqlActivationPolicy::value] or
27228        /// [SqlActivationPolicy::name].
27229        UnknownValue(sql_activation_policy::UnknownValue),
27230    }
27231
27232    #[doc(hidden)]
27233    pub mod sql_activation_policy {
27234        #[allow(unused_imports)]
27235        use super::*;
27236        #[derive(Clone, Debug, PartialEq)]
27237        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27238    }
27239
27240    impl SqlActivationPolicy {
27241        /// Gets the enum value.
27242        ///
27243        /// Returns `None` if the enum contains an unknown value deserialized from
27244        /// the string representation of enums.
27245        pub fn value(&self) -> std::option::Option<i32> {
27246            match self {
27247                Self::Unspecified => std::option::Option::Some(0),
27248                Self::Always => std::option::Option::Some(1),
27249                Self::Never => std::option::Option::Some(2),
27250                Self::OnDemand => std::option::Option::Some(3),
27251                Self::UnknownValue(u) => u.0.value(),
27252            }
27253        }
27254
27255        /// Gets the enum value as a string.
27256        ///
27257        /// Returns `None` if the enum contains an unknown value deserialized from
27258        /// the integer representation of enums.
27259        pub fn name(&self) -> std::option::Option<&str> {
27260            match self {
27261                Self::Unspecified => std::option::Option::Some("SQL_ACTIVATION_POLICY_UNSPECIFIED"),
27262                Self::Always => std::option::Option::Some("ALWAYS"),
27263                Self::Never => std::option::Option::Some("NEVER"),
27264                Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
27265                Self::UnknownValue(u) => u.0.name(),
27266            }
27267        }
27268    }
27269
27270    impl std::default::Default for SqlActivationPolicy {
27271        fn default() -> Self {
27272            use std::convert::From;
27273            Self::from(0)
27274        }
27275    }
27276
27277    impl std::fmt::Display for SqlActivationPolicy {
27278        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27279            wkt::internal::display_enum(f, self.name(), self.value())
27280        }
27281    }
27282
27283    impl std::convert::From<i32> for SqlActivationPolicy {
27284        fn from(value: i32) -> Self {
27285            match value {
27286                0 => Self::Unspecified,
27287                1 => Self::Always,
27288                2 => Self::Never,
27289                3 => Self::OnDemand,
27290                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
27291                    wkt::internal::UnknownEnumValue::Integer(value),
27292                )),
27293            }
27294        }
27295    }
27296
27297    impl std::convert::From<&str> for SqlActivationPolicy {
27298        fn from(value: &str) -> Self {
27299            use std::string::ToString;
27300            match value {
27301                "SQL_ACTIVATION_POLICY_UNSPECIFIED" => Self::Unspecified,
27302                "ALWAYS" => Self::Always,
27303                "NEVER" => Self::Never,
27304                "ON_DEMAND" => Self::OnDemand,
27305                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
27306                    wkt::internal::UnknownEnumValue::String(value.to_string()),
27307                )),
27308            }
27309        }
27310    }
27311
27312    impl serde::ser::Serialize for SqlActivationPolicy {
27313        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27314        where
27315            S: serde::Serializer,
27316        {
27317            match self {
27318                Self::Unspecified => serializer.serialize_i32(0),
27319                Self::Always => serializer.serialize_i32(1),
27320                Self::Never => serializer.serialize_i32(2),
27321                Self::OnDemand => serializer.serialize_i32(3),
27322                Self::UnknownValue(u) => u.0.serialize(serializer),
27323            }
27324        }
27325    }
27326
27327    impl<'de> serde::de::Deserialize<'de> for SqlActivationPolicy {
27328        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27329        where
27330            D: serde::Deserializer<'de>,
27331        {
27332            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlActivationPolicy>::new(
27333                ".google.cloud.sql.v1.Settings.SqlActivationPolicy",
27334            ))
27335        }
27336    }
27337
27338    /// The edition of the instance, can be ENTERPRISE or ENTERPRISE_PLUS.
27339    ///
27340    /// # Working with unknown values
27341    ///
27342    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27343    /// additional enum variants at any time. Adding new variants is not considered
27344    /// a breaking change. Applications should write their code in anticipation of:
27345    ///
27346    /// - New values appearing in future releases of the client library, **and**
27347    /// - New values received dynamically, without application changes.
27348    ///
27349    /// Please consult the [Working with enums] section in the user guide for some
27350    /// guidelines.
27351    ///
27352    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27353    #[derive(Clone, Debug, PartialEq)]
27354    #[non_exhaustive]
27355    pub enum Edition {
27356        /// The instance did not specify the edition.
27357        Unspecified,
27358        /// The instance is an enterprise edition.
27359        Enterprise,
27360        /// The instance is an Enterprise Plus edition.
27361        EnterprisePlus,
27362        /// If set, the enum was initialized with an unknown value.
27363        ///
27364        /// Applications can examine the value using [Edition::value] or
27365        /// [Edition::name].
27366        UnknownValue(edition::UnknownValue),
27367    }
27368
27369    #[doc(hidden)]
27370    pub mod edition {
27371        #[allow(unused_imports)]
27372        use super::*;
27373        #[derive(Clone, Debug, PartialEq)]
27374        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27375    }
27376
27377    impl Edition {
27378        /// Gets the enum value.
27379        ///
27380        /// Returns `None` if the enum contains an unknown value deserialized from
27381        /// the string representation of enums.
27382        pub fn value(&self) -> std::option::Option<i32> {
27383            match self {
27384                Self::Unspecified => std::option::Option::Some(0),
27385                Self::Enterprise => std::option::Option::Some(2),
27386                Self::EnterprisePlus => std::option::Option::Some(3),
27387                Self::UnknownValue(u) => u.0.value(),
27388            }
27389        }
27390
27391        /// Gets the enum value as a string.
27392        ///
27393        /// Returns `None` if the enum contains an unknown value deserialized from
27394        /// the integer representation of enums.
27395        pub fn name(&self) -> std::option::Option<&str> {
27396            match self {
27397                Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
27398                Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
27399                Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
27400                Self::UnknownValue(u) => u.0.name(),
27401            }
27402        }
27403    }
27404
27405    impl std::default::Default for Edition {
27406        fn default() -> Self {
27407            use std::convert::From;
27408            Self::from(0)
27409        }
27410    }
27411
27412    impl std::fmt::Display for Edition {
27413        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27414            wkt::internal::display_enum(f, self.name(), self.value())
27415        }
27416    }
27417
27418    impl std::convert::From<i32> for Edition {
27419        fn from(value: i32) -> Self {
27420            match value {
27421                0 => Self::Unspecified,
27422                2 => Self::Enterprise,
27423                3 => Self::EnterprisePlus,
27424                _ => Self::UnknownValue(edition::UnknownValue(
27425                    wkt::internal::UnknownEnumValue::Integer(value),
27426                )),
27427            }
27428        }
27429    }
27430
27431    impl std::convert::From<&str> for Edition {
27432        fn from(value: &str) -> Self {
27433            use std::string::ToString;
27434            match value {
27435                "EDITION_UNSPECIFIED" => Self::Unspecified,
27436                "ENTERPRISE" => Self::Enterprise,
27437                "ENTERPRISE_PLUS" => Self::EnterprisePlus,
27438                _ => Self::UnknownValue(edition::UnknownValue(
27439                    wkt::internal::UnknownEnumValue::String(value.to_string()),
27440                )),
27441            }
27442        }
27443    }
27444
27445    impl serde::ser::Serialize for Edition {
27446        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27447        where
27448            S: serde::Serializer,
27449        {
27450            match self {
27451                Self::Unspecified => serializer.serialize_i32(0),
27452                Self::Enterprise => serializer.serialize_i32(2),
27453                Self::EnterprisePlus => serializer.serialize_i32(3),
27454                Self::UnknownValue(u) => u.0.serialize(serializer),
27455            }
27456        }
27457    }
27458
27459    impl<'de> serde::de::Deserialize<'de> for Edition {
27460        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27461        where
27462            D: serde::Deserializer<'de>,
27463        {
27464            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
27465                ".google.cloud.sql.v1.Settings.Edition",
27466            ))
27467        }
27468    }
27469
27470    /// The options for enforcing Cloud SQL connectors in the instance.
27471    ///
27472    /// # Working with unknown values
27473    ///
27474    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27475    /// additional enum variants at any time. Adding new variants is not considered
27476    /// a breaking change. Applications should write their code in anticipation of:
27477    ///
27478    /// - New values appearing in future releases of the client library, **and**
27479    /// - New values received dynamically, without application changes.
27480    ///
27481    /// Please consult the [Working with enums] section in the user guide for some
27482    /// guidelines.
27483    ///
27484    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27485    #[derive(Clone, Debug, PartialEq)]
27486    #[non_exhaustive]
27487    pub enum ConnectorEnforcement {
27488        /// The requirement for Cloud SQL connectors is unknown.
27489        Unspecified,
27490        /// Do not require Cloud SQL connectors.
27491        NotRequired,
27492        /// Require all connections to use Cloud SQL connectors, including the
27493        /// Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
27494        /// Note: This disables all existing authorized networks.
27495        Required,
27496        /// If set, the enum was initialized with an unknown value.
27497        ///
27498        /// Applications can examine the value using [ConnectorEnforcement::value] or
27499        /// [ConnectorEnforcement::name].
27500        UnknownValue(connector_enforcement::UnknownValue),
27501    }
27502
27503    #[doc(hidden)]
27504    pub mod connector_enforcement {
27505        #[allow(unused_imports)]
27506        use super::*;
27507        #[derive(Clone, Debug, PartialEq)]
27508        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27509    }
27510
27511    impl ConnectorEnforcement {
27512        /// Gets the enum value.
27513        ///
27514        /// Returns `None` if the enum contains an unknown value deserialized from
27515        /// the string representation of enums.
27516        pub fn value(&self) -> std::option::Option<i32> {
27517            match self {
27518                Self::Unspecified => std::option::Option::Some(0),
27519                Self::NotRequired => std::option::Option::Some(1),
27520                Self::Required => std::option::Option::Some(2),
27521                Self::UnknownValue(u) => u.0.value(),
27522            }
27523        }
27524
27525        /// Gets the enum value as a string.
27526        ///
27527        /// Returns `None` if the enum contains an unknown value deserialized from
27528        /// the integer representation of enums.
27529        pub fn name(&self) -> std::option::Option<&str> {
27530            match self {
27531                Self::Unspecified => std::option::Option::Some("CONNECTOR_ENFORCEMENT_UNSPECIFIED"),
27532                Self::NotRequired => std::option::Option::Some("NOT_REQUIRED"),
27533                Self::Required => std::option::Option::Some("REQUIRED"),
27534                Self::UnknownValue(u) => u.0.name(),
27535            }
27536        }
27537    }
27538
27539    impl std::default::Default for ConnectorEnforcement {
27540        fn default() -> Self {
27541            use std::convert::From;
27542            Self::from(0)
27543        }
27544    }
27545
27546    impl std::fmt::Display for ConnectorEnforcement {
27547        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27548            wkt::internal::display_enum(f, self.name(), self.value())
27549        }
27550    }
27551
27552    impl std::convert::From<i32> for ConnectorEnforcement {
27553        fn from(value: i32) -> Self {
27554            match value {
27555                0 => Self::Unspecified,
27556                1 => Self::NotRequired,
27557                2 => Self::Required,
27558                _ => Self::UnknownValue(connector_enforcement::UnknownValue(
27559                    wkt::internal::UnknownEnumValue::Integer(value),
27560                )),
27561            }
27562        }
27563    }
27564
27565    impl std::convert::From<&str> for ConnectorEnforcement {
27566        fn from(value: &str) -> Self {
27567            use std::string::ToString;
27568            match value {
27569                "CONNECTOR_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
27570                "NOT_REQUIRED" => Self::NotRequired,
27571                "REQUIRED" => Self::Required,
27572                _ => Self::UnknownValue(connector_enforcement::UnknownValue(
27573                    wkt::internal::UnknownEnumValue::String(value.to_string()),
27574                )),
27575            }
27576        }
27577    }
27578
27579    impl serde::ser::Serialize for ConnectorEnforcement {
27580        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27581        where
27582            S: serde::Serializer,
27583        {
27584            match self {
27585                Self::Unspecified => serializer.serialize_i32(0),
27586                Self::NotRequired => serializer.serialize_i32(1),
27587                Self::Required => serializer.serialize_i32(2),
27588                Self::UnknownValue(u) => u.0.serialize(serializer),
27589            }
27590        }
27591    }
27592
27593    impl<'de> serde::de::Deserialize<'de> for ConnectorEnforcement {
27594        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27595        where
27596            D: serde::Deserializer<'de>,
27597        {
27598            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectorEnforcement>::new(
27599                ".google.cloud.sql.v1.Settings.ConnectorEnforcement",
27600            ))
27601        }
27602    }
27603
27604    /// ExecuteSql API's access to the instance.
27605    ///
27606    /// # Working with unknown values
27607    ///
27608    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27609    /// additional enum variants at any time. Adding new variants is not considered
27610    /// a breaking change. Applications should write their code in anticipation of:
27611    ///
27612    /// - New values appearing in future releases of the client library, **and**
27613    /// - New values received dynamically, without application changes.
27614    ///
27615    /// Please consult the [Working with enums] section in the user guide for some
27616    /// guidelines.
27617    ///
27618    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27619    #[derive(Clone, Debug, PartialEq)]
27620    #[non_exhaustive]
27621    pub enum DataApiAccess {
27622        /// Unspecified, effectively the same as `DISALLOW_DATA_API`.
27623        Unspecified,
27624        /// Disallow using ExecuteSql API to connect to the instance.
27625        DisallowDataApi,
27626        /// Allow using ExecuteSql API to connect to the instance. For private IP
27627        /// instances, this allows authorized users to access the instance from
27628        /// the public internet using ExecuteSql API.
27629        AllowDataApi,
27630        /// If set, the enum was initialized with an unknown value.
27631        ///
27632        /// Applications can examine the value using [DataApiAccess::value] or
27633        /// [DataApiAccess::name].
27634        UnknownValue(data_api_access::UnknownValue),
27635    }
27636
27637    #[doc(hidden)]
27638    pub mod data_api_access {
27639        #[allow(unused_imports)]
27640        use super::*;
27641        #[derive(Clone, Debug, PartialEq)]
27642        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27643    }
27644
27645    impl DataApiAccess {
27646        /// Gets the enum value.
27647        ///
27648        /// Returns `None` if the enum contains an unknown value deserialized from
27649        /// the string representation of enums.
27650        pub fn value(&self) -> std::option::Option<i32> {
27651            match self {
27652                Self::Unspecified => std::option::Option::Some(0),
27653                Self::DisallowDataApi => std::option::Option::Some(1),
27654                Self::AllowDataApi => std::option::Option::Some(2),
27655                Self::UnknownValue(u) => u.0.value(),
27656            }
27657        }
27658
27659        /// Gets the enum value as a string.
27660        ///
27661        /// Returns `None` if the enum contains an unknown value deserialized from
27662        /// the integer representation of enums.
27663        pub fn name(&self) -> std::option::Option<&str> {
27664            match self {
27665                Self::Unspecified => std::option::Option::Some("DATA_API_ACCESS_UNSPECIFIED"),
27666                Self::DisallowDataApi => std::option::Option::Some("DISALLOW_DATA_API"),
27667                Self::AllowDataApi => std::option::Option::Some("ALLOW_DATA_API"),
27668                Self::UnknownValue(u) => u.0.name(),
27669            }
27670        }
27671    }
27672
27673    impl std::default::Default for DataApiAccess {
27674        fn default() -> Self {
27675            use std::convert::From;
27676            Self::from(0)
27677        }
27678    }
27679
27680    impl std::fmt::Display for DataApiAccess {
27681        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27682            wkt::internal::display_enum(f, self.name(), self.value())
27683        }
27684    }
27685
27686    impl std::convert::From<i32> for DataApiAccess {
27687        fn from(value: i32) -> Self {
27688            match value {
27689                0 => Self::Unspecified,
27690                1 => Self::DisallowDataApi,
27691                2 => Self::AllowDataApi,
27692                _ => Self::UnknownValue(data_api_access::UnknownValue(
27693                    wkt::internal::UnknownEnumValue::Integer(value),
27694                )),
27695            }
27696        }
27697    }
27698
27699    impl std::convert::From<&str> for DataApiAccess {
27700        fn from(value: &str) -> Self {
27701            use std::string::ToString;
27702            match value {
27703                "DATA_API_ACCESS_UNSPECIFIED" => Self::Unspecified,
27704                "DISALLOW_DATA_API" => Self::DisallowDataApi,
27705                "ALLOW_DATA_API" => Self::AllowDataApi,
27706                _ => Self::UnknownValue(data_api_access::UnknownValue(
27707                    wkt::internal::UnknownEnumValue::String(value.to_string()),
27708                )),
27709            }
27710        }
27711    }
27712
27713    impl serde::ser::Serialize for DataApiAccess {
27714        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27715        where
27716            S: serde::Serializer,
27717        {
27718            match self {
27719                Self::Unspecified => serializer.serialize_i32(0),
27720                Self::DisallowDataApi => serializer.serialize_i32(1),
27721                Self::AllowDataApi => serializer.serialize_i32(2),
27722                Self::UnknownValue(u) => u.0.serialize(serializer),
27723            }
27724        }
27725    }
27726
27727    impl<'de> serde::de::Deserialize<'de> for DataApiAccess {
27728        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27729        where
27730            D: serde::Deserializer<'de>,
27731        {
27732            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataApiAccess>::new(
27733                ".google.cloud.sql.v1.Settings.DataApiAccess",
27734            ))
27735        }
27736    }
27737}
27738
27739/// Performance Capture configuration.
27740#[derive(Clone, Default, PartialEq)]
27741#[non_exhaustive]
27742pub struct PerformanceCaptureConfig {
27743    /// Optional. Enable or disable the Performance Capture feature.
27744    pub enabled: std::option::Option<bool>,
27745
27746    /// Optional. The time interval in seconds between any two probes.
27747    pub probing_interval_seconds: std::option::Option<i32>,
27748
27749    /// Optional. The minimum number of consecutive readings above threshold that
27750    /// triggers instance state capture.
27751    pub probe_threshold: std::option::Option<i32>,
27752
27753    /// Optional. The minimum number of server threads running to trigger the
27754    /// capture on primary.
27755    pub running_threads_threshold: std::option::Option<i32>,
27756
27757    /// Optional. The minimum number of seconds replica must be lagging behind
27758    /// primary to trigger capture on replica.
27759    pub seconds_behind_source_threshold: std::option::Option<i32>,
27760
27761    /// Optional. The amount of time in seconds that a transaction needs to have
27762    /// been open before the watcher starts recording it.
27763    pub transaction_duration_threshold: std::option::Option<i32>,
27764
27765    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27766}
27767
27768impl PerformanceCaptureConfig {
27769    pub fn new() -> Self {
27770        std::default::Default::default()
27771    }
27772
27773    /// Sets the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
27774    ///
27775    /// # Example
27776    /// ```ignore,no_run
27777    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27778    /// let x = PerformanceCaptureConfig::new().set_enabled(true);
27779    /// ```
27780    pub fn set_enabled<T>(mut self, v: T) -> Self
27781    where
27782        T: std::convert::Into<bool>,
27783    {
27784        self.enabled = std::option::Option::Some(v.into());
27785        self
27786    }
27787
27788    /// Sets or clears the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
27789    ///
27790    /// # Example
27791    /// ```ignore,no_run
27792    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27793    /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(Some(false));
27794    /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(None::<bool>);
27795    /// ```
27796    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27797    where
27798        T: std::convert::Into<bool>,
27799    {
27800        self.enabled = v.map(|x| x.into());
27801        self
27802    }
27803
27804    /// Sets the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
27805    ///
27806    /// # Example
27807    /// ```ignore,no_run
27808    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27809    /// let x = PerformanceCaptureConfig::new().set_probing_interval_seconds(42);
27810    /// ```
27811    pub fn set_probing_interval_seconds<T>(mut self, v: T) -> Self
27812    where
27813        T: std::convert::Into<i32>,
27814    {
27815        self.probing_interval_seconds = std::option::Option::Some(v.into());
27816        self
27817    }
27818
27819    /// Sets or clears the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
27820    ///
27821    /// # Example
27822    /// ```ignore,no_run
27823    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27824    /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(Some(42));
27825    /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(None::<i32>);
27826    /// ```
27827    pub fn set_or_clear_probing_interval_seconds<T>(mut self, v: std::option::Option<T>) -> Self
27828    where
27829        T: std::convert::Into<i32>,
27830    {
27831        self.probing_interval_seconds = v.map(|x| x.into());
27832        self
27833    }
27834
27835    /// Sets the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
27836    ///
27837    /// # Example
27838    /// ```ignore,no_run
27839    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27840    /// let x = PerformanceCaptureConfig::new().set_probe_threshold(42);
27841    /// ```
27842    pub fn set_probe_threshold<T>(mut self, v: T) -> Self
27843    where
27844        T: std::convert::Into<i32>,
27845    {
27846        self.probe_threshold = std::option::Option::Some(v.into());
27847        self
27848    }
27849
27850    /// Sets or clears the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
27851    ///
27852    /// # Example
27853    /// ```ignore,no_run
27854    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27855    /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(Some(42));
27856    /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(None::<i32>);
27857    /// ```
27858    pub fn set_or_clear_probe_threshold<T>(mut self, v: std::option::Option<T>) -> Self
27859    where
27860        T: std::convert::Into<i32>,
27861    {
27862        self.probe_threshold = v.map(|x| x.into());
27863        self
27864    }
27865
27866    /// Sets the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
27867    ///
27868    /// # Example
27869    /// ```ignore,no_run
27870    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27871    /// let x = PerformanceCaptureConfig::new().set_running_threads_threshold(42);
27872    /// ```
27873    pub fn set_running_threads_threshold<T>(mut self, v: T) -> Self
27874    where
27875        T: std::convert::Into<i32>,
27876    {
27877        self.running_threads_threshold = std::option::Option::Some(v.into());
27878        self
27879    }
27880
27881    /// Sets or clears the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
27882    ///
27883    /// # Example
27884    /// ```ignore,no_run
27885    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27886    /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(Some(42));
27887    /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(None::<i32>);
27888    /// ```
27889    pub fn set_or_clear_running_threads_threshold<T>(mut self, v: std::option::Option<T>) -> Self
27890    where
27891        T: std::convert::Into<i32>,
27892    {
27893        self.running_threads_threshold = v.map(|x| x.into());
27894        self
27895    }
27896
27897    /// Sets the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
27898    ///
27899    /// # Example
27900    /// ```ignore,no_run
27901    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27902    /// let x = PerformanceCaptureConfig::new().set_seconds_behind_source_threshold(42);
27903    /// ```
27904    pub fn set_seconds_behind_source_threshold<T>(mut self, v: T) -> Self
27905    where
27906        T: std::convert::Into<i32>,
27907    {
27908        self.seconds_behind_source_threshold = std::option::Option::Some(v.into());
27909        self
27910    }
27911
27912    /// Sets or clears the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
27913    ///
27914    /// # Example
27915    /// ```ignore,no_run
27916    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27917    /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(Some(42));
27918    /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(None::<i32>);
27919    /// ```
27920    pub fn set_or_clear_seconds_behind_source_threshold<T>(
27921        mut self,
27922        v: std::option::Option<T>,
27923    ) -> Self
27924    where
27925        T: std::convert::Into<i32>,
27926    {
27927        self.seconds_behind_source_threshold = v.map(|x| x.into());
27928        self
27929    }
27930
27931    /// Sets the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
27932    ///
27933    /// # Example
27934    /// ```ignore,no_run
27935    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27936    /// let x = PerformanceCaptureConfig::new().set_transaction_duration_threshold(42);
27937    /// ```
27938    pub fn set_transaction_duration_threshold<T>(mut self, v: T) -> Self
27939    where
27940        T: std::convert::Into<i32>,
27941    {
27942        self.transaction_duration_threshold = std::option::Option::Some(v.into());
27943        self
27944    }
27945
27946    /// Sets or clears the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
27947    ///
27948    /// # Example
27949    /// ```ignore,no_run
27950    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27951    /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(Some(42));
27952    /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(None::<i32>);
27953    /// ```
27954    pub fn set_or_clear_transaction_duration_threshold<T>(
27955        mut self,
27956        v: std::option::Option<T>,
27957    ) -> Self
27958    where
27959        T: std::convert::Into<i32>,
27960    {
27961        self.transaction_duration_threshold = v.map(|x| x.into());
27962        self
27963    }
27964}
27965
27966impl wkt::message::Message for PerformanceCaptureConfig {
27967    fn typename() -> &'static str {
27968        "type.googleapis.com/google.cloud.sql.v1.PerformanceCaptureConfig"
27969    }
27970}
27971
27972/// Connection pool flags for Cloud SQL instances managed connection pool
27973/// configuration.
27974#[derive(Clone, Default, PartialEq)]
27975#[non_exhaustive]
27976pub struct ConnectionPoolFlags {
27977    /// Required. The name of the flag.
27978    pub name: std::string::String,
27979
27980    /// Required. The value of the flag. Boolean flags are set to `on` for true
27981    /// and `off` for false. This field must be omitted if the flag
27982    /// doesn't take a value.
27983    pub value: std::string::String,
27984
27985    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27986}
27987
27988impl ConnectionPoolFlags {
27989    pub fn new() -> Self {
27990        std::default::Default::default()
27991    }
27992
27993    /// Sets the value of [name][crate::model::ConnectionPoolFlags::name].
27994    ///
27995    /// # Example
27996    /// ```ignore,no_run
27997    /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
27998    /// let x = ConnectionPoolFlags::new().set_name("example");
27999    /// ```
28000    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28001        self.name = v.into();
28002        self
28003    }
28004
28005    /// Sets the value of [value][crate::model::ConnectionPoolFlags::value].
28006    ///
28007    /// # Example
28008    /// ```ignore,no_run
28009    /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
28010    /// let x = ConnectionPoolFlags::new().set_value("example");
28011    /// ```
28012    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28013        self.value = v.into();
28014        self
28015    }
28016}
28017
28018impl wkt::message::Message for ConnectionPoolFlags {
28019    fn typename() -> &'static str {
28020        "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolFlags"
28021    }
28022}
28023
28024/// The managed connection pooling configuration.
28025#[derive(Clone, Default, PartialEq)]
28026#[non_exhaustive]
28027pub struct ConnectionPoolConfig {
28028    /// Whether managed connection pooling is enabled.
28029    pub connection_pooling_enabled: std::option::Option<bool>,
28030
28031    /// Optional. List of connection pool configuration flags.
28032    pub flags: std::vec::Vec<crate::model::ConnectionPoolFlags>,
28033
28034    /// Output only. Number of connection poolers.
28035    pub pooler_count: std::option::Option<i32>,
28036
28037    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28038}
28039
28040impl ConnectionPoolConfig {
28041    pub fn new() -> Self {
28042        std::default::Default::default()
28043    }
28044
28045    /// Sets the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
28046    ///
28047    /// # Example
28048    /// ```ignore,no_run
28049    /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28050    /// let x = ConnectionPoolConfig::new().set_connection_pooling_enabled(true);
28051    /// ```
28052    pub fn set_connection_pooling_enabled<T>(mut self, v: T) -> Self
28053    where
28054        T: std::convert::Into<bool>,
28055    {
28056        self.connection_pooling_enabled = std::option::Option::Some(v.into());
28057        self
28058    }
28059
28060    /// Sets or clears the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
28061    ///
28062    /// # Example
28063    /// ```ignore,no_run
28064    /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28065    /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(Some(false));
28066    /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(None::<bool>);
28067    /// ```
28068    pub fn set_or_clear_connection_pooling_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28069    where
28070        T: std::convert::Into<bool>,
28071    {
28072        self.connection_pooling_enabled = v.map(|x| x.into());
28073        self
28074    }
28075
28076    /// Sets the value of [flags][crate::model::ConnectionPoolConfig::flags].
28077    ///
28078    /// # Example
28079    /// ```ignore,no_run
28080    /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28081    /// use google_cloud_sql_v1::model::ConnectionPoolFlags;
28082    /// let x = ConnectionPoolConfig::new()
28083    ///     .set_flags([
28084    ///         ConnectionPoolFlags::default()/* use setters */,
28085    ///         ConnectionPoolFlags::default()/* use (different) setters */,
28086    ///     ]);
28087    /// ```
28088    pub fn set_flags<T, V>(mut self, v: T) -> Self
28089    where
28090        T: std::iter::IntoIterator<Item = V>,
28091        V: std::convert::Into<crate::model::ConnectionPoolFlags>,
28092    {
28093        use std::iter::Iterator;
28094        self.flags = v.into_iter().map(|i| i.into()).collect();
28095        self
28096    }
28097
28098    /// Sets the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
28099    ///
28100    /// # Example
28101    /// ```ignore,no_run
28102    /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28103    /// let x = ConnectionPoolConfig::new().set_pooler_count(42);
28104    /// ```
28105    pub fn set_pooler_count<T>(mut self, v: T) -> Self
28106    where
28107        T: std::convert::Into<i32>,
28108    {
28109        self.pooler_count = std::option::Option::Some(v.into());
28110        self
28111    }
28112
28113    /// Sets or clears the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
28114    ///
28115    /// # Example
28116    /// ```ignore,no_run
28117    /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28118    /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(Some(42));
28119    /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(None::<i32>);
28120    /// ```
28121    pub fn set_or_clear_pooler_count<T>(mut self, v: std::option::Option<T>) -> Self
28122    where
28123        T: std::convert::Into<i32>,
28124    {
28125        self.pooler_count = v.map(|x| x.into());
28126        self
28127    }
28128}
28129
28130impl wkt::message::Message for ConnectionPoolConfig {
28131    fn typename() -> &'static str {
28132        "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolConfig"
28133    }
28134}
28135
28136/// The read pool auto-scale configuration.
28137#[derive(Clone, Default, PartialEq)]
28138#[non_exhaustive]
28139pub struct ReadPoolAutoScaleConfig {
28140    /// Indicates whether read pool auto scaling is enabled.
28141    pub enabled: std::option::Option<bool>,
28142
28143    /// Minimum number of read pool nodes to be maintained.
28144    pub min_node_count: std::option::Option<i32>,
28145
28146    /// Maximum number of read pool nodes to be maintained.
28147    pub max_node_count: std::option::Option<i32>,
28148
28149    /// Optional. Target metrics for read pool auto scaling.
28150    pub target_metrics: std::vec::Vec<crate::model::read_pool_auto_scale_config::TargetMetric>,
28151
28152    /// Indicates whether read pool auto scaling supports scale in operations
28153    /// (removing nodes).
28154    pub disable_scale_in: std::option::Option<bool>,
28155
28156    /// The cooldown period for scale-in operations.
28157    pub scale_in_cooldown_seconds: std::option::Option<i32>,
28158
28159    /// The cooldown period for scale-out operations.
28160    pub scale_out_cooldown_seconds: std::option::Option<i32>,
28161
28162    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28163}
28164
28165impl ReadPoolAutoScaleConfig {
28166    pub fn new() -> Self {
28167        std::default::Default::default()
28168    }
28169
28170    /// Sets the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
28171    ///
28172    /// # Example
28173    /// ```ignore,no_run
28174    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28175    /// let x = ReadPoolAutoScaleConfig::new().set_enabled(true);
28176    /// ```
28177    pub fn set_enabled<T>(mut self, v: T) -> Self
28178    where
28179        T: std::convert::Into<bool>,
28180    {
28181        self.enabled = std::option::Option::Some(v.into());
28182        self
28183    }
28184
28185    /// Sets or clears the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
28186    ///
28187    /// # Example
28188    /// ```ignore,no_run
28189    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28190    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(Some(false));
28191    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(None::<bool>);
28192    /// ```
28193    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28194    where
28195        T: std::convert::Into<bool>,
28196    {
28197        self.enabled = v.map(|x| x.into());
28198        self
28199    }
28200
28201    /// Sets the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
28202    ///
28203    /// # Example
28204    /// ```ignore,no_run
28205    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28206    /// let x = ReadPoolAutoScaleConfig::new().set_min_node_count(42);
28207    /// ```
28208    pub fn set_min_node_count<T>(mut self, v: T) -> Self
28209    where
28210        T: std::convert::Into<i32>,
28211    {
28212        self.min_node_count = std::option::Option::Some(v.into());
28213        self
28214    }
28215
28216    /// Sets or clears the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
28217    ///
28218    /// # Example
28219    /// ```ignore,no_run
28220    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28221    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(Some(42));
28222    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(None::<i32>);
28223    /// ```
28224    pub fn set_or_clear_min_node_count<T>(mut self, v: std::option::Option<T>) -> Self
28225    where
28226        T: std::convert::Into<i32>,
28227    {
28228        self.min_node_count = v.map(|x| x.into());
28229        self
28230    }
28231
28232    /// Sets the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
28233    ///
28234    /// # Example
28235    /// ```ignore,no_run
28236    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28237    /// let x = ReadPoolAutoScaleConfig::new().set_max_node_count(42);
28238    /// ```
28239    pub fn set_max_node_count<T>(mut self, v: T) -> Self
28240    where
28241        T: std::convert::Into<i32>,
28242    {
28243        self.max_node_count = std::option::Option::Some(v.into());
28244        self
28245    }
28246
28247    /// Sets or clears the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
28248    ///
28249    /// # Example
28250    /// ```ignore,no_run
28251    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28252    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(Some(42));
28253    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(None::<i32>);
28254    /// ```
28255    pub fn set_or_clear_max_node_count<T>(mut self, v: std::option::Option<T>) -> Self
28256    where
28257        T: std::convert::Into<i32>,
28258    {
28259        self.max_node_count = v.map(|x| x.into());
28260        self
28261    }
28262
28263    /// Sets the value of [target_metrics][crate::model::ReadPoolAutoScaleConfig::target_metrics].
28264    ///
28265    /// # Example
28266    /// ```ignore,no_run
28267    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28268    /// use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28269    /// let x = ReadPoolAutoScaleConfig::new()
28270    ///     .set_target_metrics([
28271    ///         TargetMetric::default()/* use setters */,
28272    ///         TargetMetric::default()/* use (different) setters */,
28273    ///     ]);
28274    /// ```
28275    pub fn set_target_metrics<T, V>(mut self, v: T) -> Self
28276    where
28277        T: std::iter::IntoIterator<Item = V>,
28278        V: std::convert::Into<crate::model::read_pool_auto_scale_config::TargetMetric>,
28279    {
28280        use std::iter::Iterator;
28281        self.target_metrics = v.into_iter().map(|i| i.into()).collect();
28282        self
28283    }
28284
28285    /// Sets the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
28286    ///
28287    /// # Example
28288    /// ```ignore,no_run
28289    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28290    /// let x = ReadPoolAutoScaleConfig::new().set_disable_scale_in(true);
28291    /// ```
28292    pub fn set_disable_scale_in<T>(mut self, v: T) -> Self
28293    where
28294        T: std::convert::Into<bool>,
28295    {
28296        self.disable_scale_in = std::option::Option::Some(v.into());
28297        self
28298    }
28299
28300    /// Sets or clears the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
28301    ///
28302    /// # Example
28303    /// ```ignore,no_run
28304    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28305    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(Some(false));
28306    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(None::<bool>);
28307    /// ```
28308    pub fn set_or_clear_disable_scale_in<T>(mut self, v: std::option::Option<T>) -> Self
28309    where
28310        T: std::convert::Into<bool>,
28311    {
28312        self.disable_scale_in = v.map(|x| x.into());
28313        self
28314    }
28315
28316    /// Sets the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
28317    ///
28318    /// # Example
28319    /// ```ignore,no_run
28320    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28321    /// let x = ReadPoolAutoScaleConfig::new().set_scale_in_cooldown_seconds(42);
28322    /// ```
28323    pub fn set_scale_in_cooldown_seconds<T>(mut self, v: T) -> Self
28324    where
28325        T: std::convert::Into<i32>,
28326    {
28327        self.scale_in_cooldown_seconds = std::option::Option::Some(v.into());
28328        self
28329    }
28330
28331    /// Sets or clears the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
28332    ///
28333    /// # Example
28334    /// ```ignore,no_run
28335    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28336    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(Some(42));
28337    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(None::<i32>);
28338    /// ```
28339    pub fn set_or_clear_scale_in_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
28340    where
28341        T: std::convert::Into<i32>,
28342    {
28343        self.scale_in_cooldown_seconds = v.map(|x| x.into());
28344        self
28345    }
28346
28347    /// Sets the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
28348    ///
28349    /// # Example
28350    /// ```ignore,no_run
28351    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28352    /// let x = ReadPoolAutoScaleConfig::new().set_scale_out_cooldown_seconds(42);
28353    /// ```
28354    pub fn set_scale_out_cooldown_seconds<T>(mut self, v: T) -> Self
28355    where
28356        T: std::convert::Into<i32>,
28357    {
28358        self.scale_out_cooldown_seconds = std::option::Option::Some(v.into());
28359        self
28360    }
28361
28362    /// Sets or clears the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
28363    ///
28364    /// # Example
28365    /// ```ignore,no_run
28366    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28367    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(Some(42));
28368    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(None::<i32>);
28369    /// ```
28370    pub fn set_or_clear_scale_out_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
28371    where
28372        T: std::convert::Into<i32>,
28373    {
28374        self.scale_out_cooldown_seconds = v.map(|x| x.into());
28375        self
28376    }
28377}
28378
28379impl wkt::message::Message for ReadPoolAutoScaleConfig {
28380    fn typename() -> &'static str {
28381        "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig"
28382    }
28383}
28384
28385/// Defines additional types related to [ReadPoolAutoScaleConfig].
28386pub mod read_pool_auto_scale_config {
28387    #[allow(unused_imports)]
28388    use super::*;
28389
28390    /// Target metric for read pool auto scaling.
28391    #[derive(Clone, Default, PartialEq)]
28392    #[non_exhaustive]
28393    pub struct TargetMetric {
28394        /// The metric name to be used for auto scaling.
28395        pub metric: std::option::Option<std::string::String>,
28396
28397        /// The target value for the metric.
28398        pub target_value: std::option::Option<f32>,
28399
28400        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28401    }
28402
28403    impl TargetMetric {
28404        pub fn new() -> Self {
28405            std::default::Default::default()
28406        }
28407
28408        /// Sets the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
28409        ///
28410        /// # Example
28411        /// ```ignore,no_run
28412        /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28413        /// let x = TargetMetric::new().set_metric("example");
28414        /// ```
28415        pub fn set_metric<T>(mut self, v: T) -> Self
28416        where
28417            T: std::convert::Into<std::string::String>,
28418        {
28419            self.metric = std::option::Option::Some(v.into());
28420            self
28421        }
28422
28423        /// Sets or clears the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
28424        ///
28425        /// # Example
28426        /// ```ignore,no_run
28427        /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28428        /// let x = TargetMetric::new().set_or_clear_metric(Some("example"));
28429        /// let x = TargetMetric::new().set_or_clear_metric(None::<String>);
28430        /// ```
28431        pub fn set_or_clear_metric<T>(mut self, v: std::option::Option<T>) -> Self
28432        where
28433            T: std::convert::Into<std::string::String>,
28434        {
28435            self.metric = v.map(|x| x.into());
28436            self
28437        }
28438
28439        /// Sets the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
28440        ///
28441        /// # Example
28442        /// ```ignore,no_run
28443        /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28444        /// let x = TargetMetric::new().set_target_value(42.0);
28445        /// ```
28446        pub fn set_target_value<T>(mut self, v: T) -> Self
28447        where
28448            T: std::convert::Into<f32>,
28449        {
28450            self.target_value = std::option::Option::Some(v.into());
28451            self
28452        }
28453
28454        /// Sets or clears the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
28455        ///
28456        /// # Example
28457        /// ```ignore,no_run
28458        /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28459        /// let x = TargetMetric::new().set_or_clear_target_value(Some(42.0));
28460        /// let x = TargetMetric::new().set_or_clear_target_value(None::<f32>);
28461        /// ```
28462        pub fn set_or_clear_target_value<T>(mut self, v: std::option::Option<T>) -> Self
28463        where
28464            T: std::convert::Into<f32>,
28465        {
28466            self.target_value = v.map(|x| x.into());
28467            self
28468        }
28469    }
28470
28471    impl wkt::message::Message for TargetMetric {
28472        fn typename() -> &'static str {
28473            "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric"
28474        }
28475    }
28476}
28477
28478/// Specifies options for controlling advanced machine features.
28479#[derive(Clone, Default, PartialEq)]
28480#[non_exhaustive]
28481pub struct AdvancedMachineFeatures {
28482    /// The number of threads per physical core.
28483    pub threads_per_core: i32,
28484
28485    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28486}
28487
28488impl AdvancedMachineFeatures {
28489    pub fn new() -> Self {
28490        std::default::Default::default()
28491    }
28492
28493    /// Sets the value of [threads_per_core][crate::model::AdvancedMachineFeatures::threads_per_core].
28494    ///
28495    /// # Example
28496    /// ```ignore,no_run
28497    /// # use google_cloud_sql_v1::model::AdvancedMachineFeatures;
28498    /// let x = AdvancedMachineFeatures::new().set_threads_per_core(42);
28499    /// ```
28500    pub fn set_threads_per_core<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
28501        self.threads_per_core = v.into();
28502        self
28503    }
28504}
28505
28506impl wkt::message::Message for AdvancedMachineFeatures {
28507    fn typename() -> &'static str {
28508        "type.googleapis.com/google.cloud.sql.v1.AdvancedMachineFeatures"
28509    }
28510}
28511
28512/// SslCerts Resource
28513#[derive(Clone, Default, PartialEq)]
28514#[non_exhaustive]
28515pub struct SslCert {
28516    /// This is always `sql#sslCert`.
28517    pub kind: std::string::String,
28518
28519    /// Serial number, as extracted from the certificate.
28520    pub cert_serial_number: std::string::String,
28521
28522    /// PEM representation.
28523    pub cert: std::string::String,
28524
28525    /// The time when the certificate was created in [RFC
28526    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
28527    /// `2012-11-15T16:19:00.094Z`
28528    pub create_time: std::option::Option<wkt::Timestamp>,
28529
28530    /// User supplied name.  Constrained to [a-zA-Z.-_ ]+.
28531    pub common_name: std::string::String,
28532
28533    /// The time when the certificate expires in [RFC
28534    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
28535    /// `2012-11-15T16:19:00.094Z`.
28536    pub expiration_time: std::option::Option<wkt::Timestamp>,
28537
28538    /// Sha1 Fingerprint.
28539    pub sha1_fingerprint: std::string::String,
28540
28541    /// Name of the database instance.
28542    pub instance: std::string::String,
28543
28544    /// The URI of this resource.
28545    pub self_link: std::string::String,
28546
28547    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28548}
28549
28550impl SslCert {
28551    pub fn new() -> Self {
28552        std::default::Default::default()
28553    }
28554
28555    /// Sets the value of [kind][crate::model::SslCert::kind].
28556    ///
28557    /// # Example
28558    /// ```ignore,no_run
28559    /// # use google_cloud_sql_v1::model::SslCert;
28560    /// let x = SslCert::new().set_kind("example");
28561    /// ```
28562    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28563        self.kind = v.into();
28564        self
28565    }
28566
28567    /// Sets the value of [cert_serial_number][crate::model::SslCert::cert_serial_number].
28568    ///
28569    /// # Example
28570    /// ```ignore,no_run
28571    /// # use google_cloud_sql_v1::model::SslCert;
28572    /// let x = SslCert::new().set_cert_serial_number("example");
28573    /// ```
28574    pub fn set_cert_serial_number<T: std::convert::Into<std::string::String>>(
28575        mut self,
28576        v: T,
28577    ) -> Self {
28578        self.cert_serial_number = v.into();
28579        self
28580    }
28581
28582    /// Sets the value of [cert][crate::model::SslCert::cert].
28583    ///
28584    /// # Example
28585    /// ```ignore,no_run
28586    /// # use google_cloud_sql_v1::model::SslCert;
28587    /// let x = SslCert::new().set_cert("example");
28588    /// ```
28589    pub fn set_cert<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28590        self.cert = v.into();
28591        self
28592    }
28593
28594    /// Sets the value of [create_time][crate::model::SslCert::create_time].
28595    ///
28596    /// # Example
28597    /// ```ignore,no_run
28598    /// # use google_cloud_sql_v1::model::SslCert;
28599    /// use wkt::Timestamp;
28600    /// let x = SslCert::new().set_create_time(Timestamp::default()/* use setters */);
28601    /// ```
28602    pub fn set_create_time<T>(mut self, v: T) -> Self
28603    where
28604        T: std::convert::Into<wkt::Timestamp>,
28605    {
28606        self.create_time = std::option::Option::Some(v.into());
28607        self
28608    }
28609
28610    /// Sets or clears the value of [create_time][crate::model::SslCert::create_time].
28611    ///
28612    /// # Example
28613    /// ```ignore,no_run
28614    /// # use google_cloud_sql_v1::model::SslCert;
28615    /// use wkt::Timestamp;
28616    /// let x = SslCert::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
28617    /// let x = SslCert::new().set_or_clear_create_time(None::<Timestamp>);
28618    /// ```
28619    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
28620    where
28621        T: std::convert::Into<wkt::Timestamp>,
28622    {
28623        self.create_time = v.map(|x| x.into());
28624        self
28625    }
28626
28627    /// Sets the value of [common_name][crate::model::SslCert::common_name].
28628    ///
28629    /// # Example
28630    /// ```ignore,no_run
28631    /// # use google_cloud_sql_v1::model::SslCert;
28632    /// let x = SslCert::new().set_common_name("example");
28633    /// ```
28634    pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28635        self.common_name = v.into();
28636        self
28637    }
28638
28639    /// Sets the value of [expiration_time][crate::model::SslCert::expiration_time].
28640    ///
28641    /// # Example
28642    /// ```ignore,no_run
28643    /// # use google_cloud_sql_v1::model::SslCert;
28644    /// use wkt::Timestamp;
28645    /// let x = SslCert::new().set_expiration_time(Timestamp::default()/* use setters */);
28646    /// ```
28647    pub fn set_expiration_time<T>(mut self, v: T) -> Self
28648    where
28649        T: std::convert::Into<wkt::Timestamp>,
28650    {
28651        self.expiration_time = std::option::Option::Some(v.into());
28652        self
28653    }
28654
28655    /// Sets or clears the value of [expiration_time][crate::model::SslCert::expiration_time].
28656    ///
28657    /// # Example
28658    /// ```ignore,no_run
28659    /// # use google_cloud_sql_v1::model::SslCert;
28660    /// use wkt::Timestamp;
28661    /// let x = SslCert::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
28662    /// let x = SslCert::new().set_or_clear_expiration_time(None::<Timestamp>);
28663    /// ```
28664    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
28665    where
28666        T: std::convert::Into<wkt::Timestamp>,
28667    {
28668        self.expiration_time = v.map(|x| x.into());
28669        self
28670    }
28671
28672    /// Sets the value of [sha1_fingerprint][crate::model::SslCert::sha1_fingerprint].
28673    ///
28674    /// # Example
28675    /// ```ignore,no_run
28676    /// # use google_cloud_sql_v1::model::SslCert;
28677    /// let x = SslCert::new().set_sha1_fingerprint("example");
28678    /// ```
28679    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
28680        mut self,
28681        v: T,
28682    ) -> Self {
28683        self.sha1_fingerprint = v.into();
28684        self
28685    }
28686
28687    /// Sets the value of [instance][crate::model::SslCert::instance].
28688    ///
28689    /// # Example
28690    /// ```ignore,no_run
28691    /// # use google_cloud_sql_v1::model::SslCert;
28692    /// let x = SslCert::new().set_instance("example");
28693    /// ```
28694    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28695        self.instance = v.into();
28696        self
28697    }
28698
28699    /// Sets the value of [self_link][crate::model::SslCert::self_link].
28700    ///
28701    /// # Example
28702    /// ```ignore,no_run
28703    /// # use google_cloud_sql_v1::model::SslCert;
28704    /// let x = SslCert::new().set_self_link("example");
28705    /// ```
28706    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28707        self.self_link = v.into();
28708        self
28709    }
28710}
28711
28712impl wkt::message::Message for SslCert {
28713    fn typename() -> &'static str {
28714        "type.googleapis.com/google.cloud.sql.v1.SslCert"
28715    }
28716}
28717
28718/// SslCertDetail.
28719#[derive(Clone, Default, PartialEq)]
28720#[non_exhaustive]
28721pub struct SslCertDetail {
28722    /// The public information about the cert.
28723    pub cert_info: std::option::Option<crate::model::SslCert>,
28724
28725    /// The private key for the client cert, in pem format.  Keep private in order
28726    /// to protect your security.
28727    pub cert_private_key: std::string::String,
28728
28729    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28730}
28731
28732impl SslCertDetail {
28733    pub fn new() -> Self {
28734        std::default::Default::default()
28735    }
28736
28737    /// Sets the value of [cert_info][crate::model::SslCertDetail::cert_info].
28738    ///
28739    /// # Example
28740    /// ```ignore,no_run
28741    /// # use google_cloud_sql_v1::model::SslCertDetail;
28742    /// use google_cloud_sql_v1::model::SslCert;
28743    /// let x = SslCertDetail::new().set_cert_info(SslCert::default()/* use setters */);
28744    /// ```
28745    pub fn set_cert_info<T>(mut self, v: T) -> Self
28746    where
28747        T: std::convert::Into<crate::model::SslCert>,
28748    {
28749        self.cert_info = std::option::Option::Some(v.into());
28750        self
28751    }
28752
28753    /// Sets or clears the value of [cert_info][crate::model::SslCertDetail::cert_info].
28754    ///
28755    /// # Example
28756    /// ```ignore,no_run
28757    /// # use google_cloud_sql_v1::model::SslCertDetail;
28758    /// use google_cloud_sql_v1::model::SslCert;
28759    /// let x = SslCertDetail::new().set_or_clear_cert_info(Some(SslCert::default()/* use setters */));
28760    /// let x = SslCertDetail::new().set_or_clear_cert_info(None::<SslCert>);
28761    /// ```
28762    pub fn set_or_clear_cert_info<T>(mut self, v: std::option::Option<T>) -> Self
28763    where
28764        T: std::convert::Into<crate::model::SslCert>,
28765    {
28766        self.cert_info = v.map(|x| x.into());
28767        self
28768    }
28769
28770    /// Sets the value of [cert_private_key][crate::model::SslCertDetail::cert_private_key].
28771    ///
28772    /// # Example
28773    /// ```ignore,no_run
28774    /// # use google_cloud_sql_v1::model::SslCertDetail;
28775    /// let x = SslCertDetail::new().set_cert_private_key("example");
28776    /// ```
28777    pub fn set_cert_private_key<T: std::convert::Into<std::string::String>>(
28778        mut self,
28779        v: T,
28780    ) -> Self {
28781        self.cert_private_key = v.into();
28782        self
28783    }
28784}
28785
28786impl wkt::message::Message for SslCertDetail {
28787    fn typename() -> &'static str {
28788        "type.googleapis.com/google.cloud.sql.v1.SslCertDetail"
28789    }
28790}
28791
28792/// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
28793#[derive(Clone, Default, PartialEq)]
28794#[non_exhaustive]
28795pub struct SqlActiveDirectoryConfig {
28796    /// This is always sql#activeDirectoryConfig.
28797    pub kind: std::string::String,
28798
28799    /// The name of the domain (e.g., mydomain.com).
28800    pub domain: std::string::String,
28801
28802    /// Optional. The mode of the Active Directory configuration.
28803    pub mode: crate::model::sql_active_directory_config::ActiveDirectoryMode,
28804
28805    /// Optional. Domain controller IPv4 addresses used to bootstrap Active
28806    /// Directory.
28807    pub dns_servers: std::vec::Vec<std::string::String>,
28808
28809    /// Optional. The secret manager key storing the administrator credential.
28810    /// (e.g., projects/{project}/secrets/{secret}).
28811    pub admin_credential_secret_name: std::string::String,
28812
28813    /// Optional. The organizational unit distinguished name. This is the full
28814    /// hierarchical path to the organizational unit.
28815    pub organizational_unit: std::string::String,
28816
28817    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28818}
28819
28820impl SqlActiveDirectoryConfig {
28821    pub fn new() -> Self {
28822        std::default::Default::default()
28823    }
28824
28825    /// Sets the value of [kind][crate::model::SqlActiveDirectoryConfig::kind].
28826    ///
28827    /// # Example
28828    /// ```ignore,no_run
28829    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28830    /// let x = SqlActiveDirectoryConfig::new().set_kind("example");
28831    /// ```
28832    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28833        self.kind = v.into();
28834        self
28835    }
28836
28837    /// Sets the value of [domain][crate::model::SqlActiveDirectoryConfig::domain].
28838    ///
28839    /// # Example
28840    /// ```ignore,no_run
28841    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28842    /// let x = SqlActiveDirectoryConfig::new().set_domain("example");
28843    /// ```
28844    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28845        self.domain = v.into();
28846        self
28847    }
28848
28849    /// Sets the value of [mode][crate::model::SqlActiveDirectoryConfig::mode].
28850    ///
28851    /// # Example
28852    /// ```ignore,no_run
28853    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28854    /// use google_cloud_sql_v1::model::sql_active_directory_config::ActiveDirectoryMode;
28855    /// let x0 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::ManagedActiveDirectory);
28856    /// let x1 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::CustomerManagedActiveDirectory);
28857    /// ```
28858    pub fn set_mode<
28859        T: std::convert::Into<crate::model::sql_active_directory_config::ActiveDirectoryMode>,
28860    >(
28861        mut self,
28862        v: T,
28863    ) -> Self {
28864        self.mode = v.into();
28865        self
28866    }
28867
28868    /// Sets the value of [dns_servers][crate::model::SqlActiveDirectoryConfig::dns_servers].
28869    ///
28870    /// # Example
28871    /// ```ignore,no_run
28872    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28873    /// let x = SqlActiveDirectoryConfig::new().set_dns_servers(["a", "b", "c"]);
28874    /// ```
28875    pub fn set_dns_servers<T, V>(mut self, v: T) -> Self
28876    where
28877        T: std::iter::IntoIterator<Item = V>,
28878        V: std::convert::Into<std::string::String>,
28879    {
28880        use std::iter::Iterator;
28881        self.dns_servers = v.into_iter().map(|i| i.into()).collect();
28882        self
28883    }
28884
28885    /// Sets the value of [admin_credential_secret_name][crate::model::SqlActiveDirectoryConfig::admin_credential_secret_name].
28886    ///
28887    /// # Example
28888    /// ```ignore,no_run
28889    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28890    /// let x = SqlActiveDirectoryConfig::new().set_admin_credential_secret_name("example");
28891    /// ```
28892    pub fn set_admin_credential_secret_name<T: std::convert::Into<std::string::String>>(
28893        mut self,
28894        v: T,
28895    ) -> Self {
28896        self.admin_credential_secret_name = v.into();
28897        self
28898    }
28899
28900    /// Sets the value of [organizational_unit][crate::model::SqlActiveDirectoryConfig::organizational_unit].
28901    ///
28902    /// # Example
28903    /// ```ignore,no_run
28904    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28905    /// let x = SqlActiveDirectoryConfig::new().set_organizational_unit("example");
28906    /// ```
28907    pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
28908        mut self,
28909        v: T,
28910    ) -> Self {
28911        self.organizational_unit = v.into();
28912        self
28913    }
28914}
28915
28916impl wkt::message::Message for SqlActiveDirectoryConfig {
28917    fn typename() -> &'static str {
28918        "type.googleapis.com/google.cloud.sql.v1.SqlActiveDirectoryConfig"
28919    }
28920}
28921
28922/// Defines additional types related to [SqlActiveDirectoryConfig].
28923pub mod sql_active_directory_config {
28924    #[allow(unused_imports)]
28925    use super::*;
28926
28927    /// The modes of Active Directory configuration.
28928    ///
28929    /// # Working with unknown values
28930    ///
28931    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28932    /// additional enum variants at any time. Adding new variants is not considered
28933    /// a breaking change. Applications should write their code in anticipation of:
28934    ///
28935    /// - New values appearing in future releases of the client library, **and**
28936    /// - New values received dynamically, without application changes.
28937    ///
28938    /// Please consult the [Working with enums] section in the user guide for some
28939    /// guidelines.
28940    ///
28941    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
28942    #[derive(Clone, Debug, PartialEq)]
28943    #[non_exhaustive]
28944    pub enum ActiveDirectoryMode {
28945        /// Unspecified mode. Will default to MANAGED_ACTIVE_DIRECTORY if the mode is
28946        /// not specified to maintain backward compatibility.
28947        Unspecified,
28948        /// Managed Active Directory mode.
28949        ManagedActiveDirectory,
28950        /// Deprecated: Use CUSTOMER_MANAGED_ACTIVE_DIRECTORY instead.
28951        #[deprecated]
28952        SelfManagedActiveDirectory,
28953        /// Customer-managed Active Directory mode.
28954        CustomerManagedActiveDirectory,
28955        /// If set, the enum was initialized with an unknown value.
28956        ///
28957        /// Applications can examine the value using [ActiveDirectoryMode::value] or
28958        /// [ActiveDirectoryMode::name].
28959        UnknownValue(active_directory_mode::UnknownValue),
28960    }
28961
28962    #[doc(hidden)]
28963    pub mod active_directory_mode {
28964        #[allow(unused_imports)]
28965        use super::*;
28966        #[derive(Clone, Debug, PartialEq)]
28967        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28968    }
28969
28970    impl ActiveDirectoryMode {
28971        /// Gets the enum value.
28972        ///
28973        /// Returns `None` if the enum contains an unknown value deserialized from
28974        /// the string representation of enums.
28975        pub fn value(&self) -> std::option::Option<i32> {
28976            match self {
28977                Self::Unspecified => std::option::Option::Some(0),
28978                Self::ManagedActiveDirectory => std::option::Option::Some(1),
28979                Self::SelfManagedActiveDirectory => std::option::Option::Some(2),
28980                Self::CustomerManagedActiveDirectory => std::option::Option::Some(3),
28981                Self::UnknownValue(u) => u.0.value(),
28982            }
28983        }
28984
28985        /// Gets the enum value as a string.
28986        ///
28987        /// Returns `None` if the enum contains an unknown value deserialized from
28988        /// the integer representation of enums.
28989        pub fn name(&self) -> std::option::Option<&str> {
28990            match self {
28991                Self::Unspecified => std::option::Option::Some("ACTIVE_DIRECTORY_MODE_UNSPECIFIED"),
28992                Self::ManagedActiveDirectory => {
28993                    std::option::Option::Some("MANAGED_ACTIVE_DIRECTORY")
28994                }
28995                Self::SelfManagedActiveDirectory => {
28996                    std::option::Option::Some("SELF_MANAGED_ACTIVE_DIRECTORY")
28997                }
28998                Self::CustomerManagedActiveDirectory => {
28999                    std::option::Option::Some("CUSTOMER_MANAGED_ACTIVE_DIRECTORY")
29000                }
29001                Self::UnknownValue(u) => u.0.name(),
29002            }
29003        }
29004    }
29005
29006    impl std::default::Default for ActiveDirectoryMode {
29007        fn default() -> Self {
29008            use std::convert::From;
29009            Self::from(0)
29010        }
29011    }
29012
29013    impl std::fmt::Display for ActiveDirectoryMode {
29014        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29015            wkt::internal::display_enum(f, self.name(), self.value())
29016        }
29017    }
29018
29019    impl std::convert::From<i32> for ActiveDirectoryMode {
29020        fn from(value: i32) -> Self {
29021            match value {
29022                0 => Self::Unspecified,
29023                1 => Self::ManagedActiveDirectory,
29024                2 => Self::SelfManagedActiveDirectory,
29025                3 => Self::CustomerManagedActiveDirectory,
29026                _ => Self::UnknownValue(active_directory_mode::UnknownValue(
29027                    wkt::internal::UnknownEnumValue::Integer(value),
29028                )),
29029            }
29030        }
29031    }
29032
29033    impl std::convert::From<&str> for ActiveDirectoryMode {
29034        fn from(value: &str) -> Self {
29035            use std::string::ToString;
29036            match value {
29037                "ACTIVE_DIRECTORY_MODE_UNSPECIFIED" => Self::Unspecified,
29038                "MANAGED_ACTIVE_DIRECTORY" => Self::ManagedActiveDirectory,
29039                "SELF_MANAGED_ACTIVE_DIRECTORY" => Self::SelfManagedActiveDirectory,
29040                "CUSTOMER_MANAGED_ACTIVE_DIRECTORY" => Self::CustomerManagedActiveDirectory,
29041                _ => Self::UnknownValue(active_directory_mode::UnknownValue(
29042                    wkt::internal::UnknownEnumValue::String(value.to_string()),
29043                )),
29044            }
29045        }
29046    }
29047
29048    impl serde::ser::Serialize for ActiveDirectoryMode {
29049        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29050        where
29051            S: serde::Serializer,
29052        {
29053            match self {
29054                Self::Unspecified => serializer.serialize_i32(0),
29055                Self::ManagedActiveDirectory => serializer.serialize_i32(1),
29056                Self::SelfManagedActiveDirectory => serializer.serialize_i32(2),
29057                Self::CustomerManagedActiveDirectory => serializer.serialize_i32(3),
29058                Self::UnknownValue(u) => u.0.serialize(serializer),
29059            }
29060        }
29061    }
29062
29063    impl<'de> serde::de::Deserialize<'de> for ActiveDirectoryMode {
29064        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29065        where
29066            D: serde::Deserializer<'de>,
29067        {
29068            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActiveDirectoryMode>::new(
29069                ".google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode",
29070            ))
29071        }
29072    }
29073}
29074
29075/// SQL Server specific audit configuration.
29076#[derive(Clone, Default, PartialEq)]
29077#[non_exhaustive]
29078pub struct SqlServerAuditConfig {
29079    /// This is always sql#sqlServerAuditConfig
29080    pub kind: std::string::String,
29081
29082    /// The name of the destination bucket (e.g., gs://mybucket).
29083    pub bucket: std::string::String,
29084
29085    /// How long to keep generated audit files.
29086    pub retention_interval: std::option::Option<wkt::Duration>,
29087
29088    /// How often to upload generated audit files.
29089    pub upload_interval: std::option::Option<wkt::Duration>,
29090
29091    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29092}
29093
29094impl SqlServerAuditConfig {
29095    pub fn new() -> Self {
29096        std::default::Default::default()
29097    }
29098
29099    /// Sets the value of [kind][crate::model::SqlServerAuditConfig::kind].
29100    ///
29101    /// # Example
29102    /// ```ignore,no_run
29103    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29104    /// let x = SqlServerAuditConfig::new().set_kind("example");
29105    /// ```
29106    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29107        self.kind = v.into();
29108        self
29109    }
29110
29111    /// Sets the value of [bucket][crate::model::SqlServerAuditConfig::bucket].
29112    ///
29113    /// # Example
29114    /// ```ignore,no_run
29115    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29116    /// let x = SqlServerAuditConfig::new().set_bucket("example");
29117    /// ```
29118    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29119        self.bucket = v.into();
29120        self
29121    }
29122
29123    /// Sets the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
29124    ///
29125    /// # Example
29126    /// ```ignore,no_run
29127    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29128    /// use wkt::Duration;
29129    /// let x = SqlServerAuditConfig::new().set_retention_interval(Duration::default()/* use setters */);
29130    /// ```
29131    pub fn set_retention_interval<T>(mut self, v: T) -> Self
29132    where
29133        T: std::convert::Into<wkt::Duration>,
29134    {
29135        self.retention_interval = std::option::Option::Some(v.into());
29136        self
29137    }
29138
29139    /// Sets or clears the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
29140    ///
29141    /// # Example
29142    /// ```ignore,no_run
29143    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29144    /// use wkt::Duration;
29145    /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(Some(Duration::default()/* use setters */));
29146    /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(None::<Duration>);
29147    /// ```
29148    pub fn set_or_clear_retention_interval<T>(mut self, v: std::option::Option<T>) -> Self
29149    where
29150        T: std::convert::Into<wkt::Duration>,
29151    {
29152        self.retention_interval = v.map(|x| x.into());
29153        self
29154    }
29155
29156    /// Sets the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
29157    ///
29158    /// # Example
29159    /// ```ignore,no_run
29160    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29161    /// use wkt::Duration;
29162    /// let x = SqlServerAuditConfig::new().set_upload_interval(Duration::default()/* use setters */);
29163    /// ```
29164    pub fn set_upload_interval<T>(mut self, v: T) -> Self
29165    where
29166        T: std::convert::Into<wkt::Duration>,
29167    {
29168        self.upload_interval = std::option::Option::Some(v.into());
29169        self
29170    }
29171
29172    /// Sets or clears the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
29173    ///
29174    /// # Example
29175    /// ```ignore,no_run
29176    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29177    /// use wkt::Duration;
29178    /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(Some(Duration::default()/* use setters */));
29179    /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(None::<Duration>);
29180    /// ```
29181    pub fn set_or_clear_upload_interval<T>(mut self, v: std::option::Option<T>) -> Self
29182    where
29183        T: std::convert::Into<wkt::Duration>,
29184    {
29185        self.upload_interval = v.map(|x| x.into());
29186        self
29187    }
29188}
29189
29190impl wkt::message::Message for SqlServerAuditConfig {
29191    fn typename() -> &'static str {
29192        "type.googleapis.com/google.cloud.sql.v1.SqlServerAuditConfig"
29193    }
29194}
29195
29196/// SQL Server Entra ID configuration.
29197#[derive(Clone, Default, PartialEq)]
29198#[non_exhaustive]
29199pub struct SqlServerEntraIdConfig {
29200    /// Output only. This is always sql#sqlServerEntraIdConfig
29201    pub kind: std::string::String,
29202
29203    /// Optional. The tenant ID for the Entra ID configuration.
29204    pub tenant_id: std::string::String,
29205
29206    /// Optional. The application ID for the Entra ID configuration.
29207    pub application_id: std::string::String,
29208
29209    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29210}
29211
29212impl SqlServerEntraIdConfig {
29213    pub fn new() -> Self {
29214        std::default::Default::default()
29215    }
29216
29217    /// Sets the value of [kind][crate::model::SqlServerEntraIdConfig::kind].
29218    ///
29219    /// # Example
29220    /// ```ignore,no_run
29221    /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29222    /// let x = SqlServerEntraIdConfig::new().set_kind("example");
29223    /// ```
29224    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29225        self.kind = v.into();
29226        self
29227    }
29228
29229    /// Sets the value of [tenant_id][crate::model::SqlServerEntraIdConfig::tenant_id].
29230    ///
29231    /// # Example
29232    /// ```ignore,no_run
29233    /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29234    /// let x = SqlServerEntraIdConfig::new().set_tenant_id("example");
29235    /// ```
29236    pub fn set_tenant_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29237        self.tenant_id = v.into();
29238        self
29239    }
29240
29241    /// Sets the value of [application_id][crate::model::SqlServerEntraIdConfig::application_id].
29242    ///
29243    /// # Example
29244    /// ```ignore,no_run
29245    /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29246    /// let x = SqlServerEntraIdConfig::new().set_application_id("example");
29247    /// ```
29248    pub fn set_application_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29249        self.application_id = v.into();
29250        self
29251    }
29252}
29253
29254impl wkt::message::Message for SqlServerEntraIdConfig {
29255    fn typename() -> &'static str {
29256        "type.googleapis.com/google.cloud.sql.v1.SqlServerEntraIdConfig"
29257    }
29258}
29259
29260/// Acquire SSRS lease context.
29261#[derive(Clone, Default, PartialEq)]
29262#[non_exhaustive]
29263pub struct AcquireSsrsLeaseContext {
29264    /// The username to be used as the setup login to connect to the database
29265    /// server for SSRS setup.
29266    pub setup_login: std::option::Option<std::string::String>,
29267
29268    /// The username to be used as the service login to connect to the report
29269    /// database for SSRS setup.
29270    pub service_login: std::option::Option<std::string::String>,
29271
29272    /// The report database to be used for SSRS setup.
29273    pub report_database: std::option::Option<std::string::String>,
29274
29275    /// Lease duration needed for SSRS setup.
29276    pub duration: std::option::Option<wkt::Duration>,
29277
29278    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29279}
29280
29281impl AcquireSsrsLeaseContext {
29282    pub fn new() -> Self {
29283        std::default::Default::default()
29284    }
29285
29286    /// Sets the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
29287    ///
29288    /// # Example
29289    /// ```ignore,no_run
29290    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29291    /// let x = AcquireSsrsLeaseContext::new().set_setup_login("example");
29292    /// ```
29293    pub fn set_setup_login<T>(mut self, v: T) -> Self
29294    where
29295        T: std::convert::Into<std::string::String>,
29296    {
29297        self.setup_login = std::option::Option::Some(v.into());
29298        self
29299    }
29300
29301    /// Sets or clears the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
29302    ///
29303    /// # Example
29304    /// ```ignore,no_run
29305    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29306    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(Some("example"));
29307    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(None::<String>);
29308    /// ```
29309    pub fn set_or_clear_setup_login<T>(mut self, v: std::option::Option<T>) -> Self
29310    where
29311        T: std::convert::Into<std::string::String>,
29312    {
29313        self.setup_login = v.map(|x| x.into());
29314        self
29315    }
29316
29317    /// Sets the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
29318    ///
29319    /// # Example
29320    /// ```ignore,no_run
29321    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29322    /// let x = AcquireSsrsLeaseContext::new().set_service_login("example");
29323    /// ```
29324    pub fn set_service_login<T>(mut self, v: T) -> Self
29325    where
29326        T: std::convert::Into<std::string::String>,
29327    {
29328        self.service_login = std::option::Option::Some(v.into());
29329        self
29330    }
29331
29332    /// Sets or clears the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
29333    ///
29334    /// # Example
29335    /// ```ignore,no_run
29336    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29337    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(Some("example"));
29338    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(None::<String>);
29339    /// ```
29340    pub fn set_or_clear_service_login<T>(mut self, v: std::option::Option<T>) -> Self
29341    where
29342        T: std::convert::Into<std::string::String>,
29343    {
29344        self.service_login = v.map(|x| x.into());
29345        self
29346    }
29347
29348    /// Sets the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
29349    ///
29350    /// # Example
29351    /// ```ignore,no_run
29352    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29353    /// let x = AcquireSsrsLeaseContext::new().set_report_database("example");
29354    /// ```
29355    pub fn set_report_database<T>(mut self, v: T) -> Self
29356    where
29357        T: std::convert::Into<std::string::String>,
29358    {
29359        self.report_database = std::option::Option::Some(v.into());
29360        self
29361    }
29362
29363    /// Sets or clears the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
29364    ///
29365    /// # Example
29366    /// ```ignore,no_run
29367    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29368    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(Some("example"));
29369    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(None::<String>);
29370    /// ```
29371    pub fn set_or_clear_report_database<T>(mut self, v: std::option::Option<T>) -> Self
29372    where
29373        T: std::convert::Into<std::string::String>,
29374    {
29375        self.report_database = v.map(|x| x.into());
29376        self
29377    }
29378
29379    /// Sets the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
29380    ///
29381    /// # Example
29382    /// ```ignore,no_run
29383    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29384    /// use wkt::Duration;
29385    /// let x = AcquireSsrsLeaseContext::new().set_duration(Duration::default()/* use setters */);
29386    /// ```
29387    pub fn set_duration<T>(mut self, v: T) -> Self
29388    where
29389        T: std::convert::Into<wkt::Duration>,
29390    {
29391        self.duration = std::option::Option::Some(v.into());
29392        self
29393    }
29394
29395    /// Sets or clears the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
29396    ///
29397    /// # Example
29398    /// ```ignore,no_run
29399    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29400    /// use wkt::Duration;
29401    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
29402    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(None::<Duration>);
29403    /// ```
29404    pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
29405    where
29406        T: std::convert::Into<wkt::Duration>,
29407    {
29408        self.duration = v.map(|x| x.into());
29409        self
29410    }
29411}
29412
29413impl wkt::message::Message for AcquireSsrsLeaseContext {
29414    fn typename() -> &'static str {
29415        "type.googleapis.com/google.cloud.sql.v1.AcquireSsrsLeaseContext"
29416    }
29417}
29418
29419/// DNS metadata.
29420#[derive(Clone, Default, PartialEq)]
29421#[non_exhaustive]
29422pub struct DnsNameMapping {
29423    /// The DNS name.
29424    pub name: std::string::String,
29425
29426    /// Output only. The connection type of the DNS name.
29427    pub connection_type: crate::model::dns_name_mapping::ConnectionType,
29428
29429    /// Output only. The scope that the DNS name applies to.
29430    pub dns_scope: crate::model::dns_name_mapping::DnsScope,
29431
29432    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29433}
29434
29435impl DnsNameMapping {
29436    pub fn new() -> Self {
29437        std::default::Default::default()
29438    }
29439
29440    /// Sets the value of [name][crate::model::DnsNameMapping::name].
29441    ///
29442    /// # Example
29443    /// ```ignore,no_run
29444    /// # use google_cloud_sql_v1::model::DnsNameMapping;
29445    /// let x = DnsNameMapping::new().set_name("example");
29446    /// ```
29447    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29448        self.name = v.into();
29449        self
29450    }
29451
29452    /// Sets the value of [connection_type][crate::model::DnsNameMapping::connection_type].
29453    ///
29454    /// # Example
29455    /// ```ignore,no_run
29456    /// # use google_cloud_sql_v1::model::DnsNameMapping;
29457    /// use google_cloud_sql_v1::model::dns_name_mapping::ConnectionType;
29458    /// let x0 = DnsNameMapping::new().set_connection_type(ConnectionType::Public);
29459    /// let x1 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServicesAccess);
29460    /// let x2 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServiceConnect);
29461    /// ```
29462    pub fn set_connection_type<
29463        T: std::convert::Into<crate::model::dns_name_mapping::ConnectionType>,
29464    >(
29465        mut self,
29466        v: T,
29467    ) -> Self {
29468        self.connection_type = v.into();
29469        self
29470    }
29471
29472    /// Sets the value of [dns_scope][crate::model::DnsNameMapping::dns_scope].
29473    ///
29474    /// # Example
29475    /// ```ignore,no_run
29476    /// # use google_cloud_sql_v1::model::DnsNameMapping;
29477    /// use google_cloud_sql_v1::model::dns_name_mapping::DnsScope;
29478    /// let x0 = DnsNameMapping::new().set_dns_scope(DnsScope::Instance);
29479    /// ```
29480    pub fn set_dns_scope<T: std::convert::Into<crate::model::dns_name_mapping::DnsScope>>(
29481        mut self,
29482        v: T,
29483    ) -> Self {
29484        self.dns_scope = v.into();
29485        self
29486    }
29487}
29488
29489impl wkt::message::Message for DnsNameMapping {
29490    fn typename() -> &'static str {
29491        "type.googleapis.com/google.cloud.sql.v1.DnsNameMapping"
29492    }
29493}
29494
29495/// Defines additional types related to [DnsNameMapping].
29496pub mod dns_name_mapping {
29497    #[allow(unused_imports)]
29498    use super::*;
29499
29500    /// The connection type of the DNS name.
29501    ///
29502    /// # Working with unknown values
29503    ///
29504    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29505    /// additional enum variants at any time. Adding new variants is not considered
29506    /// a breaking change. Applications should write their code in anticipation of:
29507    ///
29508    /// - New values appearing in future releases of the client library, **and**
29509    /// - New values received dynamically, without application changes.
29510    ///
29511    /// Please consult the [Working with enums] section in the user guide for some
29512    /// guidelines.
29513    ///
29514    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
29515    #[derive(Clone, Debug, PartialEq)]
29516    #[non_exhaustive]
29517    pub enum ConnectionType {
29518        /// Unknown connection type.
29519        Unspecified,
29520        /// Public IP.
29521        Public,
29522        /// Private services access (private IP).
29523        PrivateServicesAccess,
29524        /// Private Service Connect.
29525        PrivateServiceConnect,
29526        /// If set, the enum was initialized with an unknown value.
29527        ///
29528        /// Applications can examine the value using [ConnectionType::value] or
29529        /// [ConnectionType::name].
29530        UnknownValue(connection_type::UnknownValue),
29531    }
29532
29533    #[doc(hidden)]
29534    pub mod connection_type {
29535        #[allow(unused_imports)]
29536        use super::*;
29537        #[derive(Clone, Debug, PartialEq)]
29538        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29539    }
29540
29541    impl ConnectionType {
29542        /// Gets the enum value.
29543        ///
29544        /// Returns `None` if the enum contains an unknown value deserialized from
29545        /// the string representation of enums.
29546        pub fn value(&self) -> std::option::Option<i32> {
29547            match self {
29548                Self::Unspecified => std::option::Option::Some(0),
29549                Self::Public => std::option::Option::Some(1),
29550                Self::PrivateServicesAccess => std::option::Option::Some(2),
29551                Self::PrivateServiceConnect => std::option::Option::Some(3),
29552                Self::UnknownValue(u) => u.0.value(),
29553            }
29554        }
29555
29556        /// Gets the enum value as a string.
29557        ///
29558        /// Returns `None` if the enum contains an unknown value deserialized from
29559        /// the integer representation of enums.
29560        pub fn name(&self) -> std::option::Option<&str> {
29561            match self {
29562                Self::Unspecified => std::option::Option::Some("CONNECTION_TYPE_UNSPECIFIED"),
29563                Self::Public => std::option::Option::Some("PUBLIC"),
29564                Self::PrivateServicesAccess => std::option::Option::Some("PRIVATE_SERVICES_ACCESS"),
29565                Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
29566                Self::UnknownValue(u) => u.0.name(),
29567            }
29568        }
29569    }
29570
29571    impl std::default::Default for ConnectionType {
29572        fn default() -> Self {
29573            use std::convert::From;
29574            Self::from(0)
29575        }
29576    }
29577
29578    impl std::fmt::Display for ConnectionType {
29579        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29580            wkt::internal::display_enum(f, self.name(), self.value())
29581        }
29582    }
29583
29584    impl std::convert::From<i32> for ConnectionType {
29585        fn from(value: i32) -> Self {
29586            match value {
29587                0 => Self::Unspecified,
29588                1 => Self::Public,
29589                2 => Self::PrivateServicesAccess,
29590                3 => Self::PrivateServiceConnect,
29591                _ => Self::UnknownValue(connection_type::UnknownValue(
29592                    wkt::internal::UnknownEnumValue::Integer(value),
29593                )),
29594            }
29595        }
29596    }
29597
29598    impl std::convert::From<&str> for ConnectionType {
29599        fn from(value: &str) -> Self {
29600            use std::string::ToString;
29601            match value {
29602                "CONNECTION_TYPE_UNSPECIFIED" => Self::Unspecified,
29603                "PUBLIC" => Self::Public,
29604                "PRIVATE_SERVICES_ACCESS" => Self::PrivateServicesAccess,
29605                "PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
29606                _ => Self::UnknownValue(connection_type::UnknownValue(
29607                    wkt::internal::UnknownEnumValue::String(value.to_string()),
29608                )),
29609            }
29610        }
29611    }
29612
29613    impl serde::ser::Serialize for ConnectionType {
29614        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29615        where
29616            S: serde::Serializer,
29617        {
29618            match self {
29619                Self::Unspecified => serializer.serialize_i32(0),
29620                Self::Public => serializer.serialize_i32(1),
29621                Self::PrivateServicesAccess => serializer.serialize_i32(2),
29622                Self::PrivateServiceConnect => serializer.serialize_i32(3),
29623                Self::UnknownValue(u) => u.0.serialize(serializer),
29624            }
29625        }
29626    }
29627
29628    impl<'de> serde::de::Deserialize<'de> for ConnectionType {
29629        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29630        where
29631            D: serde::Deserializer<'de>,
29632        {
29633            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionType>::new(
29634                ".google.cloud.sql.v1.DnsNameMapping.ConnectionType",
29635            ))
29636        }
29637    }
29638
29639    /// The scope that the DNS name applies to.
29640    ///
29641    /// # Working with unknown values
29642    ///
29643    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29644    /// additional enum variants at any time. Adding new variants is not considered
29645    /// a breaking change. Applications should write their code in anticipation of:
29646    ///
29647    /// - New values appearing in future releases of the client library, **and**
29648    /// - New values received dynamically, without application changes.
29649    ///
29650    /// Please consult the [Working with enums] section in the user guide for some
29651    /// guidelines.
29652    ///
29653    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
29654    #[derive(Clone, Debug, PartialEq)]
29655    #[non_exhaustive]
29656    pub enum DnsScope {
29657        /// Unknown DNS scope.
29658        Unspecified,
29659        /// Indicates a instance-level DNS name.
29660        Instance,
29661        /// If set, the enum was initialized with an unknown value.
29662        ///
29663        /// Applications can examine the value using [DnsScope::value] or
29664        /// [DnsScope::name].
29665        UnknownValue(dns_scope::UnknownValue),
29666    }
29667
29668    #[doc(hidden)]
29669    pub mod dns_scope {
29670        #[allow(unused_imports)]
29671        use super::*;
29672        #[derive(Clone, Debug, PartialEq)]
29673        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29674    }
29675
29676    impl DnsScope {
29677        /// Gets the enum value.
29678        ///
29679        /// Returns `None` if the enum contains an unknown value deserialized from
29680        /// the string representation of enums.
29681        pub fn value(&self) -> std::option::Option<i32> {
29682            match self {
29683                Self::Unspecified => std::option::Option::Some(0),
29684                Self::Instance => std::option::Option::Some(1),
29685                Self::UnknownValue(u) => u.0.value(),
29686            }
29687        }
29688
29689        /// Gets the enum value as a string.
29690        ///
29691        /// Returns `None` if the enum contains an unknown value deserialized from
29692        /// the integer representation of enums.
29693        pub fn name(&self) -> std::option::Option<&str> {
29694            match self {
29695                Self::Unspecified => std::option::Option::Some("DNS_SCOPE_UNSPECIFIED"),
29696                Self::Instance => std::option::Option::Some("INSTANCE"),
29697                Self::UnknownValue(u) => u.0.name(),
29698            }
29699        }
29700    }
29701
29702    impl std::default::Default for DnsScope {
29703        fn default() -> Self {
29704            use std::convert::From;
29705            Self::from(0)
29706        }
29707    }
29708
29709    impl std::fmt::Display for DnsScope {
29710        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29711            wkt::internal::display_enum(f, self.name(), self.value())
29712        }
29713    }
29714
29715    impl std::convert::From<i32> for DnsScope {
29716        fn from(value: i32) -> Self {
29717            match value {
29718                0 => Self::Unspecified,
29719                1 => Self::Instance,
29720                _ => Self::UnknownValue(dns_scope::UnknownValue(
29721                    wkt::internal::UnknownEnumValue::Integer(value),
29722                )),
29723            }
29724        }
29725    }
29726
29727    impl std::convert::From<&str> for DnsScope {
29728        fn from(value: &str) -> Self {
29729            use std::string::ToString;
29730            match value {
29731                "DNS_SCOPE_UNSPECIFIED" => Self::Unspecified,
29732                "INSTANCE" => Self::Instance,
29733                _ => Self::UnknownValue(dns_scope::UnknownValue(
29734                    wkt::internal::UnknownEnumValue::String(value.to_string()),
29735                )),
29736            }
29737        }
29738    }
29739
29740    impl serde::ser::Serialize for DnsScope {
29741        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29742        where
29743            S: serde::Serializer,
29744        {
29745            match self {
29746                Self::Unspecified => serializer.serialize_i32(0),
29747                Self::Instance => serializer.serialize_i32(1),
29748                Self::UnknownValue(u) => u.0.serialize(serializer),
29749            }
29750        }
29751    }
29752
29753    impl<'de> serde::de::Deserialize<'de> for DnsScope {
29754        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29755        where
29756            D: serde::Deserializer<'de>,
29757        {
29758            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DnsScope>::new(
29759                ".google.cloud.sql.v1.DnsNameMapping.DnsScope",
29760            ))
29761        }
29762    }
29763}
29764
29765#[derive(Clone, Default, PartialEq)]
29766#[non_exhaustive]
29767pub struct SqlSslCertsDeleteRequest {
29768    /// Cloud SQL instance ID. This does not include the project ID.
29769    pub instance: std::string::String,
29770
29771    /// Project ID of the project that contains the instance.
29772    pub project: std::string::String,
29773
29774    /// Sha1 FingerPrint.
29775    pub sha1_fingerprint: std::string::String,
29776
29777    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29778}
29779
29780impl SqlSslCertsDeleteRequest {
29781    pub fn new() -> Self {
29782        std::default::Default::default()
29783    }
29784
29785    /// Sets the value of [instance][crate::model::SqlSslCertsDeleteRequest::instance].
29786    ///
29787    /// # Example
29788    /// ```ignore,no_run
29789    /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
29790    /// let x = SqlSslCertsDeleteRequest::new().set_instance("example");
29791    /// ```
29792    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29793        self.instance = v.into();
29794        self
29795    }
29796
29797    /// Sets the value of [project][crate::model::SqlSslCertsDeleteRequest::project].
29798    ///
29799    /// # Example
29800    /// ```ignore,no_run
29801    /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
29802    /// let x = SqlSslCertsDeleteRequest::new().set_project("example");
29803    /// ```
29804    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29805        self.project = v.into();
29806        self
29807    }
29808
29809    /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsDeleteRequest::sha1_fingerprint].
29810    ///
29811    /// # Example
29812    /// ```ignore,no_run
29813    /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
29814    /// let x = SqlSslCertsDeleteRequest::new().set_sha1_fingerprint("example");
29815    /// ```
29816    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
29817        mut self,
29818        v: T,
29819    ) -> Self {
29820        self.sha1_fingerprint = v.into();
29821        self
29822    }
29823}
29824
29825impl wkt::message::Message for SqlSslCertsDeleteRequest {
29826    fn typename() -> &'static str {
29827        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsDeleteRequest"
29828    }
29829}
29830
29831#[derive(Clone, Default, PartialEq)]
29832#[non_exhaustive]
29833pub struct SqlSslCertsGetRequest {
29834    /// Cloud SQL instance ID. This does not include the project ID.
29835    pub instance: std::string::String,
29836
29837    /// Project ID of the project that contains the instance.
29838    pub project: std::string::String,
29839
29840    /// Sha1 FingerPrint.
29841    pub sha1_fingerprint: std::string::String,
29842
29843    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29844}
29845
29846impl SqlSslCertsGetRequest {
29847    pub fn new() -> Self {
29848        std::default::Default::default()
29849    }
29850
29851    /// Sets the value of [instance][crate::model::SqlSslCertsGetRequest::instance].
29852    ///
29853    /// # Example
29854    /// ```ignore,no_run
29855    /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
29856    /// let x = SqlSslCertsGetRequest::new().set_instance("example");
29857    /// ```
29858    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29859        self.instance = v.into();
29860        self
29861    }
29862
29863    /// Sets the value of [project][crate::model::SqlSslCertsGetRequest::project].
29864    ///
29865    /// # Example
29866    /// ```ignore,no_run
29867    /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
29868    /// let x = SqlSslCertsGetRequest::new().set_project("example");
29869    /// ```
29870    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29871        self.project = v.into();
29872        self
29873    }
29874
29875    /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsGetRequest::sha1_fingerprint].
29876    ///
29877    /// # Example
29878    /// ```ignore,no_run
29879    /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
29880    /// let x = SqlSslCertsGetRequest::new().set_sha1_fingerprint("example");
29881    /// ```
29882    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
29883        mut self,
29884        v: T,
29885    ) -> Self {
29886        self.sha1_fingerprint = v.into();
29887        self
29888    }
29889}
29890
29891impl wkt::message::Message for SqlSslCertsGetRequest {
29892    fn typename() -> &'static str {
29893        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsGetRequest"
29894    }
29895}
29896
29897#[derive(Clone, Default, PartialEq)]
29898#[non_exhaustive]
29899pub struct SqlSslCertsInsertRequest {
29900    /// Cloud SQL instance ID. This does not include the project ID.
29901    pub instance: std::string::String,
29902
29903    /// Project ID of the project that contains the instance.
29904    pub project: std::string::String,
29905
29906    pub body: std::option::Option<crate::model::SslCertsInsertRequest>,
29907
29908    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29909}
29910
29911impl SqlSslCertsInsertRequest {
29912    pub fn new() -> Self {
29913        std::default::Default::default()
29914    }
29915
29916    /// Sets the value of [instance][crate::model::SqlSslCertsInsertRequest::instance].
29917    ///
29918    /// # Example
29919    /// ```ignore,no_run
29920    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
29921    /// let x = SqlSslCertsInsertRequest::new().set_instance("example");
29922    /// ```
29923    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29924        self.instance = v.into();
29925        self
29926    }
29927
29928    /// Sets the value of [project][crate::model::SqlSslCertsInsertRequest::project].
29929    ///
29930    /// # Example
29931    /// ```ignore,no_run
29932    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
29933    /// let x = SqlSslCertsInsertRequest::new().set_project("example");
29934    /// ```
29935    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29936        self.project = v.into();
29937        self
29938    }
29939
29940    /// Sets the value of [body][crate::model::SqlSslCertsInsertRequest::body].
29941    ///
29942    /// # Example
29943    /// ```ignore,no_run
29944    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
29945    /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
29946    /// let x = SqlSslCertsInsertRequest::new().set_body(SslCertsInsertRequest::default()/* use setters */);
29947    /// ```
29948    pub fn set_body<T>(mut self, v: T) -> Self
29949    where
29950        T: std::convert::Into<crate::model::SslCertsInsertRequest>,
29951    {
29952        self.body = std::option::Option::Some(v.into());
29953        self
29954    }
29955
29956    /// Sets or clears the value of [body][crate::model::SqlSslCertsInsertRequest::body].
29957    ///
29958    /// # Example
29959    /// ```ignore,no_run
29960    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
29961    /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
29962    /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(Some(SslCertsInsertRequest::default()/* use setters */));
29963    /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(None::<SslCertsInsertRequest>);
29964    /// ```
29965    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
29966    where
29967        T: std::convert::Into<crate::model::SslCertsInsertRequest>,
29968    {
29969        self.body = v.map(|x| x.into());
29970        self
29971    }
29972}
29973
29974impl wkt::message::Message for SqlSslCertsInsertRequest {
29975    fn typename() -> &'static str {
29976        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsInsertRequest"
29977    }
29978}
29979
29980#[derive(Clone, Default, PartialEq)]
29981#[non_exhaustive]
29982pub struct SqlSslCertsListRequest {
29983    /// Cloud SQL instance ID. This does not include the project ID.
29984    pub instance: std::string::String,
29985
29986    /// Project ID of the project that contains the instance.
29987    pub project: std::string::String,
29988
29989    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29990}
29991
29992impl SqlSslCertsListRequest {
29993    pub fn new() -> Self {
29994        std::default::Default::default()
29995    }
29996
29997    /// Sets the value of [instance][crate::model::SqlSslCertsListRequest::instance].
29998    ///
29999    /// # Example
30000    /// ```ignore,no_run
30001    /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
30002    /// let x = SqlSslCertsListRequest::new().set_instance("example");
30003    /// ```
30004    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30005        self.instance = v.into();
30006        self
30007    }
30008
30009    /// Sets the value of [project][crate::model::SqlSslCertsListRequest::project].
30010    ///
30011    /// # Example
30012    /// ```ignore,no_run
30013    /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
30014    /// let x = SqlSslCertsListRequest::new().set_project("example");
30015    /// ```
30016    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30017        self.project = v.into();
30018        self
30019    }
30020}
30021
30022impl wkt::message::Message for SqlSslCertsListRequest {
30023    fn typename() -> &'static str {
30024        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsListRequest"
30025    }
30026}
30027
30028/// SslCerts insert request.
30029#[derive(Clone, Default, PartialEq)]
30030#[non_exhaustive]
30031pub struct SslCertsInsertRequest {
30032    /// User supplied name.  Must be a distinct name from the other certificates
30033    /// for this instance.
30034    pub common_name: std::string::String,
30035
30036    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30037}
30038
30039impl SslCertsInsertRequest {
30040    pub fn new() -> Self {
30041        std::default::Default::default()
30042    }
30043
30044    /// Sets the value of [common_name][crate::model::SslCertsInsertRequest::common_name].
30045    ///
30046    /// # Example
30047    /// ```ignore,no_run
30048    /// # use google_cloud_sql_v1::model::SslCertsInsertRequest;
30049    /// let x = SslCertsInsertRequest::new().set_common_name("example");
30050    /// ```
30051    pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30052        self.common_name = v.into();
30053        self
30054    }
30055}
30056
30057impl wkt::message::Message for SslCertsInsertRequest {
30058    fn typename() -> &'static str {
30059        "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertRequest"
30060    }
30061}
30062
30063/// SslCert insert response.
30064#[derive(Clone, Default, PartialEq)]
30065#[non_exhaustive]
30066pub struct SslCertsInsertResponse {
30067    /// This is always `sql#sslCertsInsert`.
30068    pub kind: std::string::String,
30069
30070    /// The operation to track the ssl certs insert request.
30071    pub operation: std::option::Option<crate::model::Operation>,
30072
30073    /// The server Certificate Authority's certificate.  If this is missing you can
30074    /// force a new one to be generated by calling resetSslConfig method on
30075    /// instances resource.
30076    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
30077
30078    /// The new client certificate and private key.
30079    pub client_cert: std::option::Option<crate::model::SslCertDetail>,
30080
30081    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30082}
30083
30084impl SslCertsInsertResponse {
30085    pub fn new() -> Self {
30086        std::default::Default::default()
30087    }
30088
30089    /// Sets the value of [kind][crate::model::SslCertsInsertResponse::kind].
30090    ///
30091    /// # Example
30092    /// ```ignore,no_run
30093    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30094    /// let x = SslCertsInsertResponse::new().set_kind("example");
30095    /// ```
30096    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30097        self.kind = v.into();
30098        self
30099    }
30100
30101    /// Sets the value of [operation][crate::model::SslCertsInsertResponse::operation].
30102    ///
30103    /// # Example
30104    /// ```ignore,no_run
30105    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30106    /// use google_cloud_sql_v1::model::Operation;
30107    /// let x = SslCertsInsertResponse::new().set_operation(Operation::default()/* use setters */);
30108    /// ```
30109    pub fn set_operation<T>(mut self, v: T) -> Self
30110    where
30111        T: std::convert::Into<crate::model::Operation>,
30112    {
30113        self.operation = std::option::Option::Some(v.into());
30114        self
30115    }
30116
30117    /// Sets or clears the value of [operation][crate::model::SslCertsInsertResponse::operation].
30118    ///
30119    /// # Example
30120    /// ```ignore,no_run
30121    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30122    /// use google_cloud_sql_v1::model::Operation;
30123    /// let x = SslCertsInsertResponse::new().set_or_clear_operation(Some(Operation::default()/* use setters */));
30124    /// let x = SslCertsInsertResponse::new().set_or_clear_operation(None::<Operation>);
30125    /// ```
30126    pub fn set_or_clear_operation<T>(mut self, v: std::option::Option<T>) -> Self
30127    where
30128        T: std::convert::Into<crate::model::Operation>,
30129    {
30130        self.operation = v.map(|x| x.into());
30131        self
30132    }
30133
30134    /// Sets the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
30135    ///
30136    /// # Example
30137    /// ```ignore,no_run
30138    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30139    /// use google_cloud_sql_v1::model::SslCert;
30140    /// let x = SslCertsInsertResponse::new().set_server_ca_cert(SslCert::default()/* use setters */);
30141    /// ```
30142    pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
30143    where
30144        T: std::convert::Into<crate::model::SslCert>,
30145    {
30146        self.server_ca_cert = std::option::Option::Some(v.into());
30147        self
30148    }
30149
30150    /// Sets or clears the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
30151    ///
30152    /// # Example
30153    /// ```ignore,no_run
30154    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30155    /// use google_cloud_sql_v1::model::SslCert;
30156    /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
30157    /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(None::<SslCert>);
30158    /// ```
30159    pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
30160    where
30161        T: std::convert::Into<crate::model::SslCert>,
30162    {
30163        self.server_ca_cert = v.map(|x| x.into());
30164        self
30165    }
30166
30167    /// Sets the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
30168    ///
30169    /// # Example
30170    /// ```ignore,no_run
30171    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30172    /// use google_cloud_sql_v1::model::SslCertDetail;
30173    /// let x = SslCertsInsertResponse::new().set_client_cert(SslCertDetail::default()/* use setters */);
30174    /// ```
30175    pub fn set_client_cert<T>(mut self, v: T) -> Self
30176    where
30177        T: std::convert::Into<crate::model::SslCertDetail>,
30178    {
30179        self.client_cert = std::option::Option::Some(v.into());
30180        self
30181    }
30182
30183    /// Sets or clears the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
30184    ///
30185    /// # Example
30186    /// ```ignore,no_run
30187    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30188    /// use google_cloud_sql_v1::model::SslCertDetail;
30189    /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(Some(SslCertDetail::default()/* use setters */));
30190    /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(None::<SslCertDetail>);
30191    /// ```
30192    pub fn set_or_clear_client_cert<T>(mut self, v: std::option::Option<T>) -> Self
30193    where
30194        T: std::convert::Into<crate::model::SslCertDetail>,
30195    {
30196        self.client_cert = v.map(|x| x.into());
30197        self
30198    }
30199}
30200
30201impl wkt::message::Message for SslCertsInsertResponse {
30202    fn typename() -> &'static str {
30203        "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertResponse"
30204    }
30205}
30206
30207/// SslCerts list response.
30208#[derive(Clone, Default, PartialEq)]
30209#[non_exhaustive]
30210pub struct SslCertsListResponse {
30211    /// This is always `sql#sslCertsList`.
30212    pub kind: std::string::String,
30213
30214    /// List of client certificates for the instance.
30215    pub items: std::vec::Vec<crate::model::SslCert>,
30216
30217    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30218}
30219
30220impl SslCertsListResponse {
30221    pub fn new() -> Self {
30222        std::default::Default::default()
30223    }
30224
30225    /// Sets the value of [kind][crate::model::SslCertsListResponse::kind].
30226    ///
30227    /// # Example
30228    /// ```ignore,no_run
30229    /// # use google_cloud_sql_v1::model::SslCertsListResponse;
30230    /// let x = SslCertsListResponse::new().set_kind("example");
30231    /// ```
30232    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30233        self.kind = v.into();
30234        self
30235    }
30236
30237    /// Sets the value of [items][crate::model::SslCertsListResponse::items].
30238    ///
30239    /// # Example
30240    /// ```ignore,no_run
30241    /// # use google_cloud_sql_v1::model::SslCertsListResponse;
30242    /// use google_cloud_sql_v1::model::SslCert;
30243    /// let x = SslCertsListResponse::new()
30244    ///     .set_items([
30245    ///         SslCert::default()/* use setters */,
30246    ///         SslCert::default()/* use (different) setters */,
30247    ///     ]);
30248    /// ```
30249    pub fn set_items<T, V>(mut self, v: T) -> Self
30250    where
30251        T: std::iter::IntoIterator<Item = V>,
30252        V: std::convert::Into<crate::model::SslCert>,
30253    {
30254        use std::iter::Iterator;
30255        self.items = v.into_iter().map(|i| i.into()).collect();
30256        self
30257    }
30258}
30259
30260impl wkt::message::Message for SslCertsListResponse {
30261    fn typename() -> &'static str {
30262        "type.googleapis.com/google.cloud.sql.v1.SslCertsListResponse"
30263    }
30264}
30265
30266/// Tiers list request.
30267#[derive(Clone, Default, PartialEq)]
30268#[non_exhaustive]
30269pub struct SqlTiersListRequest {
30270    /// Project ID of the project for which to list tiers.
30271    pub project: std::string::String,
30272
30273    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30274}
30275
30276impl SqlTiersListRequest {
30277    pub fn new() -> Self {
30278        std::default::Default::default()
30279    }
30280
30281    /// Sets the value of [project][crate::model::SqlTiersListRequest::project].
30282    ///
30283    /// # Example
30284    /// ```ignore,no_run
30285    /// # use google_cloud_sql_v1::model::SqlTiersListRequest;
30286    /// let x = SqlTiersListRequest::new().set_project("example");
30287    /// ```
30288    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30289        self.project = v.into();
30290        self
30291    }
30292}
30293
30294impl wkt::message::Message for SqlTiersListRequest {
30295    fn typename() -> &'static str {
30296        "type.googleapis.com/google.cloud.sql.v1.SqlTiersListRequest"
30297    }
30298}
30299
30300/// Tiers list response.
30301#[derive(Clone, Default, PartialEq)]
30302#[non_exhaustive]
30303pub struct TiersListResponse {
30304    /// This is always `sql#tiersList`.
30305    pub kind: std::string::String,
30306
30307    /// List of tiers.
30308    pub items: std::vec::Vec<crate::model::Tier>,
30309
30310    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30311}
30312
30313impl TiersListResponse {
30314    pub fn new() -> Self {
30315        std::default::Default::default()
30316    }
30317
30318    /// Sets the value of [kind][crate::model::TiersListResponse::kind].
30319    ///
30320    /// # Example
30321    /// ```ignore,no_run
30322    /// # use google_cloud_sql_v1::model::TiersListResponse;
30323    /// let x = TiersListResponse::new().set_kind("example");
30324    /// ```
30325    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30326        self.kind = v.into();
30327        self
30328    }
30329
30330    /// Sets the value of [items][crate::model::TiersListResponse::items].
30331    ///
30332    /// # Example
30333    /// ```ignore,no_run
30334    /// # use google_cloud_sql_v1::model::TiersListResponse;
30335    /// use google_cloud_sql_v1::model::Tier;
30336    /// let x = TiersListResponse::new()
30337    ///     .set_items([
30338    ///         Tier::default()/* use setters */,
30339    ///         Tier::default()/* use (different) setters */,
30340    ///     ]);
30341    /// ```
30342    pub fn set_items<T, V>(mut self, v: T) -> Self
30343    where
30344        T: std::iter::IntoIterator<Item = V>,
30345        V: std::convert::Into<crate::model::Tier>,
30346    {
30347        use std::iter::Iterator;
30348        self.items = v.into_iter().map(|i| i.into()).collect();
30349        self
30350    }
30351}
30352
30353impl wkt::message::Message for TiersListResponse {
30354    fn typename() -> &'static str {
30355        "type.googleapis.com/google.cloud.sql.v1.TiersListResponse"
30356    }
30357}
30358
30359/// A Google Cloud SQL service tier resource.
30360#[derive(Clone, Default, PartialEq)]
30361#[non_exhaustive]
30362pub struct Tier {
30363    /// An identifier for the machine type, for example, `db-custom-1-3840`. For
30364    /// related information, see [Pricing](/sql/pricing).
30365    pub tier: std::string::String,
30366
30367    /// The maximum RAM usage of this tier in bytes.
30368    pub ram: i64,
30369
30370    /// This is always `sql#tier`.
30371    pub kind: std::string::String,
30372
30373    /// The maximum disk size of this tier in bytes.
30374    pub disk_quota: i64,
30375
30376    /// The applicable regions for this tier.
30377    pub region: std::vec::Vec<std::string::String>,
30378
30379    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30380}
30381
30382impl Tier {
30383    pub fn new() -> Self {
30384        std::default::Default::default()
30385    }
30386
30387    /// Sets the value of [tier][crate::model::Tier::tier].
30388    ///
30389    /// # Example
30390    /// ```ignore,no_run
30391    /// # use google_cloud_sql_v1::model::Tier;
30392    /// let x = Tier::new().set_tier("example");
30393    /// ```
30394    pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30395        self.tier = v.into();
30396        self
30397    }
30398
30399    /// Sets the value of [ram][crate::model::Tier::ram].
30400    ///
30401    /// # Example
30402    /// ```ignore,no_run
30403    /// # use google_cloud_sql_v1::model::Tier;
30404    /// let x = Tier::new().set_ram(42);
30405    /// ```
30406    pub fn set_ram<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
30407        self.ram = v.into();
30408        self
30409    }
30410
30411    /// Sets the value of [kind][crate::model::Tier::kind].
30412    ///
30413    /// # Example
30414    /// ```ignore,no_run
30415    /// # use google_cloud_sql_v1::model::Tier;
30416    /// let x = Tier::new().set_kind("example");
30417    /// ```
30418    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30419        self.kind = v.into();
30420        self
30421    }
30422
30423    /// Sets the value of [disk_quota][crate::model::Tier::disk_quota].
30424    ///
30425    /// # Example
30426    /// ```ignore,no_run
30427    /// # use google_cloud_sql_v1::model::Tier;
30428    /// let x = Tier::new().set_disk_quota(42);
30429    /// ```
30430    pub fn set_disk_quota<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
30431        self.disk_quota = v.into();
30432        self
30433    }
30434
30435    /// Sets the value of [region][crate::model::Tier::region].
30436    ///
30437    /// # Example
30438    /// ```ignore,no_run
30439    /// # use google_cloud_sql_v1::model::Tier;
30440    /// let x = Tier::new().set_region(["a", "b", "c"]);
30441    /// ```
30442    pub fn set_region<T, V>(mut self, v: T) -> Self
30443    where
30444        T: std::iter::IntoIterator<Item = V>,
30445        V: std::convert::Into<std::string::String>,
30446    {
30447        use std::iter::Iterator;
30448        self.region = v.into_iter().map(|i| i.into()).collect();
30449        self
30450    }
30451}
30452
30453impl wkt::message::Message for Tier {
30454    fn typename() -> &'static str {
30455        "type.googleapis.com/google.cloud.sql.v1.Tier"
30456    }
30457}
30458
30459#[derive(Clone, Default, PartialEq)]
30460#[non_exhaustive]
30461pub struct SqlUsersDeleteRequest {
30462    /// Host of the user in the instance.
30463    pub host: std::string::String,
30464
30465    /// Database instance ID. This does not include the project ID.
30466    pub instance: std::string::String,
30467
30468    /// Name of the user in the instance.
30469    pub name: std::string::String,
30470
30471    /// Project ID of the project that contains the instance.
30472    pub project: std::string::String,
30473
30474    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30475}
30476
30477impl SqlUsersDeleteRequest {
30478    pub fn new() -> Self {
30479        std::default::Default::default()
30480    }
30481
30482    /// Sets the value of [host][crate::model::SqlUsersDeleteRequest::host].
30483    ///
30484    /// # Example
30485    /// ```ignore,no_run
30486    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
30487    /// let x = SqlUsersDeleteRequest::new().set_host("example");
30488    /// ```
30489    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30490        self.host = v.into();
30491        self
30492    }
30493
30494    /// Sets the value of [instance][crate::model::SqlUsersDeleteRequest::instance].
30495    ///
30496    /// # Example
30497    /// ```ignore,no_run
30498    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
30499    /// let x = SqlUsersDeleteRequest::new().set_instance("example");
30500    /// ```
30501    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30502        self.instance = v.into();
30503        self
30504    }
30505
30506    /// Sets the value of [name][crate::model::SqlUsersDeleteRequest::name].
30507    ///
30508    /// # Example
30509    /// ```ignore,no_run
30510    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
30511    /// let x = SqlUsersDeleteRequest::new().set_name("example");
30512    /// ```
30513    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30514        self.name = v.into();
30515        self
30516    }
30517
30518    /// Sets the value of [project][crate::model::SqlUsersDeleteRequest::project].
30519    ///
30520    /// # Example
30521    /// ```ignore,no_run
30522    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
30523    /// let x = SqlUsersDeleteRequest::new().set_project("example");
30524    /// ```
30525    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30526        self.project = v.into();
30527        self
30528    }
30529}
30530
30531impl wkt::message::Message for SqlUsersDeleteRequest {
30532    fn typename() -> &'static str {
30533        "type.googleapis.com/google.cloud.sql.v1.SqlUsersDeleteRequest"
30534    }
30535}
30536
30537/// Request message for Users Get RPC
30538#[derive(Clone, Default, PartialEq)]
30539#[non_exhaustive]
30540pub struct SqlUsersGetRequest {
30541    /// Database instance ID. This does not include the project ID.
30542    pub instance: std::string::String,
30543
30544    /// User of the instance.
30545    pub name: std::string::String,
30546
30547    /// Project ID of the project that contains the instance.
30548    pub project: std::string::String,
30549
30550    /// Host of a user of the instance.
30551    pub host: std::string::String,
30552
30553    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30554}
30555
30556impl SqlUsersGetRequest {
30557    pub fn new() -> Self {
30558        std::default::Default::default()
30559    }
30560
30561    /// Sets the value of [instance][crate::model::SqlUsersGetRequest::instance].
30562    ///
30563    /// # Example
30564    /// ```ignore,no_run
30565    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
30566    /// let x = SqlUsersGetRequest::new().set_instance("example");
30567    /// ```
30568    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30569        self.instance = v.into();
30570        self
30571    }
30572
30573    /// Sets the value of [name][crate::model::SqlUsersGetRequest::name].
30574    ///
30575    /// # Example
30576    /// ```ignore,no_run
30577    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
30578    /// let x = SqlUsersGetRequest::new().set_name("example");
30579    /// ```
30580    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30581        self.name = v.into();
30582        self
30583    }
30584
30585    /// Sets the value of [project][crate::model::SqlUsersGetRequest::project].
30586    ///
30587    /// # Example
30588    /// ```ignore,no_run
30589    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
30590    /// let x = SqlUsersGetRequest::new().set_project("example");
30591    /// ```
30592    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30593        self.project = v.into();
30594        self
30595    }
30596
30597    /// Sets the value of [host][crate::model::SqlUsersGetRequest::host].
30598    ///
30599    /// # Example
30600    /// ```ignore,no_run
30601    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
30602    /// let x = SqlUsersGetRequest::new().set_host("example");
30603    /// ```
30604    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30605        self.host = v.into();
30606        self
30607    }
30608}
30609
30610impl wkt::message::Message for SqlUsersGetRequest {
30611    fn typename() -> &'static str {
30612        "type.googleapis.com/google.cloud.sql.v1.SqlUsersGetRequest"
30613    }
30614}
30615
30616#[derive(Clone, Default, PartialEq)]
30617#[non_exhaustive]
30618pub struct SqlUsersInsertRequest {
30619    /// Database instance ID. This does not include the project ID.
30620    pub instance: std::string::String,
30621
30622    /// Project ID of the project that contains the instance.
30623    pub project: std::string::String,
30624
30625    pub body: std::option::Option<crate::model::User>,
30626
30627    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30628}
30629
30630impl SqlUsersInsertRequest {
30631    pub fn new() -> Self {
30632        std::default::Default::default()
30633    }
30634
30635    /// Sets the value of [instance][crate::model::SqlUsersInsertRequest::instance].
30636    ///
30637    /// # Example
30638    /// ```ignore,no_run
30639    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
30640    /// let x = SqlUsersInsertRequest::new().set_instance("example");
30641    /// ```
30642    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30643        self.instance = v.into();
30644        self
30645    }
30646
30647    /// Sets the value of [project][crate::model::SqlUsersInsertRequest::project].
30648    ///
30649    /// # Example
30650    /// ```ignore,no_run
30651    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
30652    /// let x = SqlUsersInsertRequest::new().set_project("example");
30653    /// ```
30654    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30655        self.project = v.into();
30656        self
30657    }
30658
30659    /// Sets the value of [body][crate::model::SqlUsersInsertRequest::body].
30660    ///
30661    /// # Example
30662    /// ```ignore,no_run
30663    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
30664    /// use google_cloud_sql_v1::model::User;
30665    /// let x = SqlUsersInsertRequest::new().set_body(User::default()/* use setters */);
30666    /// ```
30667    pub fn set_body<T>(mut self, v: T) -> Self
30668    where
30669        T: std::convert::Into<crate::model::User>,
30670    {
30671        self.body = std::option::Option::Some(v.into());
30672        self
30673    }
30674
30675    /// Sets or clears the value of [body][crate::model::SqlUsersInsertRequest::body].
30676    ///
30677    /// # Example
30678    /// ```ignore,no_run
30679    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
30680    /// use google_cloud_sql_v1::model::User;
30681    /// let x = SqlUsersInsertRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
30682    /// let x = SqlUsersInsertRequest::new().set_or_clear_body(None::<User>);
30683    /// ```
30684    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
30685    where
30686        T: std::convert::Into<crate::model::User>,
30687    {
30688        self.body = v.map(|x| x.into());
30689        self
30690    }
30691}
30692
30693impl wkt::message::Message for SqlUsersInsertRequest {
30694    fn typename() -> &'static str {
30695        "type.googleapis.com/google.cloud.sql.v1.SqlUsersInsertRequest"
30696    }
30697}
30698
30699#[derive(Clone, Default, PartialEq)]
30700#[non_exhaustive]
30701pub struct SqlUsersListRequest {
30702    /// Database instance ID. This does not include the project ID.
30703    pub instance: std::string::String,
30704
30705    /// Project ID of the project that contains the instance.
30706    pub project: std::string::String,
30707
30708    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30709}
30710
30711impl SqlUsersListRequest {
30712    pub fn new() -> Self {
30713        std::default::Default::default()
30714    }
30715
30716    /// Sets the value of [instance][crate::model::SqlUsersListRequest::instance].
30717    ///
30718    /// # Example
30719    /// ```ignore,no_run
30720    /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
30721    /// let x = SqlUsersListRequest::new().set_instance("example");
30722    /// ```
30723    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30724        self.instance = v.into();
30725        self
30726    }
30727
30728    /// Sets the value of [project][crate::model::SqlUsersListRequest::project].
30729    ///
30730    /// # Example
30731    /// ```ignore,no_run
30732    /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
30733    /// let x = SqlUsersListRequest::new().set_project("example");
30734    /// ```
30735    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30736        self.project = v.into();
30737        self
30738    }
30739}
30740
30741impl wkt::message::Message for SqlUsersListRequest {
30742    fn typename() -> &'static str {
30743        "type.googleapis.com/google.cloud.sql.v1.SqlUsersListRequest"
30744    }
30745}
30746
30747#[derive(Clone, Default, PartialEq)]
30748#[non_exhaustive]
30749pub struct SqlUsersUpdateRequest {
30750    /// Optional. Host of the user in the instance.
30751    pub host: std::string::String,
30752
30753    /// Database instance ID. This does not include the project ID.
30754    pub instance: std::string::String,
30755
30756    /// Name of the user in the instance.
30757    pub name: std::string::String,
30758
30759    /// Project ID of the project that contains the instance.
30760    pub project: std::string::String,
30761
30762    /// Optional. List of database roles to grant to the user. body.database_roles
30763    /// will be ignored for update request.
30764    pub database_roles: std::vec::Vec<std::string::String>,
30765
30766    pub body: std::option::Option<crate::model::User>,
30767
30768    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30769}
30770
30771impl SqlUsersUpdateRequest {
30772    pub fn new() -> Self {
30773        std::default::Default::default()
30774    }
30775
30776    /// Sets the value of [host][crate::model::SqlUsersUpdateRequest::host].
30777    ///
30778    /// # Example
30779    /// ```ignore,no_run
30780    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
30781    /// let x = SqlUsersUpdateRequest::new().set_host("example");
30782    /// ```
30783    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30784        self.host = v.into();
30785        self
30786    }
30787
30788    /// Sets the value of [instance][crate::model::SqlUsersUpdateRequest::instance].
30789    ///
30790    /// # Example
30791    /// ```ignore,no_run
30792    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
30793    /// let x = SqlUsersUpdateRequest::new().set_instance("example");
30794    /// ```
30795    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30796        self.instance = v.into();
30797        self
30798    }
30799
30800    /// Sets the value of [name][crate::model::SqlUsersUpdateRequest::name].
30801    ///
30802    /// # Example
30803    /// ```ignore,no_run
30804    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
30805    /// let x = SqlUsersUpdateRequest::new().set_name("example");
30806    /// ```
30807    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30808        self.name = v.into();
30809        self
30810    }
30811
30812    /// Sets the value of [project][crate::model::SqlUsersUpdateRequest::project].
30813    ///
30814    /// # Example
30815    /// ```ignore,no_run
30816    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
30817    /// let x = SqlUsersUpdateRequest::new().set_project("example");
30818    /// ```
30819    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30820        self.project = v.into();
30821        self
30822    }
30823
30824    /// Sets the value of [database_roles][crate::model::SqlUsersUpdateRequest::database_roles].
30825    ///
30826    /// # Example
30827    /// ```ignore,no_run
30828    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
30829    /// let x = SqlUsersUpdateRequest::new().set_database_roles(["a", "b", "c"]);
30830    /// ```
30831    pub fn set_database_roles<T, V>(mut self, v: T) -> Self
30832    where
30833        T: std::iter::IntoIterator<Item = V>,
30834        V: std::convert::Into<std::string::String>,
30835    {
30836        use std::iter::Iterator;
30837        self.database_roles = v.into_iter().map(|i| i.into()).collect();
30838        self
30839    }
30840
30841    /// Sets the value of [body][crate::model::SqlUsersUpdateRequest::body].
30842    ///
30843    /// # Example
30844    /// ```ignore,no_run
30845    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
30846    /// use google_cloud_sql_v1::model::User;
30847    /// let x = SqlUsersUpdateRequest::new().set_body(User::default()/* use setters */);
30848    /// ```
30849    pub fn set_body<T>(mut self, v: T) -> Self
30850    where
30851        T: std::convert::Into<crate::model::User>,
30852    {
30853        self.body = std::option::Option::Some(v.into());
30854        self
30855    }
30856
30857    /// Sets or clears the value of [body][crate::model::SqlUsersUpdateRequest::body].
30858    ///
30859    /// # Example
30860    /// ```ignore,no_run
30861    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
30862    /// use google_cloud_sql_v1::model::User;
30863    /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
30864    /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(None::<User>);
30865    /// ```
30866    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
30867    where
30868        T: std::convert::Into<crate::model::User>,
30869    {
30870        self.body = v.map(|x| x.into());
30871        self
30872    }
30873}
30874
30875impl wkt::message::Message for SqlUsersUpdateRequest {
30876    fn typename() -> &'static str {
30877        "type.googleapis.com/google.cloud.sql.v1.SqlUsersUpdateRequest"
30878    }
30879}
30880
30881/// User level password validation policy.
30882#[derive(Clone, Default, PartialEq)]
30883#[non_exhaustive]
30884pub struct UserPasswordValidationPolicy {
30885    /// Number of failed login attempts allowed before user get locked.
30886    pub allowed_failed_attempts: i32,
30887
30888    /// Expiration duration after password is updated.
30889    pub password_expiration_duration: std::option::Option<wkt::Duration>,
30890
30891    /// If true, failed login attempts check will be enabled.
30892    pub enable_failed_attempts_check: bool,
30893
30894    /// Output only. Read-only password status.
30895    pub status: std::option::Option<crate::model::PasswordStatus>,
30896
30897    /// If true, the user must specify the current password before changing the
30898    /// password. This flag is supported only for MySQL.
30899    pub enable_password_verification: bool,
30900
30901    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30902}
30903
30904impl UserPasswordValidationPolicy {
30905    pub fn new() -> Self {
30906        std::default::Default::default()
30907    }
30908
30909    /// Sets the value of [allowed_failed_attempts][crate::model::UserPasswordValidationPolicy::allowed_failed_attempts].
30910    ///
30911    /// # Example
30912    /// ```ignore,no_run
30913    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
30914    /// let x = UserPasswordValidationPolicy::new().set_allowed_failed_attempts(42);
30915    /// ```
30916    pub fn set_allowed_failed_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
30917        self.allowed_failed_attempts = v.into();
30918        self
30919    }
30920
30921    /// Sets the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
30922    ///
30923    /// # Example
30924    /// ```ignore,no_run
30925    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
30926    /// use wkt::Duration;
30927    /// let x = UserPasswordValidationPolicy::new().set_password_expiration_duration(Duration::default()/* use setters */);
30928    /// ```
30929    pub fn set_password_expiration_duration<T>(mut self, v: T) -> Self
30930    where
30931        T: std::convert::Into<wkt::Duration>,
30932    {
30933        self.password_expiration_duration = std::option::Option::Some(v.into());
30934        self
30935    }
30936
30937    /// Sets or clears the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
30938    ///
30939    /// # Example
30940    /// ```ignore,no_run
30941    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
30942    /// use wkt::Duration;
30943    /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(Some(Duration::default()/* use setters */));
30944    /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(None::<Duration>);
30945    /// ```
30946    pub fn set_or_clear_password_expiration_duration<T>(mut self, v: std::option::Option<T>) -> Self
30947    where
30948        T: std::convert::Into<wkt::Duration>,
30949    {
30950        self.password_expiration_duration = v.map(|x| x.into());
30951        self
30952    }
30953
30954    /// Sets the value of [enable_failed_attempts_check][crate::model::UserPasswordValidationPolicy::enable_failed_attempts_check].
30955    ///
30956    /// # Example
30957    /// ```ignore,no_run
30958    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
30959    /// let x = UserPasswordValidationPolicy::new().set_enable_failed_attempts_check(true);
30960    /// ```
30961    pub fn set_enable_failed_attempts_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
30962        self.enable_failed_attempts_check = v.into();
30963        self
30964    }
30965
30966    /// Sets the value of [status][crate::model::UserPasswordValidationPolicy::status].
30967    ///
30968    /// # Example
30969    /// ```ignore,no_run
30970    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
30971    /// use google_cloud_sql_v1::model::PasswordStatus;
30972    /// let x = UserPasswordValidationPolicy::new().set_status(PasswordStatus::default()/* use setters */);
30973    /// ```
30974    pub fn set_status<T>(mut self, v: T) -> Self
30975    where
30976        T: std::convert::Into<crate::model::PasswordStatus>,
30977    {
30978        self.status = std::option::Option::Some(v.into());
30979        self
30980    }
30981
30982    /// Sets or clears the value of [status][crate::model::UserPasswordValidationPolicy::status].
30983    ///
30984    /// # Example
30985    /// ```ignore,no_run
30986    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
30987    /// use google_cloud_sql_v1::model::PasswordStatus;
30988    /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(Some(PasswordStatus::default()/* use setters */));
30989    /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(None::<PasswordStatus>);
30990    /// ```
30991    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
30992    where
30993        T: std::convert::Into<crate::model::PasswordStatus>,
30994    {
30995        self.status = v.map(|x| x.into());
30996        self
30997    }
30998
30999    /// Sets the value of [enable_password_verification][crate::model::UserPasswordValidationPolicy::enable_password_verification].
31000    ///
31001    /// # Example
31002    /// ```ignore,no_run
31003    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31004    /// let x = UserPasswordValidationPolicy::new().set_enable_password_verification(true);
31005    /// ```
31006    pub fn set_enable_password_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31007        self.enable_password_verification = v.into();
31008        self
31009    }
31010}
31011
31012impl wkt::message::Message for UserPasswordValidationPolicy {
31013    fn typename() -> &'static str {
31014        "type.googleapis.com/google.cloud.sql.v1.UserPasswordValidationPolicy"
31015    }
31016}
31017
31018/// Read-only password status.
31019#[derive(Clone, Default, PartialEq)]
31020#[non_exhaustive]
31021pub struct PasswordStatus {
31022    /// If true, user does not have login privileges.
31023    pub locked: bool,
31024
31025    /// The expiration time of the current password.
31026    pub password_expiration_time: std::option::Option<wkt::Timestamp>,
31027
31028    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31029}
31030
31031impl PasswordStatus {
31032    pub fn new() -> Self {
31033        std::default::Default::default()
31034    }
31035
31036    /// Sets the value of [locked][crate::model::PasswordStatus::locked].
31037    ///
31038    /// # Example
31039    /// ```ignore,no_run
31040    /// # use google_cloud_sql_v1::model::PasswordStatus;
31041    /// let x = PasswordStatus::new().set_locked(true);
31042    /// ```
31043    pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31044        self.locked = v.into();
31045        self
31046    }
31047
31048    /// Sets the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
31049    ///
31050    /// # Example
31051    /// ```ignore,no_run
31052    /// # use google_cloud_sql_v1::model::PasswordStatus;
31053    /// use wkt::Timestamp;
31054    /// let x = PasswordStatus::new().set_password_expiration_time(Timestamp::default()/* use setters */);
31055    /// ```
31056    pub fn set_password_expiration_time<T>(mut self, v: T) -> Self
31057    where
31058        T: std::convert::Into<wkt::Timestamp>,
31059    {
31060        self.password_expiration_time = std::option::Option::Some(v.into());
31061        self
31062    }
31063
31064    /// Sets or clears the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
31065    ///
31066    /// # Example
31067    /// ```ignore,no_run
31068    /// # use google_cloud_sql_v1::model::PasswordStatus;
31069    /// use wkt::Timestamp;
31070    /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(Some(Timestamp::default()/* use setters */));
31071    /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(None::<Timestamp>);
31072    /// ```
31073    pub fn set_or_clear_password_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
31074    where
31075        T: std::convert::Into<wkt::Timestamp>,
31076    {
31077        self.password_expiration_time = v.map(|x| x.into());
31078        self
31079    }
31080}
31081
31082impl wkt::message::Message for PasswordStatus {
31083    fn typename() -> &'static str {
31084        "type.googleapis.com/google.cloud.sql.v1.PasswordStatus"
31085    }
31086}
31087
31088/// A Cloud SQL user resource.
31089#[derive(Clone, Default, PartialEq)]
31090#[non_exhaustive]
31091pub struct User {
31092    /// This is always `sql#user`.
31093    pub kind: std::string::String,
31094
31095    /// The password for the user.
31096    pub password: std::string::String,
31097
31098    /// This field is deprecated and will be removed from a future version of the
31099    /// API.
31100    pub etag: std::string::String,
31101
31102    /// The name of the user in the Cloud SQL instance. Can be omitted for
31103    /// `update` because it is already specified in the URL.
31104    pub name: std::string::String,
31105
31106    /// Optional. The host from which the user can connect. For `insert`
31107    /// operations, host defaults to an empty string. For `update`
31108    /// operations, host is specified as part of the request URL. The host name
31109    /// cannot be updated after insertion.  For a MySQL instance, it's required;
31110    /// for a PostgreSQL or SQL Server instance, it's optional.
31111    pub host: std::string::String,
31112
31113    /// The name of the Cloud SQL instance. This does not include the project ID.
31114    /// Can be omitted for `update` because it is already specified on the
31115    /// URL.
31116    pub instance: std::string::String,
31117
31118    /// The project ID of the project containing the Cloud SQL database. The Google
31119    /// apps domain is prefixed if applicable. Can be omitted for `update` because
31120    /// it is already specified on the URL.
31121    pub project: std::string::String,
31122
31123    /// The user type. It determines the method to authenticate the user during
31124    /// login. The default is the database's built-in user type.
31125    pub r#type: crate::model::user::SqlUserType,
31126
31127    /// Optional. The full email for an IAM user. For normal database users, this
31128    /// will not be filled. Only applicable to MySQL database users.
31129    pub iam_email: std::string::String,
31130
31131    /// User level password validation policy.
31132    pub password_policy: std::option::Option<crate::model::UserPasswordValidationPolicy>,
31133
31134    /// Dual password status for the user.
31135    pub dual_password_type: std::option::Option<crate::model::user::DualPasswordType>,
31136
31137    /// Indicates if a group is active or inactive for IAM database authentication.
31138    pub iam_status: std::option::Option<crate::model::user::IamStatus>,
31139
31140    /// Optional. Role memberships of the user
31141    pub database_roles: std::vec::Vec<std::string::String>,
31142
31143    /// User details for specific database type
31144    pub user_details: std::option::Option<crate::model::user::UserDetails>,
31145
31146    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31147}
31148
31149impl User {
31150    pub fn new() -> Self {
31151        std::default::Default::default()
31152    }
31153
31154    /// Sets the value of [kind][crate::model::User::kind].
31155    ///
31156    /// # Example
31157    /// ```ignore,no_run
31158    /// # use google_cloud_sql_v1::model::User;
31159    /// let x = User::new().set_kind("example");
31160    /// ```
31161    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31162        self.kind = v.into();
31163        self
31164    }
31165
31166    /// Sets the value of [password][crate::model::User::password].
31167    ///
31168    /// # Example
31169    /// ```ignore,no_run
31170    /// # use google_cloud_sql_v1::model::User;
31171    /// let x = User::new().set_password("example");
31172    /// ```
31173    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31174        self.password = v.into();
31175        self
31176    }
31177
31178    /// Sets the value of [etag][crate::model::User::etag].
31179    ///
31180    /// # Example
31181    /// ```ignore,no_run
31182    /// # use google_cloud_sql_v1::model::User;
31183    /// let x = User::new().set_etag("example");
31184    /// ```
31185    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31186        self.etag = v.into();
31187        self
31188    }
31189
31190    /// Sets the value of [name][crate::model::User::name].
31191    ///
31192    /// # Example
31193    /// ```ignore,no_run
31194    /// # use google_cloud_sql_v1::model::User;
31195    /// let x = User::new().set_name("example");
31196    /// ```
31197    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31198        self.name = v.into();
31199        self
31200    }
31201
31202    /// Sets the value of [host][crate::model::User::host].
31203    ///
31204    /// # Example
31205    /// ```ignore,no_run
31206    /// # use google_cloud_sql_v1::model::User;
31207    /// let x = User::new().set_host("example");
31208    /// ```
31209    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31210        self.host = v.into();
31211        self
31212    }
31213
31214    /// Sets the value of [instance][crate::model::User::instance].
31215    ///
31216    /// # Example
31217    /// ```ignore,no_run
31218    /// # use google_cloud_sql_v1::model::User;
31219    /// let x = User::new().set_instance("example");
31220    /// ```
31221    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31222        self.instance = v.into();
31223        self
31224    }
31225
31226    /// Sets the value of [project][crate::model::User::project].
31227    ///
31228    /// # Example
31229    /// ```ignore,no_run
31230    /// # use google_cloud_sql_v1::model::User;
31231    /// let x = User::new().set_project("example");
31232    /// ```
31233    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31234        self.project = v.into();
31235        self
31236    }
31237
31238    /// Sets the value of [r#type][crate::model::User::type].
31239    ///
31240    /// # Example
31241    /// ```ignore,no_run
31242    /// # use google_cloud_sql_v1::model::User;
31243    /// use google_cloud_sql_v1::model::user::SqlUserType;
31244    /// let x0 = User::new().set_type(SqlUserType::CloudIamUser);
31245    /// let x1 = User::new().set_type(SqlUserType::CloudIamServiceAccount);
31246    /// let x2 = User::new().set_type(SqlUserType::CloudIamGroup);
31247    /// ```
31248    pub fn set_type<T: std::convert::Into<crate::model::user::SqlUserType>>(
31249        mut self,
31250        v: T,
31251    ) -> Self {
31252        self.r#type = v.into();
31253        self
31254    }
31255
31256    /// Sets the value of [iam_email][crate::model::User::iam_email].
31257    ///
31258    /// # Example
31259    /// ```ignore,no_run
31260    /// # use google_cloud_sql_v1::model::User;
31261    /// let x = User::new().set_iam_email("example");
31262    /// ```
31263    pub fn set_iam_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31264        self.iam_email = v.into();
31265        self
31266    }
31267
31268    /// Sets the value of [password_policy][crate::model::User::password_policy].
31269    ///
31270    /// # Example
31271    /// ```ignore,no_run
31272    /// # use google_cloud_sql_v1::model::User;
31273    /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31274    /// let x = User::new().set_password_policy(UserPasswordValidationPolicy::default()/* use setters */);
31275    /// ```
31276    pub fn set_password_policy<T>(mut self, v: T) -> Self
31277    where
31278        T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
31279    {
31280        self.password_policy = std::option::Option::Some(v.into());
31281        self
31282    }
31283
31284    /// Sets or clears the value of [password_policy][crate::model::User::password_policy].
31285    ///
31286    /// # Example
31287    /// ```ignore,no_run
31288    /// # use google_cloud_sql_v1::model::User;
31289    /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31290    /// let x = User::new().set_or_clear_password_policy(Some(UserPasswordValidationPolicy::default()/* use setters */));
31291    /// let x = User::new().set_or_clear_password_policy(None::<UserPasswordValidationPolicy>);
31292    /// ```
31293    pub fn set_or_clear_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
31294    where
31295        T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
31296    {
31297        self.password_policy = v.map(|x| x.into());
31298        self
31299    }
31300
31301    /// Sets the value of [dual_password_type][crate::model::User::dual_password_type].
31302    ///
31303    /// # Example
31304    /// ```ignore,no_run
31305    /// # use google_cloud_sql_v1::model::User;
31306    /// use google_cloud_sql_v1::model::user::DualPasswordType;
31307    /// let x0 = User::new().set_dual_password_type(DualPasswordType::NoModifyDualPassword);
31308    /// let x1 = User::new().set_dual_password_type(DualPasswordType::NoDualPassword);
31309    /// let x2 = User::new().set_dual_password_type(DualPasswordType::DualPassword);
31310    /// ```
31311    pub fn set_dual_password_type<T>(mut self, v: T) -> Self
31312    where
31313        T: std::convert::Into<crate::model::user::DualPasswordType>,
31314    {
31315        self.dual_password_type = std::option::Option::Some(v.into());
31316        self
31317    }
31318
31319    /// Sets or clears the value of [dual_password_type][crate::model::User::dual_password_type].
31320    ///
31321    /// # Example
31322    /// ```ignore,no_run
31323    /// # use google_cloud_sql_v1::model::User;
31324    /// use google_cloud_sql_v1::model::user::DualPasswordType;
31325    /// let x0 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoModifyDualPassword));
31326    /// let x1 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoDualPassword));
31327    /// let x2 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::DualPassword));
31328    /// let x_none = User::new().set_or_clear_dual_password_type(None::<DualPasswordType>);
31329    /// ```
31330    pub fn set_or_clear_dual_password_type<T>(mut self, v: std::option::Option<T>) -> Self
31331    where
31332        T: std::convert::Into<crate::model::user::DualPasswordType>,
31333    {
31334        self.dual_password_type = v.map(|x| x.into());
31335        self
31336    }
31337
31338    /// Sets the value of [iam_status][crate::model::User::iam_status].
31339    ///
31340    /// # Example
31341    /// ```ignore,no_run
31342    /// # use google_cloud_sql_v1::model::User;
31343    /// use google_cloud_sql_v1::model::user::IamStatus;
31344    /// let x0 = User::new().set_iam_status(IamStatus::Inactive);
31345    /// let x1 = User::new().set_iam_status(IamStatus::Active);
31346    /// ```
31347    pub fn set_iam_status<T>(mut self, v: T) -> Self
31348    where
31349        T: std::convert::Into<crate::model::user::IamStatus>,
31350    {
31351        self.iam_status = std::option::Option::Some(v.into());
31352        self
31353    }
31354
31355    /// Sets or clears the value of [iam_status][crate::model::User::iam_status].
31356    ///
31357    /// # Example
31358    /// ```ignore,no_run
31359    /// # use google_cloud_sql_v1::model::User;
31360    /// use google_cloud_sql_v1::model::user::IamStatus;
31361    /// let x0 = User::new().set_or_clear_iam_status(Some(IamStatus::Inactive));
31362    /// let x1 = User::new().set_or_clear_iam_status(Some(IamStatus::Active));
31363    /// let x_none = User::new().set_or_clear_iam_status(None::<IamStatus>);
31364    /// ```
31365    pub fn set_or_clear_iam_status<T>(mut self, v: std::option::Option<T>) -> Self
31366    where
31367        T: std::convert::Into<crate::model::user::IamStatus>,
31368    {
31369        self.iam_status = v.map(|x| x.into());
31370        self
31371    }
31372
31373    /// Sets the value of [database_roles][crate::model::User::database_roles].
31374    ///
31375    /// # Example
31376    /// ```ignore,no_run
31377    /// # use google_cloud_sql_v1::model::User;
31378    /// let x = User::new().set_database_roles(["a", "b", "c"]);
31379    /// ```
31380    pub fn set_database_roles<T, V>(mut self, v: T) -> Self
31381    where
31382        T: std::iter::IntoIterator<Item = V>,
31383        V: std::convert::Into<std::string::String>,
31384    {
31385        use std::iter::Iterator;
31386        self.database_roles = v.into_iter().map(|i| i.into()).collect();
31387        self
31388    }
31389
31390    /// Sets the value of [user_details][crate::model::User::user_details].
31391    ///
31392    /// Note that all the setters affecting `user_details` are mutually
31393    /// exclusive.
31394    ///
31395    /// # Example
31396    /// ```ignore,no_run
31397    /// # use google_cloud_sql_v1::model::User;
31398    /// use google_cloud_sql_v1::model::SqlServerUserDetails;
31399    /// let x = User::new().set_user_details(Some(
31400    ///     google_cloud_sql_v1::model::user::UserDetails::SqlserverUserDetails(SqlServerUserDetails::default().into())));
31401    /// ```
31402    pub fn set_user_details<
31403        T: std::convert::Into<std::option::Option<crate::model::user::UserDetails>>,
31404    >(
31405        mut self,
31406        v: T,
31407    ) -> Self {
31408        self.user_details = v.into();
31409        self
31410    }
31411
31412    /// The value of [user_details][crate::model::User::user_details]
31413    /// if it holds a `SqlserverUserDetails`, `None` if the field is not set or
31414    /// holds a different branch.
31415    pub fn sqlserver_user_details(
31416        &self,
31417    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerUserDetails>> {
31418        #[allow(unreachable_patterns)]
31419        self.user_details.as_ref().and_then(|v| match v {
31420            crate::model::user::UserDetails::SqlserverUserDetails(v) => {
31421                std::option::Option::Some(v)
31422            }
31423            _ => std::option::Option::None,
31424        })
31425    }
31426
31427    /// Sets the value of [user_details][crate::model::User::user_details]
31428    /// to hold a `SqlserverUserDetails`.
31429    ///
31430    /// Note that all the setters affecting `user_details` are
31431    /// mutually exclusive.
31432    ///
31433    /// # Example
31434    /// ```ignore,no_run
31435    /// # use google_cloud_sql_v1::model::User;
31436    /// use google_cloud_sql_v1::model::SqlServerUserDetails;
31437    /// let x = User::new().set_sqlserver_user_details(SqlServerUserDetails::default()/* use setters */);
31438    /// assert!(x.sqlserver_user_details().is_some());
31439    /// ```
31440    pub fn set_sqlserver_user_details<
31441        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerUserDetails>>,
31442    >(
31443        mut self,
31444        v: T,
31445    ) -> Self {
31446        self.user_details = std::option::Option::Some(
31447            crate::model::user::UserDetails::SqlserverUserDetails(v.into()),
31448        );
31449        self
31450    }
31451}
31452
31453impl wkt::message::Message for User {
31454    fn typename() -> &'static str {
31455        "type.googleapis.com/google.cloud.sql.v1.User"
31456    }
31457}
31458
31459/// Defines additional types related to [User].
31460pub mod user {
31461    #[allow(unused_imports)]
31462    use super::*;
31463
31464    /// The user type.
31465    ///
31466    /// # Working with unknown values
31467    ///
31468    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31469    /// additional enum variants at any time. Adding new variants is not considered
31470    /// a breaking change. Applications should write their code in anticipation of:
31471    ///
31472    /// - New values appearing in future releases of the client library, **and**
31473    /// - New values received dynamically, without application changes.
31474    ///
31475    /// Please consult the [Working with enums] section in the user guide for some
31476    /// guidelines.
31477    ///
31478    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
31479    #[derive(Clone, Debug, PartialEq)]
31480    #[non_exhaustive]
31481    pub enum SqlUserType {
31482        /// The database's built-in user type.
31483        BuiltIn,
31484        /// Cloud IAM user.
31485        CloudIamUser,
31486        /// Cloud IAM service account.
31487        CloudIamServiceAccount,
31488        /// Cloud IAM group. Not used for login.
31489        CloudIamGroup,
31490        /// Read-only. Login for a user that belongs to the Cloud IAM group.
31491        CloudIamGroupUser,
31492        /// Read-only. Login for a service account that belongs to the
31493        /// Cloud IAM group.
31494        CloudIamGroupServiceAccount,
31495        /// Microsoft Entra ID user.
31496        EntraidUser,
31497        /// If set, the enum was initialized with an unknown value.
31498        ///
31499        /// Applications can examine the value using [SqlUserType::value] or
31500        /// [SqlUserType::name].
31501        UnknownValue(sql_user_type::UnknownValue),
31502    }
31503
31504    #[doc(hidden)]
31505    pub mod sql_user_type {
31506        #[allow(unused_imports)]
31507        use super::*;
31508        #[derive(Clone, Debug, PartialEq)]
31509        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31510    }
31511
31512    impl SqlUserType {
31513        /// Gets the enum value.
31514        ///
31515        /// Returns `None` if the enum contains an unknown value deserialized from
31516        /// the string representation of enums.
31517        pub fn value(&self) -> std::option::Option<i32> {
31518            match self {
31519                Self::BuiltIn => std::option::Option::Some(0),
31520                Self::CloudIamUser => std::option::Option::Some(1),
31521                Self::CloudIamServiceAccount => std::option::Option::Some(2),
31522                Self::CloudIamGroup => std::option::Option::Some(3),
31523                Self::CloudIamGroupUser => std::option::Option::Some(4),
31524                Self::CloudIamGroupServiceAccount => std::option::Option::Some(5),
31525                Self::EntraidUser => std::option::Option::Some(7),
31526                Self::UnknownValue(u) => u.0.value(),
31527            }
31528        }
31529
31530        /// Gets the enum value as a string.
31531        ///
31532        /// Returns `None` if the enum contains an unknown value deserialized from
31533        /// the integer representation of enums.
31534        pub fn name(&self) -> std::option::Option<&str> {
31535            match self {
31536                Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
31537                Self::CloudIamUser => std::option::Option::Some("CLOUD_IAM_USER"),
31538                Self::CloudIamServiceAccount => {
31539                    std::option::Option::Some("CLOUD_IAM_SERVICE_ACCOUNT")
31540                }
31541                Self::CloudIamGroup => std::option::Option::Some("CLOUD_IAM_GROUP"),
31542                Self::CloudIamGroupUser => std::option::Option::Some("CLOUD_IAM_GROUP_USER"),
31543                Self::CloudIamGroupServiceAccount => {
31544                    std::option::Option::Some("CLOUD_IAM_GROUP_SERVICE_ACCOUNT")
31545                }
31546                Self::EntraidUser => std::option::Option::Some("ENTRAID_USER"),
31547                Self::UnknownValue(u) => u.0.name(),
31548            }
31549        }
31550    }
31551
31552    impl std::default::Default for SqlUserType {
31553        fn default() -> Self {
31554            use std::convert::From;
31555            Self::from(0)
31556        }
31557    }
31558
31559    impl std::fmt::Display for SqlUserType {
31560        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31561            wkt::internal::display_enum(f, self.name(), self.value())
31562        }
31563    }
31564
31565    impl std::convert::From<i32> for SqlUserType {
31566        fn from(value: i32) -> Self {
31567            match value {
31568                0 => Self::BuiltIn,
31569                1 => Self::CloudIamUser,
31570                2 => Self::CloudIamServiceAccount,
31571                3 => Self::CloudIamGroup,
31572                4 => Self::CloudIamGroupUser,
31573                5 => Self::CloudIamGroupServiceAccount,
31574                7 => Self::EntraidUser,
31575                _ => Self::UnknownValue(sql_user_type::UnknownValue(
31576                    wkt::internal::UnknownEnumValue::Integer(value),
31577                )),
31578            }
31579        }
31580    }
31581
31582    impl std::convert::From<&str> for SqlUserType {
31583        fn from(value: &str) -> Self {
31584            use std::string::ToString;
31585            match value {
31586                "BUILT_IN" => Self::BuiltIn,
31587                "CLOUD_IAM_USER" => Self::CloudIamUser,
31588                "CLOUD_IAM_SERVICE_ACCOUNT" => Self::CloudIamServiceAccount,
31589                "CLOUD_IAM_GROUP" => Self::CloudIamGroup,
31590                "CLOUD_IAM_GROUP_USER" => Self::CloudIamGroupUser,
31591                "CLOUD_IAM_GROUP_SERVICE_ACCOUNT" => Self::CloudIamGroupServiceAccount,
31592                "ENTRAID_USER" => Self::EntraidUser,
31593                _ => Self::UnknownValue(sql_user_type::UnknownValue(
31594                    wkt::internal::UnknownEnumValue::String(value.to_string()),
31595                )),
31596            }
31597        }
31598    }
31599
31600    impl serde::ser::Serialize for SqlUserType {
31601        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31602        where
31603            S: serde::Serializer,
31604        {
31605            match self {
31606                Self::BuiltIn => serializer.serialize_i32(0),
31607                Self::CloudIamUser => serializer.serialize_i32(1),
31608                Self::CloudIamServiceAccount => serializer.serialize_i32(2),
31609                Self::CloudIamGroup => serializer.serialize_i32(3),
31610                Self::CloudIamGroupUser => serializer.serialize_i32(4),
31611                Self::CloudIamGroupServiceAccount => serializer.serialize_i32(5),
31612                Self::EntraidUser => serializer.serialize_i32(7),
31613                Self::UnknownValue(u) => u.0.serialize(serializer),
31614            }
31615        }
31616    }
31617
31618    impl<'de> serde::de::Deserialize<'de> for SqlUserType {
31619        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31620        where
31621            D: serde::Deserializer<'de>,
31622        {
31623            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUserType>::new(
31624                ".google.cloud.sql.v1.User.SqlUserType",
31625            ))
31626        }
31627    }
31628
31629    /// The type of retained password.
31630    ///
31631    /// # Working with unknown values
31632    ///
31633    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31634    /// additional enum variants at any time. Adding new variants is not considered
31635    /// a breaking change. Applications should write their code in anticipation of:
31636    ///
31637    /// - New values appearing in future releases of the client library, **and**
31638    /// - New values received dynamically, without application changes.
31639    ///
31640    /// Please consult the [Working with enums] section in the user guide for some
31641    /// guidelines.
31642    ///
31643    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
31644    #[derive(Clone, Debug, PartialEq)]
31645    #[non_exhaustive]
31646    pub enum DualPasswordType {
31647        /// The default value.
31648        Unspecified,
31649        /// Do not update the user's dual password status.
31650        NoModifyDualPassword,
31651        /// No dual password usable for connecting using this user.
31652        NoDualPassword,
31653        /// Dual password usable for connecting using this user.
31654        DualPassword,
31655        /// If set, the enum was initialized with an unknown value.
31656        ///
31657        /// Applications can examine the value using [DualPasswordType::value] or
31658        /// [DualPasswordType::name].
31659        UnknownValue(dual_password_type::UnknownValue),
31660    }
31661
31662    #[doc(hidden)]
31663    pub mod dual_password_type {
31664        #[allow(unused_imports)]
31665        use super::*;
31666        #[derive(Clone, Debug, PartialEq)]
31667        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31668    }
31669
31670    impl DualPasswordType {
31671        /// Gets the enum value.
31672        ///
31673        /// Returns `None` if the enum contains an unknown value deserialized from
31674        /// the string representation of enums.
31675        pub fn value(&self) -> std::option::Option<i32> {
31676            match self {
31677                Self::Unspecified => std::option::Option::Some(0),
31678                Self::NoModifyDualPassword => std::option::Option::Some(1),
31679                Self::NoDualPassword => std::option::Option::Some(2),
31680                Self::DualPassword => std::option::Option::Some(3),
31681                Self::UnknownValue(u) => u.0.value(),
31682            }
31683        }
31684
31685        /// Gets the enum value as a string.
31686        ///
31687        /// Returns `None` if the enum contains an unknown value deserialized from
31688        /// the integer representation of enums.
31689        pub fn name(&self) -> std::option::Option<&str> {
31690            match self {
31691                Self::Unspecified => std::option::Option::Some("DUAL_PASSWORD_TYPE_UNSPECIFIED"),
31692                Self::NoModifyDualPassword => std::option::Option::Some("NO_MODIFY_DUAL_PASSWORD"),
31693                Self::NoDualPassword => std::option::Option::Some("NO_DUAL_PASSWORD"),
31694                Self::DualPassword => std::option::Option::Some("DUAL_PASSWORD"),
31695                Self::UnknownValue(u) => u.0.name(),
31696            }
31697        }
31698    }
31699
31700    impl std::default::Default for DualPasswordType {
31701        fn default() -> Self {
31702            use std::convert::From;
31703            Self::from(0)
31704        }
31705    }
31706
31707    impl std::fmt::Display for DualPasswordType {
31708        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31709            wkt::internal::display_enum(f, self.name(), self.value())
31710        }
31711    }
31712
31713    impl std::convert::From<i32> for DualPasswordType {
31714        fn from(value: i32) -> Self {
31715            match value {
31716                0 => Self::Unspecified,
31717                1 => Self::NoModifyDualPassword,
31718                2 => Self::NoDualPassword,
31719                3 => Self::DualPassword,
31720                _ => Self::UnknownValue(dual_password_type::UnknownValue(
31721                    wkt::internal::UnknownEnumValue::Integer(value),
31722                )),
31723            }
31724        }
31725    }
31726
31727    impl std::convert::From<&str> for DualPasswordType {
31728        fn from(value: &str) -> Self {
31729            use std::string::ToString;
31730            match value {
31731                "DUAL_PASSWORD_TYPE_UNSPECIFIED" => Self::Unspecified,
31732                "NO_MODIFY_DUAL_PASSWORD" => Self::NoModifyDualPassword,
31733                "NO_DUAL_PASSWORD" => Self::NoDualPassword,
31734                "DUAL_PASSWORD" => Self::DualPassword,
31735                _ => Self::UnknownValue(dual_password_type::UnknownValue(
31736                    wkt::internal::UnknownEnumValue::String(value.to_string()),
31737                )),
31738            }
31739        }
31740    }
31741
31742    impl serde::ser::Serialize for DualPasswordType {
31743        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31744        where
31745            S: serde::Serializer,
31746        {
31747            match self {
31748                Self::Unspecified => serializer.serialize_i32(0),
31749                Self::NoModifyDualPassword => serializer.serialize_i32(1),
31750                Self::NoDualPassword => serializer.serialize_i32(2),
31751                Self::DualPassword => serializer.serialize_i32(3),
31752                Self::UnknownValue(u) => u.0.serialize(serializer),
31753            }
31754        }
31755    }
31756
31757    impl<'de> serde::de::Deserialize<'de> for DualPasswordType {
31758        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31759        where
31760            D: serde::Deserializer<'de>,
31761        {
31762            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DualPasswordType>::new(
31763                ".google.cloud.sql.v1.User.DualPasswordType",
31764            ))
31765        }
31766    }
31767
31768    /// Indicates if a group is available for IAM database authentication.
31769    ///
31770    /// # Working with unknown values
31771    ///
31772    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31773    /// additional enum variants at any time. Adding new variants is not considered
31774    /// a breaking change. Applications should write their code in anticipation of:
31775    ///
31776    /// - New values appearing in future releases of the client library, **and**
31777    /// - New values received dynamically, without application changes.
31778    ///
31779    /// Please consult the [Working with enums] section in the user guide for some
31780    /// guidelines.
31781    ///
31782    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
31783    #[derive(Clone, Debug, PartialEq)]
31784    #[non_exhaustive]
31785    pub enum IamStatus {
31786        /// The default value for users that are not of type CLOUD_IAM_GROUP.
31787        /// Only CLOUD_IAM_GROUP users will be inactive or active.
31788        /// Users with an IamStatus of IAM_STATUS_UNSPECIFIED will not
31789        /// display whether they are active or inactive as that is not applicable to
31790        /// them.
31791        Unspecified,
31792        /// INACTIVE indicates a group is not available for IAM database
31793        /// authentication.
31794        Inactive,
31795        /// ACTIVE indicates a group is available for IAM database authentication.
31796        Active,
31797        /// If set, the enum was initialized with an unknown value.
31798        ///
31799        /// Applications can examine the value using [IamStatus::value] or
31800        /// [IamStatus::name].
31801        UnknownValue(iam_status::UnknownValue),
31802    }
31803
31804    #[doc(hidden)]
31805    pub mod iam_status {
31806        #[allow(unused_imports)]
31807        use super::*;
31808        #[derive(Clone, Debug, PartialEq)]
31809        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31810    }
31811
31812    impl IamStatus {
31813        /// Gets the enum value.
31814        ///
31815        /// Returns `None` if the enum contains an unknown value deserialized from
31816        /// the string representation of enums.
31817        pub fn value(&self) -> std::option::Option<i32> {
31818            match self {
31819                Self::Unspecified => std::option::Option::Some(0),
31820                Self::Inactive => std::option::Option::Some(1),
31821                Self::Active => std::option::Option::Some(2),
31822                Self::UnknownValue(u) => u.0.value(),
31823            }
31824        }
31825
31826        /// Gets the enum value as a string.
31827        ///
31828        /// Returns `None` if the enum contains an unknown value deserialized from
31829        /// the integer representation of enums.
31830        pub fn name(&self) -> std::option::Option<&str> {
31831            match self {
31832                Self::Unspecified => std::option::Option::Some("IAM_STATUS_UNSPECIFIED"),
31833                Self::Inactive => std::option::Option::Some("INACTIVE"),
31834                Self::Active => std::option::Option::Some("ACTIVE"),
31835                Self::UnknownValue(u) => u.0.name(),
31836            }
31837        }
31838    }
31839
31840    impl std::default::Default for IamStatus {
31841        fn default() -> Self {
31842            use std::convert::From;
31843            Self::from(0)
31844        }
31845    }
31846
31847    impl std::fmt::Display for IamStatus {
31848        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31849            wkt::internal::display_enum(f, self.name(), self.value())
31850        }
31851    }
31852
31853    impl std::convert::From<i32> for IamStatus {
31854        fn from(value: i32) -> Self {
31855            match value {
31856                0 => Self::Unspecified,
31857                1 => Self::Inactive,
31858                2 => Self::Active,
31859                _ => Self::UnknownValue(iam_status::UnknownValue(
31860                    wkt::internal::UnknownEnumValue::Integer(value),
31861                )),
31862            }
31863        }
31864    }
31865
31866    impl std::convert::From<&str> for IamStatus {
31867        fn from(value: &str) -> Self {
31868            use std::string::ToString;
31869            match value {
31870                "IAM_STATUS_UNSPECIFIED" => Self::Unspecified,
31871                "INACTIVE" => Self::Inactive,
31872                "ACTIVE" => Self::Active,
31873                _ => Self::UnknownValue(iam_status::UnknownValue(
31874                    wkt::internal::UnknownEnumValue::String(value.to_string()),
31875                )),
31876            }
31877        }
31878    }
31879
31880    impl serde::ser::Serialize for IamStatus {
31881        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31882        where
31883            S: serde::Serializer,
31884        {
31885            match self {
31886                Self::Unspecified => serializer.serialize_i32(0),
31887                Self::Inactive => serializer.serialize_i32(1),
31888                Self::Active => serializer.serialize_i32(2),
31889                Self::UnknownValue(u) => u.0.serialize(serializer),
31890            }
31891        }
31892    }
31893
31894    impl<'de> serde::de::Deserialize<'de> for IamStatus {
31895        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31896        where
31897            D: serde::Deserializer<'de>,
31898        {
31899            deserializer.deserialize_any(wkt::internal::EnumVisitor::<IamStatus>::new(
31900                ".google.cloud.sql.v1.User.IamStatus",
31901            ))
31902        }
31903    }
31904
31905    /// User details for specific database type
31906    #[derive(Clone, Debug, PartialEq)]
31907    #[non_exhaustive]
31908    pub enum UserDetails {
31909        SqlserverUserDetails(std::boxed::Box<crate::model::SqlServerUserDetails>),
31910    }
31911}
31912
31913/// Represents a Sql Server user on the Cloud SQL instance.
31914#[derive(Clone, Default, PartialEq)]
31915#[non_exhaustive]
31916pub struct SqlServerUserDetails {
31917    /// If the user has been disabled
31918    pub disabled: bool,
31919
31920    /// The server roles for this user
31921    pub server_roles: std::vec::Vec<std::string::String>,
31922
31923    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31924}
31925
31926impl SqlServerUserDetails {
31927    pub fn new() -> Self {
31928        std::default::Default::default()
31929    }
31930
31931    /// Sets the value of [disabled][crate::model::SqlServerUserDetails::disabled].
31932    ///
31933    /// # Example
31934    /// ```ignore,no_run
31935    /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
31936    /// let x = SqlServerUserDetails::new().set_disabled(true);
31937    /// ```
31938    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31939        self.disabled = v.into();
31940        self
31941    }
31942
31943    /// Sets the value of [server_roles][crate::model::SqlServerUserDetails::server_roles].
31944    ///
31945    /// # Example
31946    /// ```ignore,no_run
31947    /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
31948    /// let x = SqlServerUserDetails::new().set_server_roles(["a", "b", "c"]);
31949    /// ```
31950    pub fn set_server_roles<T, V>(mut self, v: T) -> Self
31951    where
31952        T: std::iter::IntoIterator<Item = V>,
31953        V: std::convert::Into<std::string::String>,
31954    {
31955        use std::iter::Iterator;
31956        self.server_roles = v.into_iter().map(|i| i.into()).collect();
31957        self
31958    }
31959}
31960
31961impl wkt::message::Message for SqlServerUserDetails {
31962    fn typename() -> &'static str {
31963        "type.googleapis.com/google.cloud.sql.v1.SqlServerUserDetails"
31964    }
31965}
31966
31967/// User list response.
31968#[derive(Clone, Default, PartialEq)]
31969#[non_exhaustive]
31970pub struct UsersListResponse {
31971    /// This is always `sql#usersList`.
31972    pub kind: std::string::String,
31973
31974    /// List of user resources in the instance.
31975    pub items: std::vec::Vec<crate::model::User>,
31976
31977    /// Unused.
31978    #[deprecated]
31979    pub next_page_token: std::string::String,
31980
31981    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31982}
31983
31984impl UsersListResponse {
31985    pub fn new() -> Self {
31986        std::default::Default::default()
31987    }
31988
31989    /// Sets the value of [kind][crate::model::UsersListResponse::kind].
31990    ///
31991    /// # Example
31992    /// ```ignore,no_run
31993    /// # use google_cloud_sql_v1::model::UsersListResponse;
31994    /// let x = UsersListResponse::new().set_kind("example");
31995    /// ```
31996    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31997        self.kind = v.into();
31998        self
31999    }
32000
32001    /// Sets the value of [items][crate::model::UsersListResponse::items].
32002    ///
32003    /// # Example
32004    /// ```ignore,no_run
32005    /// # use google_cloud_sql_v1::model::UsersListResponse;
32006    /// use google_cloud_sql_v1::model::User;
32007    /// let x = UsersListResponse::new()
32008    ///     .set_items([
32009    ///         User::default()/* use setters */,
32010    ///         User::default()/* use (different) setters */,
32011    ///     ]);
32012    /// ```
32013    pub fn set_items<T, V>(mut self, v: T) -> Self
32014    where
32015        T: std::iter::IntoIterator<Item = V>,
32016        V: std::convert::Into<crate::model::User>,
32017    {
32018        use std::iter::Iterator;
32019        self.items = v.into_iter().map(|i| i.into()).collect();
32020        self
32021    }
32022
32023    /// Sets the value of [next_page_token][crate::model::UsersListResponse::next_page_token].
32024    ///
32025    /// # Example
32026    /// ```ignore,no_run
32027    /// # use google_cloud_sql_v1::model::UsersListResponse;
32028    /// let x = UsersListResponse::new().set_next_page_token("example");
32029    /// ```
32030    #[deprecated]
32031    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32032        self.next_page_token = v.into();
32033        self
32034    }
32035}
32036
32037impl wkt::message::Message for UsersListResponse {
32038    fn typename() -> &'static str {
32039        "type.googleapis.com/google.cloud.sql.v1.UsersListResponse"
32040    }
32041}
32042
32043/// The status of a backup run.
32044///
32045/// # Working with unknown values
32046///
32047/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32048/// additional enum variants at any time. Adding new variants is not considered
32049/// a breaking change. Applications should write their code in anticipation of:
32050///
32051/// - New values appearing in future releases of the client library, **and**
32052/// - New values received dynamically, without application changes.
32053///
32054/// Please consult the [Working with enums] section in the user guide for some
32055/// guidelines.
32056///
32057/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32058#[derive(Clone, Debug, PartialEq)]
32059#[non_exhaustive]
32060pub enum SqlBackupRunStatus {
32061    /// The status of the run is unknown.
32062    Unspecified,
32063    /// The backup operation was enqueued.
32064    Enqueued,
32065    /// The backup is overdue across a given backup window. Indicates a
32066    /// problem. Example: Long-running operation in progress during
32067    /// the whole window.
32068    Overdue,
32069    /// The backup is in progress.
32070    Running,
32071    /// The backup failed.
32072    Failed,
32073    /// The backup was successful.
32074    Successful,
32075    /// The backup was skipped (without problems) for a given backup
32076    /// window. Example: Instance was idle.
32077    Skipped,
32078    /// The backup is about to be deleted.
32079    DeletionPending,
32080    /// The backup deletion failed.
32081    DeletionFailed,
32082    /// The backup has been deleted.
32083    Deleted,
32084    /// If set, the enum was initialized with an unknown value.
32085    ///
32086    /// Applications can examine the value using [SqlBackupRunStatus::value] or
32087    /// [SqlBackupRunStatus::name].
32088    UnknownValue(sql_backup_run_status::UnknownValue),
32089}
32090
32091#[doc(hidden)]
32092pub mod sql_backup_run_status {
32093    #[allow(unused_imports)]
32094    use super::*;
32095    #[derive(Clone, Debug, PartialEq)]
32096    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32097}
32098
32099impl SqlBackupRunStatus {
32100    /// Gets the enum value.
32101    ///
32102    /// Returns `None` if the enum contains an unknown value deserialized from
32103    /// the string representation of enums.
32104    pub fn value(&self) -> std::option::Option<i32> {
32105        match self {
32106            Self::Unspecified => std::option::Option::Some(0),
32107            Self::Enqueued => std::option::Option::Some(1),
32108            Self::Overdue => std::option::Option::Some(2),
32109            Self::Running => std::option::Option::Some(3),
32110            Self::Failed => std::option::Option::Some(4),
32111            Self::Successful => std::option::Option::Some(5),
32112            Self::Skipped => std::option::Option::Some(6),
32113            Self::DeletionPending => std::option::Option::Some(7),
32114            Self::DeletionFailed => std::option::Option::Some(8),
32115            Self::Deleted => std::option::Option::Some(9),
32116            Self::UnknownValue(u) => u.0.value(),
32117        }
32118    }
32119
32120    /// Gets the enum value as a string.
32121    ///
32122    /// Returns `None` if the enum contains an unknown value deserialized from
32123    /// the integer representation of enums.
32124    pub fn name(&self) -> std::option::Option<&str> {
32125        match self {
32126            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_STATUS_UNSPECIFIED"),
32127            Self::Enqueued => std::option::Option::Some("ENQUEUED"),
32128            Self::Overdue => std::option::Option::Some("OVERDUE"),
32129            Self::Running => std::option::Option::Some("RUNNING"),
32130            Self::Failed => std::option::Option::Some("FAILED"),
32131            Self::Successful => std::option::Option::Some("SUCCESSFUL"),
32132            Self::Skipped => std::option::Option::Some("SKIPPED"),
32133            Self::DeletionPending => std::option::Option::Some("DELETION_PENDING"),
32134            Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
32135            Self::Deleted => std::option::Option::Some("DELETED"),
32136            Self::UnknownValue(u) => u.0.name(),
32137        }
32138    }
32139}
32140
32141impl std::default::Default for SqlBackupRunStatus {
32142    fn default() -> Self {
32143        use std::convert::From;
32144        Self::from(0)
32145    }
32146}
32147
32148impl std::fmt::Display for SqlBackupRunStatus {
32149    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32150        wkt::internal::display_enum(f, self.name(), self.value())
32151    }
32152}
32153
32154impl std::convert::From<i32> for SqlBackupRunStatus {
32155    fn from(value: i32) -> Self {
32156        match value {
32157            0 => Self::Unspecified,
32158            1 => Self::Enqueued,
32159            2 => Self::Overdue,
32160            3 => Self::Running,
32161            4 => Self::Failed,
32162            5 => Self::Successful,
32163            6 => Self::Skipped,
32164            7 => Self::DeletionPending,
32165            8 => Self::DeletionFailed,
32166            9 => Self::Deleted,
32167            _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
32168                wkt::internal::UnknownEnumValue::Integer(value),
32169            )),
32170        }
32171    }
32172}
32173
32174impl std::convert::From<&str> for SqlBackupRunStatus {
32175    fn from(value: &str) -> Self {
32176        use std::string::ToString;
32177        match value {
32178            "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" => Self::Unspecified,
32179            "ENQUEUED" => Self::Enqueued,
32180            "OVERDUE" => Self::Overdue,
32181            "RUNNING" => Self::Running,
32182            "FAILED" => Self::Failed,
32183            "SUCCESSFUL" => Self::Successful,
32184            "SKIPPED" => Self::Skipped,
32185            "DELETION_PENDING" => Self::DeletionPending,
32186            "DELETION_FAILED" => Self::DeletionFailed,
32187            "DELETED" => Self::Deleted,
32188            _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
32189                wkt::internal::UnknownEnumValue::String(value.to_string()),
32190            )),
32191        }
32192    }
32193}
32194
32195impl serde::ser::Serialize for SqlBackupRunStatus {
32196    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32197    where
32198        S: serde::Serializer,
32199    {
32200        match self {
32201            Self::Unspecified => serializer.serialize_i32(0),
32202            Self::Enqueued => serializer.serialize_i32(1),
32203            Self::Overdue => serializer.serialize_i32(2),
32204            Self::Running => serializer.serialize_i32(3),
32205            Self::Failed => serializer.serialize_i32(4),
32206            Self::Successful => serializer.serialize_i32(5),
32207            Self::Skipped => serializer.serialize_i32(6),
32208            Self::DeletionPending => serializer.serialize_i32(7),
32209            Self::DeletionFailed => serializer.serialize_i32(8),
32210            Self::Deleted => serializer.serialize_i32(9),
32211            Self::UnknownValue(u) => u.0.serialize(serializer),
32212        }
32213    }
32214}
32215
32216impl<'de> serde::de::Deserialize<'de> for SqlBackupRunStatus {
32217    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32218    where
32219        D: serde::Deserializer<'de>,
32220    {
32221        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunStatus>::new(
32222            ".google.cloud.sql.v1.SqlBackupRunStatus",
32223        ))
32224    }
32225}
32226
32227/// Defines the supported backup kinds.
32228///
32229/// # Working with unknown values
32230///
32231/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32232/// additional enum variants at any time. Adding new variants is not considered
32233/// a breaking change. Applications should write their code in anticipation of:
32234///
32235/// - New values appearing in future releases of the client library, **and**
32236/// - New values received dynamically, without application changes.
32237///
32238/// Please consult the [Working with enums] section in the user guide for some
32239/// guidelines.
32240///
32241/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32242#[derive(Clone, Debug, PartialEq)]
32243#[non_exhaustive]
32244pub enum SqlBackupKind {
32245    /// This is an unknown BackupKind.
32246    Unspecified,
32247    /// Snapshot-based backups.
32248    Snapshot,
32249    /// Physical backups.
32250    Physical,
32251    /// If set, the enum was initialized with an unknown value.
32252    ///
32253    /// Applications can examine the value using [SqlBackupKind::value] or
32254    /// [SqlBackupKind::name].
32255    UnknownValue(sql_backup_kind::UnknownValue),
32256}
32257
32258#[doc(hidden)]
32259pub mod sql_backup_kind {
32260    #[allow(unused_imports)]
32261    use super::*;
32262    #[derive(Clone, Debug, PartialEq)]
32263    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32264}
32265
32266impl SqlBackupKind {
32267    /// Gets the enum value.
32268    ///
32269    /// Returns `None` if the enum contains an unknown value deserialized from
32270    /// the string representation of enums.
32271    pub fn value(&self) -> std::option::Option<i32> {
32272        match self {
32273            Self::Unspecified => std::option::Option::Some(0),
32274            Self::Snapshot => std::option::Option::Some(1),
32275            Self::Physical => std::option::Option::Some(2),
32276            Self::UnknownValue(u) => u.0.value(),
32277        }
32278    }
32279
32280    /// Gets the enum value as a string.
32281    ///
32282    /// Returns `None` if the enum contains an unknown value deserialized from
32283    /// the integer representation of enums.
32284    pub fn name(&self) -> std::option::Option<&str> {
32285        match self {
32286            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_KIND_UNSPECIFIED"),
32287            Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
32288            Self::Physical => std::option::Option::Some("PHYSICAL"),
32289            Self::UnknownValue(u) => u.0.name(),
32290        }
32291    }
32292}
32293
32294impl std::default::Default for SqlBackupKind {
32295    fn default() -> Self {
32296        use std::convert::From;
32297        Self::from(0)
32298    }
32299}
32300
32301impl std::fmt::Display for SqlBackupKind {
32302    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32303        wkt::internal::display_enum(f, self.name(), self.value())
32304    }
32305}
32306
32307impl std::convert::From<i32> for SqlBackupKind {
32308    fn from(value: i32) -> Self {
32309        match value {
32310            0 => Self::Unspecified,
32311            1 => Self::Snapshot,
32312            2 => Self::Physical,
32313            _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
32314                wkt::internal::UnknownEnumValue::Integer(value),
32315            )),
32316        }
32317    }
32318}
32319
32320impl std::convert::From<&str> for SqlBackupKind {
32321    fn from(value: &str) -> Self {
32322        use std::string::ToString;
32323        match value {
32324            "SQL_BACKUP_KIND_UNSPECIFIED" => Self::Unspecified,
32325            "SNAPSHOT" => Self::Snapshot,
32326            "PHYSICAL" => Self::Physical,
32327            _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
32328                wkt::internal::UnknownEnumValue::String(value.to_string()),
32329            )),
32330        }
32331    }
32332}
32333
32334impl serde::ser::Serialize for SqlBackupKind {
32335    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32336    where
32337        S: serde::Serializer,
32338    {
32339        match self {
32340            Self::Unspecified => serializer.serialize_i32(0),
32341            Self::Snapshot => serializer.serialize_i32(1),
32342            Self::Physical => serializer.serialize_i32(2),
32343            Self::UnknownValue(u) => u.0.serialize(serializer),
32344        }
32345    }
32346}
32347
32348impl<'de> serde::de::Deserialize<'de> for SqlBackupKind {
32349    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32350    where
32351        D: serde::Deserializer<'de>,
32352    {
32353        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupKind>::new(
32354            ".google.cloud.sql.v1.SqlBackupKind",
32355        ))
32356    }
32357}
32358
32359/// Type of backup (i.e. automated, on demand, etc).
32360///
32361/// # Working with unknown values
32362///
32363/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32364/// additional enum variants at any time. Adding new variants is not considered
32365/// a breaking change. Applications should write their code in anticipation of:
32366///
32367/// - New values appearing in future releases of the client library, **and**
32368/// - New values received dynamically, without application changes.
32369///
32370/// Please consult the [Working with enums] section in the user guide for some
32371/// guidelines.
32372///
32373/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32374#[derive(Clone, Debug, PartialEq)]
32375#[non_exhaustive]
32376pub enum SqlBackupRunType {
32377    /// This is an unknown BackupRun type.
32378    Unspecified,
32379    /// The backup schedule automatically triggers a backup.
32380    Automated,
32381    /// The user manually triggers a backup.
32382    OnDemand,
32383    /// If set, the enum was initialized with an unknown value.
32384    ///
32385    /// Applications can examine the value using [SqlBackupRunType::value] or
32386    /// [SqlBackupRunType::name].
32387    UnknownValue(sql_backup_run_type::UnknownValue),
32388}
32389
32390#[doc(hidden)]
32391pub mod sql_backup_run_type {
32392    #[allow(unused_imports)]
32393    use super::*;
32394    #[derive(Clone, Debug, PartialEq)]
32395    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32396}
32397
32398impl SqlBackupRunType {
32399    /// Gets the enum value.
32400    ///
32401    /// Returns `None` if the enum contains an unknown value deserialized from
32402    /// the string representation of enums.
32403    pub fn value(&self) -> std::option::Option<i32> {
32404        match self {
32405            Self::Unspecified => std::option::Option::Some(0),
32406            Self::Automated => std::option::Option::Some(1),
32407            Self::OnDemand => std::option::Option::Some(2),
32408            Self::UnknownValue(u) => u.0.value(),
32409        }
32410    }
32411
32412    /// Gets the enum value as a string.
32413    ///
32414    /// Returns `None` if the enum contains an unknown value deserialized from
32415    /// the integer representation of enums.
32416    pub fn name(&self) -> std::option::Option<&str> {
32417        match self {
32418            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_TYPE_UNSPECIFIED"),
32419            Self::Automated => std::option::Option::Some("AUTOMATED"),
32420            Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
32421            Self::UnknownValue(u) => u.0.name(),
32422        }
32423    }
32424}
32425
32426impl std::default::Default for SqlBackupRunType {
32427    fn default() -> Self {
32428        use std::convert::From;
32429        Self::from(0)
32430    }
32431}
32432
32433impl std::fmt::Display for SqlBackupRunType {
32434    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32435        wkt::internal::display_enum(f, self.name(), self.value())
32436    }
32437}
32438
32439impl std::convert::From<i32> for SqlBackupRunType {
32440    fn from(value: i32) -> Self {
32441        match value {
32442            0 => Self::Unspecified,
32443            1 => Self::Automated,
32444            2 => Self::OnDemand,
32445            _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
32446                wkt::internal::UnknownEnumValue::Integer(value),
32447            )),
32448        }
32449    }
32450}
32451
32452impl std::convert::From<&str> for SqlBackupRunType {
32453    fn from(value: &str) -> Self {
32454        use std::string::ToString;
32455        match value {
32456            "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" => Self::Unspecified,
32457            "AUTOMATED" => Self::Automated,
32458            "ON_DEMAND" => Self::OnDemand,
32459            _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
32460                wkt::internal::UnknownEnumValue::String(value.to_string()),
32461            )),
32462        }
32463    }
32464}
32465
32466impl serde::ser::Serialize for SqlBackupRunType {
32467    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32468    where
32469        S: serde::Serializer,
32470    {
32471        match self {
32472            Self::Unspecified => serializer.serialize_i32(0),
32473            Self::Automated => serializer.serialize_i32(1),
32474            Self::OnDemand => serializer.serialize_i32(2),
32475            Self::UnknownValue(u) => u.0.serialize(serializer),
32476        }
32477    }
32478}
32479
32480impl<'de> serde::de::Deserialize<'de> for SqlBackupRunType {
32481    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32482    where
32483        D: serde::Deserializer<'de>,
32484    {
32485        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunType>::new(
32486            ".google.cloud.sql.v1.SqlBackupRunType",
32487        ))
32488    }
32489}
32490
32491///
32492/// # Working with unknown values
32493///
32494/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32495/// additional enum variants at any time. Adding new variants is not considered
32496/// a breaking change. Applications should write their code in anticipation of:
32497///
32498/// - New values appearing in future releases of the client library, **and**
32499/// - New values received dynamically, without application changes.
32500///
32501/// Please consult the [Working with enums] section in the user guide for some
32502/// guidelines.
32503///
32504/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32505#[derive(Clone, Debug, PartialEq)]
32506#[non_exhaustive]
32507pub enum SqlFlagType {
32508    /// This is an unknown flag type.
32509    Unspecified,
32510    /// Boolean type flag.
32511    Boolean,
32512    /// String type flag.
32513    String,
32514    /// Integer type flag.
32515    Integer,
32516    /// Flag type used for a server startup option.
32517    None,
32518    /// Type introduced specially for MySQL TimeZone offset. Accept a string value
32519    /// with the format [-12:59, 13:00].
32520    MysqlTimezoneOffset,
32521    /// Float type flag.
32522    Float,
32523    /// Comma-separated list of the strings in a SqlFlagType enum.
32524    RepeatedString,
32525    /// If set, the enum was initialized with an unknown value.
32526    ///
32527    /// Applications can examine the value using [SqlFlagType::value] or
32528    /// [SqlFlagType::name].
32529    UnknownValue(sql_flag_type::UnknownValue),
32530}
32531
32532#[doc(hidden)]
32533pub mod sql_flag_type {
32534    #[allow(unused_imports)]
32535    use super::*;
32536    #[derive(Clone, Debug, PartialEq)]
32537    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32538}
32539
32540impl SqlFlagType {
32541    /// Gets the enum value.
32542    ///
32543    /// Returns `None` if the enum contains an unknown value deserialized from
32544    /// the string representation of enums.
32545    pub fn value(&self) -> std::option::Option<i32> {
32546        match self {
32547            Self::Unspecified => std::option::Option::Some(0),
32548            Self::Boolean => std::option::Option::Some(1),
32549            Self::String => std::option::Option::Some(2),
32550            Self::Integer => std::option::Option::Some(3),
32551            Self::None => std::option::Option::Some(4),
32552            Self::MysqlTimezoneOffset => std::option::Option::Some(5),
32553            Self::Float => std::option::Option::Some(6),
32554            Self::RepeatedString => std::option::Option::Some(7),
32555            Self::UnknownValue(u) => u.0.value(),
32556        }
32557    }
32558
32559    /// Gets the enum value as a string.
32560    ///
32561    /// Returns `None` if the enum contains an unknown value deserialized from
32562    /// the integer representation of enums.
32563    pub fn name(&self) -> std::option::Option<&str> {
32564        match self {
32565            Self::Unspecified => std::option::Option::Some("SQL_FLAG_TYPE_UNSPECIFIED"),
32566            Self::Boolean => std::option::Option::Some("BOOLEAN"),
32567            Self::String => std::option::Option::Some("STRING"),
32568            Self::Integer => std::option::Option::Some("INTEGER"),
32569            Self::None => std::option::Option::Some("NONE"),
32570            Self::MysqlTimezoneOffset => std::option::Option::Some("MYSQL_TIMEZONE_OFFSET"),
32571            Self::Float => std::option::Option::Some("FLOAT"),
32572            Self::RepeatedString => std::option::Option::Some("REPEATED_STRING"),
32573            Self::UnknownValue(u) => u.0.name(),
32574        }
32575    }
32576}
32577
32578impl std::default::Default for SqlFlagType {
32579    fn default() -> Self {
32580        use std::convert::From;
32581        Self::from(0)
32582    }
32583}
32584
32585impl std::fmt::Display for SqlFlagType {
32586    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32587        wkt::internal::display_enum(f, self.name(), self.value())
32588    }
32589}
32590
32591impl std::convert::From<i32> for SqlFlagType {
32592    fn from(value: i32) -> Self {
32593        match value {
32594            0 => Self::Unspecified,
32595            1 => Self::Boolean,
32596            2 => Self::String,
32597            3 => Self::Integer,
32598            4 => Self::None,
32599            5 => Self::MysqlTimezoneOffset,
32600            6 => Self::Float,
32601            7 => Self::RepeatedString,
32602            _ => Self::UnknownValue(sql_flag_type::UnknownValue(
32603                wkt::internal::UnknownEnumValue::Integer(value),
32604            )),
32605        }
32606    }
32607}
32608
32609impl std::convert::From<&str> for SqlFlagType {
32610    fn from(value: &str) -> Self {
32611        use std::string::ToString;
32612        match value {
32613            "SQL_FLAG_TYPE_UNSPECIFIED" => Self::Unspecified,
32614            "BOOLEAN" => Self::Boolean,
32615            "STRING" => Self::String,
32616            "INTEGER" => Self::Integer,
32617            "NONE" => Self::None,
32618            "MYSQL_TIMEZONE_OFFSET" => Self::MysqlTimezoneOffset,
32619            "FLOAT" => Self::Float,
32620            "REPEATED_STRING" => Self::RepeatedString,
32621            _ => Self::UnknownValue(sql_flag_type::UnknownValue(
32622                wkt::internal::UnknownEnumValue::String(value.to_string()),
32623            )),
32624        }
32625    }
32626}
32627
32628impl serde::ser::Serialize for SqlFlagType {
32629    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32630    where
32631        S: serde::Serializer,
32632    {
32633        match self {
32634            Self::Unspecified => serializer.serialize_i32(0),
32635            Self::Boolean => serializer.serialize_i32(1),
32636            Self::String => serializer.serialize_i32(2),
32637            Self::Integer => serializer.serialize_i32(3),
32638            Self::None => serializer.serialize_i32(4),
32639            Self::MysqlTimezoneOffset => serializer.serialize_i32(5),
32640            Self::Float => serializer.serialize_i32(6),
32641            Self::RepeatedString => serializer.serialize_i32(7),
32642            Self::UnknownValue(u) => u.0.serialize(serializer),
32643        }
32644    }
32645}
32646
32647impl<'de> serde::de::Deserialize<'de> for SqlFlagType {
32648    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32649    where
32650        D: serde::Deserializer<'de>,
32651    {
32652        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagType>::new(
32653            ".google.cloud.sql.v1.SqlFlagType",
32654        ))
32655    }
32656}
32657
32658/// Scopes of a flag describe where the flag is used.
32659///
32660/// # Working with unknown values
32661///
32662/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32663/// additional enum variants at any time. Adding new variants is not considered
32664/// a breaking change. Applications should write their code in anticipation of:
32665///
32666/// - New values appearing in future releases of the client library, **and**
32667/// - New values received dynamically, without application changes.
32668///
32669/// Please consult the [Working with enums] section in the user guide for some
32670/// guidelines.
32671///
32672/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32673#[derive(Clone, Debug, PartialEq)]
32674#[non_exhaustive]
32675pub enum SqlFlagScope {
32676    /// Assume database flags if unspecified
32677    Unspecified,
32678    /// database flags
32679    Database,
32680    /// connection pool configuration flags
32681    ConnectionPool,
32682    /// If set, the enum was initialized with an unknown value.
32683    ///
32684    /// Applications can examine the value using [SqlFlagScope::value] or
32685    /// [SqlFlagScope::name].
32686    UnknownValue(sql_flag_scope::UnknownValue),
32687}
32688
32689#[doc(hidden)]
32690pub mod sql_flag_scope {
32691    #[allow(unused_imports)]
32692    use super::*;
32693    #[derive(Clone, Debug, PartialEq)]
32694    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32695}
32696
32697impl SqlFlagScope {
32698    /// Gets the enum value.
32699    ///
32700    /// Returns `None` if the enum contains an unknown value deserialized from
32701    /// the string representation of enums.
32702    pub fn value(&self) -> std::option::Option<i32> {
32703        match self {
32704            Self::Unspecified => std::option::Option::Some(0),
32705            Self::Database => std::option::Option::Some(1),
32706            Self::ConnectionPool => std::option::Option::Some(2),
32707            Self::UnknownValue(u) => u.0.value(),
32708        }
32709    }
32710
32711    /// Gets the enum value as a string.
32712    ///
32713    /// Returns `None` if the enum contains an unknown value deserialized from
32714    /// the integer representation of enums.
32715    pub fn name(&self) -> std::option::Option<&str> {
32716        match self {
32717            Self::Unspecified => std::option::Option::Some("SQL_FLAG_SCOPE_UNSPECIFIED"),
32718            Self::Database => std::option::Option::Some("SQL_FLAG_SCOPE_DATABASE"),
32719            Self::ConnectionPool => std::option::Option::Some("SQL_FLAG_SCOPE_CONNECTION_POOL"),
32720            Self::UnknownValue(u) => u.0.name(),
32721        }
32722    }
32723}
32724
32725impl std::default::Default for SqlFlagScope {
32726    fn default() -> Self {
32727        use std::convert::From;
32728        Self::from(0)
32729    }
32730}
32731
32732impl std::fmt::Display for SqlFlagScope {
32733    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32734        wkt::internal::display_enum(f, self.name(), self.value())
32735    }
32736}
32737
32738impl std::convert::From<i32> for SqlFlagScope {
32739    fn from(value: i32) -> Self {
32740        match value {
32741            0 => Self::Unspecified,
32742            1 => Self::Database,
32743            2 => Self::ConnectionPool,
32744            _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
32745                wkt::internal::UnknownEnumValue::Integer(value),
32746            )),
32747        }
32748    }
32749}
32750
32751impl std::convert::From<&str> for SqlFlagScope {
32752    fn from(value: &str) -> Self {
32753        use std::string::ToString;
32754        match value {
32755            "SQL_FLAG_SCOPE_UNSPECIFIED" => Self::Unspecified,
32756            "SQL_FLAG_SCOPE_DATABASE" => Self::Database,
32757            "SQL_FLAG_SCOPE_CONNECTION_POOL" => Self::ConnectionPool,
32758            _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
32759                wkt::internal::UnknownEnumValue::String(value.to_string()),
32760            )),
32761        }
32762    }
32763}
32764
32765impl serde::ser::Serialize for SqlFlagScope {
32766    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32767    where
32768        S: serde::Serializer,
32769    {
32770        match self {
32771            Self::Unspecified => serializer.serialize_i32(0),
32772            Self::Database => serializer.serialize_i32(1),
32773            Self::ConnectionPool => serializer.serialize_i32(2),
32774            Self::UnknownValue(u) => u.0.serialize(serializer),
32775        }
32776    }
32777}
32778
32779impl<'de> serde::de::Deserialize<'de> for SqlFlagScope {
32780    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32781    where
32782        D: serde::Deserializer<'de>,
32783    {
32784        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagScope>::new(
32785            ".google.cloud.sql.v1.SqlFlagScope",
32786        ))
32787    }
32788}
32789
32790/// External Sync parallel level.
32791///
32792/// # Working with unknown values
32793///
32794/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32795/// additional enum variants at any time. Adding new variants is not considered
32796/// a breaking change. Applications should write their code in anticipation of:
32797///
32798/// - New values appearing in future releases of the client library, **and**
32799/// - New values received dynamically, without application changes.
32800///
32801/// Please consult the [Working with enums] section in the user guide for some
32802/// guidelines.
32803///
32804/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32805#[derive(Clone, Debug, PartialEq)]
32806#[non_exhaustive]
32807pub enum ExternalSyncParallelLevel {
32808    /// Unknown sync parallel level. Will be defaulted to OPTIMAL.
32809    Unspecified,
32810    /// Minimal parallel level.
32811    Min,
32812    /// Optimal parallel level.
32813    Optimal,
32814    /// Maximum parallel level.
32815    Max,
32816    /// If set, the enum was initialized with an unknown value.
32817    ///
32818    /// Applications can examine the value using [ExternalSyncParallelLevel::value] or
32819    /// [ExternalSyncParallelLevel::name].
32820    UnknownValue(external_sync_parallel_level::UnknownValue),
32821}
32822
32823#[doc(hidden)]
32824pub mod external_sync_parallel_level {
32825    #[allow(unused_imports)]
32826    use super::*;
32827    #[derive(Clone, Debug, PartialEq)]
32828    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32829}
32830
32831impl ExternalSyncParallelLevel {
32832    /// Gets the enum value.
32833    ///
32834    /// Returns `None` if the enum contains an unknown value deserialized from
32835    /// the string representation of enums.
32836    pub fn value(&self) -> std::option::Option<i32> {
32837        match self {
32838            Self::Unspecified => std::option::Option::Some(0),
32839            Self::Min => std::option::Option::Some(1),
32840            Self::Optimal => std::option::Option::Some(2),
32841            Self::Max => std::option::Option::Some(3),
32842            Self::UnknownValue(u) => u.0.value(),
32843        }
32844    }
32845
32846    /// Gets the enum value as a string.
32847    ///
32848    /// Returns `None` if the enum contains an unknown value deserialized from
32849    /// the integer representation of enums.
32850    pub fn name(&self) -> std::option::Option<&str> {
32851        match self {
32852            Self::Unspecified => {
32853                std::option::Option::Some("EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED")
32854            }
32855            Self::Min => std::option::Option::Some("MIN"),
32856            Self::Optimal => std::option::Option::Some("OPTIMAL"),
32857            Self::Max => std::option::Option::Some("MAX"),
32858            Self::UnknownValue(u) => u.0.name(),
32859        }
32860    }
32861}
32862
32863impl std::default::Default for ExternalSyncParallelLevel {
32864    fn default() -> Self {
32865        use std::convert::From;
32866        Self::from(0)
32867    }
32868}
32869
32870impl std::fmt::Display for ExternalSyncParallelLevel {
32871    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32872        wkt::internal::display_enum(f, self.name(), self.value())
32873    }
32874}
32875
32876impl std::convert::From<i32> for ExternalSyncParallelLevel {
32877    fn from(value: i32) -> Self {
32878        match value {
32879            0 => Self::Unspecified,
32880            1 => Self::Min,
32881            2 => Self::Optimal,
32882            3 => Self::Max,
32883            _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
32884                wkt::internal::UnknownEnumValue::Integer(value),
32885            )),
32886        }
32887    }
32888}
32889
32890impl std::convert::From<&str> for ExternalSyncParallelLevel {
32891    fn from(value: &str) -> Self {
32892        use std::string::ToString;
32893        match value {
32894            "EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
32895            "MIN" => Self::Min,
32896            "OPTIMAL" => Self::Optimal,
32897            "MAX" => Self::Max,
32898            _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
32899                wkt::internal::UnknownEnumValue::String(value.to_string()),
32900            )),
32901        }
32902    }
32903}
32904
32905impl serde::ser::Serialize for ExternalSyncParallelLevel {
32906    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32907    where
32908        S: serde::Serializer,
32909    {
32910        match self {
32911            Self::Unspecified => serializer.serialize_i32(0),
32912            Self::Min => serializer.serialize_i32(1),
32913            Self::Optimal => serializer.serialize_i32(2),
32914            Self::Max => serializer.serialize_i32(3),
32915            Self::UnknownValue(u) => u.0.serialize(serializer),
32916        }
32917    }
32918}
32919
32920impl<'de> serde::de::Deserialize<'de> for ExternalSyncParallelLevel {
32921    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32922    where
32923        D: serde::Deserializer<'de>,
32924    {
32925        deserializer.deserialize_any(
32926            wkt::internal::EnumVisitor::<ExternalSyncParallelLevel>::new(
32927                ".google.cloud.sql.v1.ExternalSyncParallelLevel",
32928            ),
32929        )
32930    }
32931}
32932
32933///
32934/// # Working with unknown values
32935///
32936/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32937/// additional enum variants at any time. Adding new variants is not considered
32938/// a breaking change. Applications should write their code in anticipation of:
32939///
32940/// - New values appearing in future releases of the client library, **and**
32941/// - New values received dynamically, without application changes.
32942///
32943/// Please consult the [Working with enums] section in the user guide for some
32944/// guidelines.
32945///
32946/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32947#[derive(Clone, Debug, PartialEq)]
32948#[non_exhaustive]
32949pub enum SqlInstanceType {
32950    /// This is an unknown Cloud SQL instance type.
32951    Unspecified,
32952    /// A regular Cloud SQL instance that is not replicating from a primary
32953    /// instance.
32954    CloudSqlInstance,
32955    /// An instance running on the customer's premises that is not managed by
32956    /// Cloud SQL.
32957    OnPremisesInstance,
32958    /// A Cloud SQL instance acting as a read-replica.
32959    ReadReplicaInstance,
32960    /// A Cloud SQL read pool.
32961    ReadPoolInstance,
32962    /// If set, the enum was initialized with an unknown value.
32963    ///
32964    /// Applications can examine the value using [SqlInstanceType::value] or
32965    /// [SqlInstanceType::name].
32966    UnknownValue(sql_instance_type::UnknownValue),
32967}
32968
32969#[doc(hidden)]
32970pub mod sql_instance_type {
32971    #[allow(unused_imports)]
32972    use super::*;
32973    #[derive(Clone, Debug, PartialEq)]
32974    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32975}
32976
32977impl SqlInstanceType {
32978    /// Gets the enum value.
32979    ///
32980    /// Returns `None` if the enum contains an unknown value deserialized from
32981    /// the string representation of enums.
32982    pub fn value(&self) -> std::option::Option<i32> {
32983        match self {
32984            Self::Unspecified => std::option::Option::Some(0),
32985            Self::CloudSqlInstance => std::option::Option::Some(1),
32986            Self::OnPremisesInstance => std::option::Option::Some(2),
32987            Self::ReadReplicaInstance => std::option::Option::Some(3),
32988            Self::ReadPoolInstance => std::option::Option::Some(5),
32989            Self::UnknownValue(u) => u.0.value(),
32990        }
32991    }
32992
32993    /// Gets the enum value as a string.
32994    ///
32995    /// Returns `None` if the enum contains an unknown value deserialized from
32996    /// the integer representation of enums.
32997    pub fn name(&self) -> std::option::Option<&str> {
32998        match self {
32999            Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_TYPE_UNSPECIFIED"),
33000            Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
33001            Self::OnPremisesInstance => std::option::Option::Some("ON_PREMISES_INSTANCE"),
33002            Self::ReadReplicaInstance => std::option::Option::Some("READ_REPLICA_INSTANCE"),
33003            Self::ReadPoolInstance => std::option::Option::Some("READ_POOL_INSTANCE"),
33004            Self::UnknownValue(u) => u.0.name(),
33005        }
33006    }
33007}
33008
33009impl std::default::Default for SqlInstanceType {
33010    fn default() -> Self {
33011        use std::convert::From;
33012        Self::from(0)
33013    }
33014}
33015
33016impl std::fmt::Display for SqlInstanceType {
33017    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33018        wkt::internal::display_enum(f, self.name(), self.value())
33019    }
33020}
33021
33022impl std::convert::From<i32> for SqlInstanceType {
33023    fn from(value: i32) -> Self {
33024        match value {
33025            0 => Self::Unspecified,
33026            1 => Self::CloudSqlInstance,
33027            2 => Self::OnPremisesInstance,
33028            3 => Self::ReadReplicaInstance,
33029            5 => Self::ReadPoolInstance,
33030            _ => Self::UnknownValue(sql_instance_type::UnknownValue(
33031                wkt::internal::UnknownEnumValue::Integer(value),
33032            )),
33033        }
33034    }
33035}
33036
33037impl std::convert::From<&str> for SqlInstanceType {
33038    fn from(value: &str) -> Self {
33039        use std::string::ToString;
33040        match value {
33041            "SQL_INSTANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
33042            "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
33043            "ON_PREMISES_INSTANCE" => Self::OnPremisesInstance,
33044            "READ_REPLICA_INSTANCE" => Self::ReadReplicaInstance,
33045            "READ_POOL_INSTANCE" => Self::ReadPoolInstance,
33046            _ => Self::UnknownValue(sql_instance_type::UnknownValue(
33047                wkt::internal::UnknownEnumValue::String(value.to_string()),
33048            )),
33049        }
33050    }
33051}
33052
33053impl serde::ser::Serialize for SqlInstanceType {
33054    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33055    where
33056        S: serde::Serializer,
33057    {
33058        match self {
33059            Self::Unspecified => serializer.serialize_i32(0),
33060            Self::CloudSqlInstance => serializer.serialize_i32(1),
33061            Self::OnPremisesInstance => serializer.serialize_i32(2),
33062            Self::ReadReplicaInstance => serializer.serialize_i32(3),
33063            Self::ReadPoolInstance => serializer.serialize_i32(5),
33064            Self::UnknownValue(u) => u.0.serialize(serializer),
33065        }
33066    }
33067}
33068
33069impl<'de> serde::de::Deserialize<'de> for SqlInstanceType {
33070    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33071    where
33072        D: serde::Deserializer<'de>,
33073    {
33074        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceType>::new(
33075            ".google.cloud.sql.v1.SqlInstanceType",
33076        ))
33077    }
33078}
33079
33080/// The suspension reason of the database instance if the state is SUSPENDED.
33081///
33082/// # Working with unknown values
33083///
33084/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33085/// additional enum variants at any time. Adding new variants is not considered
33086/// a breaking change. Applications should write their code in anticipation of:
33087///
33088/// - New values appearing in future releases of the client library, **and**
33089/// - New values received dynamically, without application changes.
33090///
33091/// Please consult the [Working with enums] section in the user guide for some
33092/// guidelines.
33093///
33094/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33095#[derive(Clone, Debug, PartialEq)]
33096#[non_exhaustive]
33097pub enum SqlSuspensionReason {
33098    /// This is an unknown suspension reason.
33099    Unspecified,
33100    /// The instance is suspended due to billing issues (for example:, account
33101    /// issue)
33102    BillingIssue,
33103    /// The instance is suspended due to illegal content (for example:, child
33104    /// pornography, copyrighted material, etc.).
33105    LegalIssue,
33106    /// The instance is causing operational issues (for example:, causing the
33107    /// database to crash).
33108    OperationalIssue,
33109    /// The KMS key used by the instance is either revoked or denied access to
33110    KmsKeyIssue,
33111    /// If set, the enum was initialized with an unknown value.
33112    ///
33113    /// Applications can examine the value using [SqlSuspensionReason::value] or
33114    /// [SqlSuspensionReason::name].
33115    UnknownValue(sql_suspension_reason::UnknownValue),
33116}
33117
33118#[doc(hidden)]
33119pub mod sql_suspension_reason {
33120    #[allow(unused_imports)]
33121    use super::*;
33122    #[derive(Clone, Debug, PartialEq)]
33123    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33124}
33125
33126impl SqlSuspensionReason {
33127    /// Gets the enum value.
33128    ///
33129    /// Returns `None` if the enum contains an unknown value deserialized from
33130    /// the string representation of enums.
33131    pub fn value(&self) -> std::option::Option<i32> {
33132        match self {
33133            Self::Unspecified => std::option::Option::Some(0),
33134            Self::BillingIssue => std::option::Option::Some(2),
33135            Self::LegalIssue => std::option::Option::Some(3),
33136            Self::OperationalIssue => std::option::Option::Some(4),
33137            Self::KmsKeyIssue => std::option::Option::Some(5),
33138            Self::UnknownValue(u) => u.0.value(),
33139        }
33140    }
33141
33142    /// Gets the enum value as a string.
33143    ///
33144    /// Returns `None` if the enum contains an unknown value deserialized from
33145    /// the integer representation of enums.
33146    pub fn name(&self) -> std::option::Option<&str> {
33147        match self {
33148            Self::Unspecified => std::option::Option::Some("SQL_SUSPENSION_REASON_UNSPECIFIED"),
33149            Self::BillingIssue => std::option::Option::Some("BILLING_ISSUE"),
33150            Self::LegalIssue => std::option::Option::Some("LEGAL_ISSUE"),
33151            Self::OperationalIssue => std::option::Option::Some("OPERATIONAL_ISSUE"),
33152            Self::KmsKeyIssue => std::option::Option::Some("KMS_KEY_ISSUE"),
33153            Self::UnknownValue(u) => u.0.name(),
33154        }
33155    }
33156}
33157
33158impl std::default::Default for SqlSuspensionReason {
33159    fn default() -> Self {
33160        use std::convert::From;
33161        Self::from(0)
33162    }
33163}
33164
33165impl std::fmt::Display for SqlSuspensionReason {
33166    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33167        wkt::internal::display_enum(f, self.name(), self.value())
33168    }
33169}
33170
33171impl std::convert::From<i32> for SqlSuspensionReason {
33172    fn from(value: i32) -> Self {
33173        match value {
33174            0 => Self::Unspecified,
33175            2 => Self::BillingIssue,
33176            3 => Self::LegalIssue,
33177            4 => Self::OperationalIssue,
33178            5 => Self::KmsKeyIssue,
33179            _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
33180                wkt::internal::UnknownEnumValue::Integer(value),
33181            )),
33182        }
33183    }
33184}
33185
33186impl std::convert::From<&str> for SqlSuspensionReason {
33187    fn from(value: &str) -> Self {
33188        use std::string::ToString;
33189        match value {
33190            "SQL_SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
33191            "BILLING_ISSUE" => Self::BillingIssue,
33192            "LEGAL_ISSUE" => Self::LegalIssue,
33193            "OPERATIONAL_ISSUE" => Self::OperationalIssue,
33194            "KMS_KEY_ISSUE" => Self::KmsKeyIssue,
33195            _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
33196                wkt::internal::UnknownEnumValue::String(value.to_string()),
33197            )),
33198        }
33199    }
33200}
33201
33202impl serde::ser::Serialize for SqlSuspensionReason {
33203    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33204    where
33205        S: serde::Serializer,
33206    {
33207        match self {
33208            Self::Unspecified => serializer.serialize_i32(0),
33209            Self::BillingIssue => serializer.serialize_i32(2),
33210            Self::LegalIssue => serializer.serialize_i32(3),
33211            Self::OperationalIssue => serializer.serialize_i32(4),
33212            Self::KmsKeyIssue => serializer.serialize_i32(5),
33213            Self::UnknownValue(u) => u.0.serialize(serializer),
33214        }
33215    }
33216}
33217
33218impl<'de> serde::de::Deserialize<'de> for SqlSuspensionReason {
33219    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33220    where
33221        D: serde::Deserializer<'de>,
33222    {
33223        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlSuspensionReason>::new(
33224            ".google.cloud.sql.v1.SqlSuspensionReason",
33225        ))
33226    }
33227}
33228
33229///
33230/// # Working with unknown values
33231///
33232/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33233/// additional enum variants at any time. Adding new variants is not considered
33234/// a breaking change. Applications should write their code in anticipation of:
33235///
33236/// - New values appearing in future releases of the client library, **and**
33237/// - New values received dynamically, without application changes.
33238///
33239/// Please consult the [Working with enums] section in the user guide for some
33240/// guidelines.
33241///
33242/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33243#[derive(Clone, Debug, PartialEq)]
33244#[non_exhaustive]
33245pub enum SqlFileType {
33246    /// Unknown file type.
33247    Unspecified,
33248    /// File containing SQL statements.
33249    Sql,
33250    /// File in CSV format.
33251    Csv,
33252    Bak,
33253    /// TDE certificate.
33254    Tde,
33255    /// If set, the enum was initialized with an unknown value.
33256    ///
33257    /// Applications can examine the value using [SqlFileType::value] or
33258    /// [SqlFileType::name].
33259    UnknownValue(sql_file_type::UnknownValue),
33260}
33261
33262#[doc(hidden)]
33263pub mod sql_file_type {
33264    #[allow(unused_imports)]
33265    use super::*;
33266    #[derive(Clone, Debug, PartialEq)]
33267    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33268}
33269
33270impl SqlFileType {
33271    /// Gets the enum value.
33272    ///
33273    /// Returns `None` if the enum contains an unknown value deserialized from
33274    /// the string representation of enums.
33275    pub fn value(&self) -> std::option::Option<i32> {
33276        match self {
33277            Self::Unspecified => std::option::Option::Some(0),
33278            Self::Sql => std::option::Option::Some(1),
33279            Self::Csv => std::option::Option::Some(2),
33280            Self::Bak => std::option::Option::Some(4),
33281            Self::Tde => std::option::Option::Some(8),
33282            Self::UnknownValue(u) => u.0.value(),
33283        }
33284    }
33285
33286    /// Gets the enum value as a string.
33287    ///
33288    /// Returns `None` if the enum contains an unknown value deserialized from
33289    /// the integer representation of enums.
33290    pub fn name(&self) -> std::option::Option<&str> {
33291        match self {
33292            Self::Unspecified => std::option::Option::Some("SQL_FILE_TYPE_UNSPECIFIED"),
33293            Self::Sql => std::option::Option::Some("SQL"),
33294            Self::Csv => std::option::Option::Some("CSV"),
33295            Self::Bak => std::option::Option::Some("BAK"),
33296            Self::Tde => std::option::Option::Some("TDE"),
33297            Self::UnknownValue(u) => u.0.name(),
33298        }
33299    }
33300}
33301
33302impl std::default::Default for SqlFileType {
33303    fn default() -> Self {
33304        use std::convert::From;
33305        Self::from(0)
33306    }
33307}
33308
33309impl std::fmt::Display for SqlFileType {
33310    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33311        wkt::internal::display_enum(f, self.name(), self.value())
33312    }
33313}
33314
33315impl std::convert::From<i32> for SqlFileType {
33316    fn from(value: i32) -> Self {
33317        match value {
33318            0 => Self::Unspecified,
33319            1 => Self::Sql,
33320            2 => Self::Csv,
33321            4 => Self::Bak,
33322            8 => Self::Tde,
33323            _ => Self::UnknownValue(sql_file_type::UnknownValue(
33324                wkt::internal::UnknownEnumValue::Integer(value),
33325            )),
33326        }
33327    }
33328}
33329
33330impl std::convert::From<&str> for SqlFileType {
33331    fn from(value: &str) -> Self {
33332        use std::string::ToString;
33333        match value {
33334            "SQL_FILE_TYPE_UNSPECIFIED" => Self::Unspecified,
33335            "SQL" => Self::Sql,
33336            "CSV" => Self::Csv,
33337            "BAK" => Self::Bak,
33338            "TDE" => Self::Tde,
33339            _ => Self::UnknownValue(sql_file_type::UnknownValue(
33340                wkt::internal::UnknownEnumValue::String(value.to_string()),
33341            )),
33342        }
33343    }
33344}
33345
33346impl serde::ser::Serialize for SqlFileType {
33347    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33348    where
33349        S: serde::Serializer,
33350    {
33351        match self {
33352            Self::Unspecified => serializer.serialize_i32(0),
33353            Self::Sql => serializer.serialize_i32(1),
33354            Self::Csv => serializer.serialize_i32(2),
33355            Self::Bak => serializer.serialize_i32(4),
33356            Self::Tde => serializer.serialize_i32(8),
33357            Self::UnknownValue(u) => u.0.serialize(serializer),
33358        }
33359    }
33360}
33361
33362impl<'de> serde::de::Deserialize<'de> for SqlFileType {
33363    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33364    where
33365        D: serde::Deserializer<'de>,
33366    {
33367        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFileType>::new(
33368            ".google.cloud.sql.v1.SqlFileType",
33369        ))
33370    }
33371}
33372
33373///
33374/// # Working with unknown values
33375///
33376/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33377/// additional enum variants at any time. Adding new variants is not considered
33378/// a breaking change. Applications should write their code in anticipation of:
33379///
33380/// - New values appearing in future releases of the client library, **and**
33381/// - New values received dynamically, without application changes.
33382///
33383/// Please consult the [Working with enums] section in the user guide for some
33384/// guidelines.
33385///
33386/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33387#[derive(Clone, Debug, PartialEq)]
33388#[non_exhaustive]
33389pub enum BakType {
33390    /// Default type.
33391    Unspecified,
33392    /// Full backup.
33393    Full,
33394    /// Differential backup.
33395    Diff,
33396    /// Transaction Log backup
33397    Tlog,
33398    /// If set, the enum was initialized with an unknown value.
33399    ///
33400    /// Applications can examine the value using [BakType::value] or
33401    /// [BakType::name].
33402    UnknownValue(bak_type::UnknownValue),
33403}
33404
33405#[doc(hidden)]
33406pub mod bak_type {
33407    #[allow(unused_imports)]
33408    use super::*;
33409    #[derive(Clone, Debug, PartialEq)]
33410    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33411}
33412
33413impl BakType {
33414    /// Gets the enum value.
33415    ///
33416    /// Returns `None` if the enum contains an unknown value deserialized from
33417    /// the string representation of enums.
33418    pub fn value(&self) -> std::option::Option<i32> {
33419        match self {
33420            Self::Unspecified => std::option::Option::Some(0),
33421            Self::Full => std::option::Option::Some(1),
33422            Self::Diff => std::option::Option::Some(2),
33423            Self::Tlog => std::option::Option::Some(3),
33424            Self::UnknownValue(u) => u.0.value(),
33425        }
33426    }
33427
33428    /// Gets the enum value as a string.
33429    ///
33430    /// Returns `None` if the enum contains an unknown value deserialized from
33431    /// the integer representation of enums.
33432    pub fn name(&self) -> std::option::Option<&str> {
33433        match self {
33434            Self::Unspecified => std::option::Option::Some("BAK_TYPE_UNSPECIFIED"),
33435            Self::Full => std::option::Option::Some("FULL"),
33436            Self::Diff => std::option::Option::Some("DIFF"),
33437            Self::Tlog => std::option::Option::Some("TLOG"),
33438            Self::UnknownValue(u) => u.0.name(),
33439        }
33440    }
33441}
33442
33443impl std::default::Default for BakType {
33444    fn default() -> Self {
33445        use std::convert::From;
33446        Self::from(0)
33447    }
33448}
33449
33450impl std::fmt::Display for BakType {
33451    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33452        wkt::internal::display_enum(f, self.name(), self.value())
33453    }
33454}
33455
33456impl std::convert::From<i32> for BakType {
33457    fn from(value: i32) -> Self {
33458        match value {
33459            0 => Self::Unspecified,
33460            1 => Self::Full,
33461            2 => Self::Diff,
33462            3 => Self::Tlog,
33463            _ => Self::UnknownValue(bak_type::UnknownValue(
33464                wkt::internal::UnknownEnumValue::Integer(value),
33465            )),
33466        }
33467    }
33468}
33469
33470impl std::convert::From<&str> for BakType {
33471    fn from(value: &str) -> Self {
33472        use std::string::ToString;
33473        match value {
33474            "BAK_TYPE_UNSPECIFIED" => Self::Unspecified,
33475            "FULL" => Self::Full,
33476            "DIFF" => Self::Diff,
33477            "TLOG" => Self::Tlog,
33478            _ => Self::UnknownValue(bak_type::UnknownValue(
33479                wkt::internal::UnknownEnumValue::String(value.to_string()),
33480            )),
33481        }
33482    }
33483}
33484
33485impl serde::ser::Serialize for BakType {
33486    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33487    where
33488        S: serde::Serializer,
33489    {
33490        match self {
33491            Self::Unspecified => serializer.serialize_i32(0),
33492            Self::Full => serializer.serialize_i32(1),
33493            Self::Diff => serializer.serialize_i32(2),
33494            Self::Tlog => serializer.serialize_i32(3),
33495            Self::UnknownValue(u) => u.0.serialize(serializer),
33496        }
33497    }
33498}
33499
33500impl<'de> serde::de::Deserialize<'de> for BakType {
33501    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33502    where
33503        D: serde::Deserializer<'de>,
33504    {
33505        deserializer.deserialize_any(wkt::internal::EnumVisitor::<BakType>::new(
33506            ".google.cloud.sql.v1.BakType",
33507        ))
33508    }
33509}
33510
33511/// The type of maintenance to be performed on the instance.
33512///
33513/// # Working with unknown values
33514///
33515/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33516/// additional enum variants at any time. Adding new variants is not considered
33517/// a breaking change. Applications should write their code in anticipation of:
33518///
33519/// - New values appearing in future releases of the client library, **and**
33520/// - New values received dynamically, without application changes.
33521///
33522/// Please consult the [Working with enums] section in the user guide for some
33523/// guidelines.
33524///
33525/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33526#[derive(Clone, Debug, PartialEq)]
33527#[non_exhaustive]
33528pub enum SqlMaintenanceType {
33529    /// Maintenance type is unspecified.
33530    Unspecified,
33531    /// Indicates that a standalone instance is undergoing maintenance. The
33532    /// instance can be either a primary instance or a replica.
33533    InstanceMaintenance,
33534    /// Indicates that the primary instance and all of its replicas, including
33535    /// cascading replicas, are undergoing maintenance. Maintenance is performed on
33536    /// groups of replicas first, followed by the primary instance.
33537    ReplicaIncludedMaintenance,
33538    /// Indicates that the standalone instance is undergoing maintenance, initiated
33539    /// by self-service. The instance can be either a primary instance or a
33540    /// replica.
33541    InstanceSelfServiceMaintenance,
33542    /// Indicates that the primary instance and all of its replicas are undergoing
33543    /// maintenance, initiated by self-service. Maintenance is performed on groups
33544    /// of replicas first, followed by the primary instance.
33545    ReplicaIncludedSelfServiceMaintenance,
33546    /// If set, the enum was initialized with an unknown value.
33547    ///
33548    /// Applications can examine the value using [SqlMaintenanceType::value] or
33549    /// [SqlMaintenanceType::name].
33550    UnknownValue(sql_maintenance_type::UnknownValue),
33551}
33552
33553#[doc(hidden)]
33554pub mod sql_maintenance_type {
33555    #[allow(unused_imports)]
33556    use super::*;
33557    #[derive(Clone, Debug, PartialEq)]
33558    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33559}
33560
33561impl SqlMaintenanceType {
33562    /// Gets the enum value.
33563    ///
33564    /// Returns `None` if the enum contains an unknown value deserialized from
33565    /// the string representation of enums.
33566    pub fn value(&self) -> std::option::Option<i32> {
33567        match self {
33568            Self::Unspecified => std::option::Option::Some(0),
33569            Self::InstanceMaintenance => std::option::Option::Some(1),
33570            Self::ReplicaIncludedMaintenance => std::option::Option::Some(2),
33571            Self::InstanceSelfServiceMaintenance => std::option::Option::Some(3),
33572            Self::ReplicaIncludedSelfServiceMaintenance => std::option::Option::Some(4),
33573            Self::UnknownValue(u) => u.0.value(),
33574        }
33575    }
33576
33577    /// Gets the enum value as a string.
33578    ///
33579    /// Returns `None` if the enum contains an unknown value deserialized from
33580    /// the integer representation of enums.
33581    pub fn name(&self) -> std::option::Option<&str> {
33582        match self {
33583            Self::Unspecified => std::option::Option::Some("SQL_MAINTENANCE_TYPE_UNSPECIFIED"),
33584            Self::InstanceMaintenance => std::option::Option::Some("INSTANCE_MAINTENANCE"),
33585            Self::ReplicaIncludedMaintenance => {
33586                std::option::Option::Some("REPLICA_INCLUDED_MAINTENANCE")
33587            }
33588            Self::InstanceSelfServiceMaintenance => {
33589                std::option::Option::Some("INSTANCE_SELF_SERVICE_MAINTENANCE")
33590            }
33591            Self::ReplicaIncludedSelfServiceMaintenance => {
33592                std::option::Option::Some("REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE")
33593            }
33594            Self::UnknownValue(u) => u.0.name(),
33595        }
33596    }
33597}
33598
33599impl std::default::Default for SqlMaintenanceType {
33600    fn default() -> Self {
33601        use std::convert::From;
33602        Self::from(0)
33603    }
33604}
33605
33606impl std::fmt::Display for SqlMaintenanceType {
33607    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33608        wkt::internal::display_enum(f, self.name(), self.value())
33609    }
33610}
33611
33612impl std::convert::From<i32> for SqlMaintenanceType {
33613    fn from(value: i32) -> Self {
33614        match value {
33615            0 => Self::Unspecified,
33616            1 => Self::InstanceMaintenance,
33617            2 => Self::ReplicaIncludedMaintenance,
33618            3 => Self::InstanceSelfServiceMaintenance,
33619            4 => Self::ReplicaIncludedSelfServiceMaintenance,
33620            _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
33621                wkt::internal::UnknownEnumValue::Integer(value),
33622            )),
33623        }
33624    }
33625}
33626
33627impl std::convert::From<&str> for SqlMaintenanceType {
33628    fn from(value: &str) -> Self {
33629        use std::string::ToString;
33630        match value {
33631            "SQL_MAINTENANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
33632            "INSTANCE_MAINTENANCE" => Self::InstanceMaintenance,
33633            "REPLICA_INCLUDED_MAINTENANCE" => Self::ReplicaIncludedMaintenance,
33634            "INSTANCE_SELF_SERVICE_MAINTENANCE" => Self::InstanceSelfServiceMaintenance,
33635            "REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE" => {
33636                Self::ReplicaIncludedSelfServiceMaintenance
33637            }
33638            _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
33639                wkt::internal::UnknownEnumValue::String(value.to_string()),
33640            )),
33641        }
33642    }
33643}
33644
33645impl serde::ser::Serialize for SqlMaintenanceType {
33646    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33647    where
33648        S: serde::Serializer,
33649    {
33650        match self {
33651            Self::Unspecified => serializer.serialize_i32(0),
33652            Self::InstanceMaintenance => serializer.serialize_i32(1),
33653            Self::ReplicaIncludedMaintenance => serializer.serialize_i32(2),
33654            Self::InstanceSelfServiceMaintenance => serializer.serialize_i32(3),
33655            Self::ReplicaIncludedSelfServiceMaintenance => serializer.serialize_i32(4),
33656            Self::UnknownValue(u) => u.0.serialize(serializer),
33657        }
33658    }
33659}
33660
33661impl<'de> serde::de::Deserialize<'de> for SqlMaintenanceType {
33662    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33663    where
33664        D: serde::Deserializer<'de>,
33665    {
33666        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlMaintenanceType>::new(
33667            ".google.cloud.sql.v1.SqlMaintenanceType",
33668        ))
33669    }
33670}
33671
33672///
33673/// # Working with unknown values
33674///
33675/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33676/// additional enum variants at any time. Adding new variants is not considered
33677/// a breaking change. Applications should write their code in anticipation of:
33678///
33679/// - New values appearing in future releases of the client library, **and**
33680/// - New values received dynamically, without application changes.
33681///
33682/// Please consult the [Working with enums] section in the user guide for some
33683/// guidelines.
33684///
33685/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33686#[derive(Clone, Debug, PartialEq)]
33687#[non_exhaustive]
33688pub enum SqlBackendType {
33689    /// This is an unknown backend type for instance.
33690    Unspecified,
33691    /// V1 speckle instance.
33692    #[deprecated]
33693    FirstGen,
33694    /// V2 speckle instance.
33695    SecondGen,
33696    /// On premises instance.
33697    External,
33698    /// If set, the enum was initialized with an unknown value.
33699    ///
33700    /// Applications can examine the value using [SqlBackendType::value] or
33701    /// [SqlBackendType::name].
33702    UnknownValue(sql_backend_type::UnknownValue),
33703}
33704
33705#[doc(hidden)]
33706pub mod sql_backend_type {
33707    #[allow(unused_imports)]
33708    use super::*;
33709    #[derive(Clone, Debug, PartialEq)]
33710    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33711}
33712
33713impl SqlBackendType {
33714    /// Gets the enum value.
33715    ///
33716    /// Returns `None` if the enum contains an unknown value deserialized from
33717    /// the string representation of enums.
33718    pub fn value(&self) -> std::option::Option<i32> {
33719        match self {
33720            Self::Unspecified => std::option::Option::Some(0),
33721            Self::FirstGen => std::option::Option::Some(1),
33722            Self::SecondGen => std::option::Option::Some(2),
33723            Self::External => std::option::Option::Some(3),
33724            Self::UnknownValue(u) => u.0.value(),
33725        }
33726    }
33727
33728    /// Gets the enum value as a string.
33729    ///
33730    /// Returns `None` if the enum contains an unknown value deserialized from
33731    /// the integer representation of enums.
33732    pub fn name(&self) -> std::option::Option<&str> {
33733        match self {
33734            Self::Unspecified => std::option::Option::Some("SQL_BACKEND_TYPE_UNSPECIFIED"),
33735            Self::FirstGen => std::option::Option::Some("FIRST_GEN"),
33736            Self::SecondGen => std::option::Option::Some("SECOND_GEN"),
33737            Self::External => std::option::Option::Some("EXTERNAL"),
33738            Self::UnknownValue(u) => u.0.name(),
33739        }
33740    }
33741}
33742
33743impl std::default::Default for SqlBackendType {
33744    fn default() -> Self {
33745        use std::convert::From;
33746        Self::from(0)
33747    }
33748}
33749
33750impl std::fmt::Display for SqlBackendType {
33751    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33752        wkt::internal::display_enum(f, self.name(), self.value())
33753    }
33754}
33755
33756impl std::convert::From<i32> for SqlBackendType {
33757    fn from(value: i32) -> Self {
33758        match value {
33759            0 => Self::Unspecified,
33760            1 => Self::FirstGen,
33761            2 => Self::SecondGen,
33762            3 => Self::External,
33763            _ => Self::UnknownValue(sql_backend_type::UnknownValue(
33764                wkt::internal::UnknownEnumValue::Integer(value),
33765            )),
33766        }
33767    }
33768}
33769
33770impl std::convert::From<&str> for SqlBackendType {
33771    fn from(value: &str) -> Self {
33772        use std::string::ToString;
33773        match value {
33774            "SQL_BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
33775            "FIRST_GEN" => Self::FirstGen,
33776            "SECOND_GEN" => Self::SecondGen,
33777            "EXTERNAL" => Self::External,
33778            _ => Self::UnknownValue(sql_backend_type::UnknownValue(
33779                wkt::internal::UnknownEnumValue::String(value.to_string()),
33780            )),
33781        }
33782    }
33783}
33784
33785impl serde::ser::Serialize for SqlBackendType {
33786    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33787    where
33788        S: serde::Serializer,
33789    {
33790        match self {
33791            Self::Unspecified => serializer.serialize_i32(0),
33792            Self::FirstGen => serializer.serialize_i32(1),
33793            Self::SecondGen => serializer.serialize_i32(2),
33794            Self::External => serializer.serialize_i32(3),
33795            Self::UnknownValue(u) => u.0.serialize(serializer),
33796        }
33797    }
33798}
33799
33800impl<'de> serde::de::Deserialize<'de> for SqlBackendType {
33801    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33802    where
33803        D: serde::Deserializer<'de>,
33804    {
33805        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackendType>::new(
33806            ".google.cloud.sql.v1.SqlBackendType",
33807        ))
33808    }
33809}
33810
33811///
33812/// # Working with unknown values
33813///
33814/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33815/// additional enum variants at any time. Adding new variants is not considered
33816/// a breaking change. Applications should write their code in anticipation of:
33817///
33818/// - New values appearing in future releases of the client library, **and**
33819/// - New values received dynamically, without application changes.
33820///
33821/// Please consult the [Working with enums] section in the user guide for some
33822/// guidelines.
33823///
33824/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33825#[derive(Clone, Debug, PartialEq)]
33826#[non_exhaustive]
33827pub enum SqlIpAddressType {
33828    /// This is an unknown IP address type.
33829    Unspecified,
33830    /// IP address the customer is supposed to connect to. Usually this is the
33831    /// load balancer's IP address
33832    Primary,
33833    /// Source IP address of the connection a read replica establishes to its
33834    /// external primary instance. This IP address can be allowlisted by the
33835    /// customer in case it has a firewall that filters incoming connection to its
33836    /// on premises primary instance.
33837    Outgoing,
33838    /// Private IP used when using private IPs and network peering.
33839    Private,
33840    /// V1 IP of a migrated instance. We want the user to
33841    /// decommission this IP as soon as the migration is complete.
33842    /// Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
33843    Migrated1StGen,
33844    /// If set, the enum was initialized with an unknown value.
33845    ///
33846    /// Applications can examine the value using [SqlIpAddressType::value] or
33847    /// [SqlIpAddressType::name].
33848    UnknownValue(sql_ip_address_type::UnknownValue),
33849}
33850
33851#[doc(hidden)]
33852pub mod sql_ip_address_type {
33853    #[allow(unused_imports)]
33854    use super::*;
33855    #[derive(Clone, Debug, PartialEq)]
33856    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33857}
33858
33859impl SqlIpAddressType {
33860    /// Gets the enum value.
33861    ///
33862    /// Returns `None` if the enum contains an unknown value deserialized from
33863    /// the string representation of enums.
33864    pub fn value(&self) -> std::option::Option<i32> {
33865        match self {
33866            Self::Unspecified => std::option::Option::Some(0),
33867            Self::Primary => std::option::Option::Some(1),
33868            Self::Outgoing => std::option::Option::Some(2),
33869            Self::Private => std::option::Option::Some(3),
33870            Self::Migrated1StGen => std::option::Option::Some(4),
33871            Self::UnknownValue(u) => u.0.value(),
33872        }
33873    }
33874
33875    /// Gets the enum value as a string.
33876    ///
33877    /// Returns `None` if the enum contains an unknown value deserialized from
33878    /// the integer representation of enums.
33879    pub fn name(&self) -> std::option::Option<&str> {
33880        match self {
33881            Self::Unspecified => std::option::Option::Some("SQL_IP_ADDRESS_TYPE_UNSPECIFIED"),
33882            Self::Primary => std::option::Option::Some("PRIMARY"),
33883            Self::Outgoing => std::option::Option::Some("OUTGOING"),
33884            Self::Private => std::option::Option::Some("PRIVATE"),
33885            Self::Migrated1StGen => std::option::Option::Some("MIGRATED_1ST_GEN"),
33886            Self::UnknownValue(u) => u.0.name(),
33887        }
33888    }
33889}
33890
33891impl std::default::Default for SqlIpAddressType {
33892    fn default() -> Self {
33893        use std::convert::From;
33894        Self::from(0)
33895    }
33896}
33897
33898impl std::fmt::Display for SqlIpAddressType {
33899    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33900        wkt::internal::display_enum(f, self.name(), self.value())
33901    }
33902}
33903
33904impl std::convert::From<i32> for SqlIpAddressType {
33905    fn from(value: i32) -> Self {
33906        match value {
33907            0 => Self::Unspecified,
33908            1 => Self::Primary,
33909            2 => Self::Outgoing,
33910            3 => Self::Private,
33911            4 => Self::Migrated1StGen,
33912            _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
33913                wkt::internal::UnknownEnumValue::Integer(value),
33914            )),
33915        }
33916    }
33917}
33918
33919impl std::convert::From<&str> for SqlIpAddressType {
33920    fn from(value: &str) -> Self {
33921        use std::string::ToString;
33922        match value {
33923            "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" => Self::Unspecified,
33924            "PRIMARY" => Self::Primary,
33925            "OUTGOING" => Self::Outgoing,
33926            "PRIVATE" => Self::Private,
33927            "MIGRATED_1ST_GEN" => Self::Migrated1StGen,
33928            _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
33929                wkt::internal::UnknownEnumValue::String(value.to_string()),
33930            )),
33931        }
33932    }
33933}
33934
33935impl serde::ser::Serialize for SqlIpAddressType {
33936    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33937    where
33938        S: serde::Serializer,
33939    {
33940        match self {
33941            Self::Unspecified => serializer.serialize_i32(0),
33942            Self::Primary => serializer.serialize_i32(1),
33943            Self::Outgoing => serializer.serialize_i32(2),
33944            Self::Private => serializer.serialize_i32(3),
33945            Self::Migrated1StGen => serializer.serialize_i32(4),
33946            Self::UnknownValue(u) => u.0.serialize(serializer),
33947        }
33948    }
33949}
33950
33951impl<'de> serde::de::Deserialize<'de> for SqlIpAddressType {
33952    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33953    where
33954        D: serde::Deserializer<'de>,
33955    {
33956        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlIpAddressType>::new(
33957            ".google.cloud.sql.v1.SqlIpAddressType",
33958        ))
33959    }
33960}
33961
33962/// The database engine type and version.
33963///
33964/// # Working with unknown values
33965///
33966/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33967/// additional enum variants at any time. Adding new variants is not considered
33968/// a breaking change. Applications should write their code in anticipation of:
33969///
33970/// - New values appearing in future releases of the client library, **and**
33971/// - New values received dynamically, without application changes.
33972///
33973/// Please consult the [Working with enums] section in the user guide for some
33974/// guidelines.
33975///
33976/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33977#[derive(Clone, Debug, PartialEq)]
33978#[non_exhaustive]
33979pub enum SqlDatabaseVersion {
33980    /// This is an unknown database version.
33981    Unspecified,
33982    /// The database version is MySQL 5.1.
33983    #[deprecated]
33984    Mysql51,
33985    /// The database version is MySQL 5.5.
33986    #[deprecated]
33987    Mysql55,
33988    /// The database version is MySQL 5.6.
33989    Mysql56,
33990    /// The database version is MySQL 5.7.
33991    Mysql57,
33992    /// The database version is MySQL 8.
33993    Mysql80,
33994    /// The database major version is MySQL 8.0 and the minor version is 18.
33995    Mysql8018,
33996    /// The database major version is MySQL 8.0 and the minor version is 26.
33997    Mysql8026,
33998    /// The database major version is MySQL 8.0 and the minor version is 27.
33999    Mysql8027,
34000    /// The database major version is MySQL 8.0 and the minor version is 28.
34001    Mysql8028,
34002    /// The database major version is MySQL 8.0 and the minor version is 29.
34003    #[deprecated]
34004    Mysql8029,
34005    /// The database major version is MySQL 8.0 and the minor version is 30.
34006    Mysql8030,
34007    /// The database major version is MySQL 8.0 and the minor version is 31.
34008    Mysql8031,
34009    /// The database major version is MySQL 8.0 and the minor version is 32.
34010    Mysql8032,
34011    /// The database major version is MySQL 8.0 and the minor version is 33.
34012    Mysql8033,
34013    /// The database major version is MySQL 8.0 and the minor version is 34.
34014    Mysql8034,
34015    /// The database major version is MySQL 8.0 and the minor version is 35.
34016    Mysql8035,
34017    /// The database major version is MySQL 8.0 and the minor version is 36.
34018    Mysql8036,
34019    /// The database major version is MySQL 8.0 and the minor version is 37.
34020    Mysql8037,
34021    /// The database major version is MySQL 8.0 and the minor version is 39.
34022    Mysql8039,
34023    /// The database major version is MySQL 8.0 and the minor version is 40.
34024    Mysql8040,
34025    /// The database major version is MySQL 8.0 and the minor version is 41.
34026    Mysql8041,
34027    /// The database major version is MySQL 8.0 and the minor version is 42.
34028    Mysql8042,
34029    /// The database major version is MySQL 8.0 and the minor version is 43.
34030    Mysql8043,
34031    /// The database major version is MySQL 8.0 and the minor version is 44.
34032    Mysql8044,
34033    /// The database major version is MySQL 8.0 and the minor version is 45.
34034    Mysql8045,
34035    /// The database major version is MySQL 8.0 and the minor version is 46.
34036    Mysql8046,
34037    /// The database version is MySQL 8.4.
34038    Mysql84,
34039    /// The database version is SQL Server 2017 Standard.
34040    Sqlserver2017Standard,
34041    /// The database version is SQL Server 2017 Enterprise.
34042    Sqlserver2017Enterprise,
34043    /// The database version is SQL Server 2017 Express.
34044    Sqlserver2017Express,
34045    /// The database version is SQL Server 2017 Web.
34046    Sqlserver2017Web,
34047    /// The database version is PostgreSQL 9.6.
34048    Postgres96,
34049    /// The database version is PostgreSQL 10.
34050    Postgres10,
34051    /// The database version is PostgreSQL 11.
34052    Postgres11,
34053    /// The database version is PostgreSQL 12.
34054    Postgres12,
34055    /// The database version is PostgreSQL 13.
34056    Postgres13,
34057    /// The database version is PostgreSQL 14.
34058    Postgres14,
34059    /// The database version is PostgreSQL 15.
34060    Postgres15,
34061    /// The database version is PostgreSQL 16.
34062    Postgres16,
34063    /// The database version is PostgreSQL 17.
34064    Postgres17,
34065    /// The database version is PostgreSQL 18.
34066    Postgres18,
34067    /// The database version is SQL Server 2019 Standard.
34068    Sqlserver2019Standard,
34069    /// The database version is SQL Server 2019 Enterprise.
34070    Sqlserver2019Enterprise,
34071    /// The database version is SQL Server 2019 Express.
34072    Sqlserver2019Express,
34073    /// The database version is SQL Server 2019 Web.
34074    Sqlserver2019Web,
34075    /// The database version is SQL Server 2022 Standard.
34076    Sqlserver2022Standard,
34077    /// The database version is SQL Server 2022 Enterprise.
34078    Sqlserver2022Enterprise,
34079    /// The database version is SQL Server 2022 Express.
34080    Sqlserver2022Express,
34081    /// The database version is SQL Server 2022 Web.
34082    Sqlserver2022Web,
34083    /// If set, the enum was initialized with an unknown value.
34084    ///
34085    /// Applications can examine the value using [SqlDatabaseVersion::value] or
34086    /// [SqlDatabaseVersion::name].
34087    UnknownValue(sql_database_version::UnknownValue),
34088}
34089
34090#[doc(hidden)]
34091pub mod sql_database_version {
34092    #[allow(unused_imports)]
34093    use super::*;
34094    #[derive(Clone, Debug, PartialEq)]
34095    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34096}
34097
34098impl SqlDatabaseVersion {
34099    /// Gets the enum value.
34100    ///
34101    /// Returns `None` if the enum contains an unknown value deserialized from
34102    /// the string representation of enums.
34103    pub fn value(&self) -> std::option::Option<i32> {
34104        match self {
34105            Self::Unspecified => std::option::Option::Some(0),
34106            Self::Mysql51 => std::option::Option::Some(2),
34107            Self::Mysql55 => std::option::Option::Some(3),
34108            Self::Mysql56 => std::option::Option::Some(5),
34109            Self::Mysql57 => std::option::Option::Some(6),
34110            Self::Mysql80 => std::option::Option::Some(20),
34111            Self::Mysql8018 => std::option::Option::Some(41),
34112            Self::Mysql8026 => std::option::Option::Some(85),
34113            Self::Mysql8027 => std::option::Option::Some(111),
34114            Self::Mysql8028 => std::option::Option::Some(132),
34115            Self::Mysql8029 => std::option::Option::Some(148),
34116            Self::Mysql8030 => std::option::Option::Some(174),
34117            Self::Mysql8031 => std::option::Option::Some(197),
34118            Self::Mysql8032 => std::option::Option::Some(213),
34119            Self::Mysql8033 => std::option::Option::Some(238),
34120            Self::Mysql8034 => std::option::Option::Some(239),
34121            Self::Mysql8035 => std::option::Option::Some(240),
34122            Self::Mysql8036 => std::option::Option::Some(241),
34123            Self::Mysql8037 => std::option::Option::Some(355),
34124            Self::Mysql8039 => std::option::Option::Some(357),
34125            Self::Mysql8040 => std::option::Option::Some(358),
34126            Self::Mysql8041 => std::option::Option::Some(488),
34127            Self::Mysql8042 => std::option::Option::Some(489),
34128            Self::Mysql8043 => std::option::Option::Some(553),
34129            Self::Mysql8044 => std::option::Option::Some(554),
34130            Self::Mysql8045 => std::option::Option::Some(555),
34131            Self::Mysql8046 => std::option::Option::Some(556),
34132            Self::Mysql84 => std::option::Option::Some(398),
34133            Self::Sqlserver2017Standard => std::option::Option::Some(11),
34134            Self::Sqlserver2017Enterprise => std::option::Option::Some(14),
34135            Self::Sqlserver2017Express => std::option::Option::Some(15),
34136            Self::Sqlserver2017Web => std::option::Option::Some(16),
34137            Self::Postgres96 => std::option::Option::Some(9),
34138            Self::Postgres10 => std::option::Option::Some(18),
34139            Self::Postgres11 => std::option::Option::Some(10),
34140            Self::Postgres12 => std::option::Option::Some(19),
34141            Self::Postgres13 => std::option::Option::Some(23),
34142            Self::Postgres14 => std::option::Option::Some(110),
34143            Self::Postgres15 => std::option::Option::Some(172),
34144            Self::Postgres16 => std::option::Option::Some(272),
34145            Self::Postgres17 => std::option::Option::Some(408),
34146            Self::Postgres18 => std::option::Option::Some(557),
34147            Self::Sqlserver2019Standard => std::option::Option::Some(26),
34148            Self::Sqlserver2019Enterprise => std::option::Option::Some(27),
34149            Self::Sqlserver2019Express => std::option::Option::Some(28),
34150            Self::Sqlserver2019Web => std::option::Option::Some(29),
34151            Self::Sqlserver2022Standard => std::option::Option::Some(199),
34152            Self::Sqlserver2022Enterprise => std::option::Option::Some(200),
34153            Self::Sqlserver2022Express => std::option::Option::Some(201),
34154            Self::Sqlserver2022Web => std::option::Option::Some(202),
34155            Self::UnknownValue(u) => u.0.value(),
34156        }
34157    }
34158
34159    /// Gets the enum value as a string.
34160    ///
34161    /// Returns `None` if the enum contains an unknown value deserialized from
34162    /// the integer representation of enums.
34163    pub fn name(&self) -> std::option::Option<&str> {
34164        match self {
34165            Self::Unspecified => std::option::Option::Some("SQL_DATABASE_VERSION_UNSPECIFIED"),
34166            Self::Mysql51 => std::option::Option::Some("MYSQL_5_1"),
34167            Self::Mysql55 => std::option::Option::Some("MYSQL_5_5"),
34168            Self::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
34169            Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
34170            Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
34171            Self::Mysql8018 => std::option::Option::Some("MYSQL_8_0_18"),
34172            Self::Mysql8026 => std::option::Option::Some("MYSQL_8_0_26"),
34173            Self::Mysql8027 => std::option::Option::Some("MYSQL_8_0_27"),
34174            Self::Mysql8028 => std::option::Option::Some("MYSQL_8_0_28"),
34175            Self::Mysql8029 => std::option::Option::Some("MYSQL_8_0_29"),
34176            Self::Mysql8030 => std::option::Option::Some("MYSQL_8_0_30"),
34177            Self::Mysql8031 => std::option::Option::Some("MYSQL_8_0_31"),
34178            Self::Mysql8032 => std::option::Option::Some("MYSQL_8_0_32"),
34179            Self::Mysql8033 => std::option::Option::Some("MYSQL_8_0_33"),
34180            Self::Mysql8034 => std::option::Option::Some("MYSQL_8_0_34"),
34181            Self::Mysql8035 => std::option::Option::Some("MYSQL_8_0_35"),
34182            Self::Mysql8036 => std::option::Option::Some("MYSQL_8_0_36"),
34183            Self::Mysql8037 => std::option::Option::Some("MYSQL_8_0_37"),
34184            Self::Mysql8039 => std::option::Option::Some("MYSQL_8_0_39"),
34185            Self::Mysql8040 => std::option::Option::Some("MYSQL_8_0_40"),
34186            Self::Mysql8041 => std::option::Option::Some("MYSQL_8_0_41"),
34187            Self::Mysql8042 => std::option::Option::Some("MYSQL_8_0_42"),
34188            Self::Mysql8043 => std::option::Option::Some("MYSQL_8_0_43"),
34189            Self::Mysql8044 => std::option::Option::Some("MYSQL_8_0_44"),
34190            Self::Mysql8045 => std::option::Option::Some("MYSQL_8_0_45"),
34191            Self::Mysql8046 => std::option::Option::Some("MYSQL_8_0_46"),
34192            Self::Mysql84 => std::option::Option::Some("MYSQL_8_4"),
34193            Self::Sqlserver2017Standard => std::option::Option::Some("SQLSERVER_2017_STANDARD"),
34194            Self::Sqlserver2017Enterprise => std::option::Option::Some("SQLSERVER_2017_ENTERPRISE"),
34195            Self::Sqlserver2017Express => std::option::Option::Some("SQLSERVER_2017_EXPRESS"),
34196            Self::Sqlserver2017Web => std::option::Option::Some("SQLSERVER_2017_WEB"),
34197            Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
34198            Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
34199            Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
34200            Self::Postgres12 => std::option::Option::Some("POSTGRES_12"),
34201            Self::Postgres13 => std::option::Option::Some("POSTGRES_13"),
34202            Self::Postgres14 => std::option::Option::Some("POSTGRES_14"),
34203            Self::Postgres15 => std::option::Option::Some("POSTGRES_15"),
34204            Self::Postgres16 => std::option::Option::Some("POSTGRES_16"),
34205            Self::Postgres17 => std::option::Option::Some("POSTGRES_17"),
34206            Self::Postgres18 => std::option::Option::Some("POSTGRES_18"),
34207            Self::Sqlserver2019Standard => std::option::Option::Some("SQLSERVER_2019_STANDARD"),
34208            Self::Sqlserver2019Enterprise => std::option::Option::Some("SQLSERVER_2019_ENTERPRISE"),
34209            Self::Sqlserver2019Express => std::option::Option::Some("SQLSERVER_2019_EXPRESS"),
34210            Self::Sqlserver2019Web => std::option::Option::Some("SQLSERVER_2019_WEB"),
34211            Self::Sqlserver2022Standard => std::option::Option::Some("SQLSERVER_2022_STANDARD"),
34212            Self::Sqlserver2022Enterprise => std::option::Option::Some("SQLSERVER_2022_ENTERPRISE"),
34213            Self::Sqlserver2022Express => std::option::Option::Some("SQLSERVER_2022_EXPRESS"),
34214            Self::Sqlserver2022Web => std::option::Option::Some("SQLSERVER_2022_WEB"),
34215            Self::UnknownValue(u) => u.0.name(),
34216        }
34217    }
34218}
34219
34220impl std::default::Default for SqlDatabaseVersion {
34221    fn default() -> Self {
34222        use std::convert::From;
34223        Self::from(0)
34224    }
34225}
34226
34227impl std::fmt::Display for SqlDatabaseVersion {
34228    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34229        wkt::internal::display_enum(f, self.name(), self.value())
34230    }
34231}
34232
34233impl std::convert::From<i32> for SqlDatabaseVersion {
34234    fn from(value: i32) -> Self {
34235        match value {
34236            0 => Self::Unspecified,
34237            2 => Self::Mysql51,
34238            3 => Self::Mysql55,
34239            5 => Self::Mysql56,
34240            6 => Self::Mysql57,
34241            9 => Self::Postgres96,
34242            10 => Self::Postgres11,
34243            11 => Self::Sqlserver2017Standard,
34244            14 => Self::Sqlserver2017Enterprise,
34245            15 => Self::Sqlserver2017Express,
34246            16 => Self::Sqlserver2017Web,
34247            18 => Self::Postgres10,
34248            19 => Self::Postgres12,
34249            20 => Self::Mysql80,
34250            23 => Self::Postgres13,
34251            26 => Self::Sqlserver2019Standard,
34252            27 => Self::Sqlserver2019Enterprise,
34253            28 => Self::Sqlserver2019Express,
34254            29 => Self::Sqlserver2019Web,
34255            41 => Self::Mysql8018,
34256            85 => Self::Mysql8026,
34257            110 => Self::Postgres14,
34258            111 => Self::Mysql8027,
34259            132 => Self::Mysql8028,
34260            148 => Self::Mysql8029,
34261            172 => Self::Postgres15,
34262            174 => Self::Mysql8030,
34263            197 => Self::Mysql8031,
34264            199 => Self::Sqlserver2022Standard,
34265            200 => Self::Sqlserver2022Enterprise,
34266            201 => Self::Sqlserver2022Express,
34267            202 => Self::Sqlserver2022Web,
34268            213 => Self::Mysql8032,
34269            238 => Self::Mysql8033,
34270            239 => Self::Mysql8034,
34271            240 => Self::Mysql8035,
34272            241 => Self::Mysql8036,
34273            272 => Self::Postgres16,
34274            355 => Self::Mysql8037,
34275            357 => Self::Mysql8039,
34276            358 => Self::Mysql8040,
34277            398 => Self::Mysql84,
34278            408 => Self::Postgres17,
34279            488 => Self::Mysql8041,
34280            489 => Self::Mysql8042,
34281            553 => Self::Mysql8043,
34282            554 => Self::Mysql8044,
34283            555 => Self::Mysql8045,
34284            556 => Self::Mysql8046,
34285            557 => Self::Postgres18,
34286            _ => Self::UnknownValue(sql_database_version::UnknownValue(
34287                wkt::internal::UnknownEnumValue::Integer(value),
34288            )),
34289        }
34290    }
34291}
34292
34293impl std::convert::From<&str> for SqlDatabaseVersion {
34294    fn from(value: &str) -> Self {
34295        use std::string::ToString;
34296        match value {
34297            "SQL_DATABASE_VERSION_UNSPECIFIED" => Self::Unspecified,
34298            "MYSQL_5_1" => Self::Mysql51,
34299            "MYSQL_5_5" => Self::Mysql55,
34300            "MYSQL_5_6" => Self::Mysql56,
34301            "MYSQL_5_7" => Self::Mysql57,
34302            "MYSQL_8_0" => Self::Mysql80,
34303            "MYSQL_8_0_18" => Self::Mysql8018,
34304            "MYSQL_8_0_26" => Self::Mysql8026,
34305            "MYSQL_8_0_27" => Self::Mysql8027,
34306            "MYSQL_8_0_28" => Self::Mysql8028,
34307            "MYSQL_8_0_29" => Self::Mysql8029,
34308            "MYSQL_8_0_30" => Self::Mysql8030,
34309            "MYSQL_8_0_31" => Self::Mysql8031,
34310            "MYSQL_8_0_32" => Self::Mysql8032,
34311            "MYSQL_8_0_33" => Self::Mysql8033,
34312            "MYSQL_8_0_34" => Self::Mysql8034,
34313            "MYSQL_8_0_35" => Self::Mysql8035,
34314            "MYSQL_8_0_36" => Self::Mysql8036,
34315            "MYSQL_8_0_37" => Self::Mysql8037,
34316            "MYSQL_8_0_39" => Self::Mysql8039,
34317            "MYSQL_8_0_40" => Self::Mysql8040,
34318            "MYSQL_8_0_41" => Self::Mysql8041,
34319            "MYSQL_8_0_42" => Self::Mysql8042,
34320            "MYSQL_8_0_43" => Self::Mysql8043,
34321            "MYSQL_8_0_44" => Self::Mysql8044,
34322            "MYSQL_8_0_45" => Self::Mysql8045,
34323            "MYSQL_8_0_46" => Self::Mysql8046,
34324            "MYSQL_8_4" => Self::Mysql84,
34325            "SQLSERVER_2017_STANDARD" => Self::Sqlserver2017Standard,
34326            "SQLSERVER_2017_ENTERPRISE" => Self::Sqlserver2017Enterprise,
34327            "SQLSERVER_2017_EXPRESS" => Self::Sqlserver2017Express,
34328            "SQLSERVER_2017_WEB" => Self::Sqlserver2017Web,
34329            "POSTGRES_9_6" => Self::Postgres96,
34330            "POSTGRES_10" => Self::Postgres10,
34331            "POSTGRES_11" => Self::Postgres11,
34332            "POSTGRES_12" => Self::Postgres12,
34333            "POSTGRES_13" => Self::Postgres13,
34334            "POSTGRES_14" => Self::Postgres14,
34335            "POSTGRES_15" => Self::Postgres15,
34336            "POSTGRES_16" => Self::Postgres16,
34337            "POSTGRES_17" => Self::Postgres17,
34338            "POSTGRES_18" => Self::Postgres18,
34339            "SQLSERVER_2019_STANDARD" => Self::Sqlserver2019Standard,
34340            "SQLSERVER_2019_ENTERPRISE" => Self::Sqlserver2019Enterprise,
34341            "SQLSERVER_2019_EXPRESS" => Self::Sqlserver2019Express,
34342            "SQLSERVER_2019_WEB" => Self::Sqlserver2019Web,
34343            "SQLSERVER_2022_STANDARD" => Self::Sqlserver2022Standard,
34344            "SQLSERVER_2022_ENTERPRISE" => Self::Sqlserver2022Enterprise,
34345            "SQLSERVER_2022_EXPRESS" => Self::Sqlserver2022Express,
34346            "SQLSERVER_2022_WEB" => Self::Sqlserver2022Web,
34347            _ => Self::UnknownValue(sql_database_version::UnknownValue(
34348                wkt::internal::UnknownEnumValue::String(value.to_string()),
34349            )),
34350        }
34351    }
34352}
34353
34354impl serde::ser::Serialize for SqlDatabaseVersion {
34355    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34356    where
34357        S: serde::Serializer,
34358    {
34359        match self {
34360            Self::Unspecified => serializer.serialize_i32(0),
34361            Self::Mysql51 => serializer.serialize_i32(2),
34362            Self::Mysql55 => serializer.serialize_i32(3),
34363            Self::Mysql56 => serializer.serialize_i32(5),
34364            Self::Mysql57 => serializer.serialize_i32(6),
34365            Self::Mysql80 => serializer.serialize_i32(20),
34366            Self::Mysql8018 => serializer.serialize_i32(41),
34367            Self::Mysql8026 => serializer.serialize_i32(85),
34368            Self::Mysql8027 => serializer.serialize_i32(111),
34369            Self::Mysql8028 => serializer.serialize_i32(132),
34370            Self::Mysql8029 => serializer.serialize_i32(148),
34371            Self::Mysql8030 => serializer.serialize_i32(174),
34372            Self::Mysql8031 => serializer.serialize_i32(197),
34373            Self::Mysql8032 => serializer.serialize_i32(213),
34374            Self::Mysql8033 => serializer.serialize_i32(238),
34375            Self::Mysql8034 => serializer.serialize_i32(239),
34376            Self::Mysql8035 => serializer.serialize_i32(240),
34377            Self::Mysql8036 => serializer.serialize_i32(241),
34378            Self::Mysql8037 => serializer.serialize_i32(355),
34379            Self::Mysql8039 => serializer.serialize_i32(357),
34380            Self::Mysql8040 => serializer.serialize_i32(358),
34381            Self::Mysql8041 => serializer.serialize_i32(488),
34382            Self::Mysql8042 => serializer.serialize_i32(489),
34383            Self::Mysql8043 => serializer.serialize_i32(553),
34384            Self::Mysql8044 => serializer.serialize_i32(554),
34385            Self::Mysql8045 => serializer.serialize_i32(555),
34386            Self::Mysql8046 => serializer.serialize_i32(556),
34387            Self::Mysql84 => serializer.serialize_i32(398),
34388            Self::Sqlserver2017Standard => serializer.serialize_i32(11),
34389            Self::Sqlserver2017Enterprise => serializer.serialize_i32(14),
34390            Self::Sqlserver2017Express => serializer.serialize_i32(15),
34391            Self::Sqlserver2017Web => serializer.serialize_i32(16),
34392            Self::Postgres96 => serializer.serialize_i32(9),
34393            Self::Postgres10 => serializer.serialize_i32(18),
34394            Self::Postgres11 => serializer.serialize_i32(10),
34395            Self::Postgres12 => serializer.serialize_i32(19),
34396            Self::Postgres13 => serializer.serialize_i32(23),
34397            Self::Postgres14 => serializer.serialize_i32(110),
34398            Self::Postgres15 => serializer.serialize_i32(172),
34399            Self::Postgres16 => serializer.serialize_i32(272),
34400            Self::Postgres17 => serializer.serialize_i32(408),
34401            Self::Postgres18 => serializer.serialize_i32(557),
34402            Self::Sqlserver2019Standard => serializer.serialize_i32(26),
34403            Self::Sqlserver2019Enterprise => serializer.serialize_i32(27),
34404            Self::Sqlserver2019Express => serializer.serialize_i32(28),
34405            Self::Sqlserver2019Web => serializer.serialize_i32(29),
34406            Self::Sqlserver2022Standard => serializer.serialize_i32(199),
34407            Self::Sqlserver2022Enterprise => serializer.serialize_i32(200),
34408            Self::Sqlserver2022Express => serializer.serialize_i32(201),
34409            Self::Sqlserver2022Web => serializer.serialize_i32(202),
34410            Self::UnknownValue(u) => u.0.serialize(serializer),
34411        }
34412    }
34413}
34414
34415impl<'de> serde::de::Deserialize<'de> for SqlDatabaseVersion {
34416    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34417    where
34418        D: serde::Deserializer<'de>,
34419    {
34420        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDatabaseVersion>::new(
34421            ".google.cloud.sql.v1.SqlDatabaseVersion",
34422        ))
34423    }
34424}
34425
34426/// The pricing plan for this instance.
34427///
34428/// # Working with unknown values
34429///
34430/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34431/// additional enum variants at any time. Adding new variants is not considered
34432/// a breaking change. Applications should write their code in anticipation of:
34433///
34434/// - New values appearing in future releases of the client library, **and**
34435/// - New values received dynamically, without application changes.
34436///
34437/// Please consult the [Working with enums] section in the user guide for some
34438/// guidelines.
34439///
34440/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34441#[derive(Clone, Debug, PartialEq)]
34442#[non_exhaustive]
34443pub enum SqlPricingPlan {
34444    /// This is an unknown pricing plan for this instance.
34445    Unspecified,
34446    /// The instance is billed at a monthly flat rate.
34447    Package,
34448    /// The instance is billed per usage.
34449    PerUse,
34450    /// If set, the enum was initialized with an unknown value.
34451    ///
34452    /// Applications can examine the value using [SqlPricingPlan::value] or
34453    /// [SqlPricingPlan::name].
34454    UnknownValue(sql_pricing_plan::UnknownValue),
34455}
34456
34457#[doc(hidden)]
34458pub mod sql_pricing_plan {
34459    #[allow(unused_imports)]
34460    use super::*;
34461    #[derive(Clone, Debug, PartialEq)]
34462    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34463}
34464
34465impl SqlPricingPlan {
34466    /// Gets the enum value.
34467    ///
34468    /// Returns `None` if the enum contains an unknown value deserialized from
34469    /// the string representation of enums.
34470    pub fn value(&self) -> std::option::Option<i32> {
34471        match self {
34472            Self::Unspecified => std::option::Option::Some(0),
34473            Self::Package => std::option::Option::Some(1),
34474            Self::PerUse => std::option::Option::Some(2),
34475            Self::UnknownValue(u) => u.0.value(),
34476        }
34477    }
34478
34479    /// Gets the enum value as a string.
34480    ///
34481    /// Returns `None` if the enum contains an unknown value deserialized from
34482    /// the integer representation of enums.
34483    pub fn name(&self) -> std::option::Option<&str> {
34484        match self {
34485            Self::Unspecified => std::option::Option::Some("SQL_PRICING_PLAN_UNSPECIFIED"),
34486            Self::Package => std::option::Option::Some("PACKAGE"),
34487            Self::PerUse => std::option::Option::Some("PER_USE"),
34488            Self::UnknownValue(u) => u.0.name(),
34489        }
34490    }
34491}
34492
34493impl std::default::Default for SqlPricingPlan {
34494    fn default() -> Self {
34495        use std::convert::From;
34496        Self::from(0)
34497    }
34498}
34499
34500impl std::fmt::Display for SqlPricingPlan {
34501    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34502        wkt::internal::display_enum(f, self.name(), self.value())
34503    }
34504}
34505
34506impl std::convert::From<i32> for SqlPricingPlan {
34507    fn from(value: i32) -> Self {
34508        match value {
34509            0 => Self::Unspecified,
34510            1 => Self::Package,
34511            2 => Self::PerUse,
34512            _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
34513                wkt::internal::UnknownEnumValue::Integer(value),
34514            )),
34515        }
34516    }
34517}
34518
34519impl std::convert::From<&str> for SqlPricingPlan {
34520    fn from(value: &str) -> Self {
34521        use std::string::ToString;
34522        match value {
34523            "SQL_PRICING_PLAN_UNSPECIFIED" => Self::Unspecified,
34524            "PACKAGE" => Self::Package,
34525            "PER_USE" => Self::PerUse,
34526            _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
34527                wkt::internal::UnknownEnumValue::String(value.to_string()),
34528            )),
34529        }
34530    }
34531}
34532
34533impl serde::ser::Serialize for SqlPricingPlan {
34534    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34535    where
34536        S: serde::Serializer,
34537    {
34538        match self {
34539            Self::Unspecified => serializer.serialize_i32(0),
34540            Self::Package => serializer.serialize_i32(1),
34541            Self::PerUse => serializer.serialize_i32(2),
34542            Self::UnknownValue(u) => u.0.serialize(serializer),
34543        }
34544    }
34545}
34546
34547impl<'de> serde::de::Deserialize<'de> for SqlPricingPlan {
34548    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34549    where
34550        D: serde::Deserializer<'de>,
34551    {
34552        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlPricingPlan>::new(
34553            ".google.cloud.sql.v1.SqlPricingPlan",
34554        ))
34555    }
34556}
34557
34558///
34559/// # Working with unknown values
34560///
34561/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34562/// additional enum variants at any time. Adding new variants is not considered
34563/// a breaking change. Applications should write their code in anticipation of:
34564///
34565/// - New values appearing in future releases of the client library, **and**
34566/// - New values received dynamically, without application changes.
34567///
34568/// Please consult the [Working with enums] section in the user guide for some
34569/// guidelines.
34570///
34571/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34572#[derive(Clone, Debug, PartialEq)]
34573#[non_exhaustive]
34574pub enum SqlReplicationType {
34575    /// This is an unknown replication type for a Cloud SQL instance.
34576    Unspecified,
34577    /// The synchronous replication mode for First Generation instances. It is the
34578    /// default value.
34579    Synchronous,
34580    /// The asynchronous replication mode for First Generation instances. It
34581    /// provides a slight performance gain, but if an outage occurs while this
34582    /// option is set to asynchronous, you can lose up to a few seconds of updates
34583    /// to your data.
34584    Asynchronous,
34585    /// If set, the enum was initialized with an unknown value.
34586    ///
34587    /// Applications can examine the value using [SqlReplicationType::value] or
34588    /// [SqlReplicationType::name].
34589    UnknownValue(sql_replication_type::UnknownValue),
34590}
34591
34592#[doc(hidden)]
34593pub mod sql_replication_type {
34594    #[allow(unused_imports)]
34595    use super::*;
34596    #[derive(Clone, Debug, PartialEq)]
34597    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34598}
34599
34600impl SqlReplicationType {
34601    /// Gets the enum value.
34602    ///
34603    /// Returns `None` if the enum contains an unknown value deserialized from
34604    /// the string representation of enums.
34605    pub fn value(&self) -> std::option::Option<i32> {
34606        match self {
34607            Self::Unspecified => std::option::Option::Some(0),
34608            Self::Synchronous => std::option::Option::Some(1),
34609            Self::Asynchronous => std::option::Option::Some(2),
34610            Self::UnknownValue(u) => u.0.value(),
34611        }
34612    }
34613
34614    /// Gets the enum value as a string.
34615    ///
34616    /// Returns `None` if the enum contains an unknown value deserialized from
34617    /// the integer representation of enums.
34618    pub fn name(&self) -> std::option::Option<&str> {
34619        match self {
34620            Self::Unspecified => std::option::Option::Some("SQL_REPLICATION_TYPE_UNSPECIFIED"),
34621            Self::Synchronous => std::option::Option::Some("SYNCHRONOUS"),
34622            Self::Asynchronous => std::option::Option::Some("ASYNCHRONOUS"),
34623            Self::UnknownValue(u) => u.0.name(),
34624        }
34625    }
34626}
34627
34628impl std::default::Default for SqlReplicationType {
34629    fn default() -> Self {
34630        use std::convert::From;
34631        Self::from(0)
34632    }
34633}
34634
34635impl std::fmt::Display for SqlReplicationType {
34636    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34637        wkt::internal::display_enum(f, self.name(), self.value())
34638    }
34639}
34640
34641impl std::convert::From<i32> for SqlReplicationType {
34642    fn from(value: i32) -> Self {
34643        match value {
34644            0 => Self::Unspecified,
34645            1 => Self::Synchronous,
34646            2 => Self::Asynchronous,
34647            _ => Self::UnknownValue(sql_replication_type::UnknownValue(
34648                wkt::internal::UnknownEnumValue::Integer(value),
34649            )),
34650        }
34651    }
34652}
34653
34654impl std::convert::From<&str> for SqlReplicationType {
34655    fn from(value: &str) -> Self {
34656        use std::string::ToString;
34657        match value {
34658            "SQL_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
34659            "SYNCHRONOUS" => Self::Synchronous,
34660            "ASYNCHRONOUS" => Self::Asynchronous,
34661            _ => Self::UnknownValue(sql_replication_type::UnknownValue(
34662                wkt::internal::UnknownEnumValue::String(value.to_string()),
34663            )),
34664        }
34665    }
34666}
34667
34668impl serde::ser::Serialize for SqlReplicationType {
34669    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34670    where
34671        S: serde::Serializer,
34672    {
34673        match self {
34674            Self::Unspecified => serializer.serialize_i32(0),
34675            Self::Synchronous => serializer.serialize_i32(1),
34676            Self::Asynchronous => serializer.serialize_i32(2),
34677            Self::UnknownValue(u) => u.0.serialize(serializer),
34678        }
34679    }
34680}
34681
34682impl<'de> serde::de::Deserialize<'de> for SqlReplicationType {
34683    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34684    where
34685        D: serde::Deserializer<'de>,
34686    {
34687        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlReplicationType>::new(
34688            ".google.cloud.sql.v1.SqlReplicationType",
34689        ))
34690    }
34691}
34692
34693/// The type of disk that is used for a v2 instance to use.
34694///
34695/// # Working with unknown values
34696///
34697/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34698/// additional enum variants at any time. Adding new variants is not considered
34699/// a breaking change. Applications should write their code in anticipation of:
34700///
34701/// - New values appearing in future releases of the client library, **and**
34702/// - New values received dynamically, without application changes.
34703///
34704/// Please consult the [Working with enums] section in the user guide for some
34705/// guidelines.
34706///
34707/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34708#[derive(Clone, Debug, PartialEq)]
34709#[non_exhaustive]
34710pub enum SqlDataDiskType {
34711    /// This is an unknown data disk type.
34712    Unspecified,
34713    /// An SSD data disk.
34714    PdSsd,
34715    /// An HDD data disk.
34716    PdHdd,
34717    /// This field is deprecated and will be removed from a future version of the
34718    /// API.
34719    #[deprecated]
34720    ObsoleteLocalSsd,
34721    /// A Hyperdisk Balanced data disk.
34722    HyperdiskBalanced,
34723    /// If set, the enum was initialized with an unknown value.
34724    ///
34725    /// Applications can examine the value using [SqlDataDiskType::value] or
34726    /// [SqlDataDiskType::name].
34727    UnknownValue(sql_data_disk_type::UnknownValue),
34728}
34729
34730#[doc(hidden)]
34731pub mod sql_data_disk_type {
34732    #[allow(unused_imports)]
34733    use super::*;
34734    #[derive(Clone, Debug, PartialEq)]
34735    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34736}
34737
34738impl SqlDataDiskType {
34739    /// Gets the enum value.
34740    ///
34741    /// Returns `None` if the enum contains an unknown value deserialized from
34742    /// the string representation of enums.
34743    pub fn value(&self) -> std::option::Option<i32> {
34744        match self {
34745            Self::Unspecified => std::option::Option::Some(0),
34746            Self::PdSsd => std::option::Option::Some(1),
34747            Self::PdHdd => std::option::Option::Some(2),
34748            Self::ObsoleteLocalSsd => std::option::Option::Some(3),
34749            Self::HyperdiskBalanced => std::option::Option::Some(4),
34750            Self::UnknownValue(u) => u.0.value(),
34751        }
34752    }
34753
34754    /// Gets the enum value as a string.
34755    ///
34756    /// Returns `None` if the enum contains an unknown value deserialized from
34757    /// the integer representation of enums.
34758    pub fn name(&self) -> std::option::Option<&str> {
34759        match self {
34760            Self::Unspecified => std::option::Option::Some("SQL_DATA_DISK_TYPE_UNSPECIFIED"),
34761            Self::PdSsd => std::option::Option::Some("PD_SSD"),
34762            Self::PdHdd => std::option::Option::Some("PD_HDD"),
34763            Self::ObsoleteLocalSsd => std::option::Option::Some("OBSOLETE_LOCAL_SSD"),
34764            Self::HyperdiskBalanced => std::option::Option::Some("HYPERDISK_BALANCED"),
34765            Self::UnknownValue(u) => u.0.name(),
34766        }
34767    }
34768}
34769
34770impl std::default::Default for SqlDataDiskType {
34771    fn default() -> Self {
34772        use std::convert::From;
34773        Self::from(0)
34774    }
34775}
34776
34777impl std::fmt::Display for SqlDataDiskType {
34778    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34779        wkt::internal::display_enum(f, self.name(), self.value())
34780    }
34781}
34782
34783impl std::convert::From<i32> for SqlDataDiskType {
34784    fn from(value: i32) -> Self {
34785        match value {
34786            0 => Self::Unspecified,
34787            1 => Self::PdSsd,
34788            2 => Self::PdHdd,
34789            3 => Self::ObsoleteLocalSsd,
34790            4 => Self::HyperdiskBalanced,
34791            _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
34792                wkt::internal::UnknownEnumValue::Integer(value),
34793            )),
34794        }
34795    }
34796}
34797
34798impl std::convert::From<&str> for SqlDataDiskType {
34799    fn from(value: &str) -> Self {
34800        use std::string::ToString;
34801        match value {
34802            "SQL_DATA_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
34803            "PD_SSD" => Self::PdSsd,
34804            "PD_HDD" => Self::PdHdd,
34805            "OBSOLETE_LOCAL_SSD" => Self::ObsoleteLocalSsd,
34806            "HYPERDISK_BALANCED" => Self::HyperdiskBalanced,
34807            _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
34808                wkt::internal::UnknownEnumValue::String(value.to_string()),
34809            )),
34810        }
34811    }
34812}
34813
34814impl serde::ser::Serialize for SqlDataDiskType {
34815    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34816    where
34817        S: serde::Serializer,
34818    {
34819        match self {
34820            Self::Unspecified => serializer.serialize_i32(0),
34821            Self::PdSsd => serializer.serialize_i32(1),
34822            Self::PdHdd => serializer.serialize_i32(2),
34823            Self::ObsoleteLocalSsd => serializer.serialize_i32(3),
34824            Self::HyperdiskBalanced => serializer.serialize_i32(4),
34825            Self::UnknownValue(u) => u.0.serialize(serializer),
34826        }
34827    }
34828}
34829
34830impl<'de> serde::de::Deserialize<'de> for SqlDataDiskType {
34831    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34832    where
34833        D: serde::Deserializer<'de>,
34834    {
34835        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDataDiskType>::new(
34836            ".google.cloud.sql.v1.SqlDataDiskType",
34837        ))
34838    }
34839}
34840
34841/// The availability type of the given Cloud SQL instance.
34842///
34843/// # Working with unknown values
34844///
34845/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34846/// additional enum variants at any time. Adding new variants is not considered
34847/// a breaking change. Applications should write their code in anticipation of:
34848///
34849/// - New values appearing in future releases of the client library, **and**
34850/// - New values received dynamically, without application changes.
34851///
34852/// Please consult the [Working with enums] section in the user guide for some
34853/// guidelines.
34854///
34855/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34856#[derive(Clone, Debug, PartialEq)]
34857#[non_exhaustive]
34858pub enum SqlAvailabilityType {
34859    /// This is an unknown Availability type.
34860    Unspecified,
34861    /// Zonal available instance.
34862    Zonal,
34863    /// Regional available instance.
34864    Regional,
34865    /// If set, the enum was initialized with an unknown value.
34866    ///
34867    /// Applications can examine the value using [SqlAvailabilityType::value] or
34868    /// [SqlAvailabilityType::name].
34869    UnknownValue(sql_availability_type::UnknownValue),
34870}
34871
34872#[doc(hidden)]
34873pub mod sql_availability_type {
34874    #[allow(unused_imports)]
34875    use super::*;
34876    #[derive(Clone, Debug, PartialEq)]
34877    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34878}
34879
34880impl SqlAvailabilityType {
34881    /// Gets the enum value.
34882    ///
34883    /// Returns `None` if the enum contains an unknown value deserialized from
34884    /// the string representation of enums.
34885    pub fn value(&self) -> std::option::Option<i32> {
34886        match self {
34887            Self::Unspecified => std::option::Option::Some(0),
34888            Self::Zonal => std::option::Option::Some(1),
34889            Self::Regional => std::option::Option::Some(2),
34890            Self::UnknownValue(u) => u.0.value(),
34891        }
34892    }
34893
34894    /// Gets the enum value as a string.
34895    ///
34896    /// Returns `None` if the enum contains an unknown value deserialized from
34897    /// the integer representation of enums.
34898    pub fn name(&self) -> std::option::Option<&str> {
34899        match self {
34900            Self::Unspecified => std::option::Option::Some("SQL_AVAILABILITY_TYPE_UNSPECIFIED"),
34901            Self::Zonal => std::option::Option::Some("ZONAL"),
34902            Self::Regional => std::option::Option::Some("REGIONAL"),
34903            Self::UnknownValue(u) => u.0.name(),
34904        }
34905    }
34906}
34907
34908impl std::default::Default for SqlAvailabilityType {
34909    fn default() -> Self {
34910        use std::convert::From;
34911        Self::from(0)
34912    }
34913}
34914
34915impl std::fmt::Display for SqlAvailabilityType {
34916    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34917        wkt::internal::display_enum(f, self.name(), self.value())
34918    }
34919}
34920
34921impl std::convert::From<i32> for SqlAvailabilityType {
34922    fn from(value: i32) -> Self {
34923        match value {
34924            0 => Self::Unspecified,
34925            1 => Self::Zonal,
34926            2 => Self::Regional,
34927            _ => Self::UnknownValue(sql_availability_type::UnknownValue(
34928                wkt::internal::UnknownEnumValue::Integer(value),
34929            )),
34930        }
34931    }
34932}
34933
34934impl std::convert::From<&str> for SqlAvailabilityType {
34935    fn from(value: &str) -> Self {
34936        use std::string::ToString;
34937        match value {
34938            "SQL_AVAILABILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
34939            "ZONAL" => Self::Zonal,
34940            "REGIONAL" => Self::Regional,
34941            _ => Self::UnknownValue(sql_availability_type::UnknownValue(
34942                wkt::internal::UnknownEnumValue::String(value.to_string()),
34943            )),
34944        }
34945    }
34946}
34947
34948impl serde::ser::Serialize for SqlAvailabilityType {
34949    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34950    where
34951        S: serde::Serializer,
34952    {
34953        match self {
34954            Self::Unspecified => serializer.serialize_i32(0),
34955            Self::Zonal => serializer.serialize_i32(1),
34956            Self::Regional => serializer.serialize_i32(2),
34957            Self::UnknownValue(u) => u.0.serialize(serializer),
34958        }
34959    }
34960}
34961
34962impl<'de> serde::de::Deserialize<'de> for SqlAvailabilityType {
34963    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34964    where
34965        D: serde::Deserializer<'de>,
34966    {
34967        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlAvailabilityType>::new(
34968            ".google.cloud.sql.v1.SqlAvailabilityType",
34969        ))
34970    }
34971}
34972
34973///
34974/// # Working with unknown values
34975///
34976/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34977/// additional enum variants at any time. Adding new variants is not considered
34978/// a breaking change. Applications should write their code in anticipation of:
34979///
34980/// - New values appearing in future releases of the client library, **and**
34981/// - New values received dynamically, without application changes.
34982///
34983/// Please consult the [Working with enums] section in the user guide for some
34984/// guidelines.
34985///
34986/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34987#[derive(Clone, Debug, PartialEq)]
34988#[non_exhaustive]
34989pub enum SqlUpdateTrack {
34990    /// This is an unknown maintenance timing preference.
34991    Unspecified,
34992    /// For an instance with a scheduled maintenance window, this maintenance
34993    /// timing indicates that the maintenance update is scheduled 7 to 14 days
34994    /// after the notification is sent out. Also referred to as `Week 1` (Console)
34995    /// and `preview` (gcloud CLI).
34996    Canary,
34997    /// For an instance with a scheduled maintenance window, this maintenance
34998    /// timing indicates that the maintenance update is scheduled 15 to 21 days
34999    /// after the notification is sent out. Also referred to as `Week 2` (Console)
35000    /// and `production` (gcloud CLI).
35001    Stable,
35002    /// For instance with a scheduled maintenance window, this maintenance
35003    /// timing indicates that the maintenance update is scheduled 35 to 42 days
35004    /// after the notification is sent out.
35005    Week5,
35006    /// If set, the enum was initialized with an unknown value.
35007    ///
35008    /// Applications can examine the value using [SqlUpdateTrack::value] or
35009    /// [SqlUpdateTrack::name].
35010    UnknownValue(sql_update_track::UnknownValue),
35011}
35012
35013#[doc(hidden)]
35014pub mod sql_update_track {
35015    #[allow(unused_imports)]
35016    use super::*;
35017    #[derive(Clone, Debug, PartialEq)]
35018    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35019}
35020
35021impl SqlUpdateTrack {
35022    /// Gets the enum value.
35023    ///
35024    /// Returns `None` if the enum contains an unknown value deserialized from
35025    /// the string representation of enums.
35026    pub fn value(&self) -> std::option::Option<i32> {
35027        match self {
35028            Self::Unspecified => std::option::Option::Some(0),
35029            Self::Canary => std::option::Option::Some(1),
35030            Self::Stable => std::option::Option::Some(2),
35031            Self::Week5 => std::option::Option::Some(3),
35032            Self::UnknownValue(u) => u.0.value(),
35033        }
35034    }
35035
35036    /// Gets the enum value as a string.
35037    ///
35038    /// Returns `None` if the enum contains an unknown value deserialized from
35039    /// the integer representation of enums.
35040    pub fn name(&self) -> std::option::Option<&str> {
35041        match self {
35042            Self::Unspecified => std::option::Option::Some("SQL_UPDATE_TRACK_UNSPECIFIED"),
35043            Self::Canary => std::option::Option::Some("canary"),
35044            Self::Stable => std::option::Option::Some("stable"),
35045            Self::Week5 => std::option::Option::Some("week5"),
35046            Self::UnknownValue(u) => u.0.name(),
35047        }
35048    }
35049}
35050
35051impl std::default::Default for SqlUpdateTrack {
35052    fn default() -> Self {
35053        use std::convert::From;
35054        Self::from(0)
35055    }
35056}
35057
35058impl std::fmt::Display for SqlUpdateTrack {
35059    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35060        wkt::internal::display_enum(f, self.name(), self.value())
35061    }
35062}
35063
35064impl std::convert::From<i32> for SqlUpdateTrack {
35065    fn from(value: i32) -> Self {
35066        match value {
35067            0 => Self::Unspecified,
35068            1 => Self::Canary,
35069            2 => Self::Stable,
35070            3 => Self::Week5,
35071            _ => Self::UnknownValue(sql_update_track::UnknownValue(
35072                wkt::internal::UnknownEnumValue::Integer(value),
35073            )),
35074        }
35075    }
35076}
35077
35078impl std::convert::From<&str> for SqlUpdateTrack {
35079    fn from(value: &str) -> Self {
35080        use std::string::ToString;
35081        match value {
35082            "SQL_UPDATE_TRACK_UNSPECIFIED" => Self::Unspecified,
35083            "canary" => Self::Canary,
35084            "stable" => Self::Stable,
35085            "week5" => Self::Week5,
35086            _ => Self::UnknownValue(sql_update_track::UnknownValue(
35087                wkt::internal::UnknownEnumValue::String(value.to_string()),
35088            )),
35089        }
35090    }
35091}
35092
35093impl serde::ser::Serialize for SqlUpdateTrack {
35094    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35095    where
35096        S: serde::Serializer,
35097    {
35098        match self {
35099            Self::Unspecified => serializer.serialize_i32(0),
35100            Self::Canary => serializer.serialize_i32(1),
35101            Self::Stable => serializer.serialize_i32(2),
35102            Self::Week5 => serializer.serialize_i32(3),
35103            Self::UnknownValue(u) => u.0.serialize(serializer),
35104        }
35105    }
35106}
35107
35108impl<'de> serde::de::Deserialize<'de> for SqlUpdateTrack {
35109    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35110    where
35111        D: serde::Deserializer<'de>,
35112    {
35113        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUpdateTrack>::new(
35114            ".google.cloud.sql.v1.SqlUpdateTrack",
35115        ))
35116    }
35117}