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 gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_rpc;
25extern crate google_cloud_type;
26extern crate serde;
27extern crate serde_json;
28extern crate serde_with;
29extern crate std;
30extern crate tracing;
31extern crate wkt;
32
33mod debug;
34mod deserialize;
35mod serialize;
36
37/// Backup runs delete request.
38#[derive(Clone, Default, PartialEq)]
39#[non_exhaustive]
40pub struct SqlBackupRunsDeleteRequest {
41    /// The ID of the backup run to delete. To find a backup run ID, use the
42    /// [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/backupRuns/list)
43    /// method.
44    pub id: i64,
45
46    /// Cloud SQL instance ID. This does not include the project ID.
47    pub instance: std::string::String,
48
49    /// Project ID of the project that contains the instance.
50    pub project: std::string::String,
51
52    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
53}
54
55impl SqlBackupRunsDeleteRequest {
56    /// Creates a new default instance.
57    pub fn new() -> Self {
58        std::default::Default::default()
59    }
60
61    /// Sets the value of [id][crate::model::SqlBackupRunsDeleteRequest::id].
62    ///
63    /// # Example
64    /// ```ignore,no_run
65    /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
66    /// let x = SqlBackupRunsDeleteRequest::new().set_id(42);
67    /// ```
68    pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
69        self.id = v.into();
70        self
71    }
72
73    /// Sets the value of [instance][crate::model::SqlBackupRunsDeleteRequest::instance].
74    ///
75    /// # Example
76    /// ```ignore,no_run
77    /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
78    /// let x = SqlBackupRunsDeleteRequest::new().set_instance("example");
79    /// ```
80    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
81        self.instance = v.into();
82        self
83    }
84
85    /// Sets the value of [project][crate::model::SqlBackupRunsDeleteRequest::project].
86    ///
87    /// # Example
88    /// ```ignore,no_run
89    /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
90    /// let x = SqlBackupRunsDeleteRequest::new().set_project("example");
91    /// ```
92    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
93        self.project = v.into();
94        self
95    }
96}
97
98impl wkt::message::Message for SqlBackupRunsDeleteRequest {
99    fn typename() -> &'static str {
100        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsDeleteRequest"
101    }
102}
103
104/// Backup runs get request.
105#[derive(Clone, Default, PartialEq)]
106#[non_exhaustive]
107pub struct SqlBackupRunsGetRequest {
108    /// The ID of this backup run.
109    pub id: i64,
110
111    /// Cloud SQL instance ID. This does not include the project ID.
112    pub instance: std::string::String,
113
114    /// Project ID of the project that contains the instance.
115    pub project: std::string::String,
116
117    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
118}
119
120impl SqlBackupRunsGetRequest {
121    /// Creates a new default instance.
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    #[allow(missing_docs)]
180    pub body: std::option::Option<crate::model::BackupRun>,
181
182    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
183}
184
185impl SqlBackupRunsInsertRequest {
186    /// Creates a new default instance.
187    pub fn new() -> Self {
188        std::default::Default::default()
189    }
190
191    /// Sets the value of [instance][crate::model::SqlBackupRunsInsertRequest::instance].
192    ///
193    /// # Example
194    /// ```ignore,no_run
195    /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
196    /// let x = SqlBackupRunsInsertRequest::new().set_instance("example");
197    /// ```
198    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
199        self.instance = v.into();
200        self
201    }
202
203    /// Sets the value of [project][crate::model::SqlBackupRunsInsertRequest::project].
204    ///
205    /// # Example
206    /// ```ignore,no_run
207    /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
208    /// let x = SqlBackupRunsInsertRequest::new().set_project("example");
209    /// ```
210    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
211        self.project = v.into();
212        self
213    }
214
215    /// Sets the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
216    ///
217    /// # Example
218    /// ```ignore,no_run
219    /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
220    /// use google_cloud_sql_v1::model::BackupRun;
221    /// let x = SqlBackupRunsInsertRequest::new().set_body(BackupRun::default()/* use setters */);
222    /// ```
223    pub fn set_body<T>(mut self, v: T) -> Self
224    where
225        T: std::convert::Into<crate::model::BackupRun>,
226    {
227        self.body = std::option::Option::Some(v.into());
228        self
229    }
230
231    /// Sets or clears the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
232    ///
233    /// # Example
234    /// ```ignore,no_run
235    /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
236    /// use google_cloud_sql_v1::model::BackupRun;
237    /// let x = SqlBackupRunsInsertRequest::new().set_or_clear_body(Some(BackupRun::default()/* use setters */));
238    /// let x = SqlBackupRunsInsertRequest::new().set_or_clear_body(None::<BackupRun>);
239    /// ```
240    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
241    where
242        T: std::convert::Into<crate::model::BackupRun>,
243    {
244        self.body = v.map(|x| x.into());
245        self
246    }
247}
248
249impl wkt::message::Message for SqlBackupRunsInsertRequest {
250    fn typename() -> &'static str {
251        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsInsertRequest"
252    }
253}
254
255/// Backup runs list request.
256#[derive(Clone, Default, PartialEq)]
257#[non_exhaustive]
258pub struct SqlBackupRunsListRequest {
259    /// Cloud SQL instance ID, or "-" for all instances. This does not include
260    /// the project ID.
261    pub instance: std::string::String,
262
263    /// Maximum number of backup runs per response.
264    pub max_results: i32,
265
266    /// A previously-returned page token representing part of the larger set of
267    /// results to view.
268    pub page_token: std::string::String,
269
270    /// Project ID of the project that contains the instance.
271    pub project: std::string::String,
272
273    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
274}
275
276impl SqlBackupRunsListRequest {
277    /// Creates a new default instance.
278    pub fn new() -> Self {
279        std::default::Default::default()
280    }
281
282    /// Sets the value of [instance][crate::model::SqlBackupRunsListRequest::instance].
283    ///
284    /// # Example
285    /// ```ignore,no_run
286    /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
287    /// let x = SqlBackupRunsListRequest::new().set_instance("example");
288    /// ```
289    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
290        self.instance = v.into();
291        self
292    }
293
294    /// Sets the value of [max_results][crate::model::SqlBackupRunsListRequest::max_results].
295    ///
296    /// # Example
297    /// ```ignore,no_run
298    /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
299    /// let x = SqlBackupRunsListRequest::new().set_max_results(42);
300    /// ```
301    pub fn set_max_results<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
302        self.max_results = v.into();
303        self
304    }
305
306    /// Sets the value of [page_token][crate::model::SqlBackupRunsListRequest::page_token].
307    ///
308    /// # Example
309    /// ```ignore,no_run
310    /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
311    /// let x = SqlBackupRunsListRequest::new().set_page_token("example");
312    /// ```
313    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
314        self.page_token = v.into();
315        self
316    }
317
318    /// Sets the value of [project][crate::model::SqlBackupRunsListRequest::project].
319    ///
320    /// # Example
321    /// ```ignore,no_run
322    /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
323    /// let x = SqlBackupRunsListRequest::new().set_project("example");
324    /// ```
325    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
326        self.project = v.into();
327        self
328    }
329}
330
331impl wkt::message::Message for SqlBackupRunsListRequest {
332    fn typename() -> &'static str {
333        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsListRequest"
334    }
335}
336
337/// A BackupRun resource.
338#[derive(Clone, Default, PartialEq)]
339#[non_exhaustive]
340pub struct BackupRun {
341    /// This is always `sql#backupRun`.
342    pub kind: std::string::String,
343
344    /// The status of this run.
345    pub status: crate::model::SqlBackupRunStatus,
346
347    /// The time the run was enqueued in UTC timezone in
348    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
349    /// `2012-11-15T16:19:00.094Z`.
350    pub enqueued_time: std::option::Option<wkt::Timestamp>,
351
352    /// The identifier for this backup run. Unique only for a specific Cloud SQL
353    /// instance.
354    pub id: i64,
355
356    /// The time the backup operation actually started in UTC timezone in
357    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
358    /// `2012-11-15T16:19:00.094Z`.
359    pub start_time: std::option::Option<wkt::Timestamp>,
360
361    /// The time the backup operation completed in UTC timezone in
362    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
363    /// `2012-11-15T16:19:00.094Z`.
364    pub end_time: std::option::Option<wkt::Timestamp>,
365
366    /// Information about why the backup operation failed. This is only present if
367    /// the run has the FAILED status.
368    pub error: std::option::Option<crate::model::OperationError>,
369
370    /// The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
371    /// This field defaults to "ON_DEMAND" and is ignored, when specified for
372    /// insert requests.
373    pub r#type: crate::model::SqlBackupRunType,
374
375    /// The description of this run, only applicable to on-demand backups.
376    pub description: std::string::String,
377
378    /// The start time of the backup window during which this the backup was
379    /// attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
380    /// example `2012-11-15T16:19:00.094Z`.
381    pub window_start_time: std::option::Option<wkt::Timestamp>,
382
383    /// Name of the database instance.
384    pub instance: std::string::String,
385
386    /// The URI of this resource.
387    pub self_link: std::string::String,
388
389    /// Location of the backups.
390    pub location: std::string::String,
391
392    /// Output only. The instance database version at the time this backup was
393    /// made.
394    pub database_version: crate::model::SqlDatabaseVersion,
395
396    /// Encryption configuration specific to a backup.
397    pub disk_encryption_configuration:
398        std::option::Option<crate::model::DiskEncryptionConfiguration>,
399
400    /// Encryption status specific to a backup.
401    pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
402
403    /// Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
404    pub backup_kind: crate::model::SqlBackupKind,
405
406    /// Backup time zone to prevent restores to an instance with
407    /// a different time zone. Now relevant only for SQL Server.
408    pub time_zone: std::string::String,
409
410    /// Output only. The maximum chargeable bytes for the backup.
411    pub max_chargeable_bytes: std::option::Option<i64>,
412
413    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
414}
415
416impl BackupRun {
417    /// Creates a new default instance.
418    pub fn new() -> Self {
419        std::default::Default::default()
420    }
421
422    /// Sets the value of [kind][crate::model::BackupRun::kind].
423    ///
424    /// # Example
425    /// ```ignore,no_run
426    /// # use google_cloud_sql_v1::model::BackupRun;
427    /// let x = BackupRun::new().set_kind("example");
428    /// ```
429    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
430        self.kind = v.into();
431        self
432    }
433
434    /// Sets the value of [status][crate::model::BackupRun::status].
435    ///
436    /// # Example
437    /// ```ignore,no_run
438    /// # use google_cloud_sql_v1::model::BackupRun;
439    /// use google_cloud_sql_v1::model::SqlBackupRunStatus;
440    /// let x0 = BackupRun::new().set_status(SqlBackupRunStatus::Enqueued);
441    /// let x1 = BackupRun::new().set_status(SqlBackupRunStatus::Overdue);
442    /// let x2 = BackupRun::new().set_status(SqlBackupRunStatus::Running);
443    /// ```
444    pub fn set_status<T: std::convert::Into<crate::model::SqlBackupRunStatus>>(
445        mut self,
446        v: T,
447    ) -> Self {
448        self.status = v.into();
449        self
450    }
451
452    /// Sets the value of [enqueued_time][crate::model::BackupRun::enqueued_time].
453    ///
454    /// # Example
455    /// ```ignore,no_run
456    /// # use google_cloud_sql_v1::model::BackupRun;
457    /// use wkt::Timestamp;
458    /// let x = BackupRun::new().set_enqueued_time(Timestamp::default()/* use setters */);
459    /// ```
460    pub fn set_enqueued_time<T>(mut self, v: T) -> Self
461    where
462        T: std::convert::Into<wkt::Timestamp>,
463    {
464        self.enqueued_time = std::option::Option::Some(v.into());
465        self
466    }
467
468    /// Sets or clears the value of [enqueued_time][crate::model::BackupRun::enqueued_time].
469    ///
470    /// # Example
471    /// ```ignore,no_run
472    /// # use google_cloud_sql_v1::model::BackupRun;
473    /// use wkt::Timestamp;
474    /// let x = BackupRun::new().set_or_clear_enqueued_time(Some(Timestamp::default()/* use setters */));
475    /// let x = BackupRun::new().set_or_clear_enqueued_time(None::<Timestamp>);
476    /// ```
477    pub fn set_or_clear_enqueued_time<T>(mut self, v: std::option::Option<T>) -> Self
478    where
479        T: std::convert::Into<wkt::Timestamp>,
480    {
481        self.enqueued_time = v.map(|x| x.into());
482        self
483    }
484
485    /// Sets the value of [id][crate::model::BackupRun::id].
486    ///
487    /// # Example
488    /// ```ignore,no_run
489    /// # use google_cloud_sql_v1::model::BackupRun;
490    /// let x = BackupRun::new().set_id(42);
491    /// ```
492    pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
493        self.id = v.into();
494        self
495    }
496
497    /// Sets the value of [start_time][crate::model::BackupRun::start_time].
498    ///
499    /// # Example
500    /// ```ignore,no_run
501    /// # use google_cloud_sql_v1::model::BackupRun;
502    /// use wkt::Timestamp;
503    /// let x = BackupRun::new().set_start_time(Timestamp::default()/* use setters */);
504    /// ```
505    pub fn set_start_time<T>(mut self, v: T) -> Self
506    where
507        T: std::convert::Into<wkt::Timestamp>,
508    {
509        self.start_time = std::option::Option::Some(v.into());
510        self
511    }
512
513    /// Sets or clears the value of [start_time][crate::model::BackupRun::start_time].
514    ///
515    /// # Example
516    /// ```ignore,no_run
517    /// # use google_cloud_sql_v1::model::BackupRun;
518    /// use wkt::Timestamp;
519    /// let x = BackupRun::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
520    /// let x = BackupRun::new().set_or_clear_start_time(None::<Timestamp>);
521    /// ```
522    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
523    where
524        T: std::convert::Into<wkt::Timestamp>,
525    {
526        self.start_time = v.map(|x| x.into());
527        self
528    }
529
530    /// Sets the value of [end_time][crate::model::BackupRun::end_time].
531    ///
532    /// # Example
533    /// ```ignore,no_run
534    /// # use google_cloud_sql_v1::model::BackupRun;
535    /// use wkt::Timestamp;
536    /// let x = BackupRun::new().set_end_time(Timestamp::default()/* use setters */);
537    /// ```
538    pub fn set_end_time<T>(mut self, v: T) -> Self
539    where
540        T: std::convert::Into<wkt::Timestamp>,
541    {
542        self.end_time = std::option::Option::Some(v.into());
543        self
544    }
545
546    /// Sets or clears the value of [end_time][crate::model::BackupRun::end_time].
547    ///
548    /// # Example
549    /// ```ignore,no_run
550    /// # use google_cloud_sql_v1::model::BackupRun;
551    /// use wkt::Timestamp;
552    /// let x = BackupRun::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
553    /// let x = BackupRun::new().set_or_clear_end_time(None::<Timestamp>);
554    /// ```
555    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
556    where
557        T: std::convert::Into<wkt::Timestamp>,
558    {
559        self.end_time = v.map(|x| x.into());
560        self
561    }
562
563    /// Sets the value of [error][crate::model::BackupRun::error].
564    ///
565    /// # Example
566    /// ```ignore,no_run
567    /// # use google_cloud_sql_v1::model::BackupRun;
568    /// use google_cloud_sql_v1::model::OperationError;
569    /// let x = BackupRun::new().set_error(OperationError::default()/* use setters */);
570    /// ```
571    pub fn set_error<T>(mut self, v: T) -> Self
572    where
573        T: std::convert::Into<crate::model::OperationError>,
574    {
575        self.error = std::option::Option::Some(v.into());
576        self
577    }
578
579    /// Sets or clears the value of [error][crate::model::BackupRun::error].
580    ///
581    /// # Example
582    /// ```ignore,no_run
583    /// # use google_cloud_sql_v1::model::BackupRun;
584    /// use google_cloud_sql_v1::model::OperationError;
585    /// let x = BackupRun::new().set_or_clear_error(Some(OperationError::default()/* use setters */));
586    /// let x = BackupRun::new().set_or_clear_error(None::<OperationError>);
587    /// ```
588    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
589    where
590        T: std::convert::Into<crate::model::OperationError>,
591    {
592        self.error = v.map(|x| x.into());
593        self
594    }
595
596    /// Sets the value of [r#type][crate::model::BackupRun::type].
597    ///
598    /// # Example
599    /// ```ignore,no_run
600    /// # use google_cloud_sql_v1::model::BackupRun;
601    /// use google_cloud_sql_v1::model::SqlBackupRunType;
602    /// let x0 = BackupRun::new().set_type(SqlBackupRunType::Automated);
603    /// let x1 = BackupRun::new().set_type(SqlBackupRunType::OnDemand);
604    /// ```
605    pub fn set_type<T: std::convert::Into<crate::model::SqlBackupRunType>>(mut self, v: T) -> Self {
606        self.r#type = v.into();
607        self
608    }
609
610    /// Sets the value of [description][crate::model::BackupRun::description].
611    ///
612    /// # Example
613    /// ```ignore,no_run
614    /// # use google_cloud_sql_v1::model::BackupRun;
615    /// let x = BackupRun::new().set_description("example");
616    /// ```
617    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
618        self.description = v.into();
619        self
620    }
621
622    /// Sets the value of [window_start_time][crate::model::BackupRun::window_start_time].
623    ///
624    /// # Example
625    /// ```ignore,no_run
626    /// # use google_cloud_sql_v1::model::BackupRun;
627    /// use wkt::Timestamp;
628    /// let x = BackupRun::new().set_window_start_time(Timestamp::default()/* use setters */);
629    /// ```
630    pub fn set_window_start_time<T>(mut self, v: T) -> Self
631    where
632        T: std::convert::Into<wkt::Timestamp>,
633    {
634        self.window_start_time = std::option::Option::Some(v.into());
635        self
636    }
637
638    /// Sets or clears the value of [window_start_time][crate::model::BackupRun::window_start_time].
639    ///
640    /// # Example
641    /// ```ignore,no_run
642    /// # use google_cloud_sql_v1::model::BackupRun;
643    /// use wkt::Timestamp;
644    /// let x = BackupRun::new().set_or_clear_window_start_time(Some(Timestamp::default()/* use setters */));
645    /// let x = BackupRun::new().set_or_clear_window_start_time(None::<Timestamp>);
646    /// ```
647    pub fn set_or_clear_window_start_time<T>(mut self, v: std::option::Option<T>) -> Self
648    where
649        T: std::convert::Into<wkt::Timestamp>,
650    {
651        self.window_start_time = v.map(|x| x.into());
652        self
653    }
654
655    /// Sets the value of [instance][crate::model::BackupRun::instance].
656    ///
657    /// # Example
658    /// ```ignore,no_run
659    /// # use google_cloud_sql_v1::model::BackupRun;
660    /// let x = BackupRun::new().set_instance("example");
661    /// ```
662    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
663        self.instance = v.into();
664        self
665    }
666
667    /// Sets the value of [self_link][crate::model::BackupRun::self_link].
668    ///
669    /// # Example
670    /// ```ignore,no_run
671    /// # use google_cloud_sql_v1::model::BackupRun;
672    /// let x = BackupRun::new().set_self_link("example");
673    /// ```
674    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
675        self.self_link = v.into();
676        self
677    }
678
679    /// Sets the value of [location][crate::model::BackupRun::location].
680    ///
681    /// # Example
682    /// ```ignore,no_run
683    /// # use google_cloud_sql_v1::model::BackupRun;
684    /// let x = BackupRun::new().set_location("example");
685    /// ```
686    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
687        self.location = v.into();
688        self
689    }
690
691    /// Sets the value of [database_version][crate::model::BackupRun::database_version].
692    ///
693    /// # Example
694    /// ```ignore,no_run
695    /// # use google_cloud_sql_v1::model::BackupRun;
696    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
697    /// let x0 = BackupRun::new().set_database_version(SqlDatabaseVersion::Mysql56);
698    /// let x1 = BackupRun::new().set_database_version(SqlDatabaseVersion::Mysql57);
699    /// let x2 = BackupRun::new().set_database_version(SqlDatabaseVersion::Mysql80);
700    /// ```
701    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
702        mut self,
703        v: T,
704    ) -> Self {
705        self.database_version = v.into();
706        self
707    }
708
709    /// Sets the value of [disk_encryption_configuration][crate::model::BackupRun::disk_encryption_configuration].
710    ///
711    /// # Example
712    /// ```ignore,no_run
713    /// # use google_cloud_sql_v1::model::BackupRun;
714    /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
715    /// let x = BackupRun::new().set_disk_encryption_configuration(DiskEncryptionConfiguration::default()/* use setters */);
716    /// ```
717    pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
718    where
719        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
720    {
721        self.disk_encryption_configuration = std::option::Option::Some(v.into());
722        self
723    }
724
725    /// Sets or clears the value of [disk_encryption_configuration][crate::model::BackupRun::disk_encryption_configuration].
726    ///
727    /// # Example
728    /// ```ignore,no_run
729    /// # use google_cloud_sql_v1::model::BackupRun;
730    /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
731    /// let x = BackupRun::new().set_or_clear_disk_encryption_configuration(Some(DiskEncryptionConfiguration::default()/* use setters */));
732    /// let x = BackupRun::new().set_or_clear_disk_encryption_configuration(None::<DiskEncryptionConfiguration>);
733    /// ```
734    pub fn set_or_clear_disk_encryption_configuration<T>(
735        mut self,
736        v: std::option::Option<T>,
737    ) -> Self
738    where
739        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
740    {
741        self.disk_encryption_configuration = v.map(|x| x.into());
742        self
743    }
744
745    /// Sets the value of [disk_encryption_status][crate::model::BackupRun::disk_encryption_status].
746    ///
747    /// # Example
748    /// ```ignore,no_run
749    /// # use google_cloud_sql_v1::model::BackupRun;
750    /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
751    /// let x = BackupRun::new().set_disk_encryption_status(DiskEncryptionStatus::default()/* use setters */);
752    /// ```
753    pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
754    where
755        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
756    {
757        self.disk_encryption_status = std::option::Option::Some(v.into());
758        self
759    }
760
761    /// Sets or clears the value of [disk_encryption_status][crate::model::BackupRun::disk_encryption_status].
762    ///
763    /// # Example
764    /// ```ignore,no_run
765    /// # use google_cloud_sql_v1::model::BackupRun;
766    /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
767    /// let x = BackupRun::new().set_or_clear_disk_encryption_status(Some(DiskEncryptionStatus::default()/* use setters */));
768    /// let x = BackupRun::new().set_or_clear_disk_encryption_status(None::<DiskEncryptionStatus>);
769    /// ```
770    pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
771    where
772        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
773    {
774        self.disk_encryption_status = v.map(|x| x.into());
775        self
776    }
777
778    /// Sets the value of [backup_kind][crate::model::BackupRun::backup_kind].
779    ///
780    /// # Example
781    /// ```ignore,no_run
782    /// # use google_cloud_sql_v1::model::BackupRun;
783    /// use google_cloud_sql_v1::model::SqlBackupKind;
784    /// let x0 = BackupRun::new().set_backup_kind(SqlBackupKind::Snapshot);
785    /// let x1 = BackupRun::new().set_backup_kind(SqlBackupKind::Physical);
786    /// ```
787    pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
788        mut self,
789        v: T,
790    ) -> Self {
791        self.backup_kind = v.into();
792        self
793    }
794
795    /// Sets the value of [time_zone][crate::model::BackupRun::time_zone].
796    ///
797    /// # Example
798    /// ```ignore,no_run
799    /// # use google_cloud_sql_v1::model::BackupRun;
800    /// let x = BackupRun::new().set_time_zone("example");
801    /// ```
802    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
803        self.time_zone = v.into();
804        self
805    }
806
807    /// Sets the value of [max_chargeable_bytes][crate::model::BackupRun::max_chargeable_bytes].
808    ///
809    /// # Example
810    /// ```ignore,no_run
811    /// # use google_cloud_sql_v1::model::BackupRun;
812    /// let x = BackupRun::new().set_max_chargeable_bytes(42);
813    /// ```
814    pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
815    where
816        T: std::convert::Into<i64>,
817    {
818        self.max_chargeable_bytes = std::option::Option::Some(v.into());
819        self
820    }
821
822    /// Sets or clears the value of [max_chargeable_bytes][crate::model::BackupRun::max_chargeable_bytes].
823    ///
824    /// # Example
825    /// ```ignore,no_run
826    /// # use google_cloud_sql_v1::model::BackupRun;
827    /// let x = BackupRun::new().set_or_clear_max_chargeable_bytes(Some(42));
828    /// let x = BackupRun::new().set_or_clear_max_chargeable_bytes(None::<i32>);
829    /// ```
830    pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
831    where
832        T: std::convert::Into<i64>,
833    {
834        self.max_chargeable_bytes = v.map(|x| x.into());
835        self
836    }
837}
838
839impl wkt::message::Message for BackupRun {
840    fn typename() -> &'static str {
841        "type.googleapis.com/google.cloud.sql.v1.BackupRun"
842    }
843}
844
845/// Backup run list results.
846#[derive(Clone, Default, PartialEq)]
847#[non_exhaustive]
848pub struct BackupRunsListResponse {
849    /// This is always `sql#backupRunsList`.
850    pub kind: std::string::String,
851
852    /// A list of backup runs in reverse chronological order of the enqueued time.
853    pub items: std::vec::Vec<crate::model::BackupRun>,
854
855    /// The continuation token, used to page through large result sets. Provide
856    /// this value in a subsequent request to return the next page of results.
857    pub next_page_token: std::string::String,
858
859    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
860}
861
862impl BackupRunsListResponse {
863    /// Creates a new default instance.
864    pub fn new() -> Self {
865        std::default::Default::default()
866    }
867
868    /// Sets the value of [kind][crate::model::BackupRunsListResponse::kind].
869    ///
870    /// # Example
871    /// ```ignore,no_run
872    /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
873    /// let x = BackupRunsListResponse::new().set_kind("example");
874    /// ```
875    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
876        self.kind = v.into();
877        self
878    }
879
880    /// Sets the value of [items][crate::model::BackupRunsListResponse::items].
881    ///
882    /// # Example
883    /// ```ignore,no_run
884    /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
885    /// use google_cloud_sql_v1::model::BackupRun;
886    /// let x = BackupRunsListResponse::new()
887    ///     .set_items([
888    ///         BackupRun::default()/* use setters */,
889    ///         BackupRun::default()/* use (different) setters */,
890    ///     ]);
891    /// ```
892    pub fn set_items<T, V>(mut self, v: T) -> Self
893    where
894        T: std::iter::IntoIterator<Item = V>,
895        V: std::convert::Into<crate::model::BackupRun>,
896    {
897        use std::iter::Iterator;
898        self.items = v.into_iter().map(|i| i.into()).collect();
899        self
900    }
901
902    /// Sets the value of [next_page_token][crate::model::BackupRunsListResponse::next_page_token].
903    ///
904    /// # Example
905    /// ```ignore,no_run
906    /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
907    /// let x = BackupRunsListResponse::new().set_next_page_token("example");
908    /// ```
909    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
910        self.next_page_token = v.into();
911        self
912    }
913}
914
915impl wkt::message::Message for BackupRunsListResponse {
916    fn typename() -> &'static str {
917        "type.googleapis.com/google.cloud.sql.v1.BackupRunsListResponse"
918    }
919}
920
921#[doc(hidden)]
922impl google_cloud_gax::paginator::internal::PageableResponse for BackupRunsListResponse {
923    type PageItem = crate::model::BackupRun;
924
925    fn items(self) -> std::vec::Vec<Self::PageItem> {
926        self.items
927    }
928
929    fn next_page_token(&self) -> std::string::String {
930        use std::clone::Clone;
931        self.next_page_token.clone()
932    }
933}
934
935/// The request payload to create the backup
936#[derive(Clone, Default, PartialEq)]
937#[non_exhaustive]
938pub struct CreateBackupRequest {
939    /// Required. The parent resource where this backup is created.
940    /// Format: projects/{project}
941    pub parent: std::string::String,
942
943    /// Required. The Backup to create.
944    pub backup: std::option::Option<crate::model::Backup>,
945
946    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
947}
948
949impl CreateBackupRequest {
950    /// Creates a new default instance.
951    pub fn new() -> Self {
952        std::default::Default::default()
953    }
954
955    /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
956    ///
957    /// # Example
958    /// ```ignore,no_run
959    /// # use google_cloud_sql_v1::model::CreateBackupRequest;
960    /// let x = CreateBackupRequest::new().set_parent("example");
961    /// ```
962    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
963        self.parent = v.into();
964        self
965    }
966
967    /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
968    ///
969    /// # Example
970    /// ```ignore,no_run
971    /// # use google_cloud_sql_v1::model::CreateBackupRequest;
972    /// use google_cloud_sql_v1::model::Backup;
973    /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
974    /// ```
975    pub fn set_backup<T>(mut self, v: T) -> Self
976    where
977        T: std::convert::Into<crate::model::Backup>,
978    {
979        self.backup = std::option::Option::Some(v.into());
980        self
981    }
982
983    /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
984    ///
985    /// # Example
986    /// ```ignore,no_run
987    /// # use google_cloud_sql_v1::model::CreateBackupRequest;
988    /// use google_cloud_sql_v1::model::Backup;
989    /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
990    /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
991    /// ```
992    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
993    where
994        T: std::convert::Into<crate::model::Backup>,
995    {
996        self.backup = v.map(|x| x.into());
997        self
998    }
999}
1000
1001impl wkt::message::Message for CreateBackupRequest {
1002    fn typename() -> &'static str {
1003        "type.googleapis.com/google.cloud.sql.v1.CreateBackupRequest"
1004    }
1005}
1006
1007/// The request payload to get the backup.
1008#[derive(Clone, Default, PartialEq)]
1009#[non_exhaustive]
1010pub struct GetBackupRequest {
1011    /// Required. The name of the backup to retrieve.
1012    /// Format: projects/{project}/backups/{backup}
1013    pub name: std::string::String,
1014
1015    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1016}
1017
1018impl GetBackupRequest {
1019    /// Creates a new default instance.
1020    pub fn new() -> Self {
1021        std::default::Default::default()
1022    }
1023
1024    /// Sets the value of [name][crate::model::GetBackupRequest::name].
1025    ///
1026    /// # Example
1027    /// ```ignore,no_run
1028    /// # use google_cloud_sql_v1::model::GetBackupRequest;
1029    /// let x = GetBackupRequest::new().set_name("example");
1030    /// ```
1031    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1032        self.name = v.into();
1033        self
1034    }
1035}
1036
1037impl wkt::message::Message for GetBackupRequest {
1038    fn typename() -> &'static str {
1039        "type.googleapis.com/google.cloud.sql.v1.GetBackupRequest"
1040    }
1041}
1042
1043/// The request payload to list the backups.
1044#[derive(Clone, Default, PartialEq)]
1045#[non_exhaustive]
1046pub struct ListBackupsRequest {
1047    /// Required. The parent that owns this collection of backups.
1048    /// Format: projects/{project}
1049    pub parent: std::string::String,
1050
1051    /// The maximum number of backups to return per response. The service might
1052    /// return fewer backups than this value. If a value for this parameter isn't
1053    /// specified, then, at most, 500 backups are returned. The maximum value is
1054    /// 2,000. Any values that you set, which are greater than 2,000, are changed
1055    /// to 2,000.
1056    pub page_size: i32,
1057
1058    /// A page token, received from a previous `ListBackups` call.
1059    /// Provide this to retrieve the subsequent page.
1060    ///
1061    /// When paginating, all other parameters provided to `ListBackups` must match
1062    /// the call that provided the page token.
1063    pub page_token: std::string::String,
1064
1065    /// Multiple filter queries are separated by spaces. For example,
1066    /// 'instance:abc AND type:FINAL, 'location:us',
1067    /// 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
1068    /// type, instance, backupInterval.startTime (creation time), or location.
1069    pub filter: std::string::String,
1070
1071    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1072}
1073
1074impl ListBackupsRequest {
1075    /// Creates a new default instance.
1076    pub fn new() -> Self {
1077        std::default::Default::default()
1078    }
1079
1080    /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1081    ///
1082    /// # Example
1083    /// ```ignore,no_run
1084    /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1085    /// let x = ListBackupsRequest::new().set_parent("example");
1086    /// ```
1087    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1088        self.parent = v.into();
1089        self
1090    }
1091
1092    /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1093    ///
1094    /// # Example
1095    /// ```ignore,no_run
1096    /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1097    /// let x = ListBackupsRequest::new().set_page_size(42);
1098    /// ```
1099    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1100        self.page_size = v.into();
1101        self
1102    }
1103
1104    /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1105    ///
1106    /// # Example
1107    /// ```ignore,no_run
1108    /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1109    /// let x = ListBackupsRequest::new().set_page_token("example");
1110    /// ```
1111    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1112        self.page_token = v.into();
1113        self
1114    }
1115
1116    /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1117    ///
1118    /// # Example
1119    /// ```ignore,no_run
1120    /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1121    /// let x = ListBackupsRequest::new().set_filter("example");
1122    /// ```
1123    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1124        self.filter = v.into();
1125        self
1126    }
1127}
1128
1129impl wkt::message::Message for ListBackupsRequest {
1130    fn typename() -> &'static str {
1131        "type.googleapis.com/google.cloud.sql.v1.ListBackupsRequest"
1132    }
1133}
1134
1135/// The response payload containing a list of the backups.
1136#[derive(Clone, Default, PartialEq)]
1137#[non_exhaustive]
1138pub struct ListBackupsResponse {
1139    /// A list of backups.
1140    pub backups: std::vec::Vec<crate::model::Backup>,
1141
1142    /// A token, which can be sent as `page_token` to retrieve the next page.
1143    /// If this field is omitted, then there aren't subsequent pages.
1144    pub next_page_token: std::string::String,
1145
1146    /// If a region isn't unavailable or if an unknown error occurs, then a warning
1147    /// message is returned.
1148    pub warnings: std::vec::Vec<crate::model::ApiWarning>,
1149
1150    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1151}
1152
1153impl ListBackupsResponse {
1154    /// Creates a new default instance.
1155    pub fn new() -> Self {
1156        std::default::Default::default()
1157    }
1158
1159    /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
1160    ///
1161    /// # Example
1162    /// ```ignore,no_run
1163    /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1164    /// use google_cloud_sql_v1::model::Backup;
1165    /// let x = ListBackupsResponse::new()
1166    ///     .set_backups([
1167    ///         Backup::default()/* use setters */,
1168    ///         Backup::default()/* use (different) setters */,
1169    ///     ]);
1170    /// ```
1171    pub fn set_backups<T, V>(mut self, v: T) -> Self
1172    where
1173        T: std::iter::IntoIterator<Item = V>,
1174        V: std::convert::Into<crate::model::Backup>,
1175    {
1176        use std::iter::Iterator;
1177        self.backups = v.into_iter().map(|i| i.into()).collect();
1178        self
1179    }
1180
1181    /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
1182    ///
1183    /// # Example
1184    /// ```ignore,no_run
1185    /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1186    /// let x = ListBackupsResponse::new().set_next_page_token("example");
1187    /// ```
1188    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1189        self.next_page_token = v.into();
1190        self
1191    }
1192
1193    /// Sets the value of [warnings][crate::model::ListBackupsResponse::warnings].
1194    ///
1195    /// # Example
1196    /// ```ignore,no_run
1197    /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1198    /// use google_cloud_sql_v1::model::ApiWarning;
1199    /// let x = ListBackupsResponse::new()
1200    ///     .set_warnings([
1201    ///         ApiWarning::default()/* use setters */,
1202    ///         ApiWarning::default()/* use (different) setters */,
1203    ///     ]);
1204    /// ```
1205    pub fn set_warnings<T, V>(mut self, v: T) -> Self
1206    where
1207        T: std::iter::IntoIterator<Item = V>,
1208        V: std::convert::Into<crate::model::ApiWarning>,
1209    {
1210        use std::iter::Iterator;
1211        self.warnings = v.into_iter().map(|i| i.into()).collect();
1212        self
1213    }
1214}
1215
1216impl wkt::message::Message for ListBackupsResponse {
1217    fn typename() -> &'static str {
1218        "type.googleapis.com/google.cloud.sql.v1.ListBackupsResponse"
1219    }
1220}
1221
1222#[doc(hidden)]
1223impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
1224    type PageItem = crate::model::Backup;
1225
1226    fn items(self) -> std::vec::Vec<Self::PageItem> {
1227        self.backups
1228    }
1229
1230    fn next_page_token(&self) -> std::string::String {
1231        use std::clone::Clone;
1232        self.next_page_token.clone()
1233    }
1234}
1235
1236/// The request payload to update the backup.
1237#[derive(Clone, Default, PartialEq)]
1238#[non_exhaustive]
1239pub struct UpdateBackupRequest {
1240    /// Required. The backup to update.
1241    /// The backup’s `name` field is used to identify the backup to update.
1242    /// Format: projects/{project}/backups/{backup}
1243    pub backup: std::option::Option<crate::model::Backup>,
1244
1245    /// The list of fields that you can update. You can update only the description
1246    /// and retention period of the final backup.
1247    pub update_mask: std::option::Option<wkt::FieldMask>,
1248
1249    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1250}
1251
1252impl UpdateBackupRequest {
1253    /// Creates a new default instance.
1254    pub fn new() -> Self {
1255        std::default::Default::default()
1256    }
1257
1258    /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
1259    ///
1260    /// # Example
1261    /// ```ignore,no_run
1262    /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1263    /// use google_cloud_sql_v1::model::Backup;
1264    /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
1265    /// ```
1266    pub fn set_backup<T>(mut self, v: T) -> Self
1267    where
1268        T: std::convert::Into<crate::model::Backup>,
1269    {
1270        self.backup = std::option::Option::Some(v.into());
1271        self
1272    }
1273
1274    /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
1275    ///
1276    /// # Example
1277    /// ```ignore,no_run
1278    /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1279    /// use google_cloud_sql_v1::model::Backup;
1280    /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
1281    /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
1282    /// ```
1283    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
1284    where
1285        T: std::convert::Into<crate::model::Backup>,
1286    {
1287        self.backup = v.map(|x| x.into());
1288        self
1289    }
1290
1291    /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
1292    ///
1293    /// # Example
1294    /// ```ignore,no_run
1295    /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1296    /// use wkt::FieldMask;
1297    /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1298    /// ```
1299    pub fn set_update_mask<T>(mut self, v: T) -> Self
1300    where
1301        T: std::convert::Into<wkt::FieldMask>,
1302    {
1303        self.update_mask = std::option::Option::Some(v.into());
1304        self
1305    }
1306
1307    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
1308    ///
1309    /// # Example
1310    /// ```ignore,no_run
1311    /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1312    /// use wkt::FieldMask;
1313    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1314    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1315    /// ```
1316    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1317    where
1318        T: std::convert::Into<wkt::FieldMask>,
1319    {
1320        self.update_mask = v.map(|x| x.into());
1321        self
1322    }
1323}
1324
1325impl wkt::message::Message for UpdateBackupRequest {
1326    fn typename() -> &'static str {
1327        "type.googleapis.com/google.cloud.sql.v1.UpdateBackupRequest"
1328    }
1329}
1330
1331/// The request payload to delete the backup.
1332#[derive(Clone, Default, PartialEq)]
1333#[non_exhaustive]
1334pub struct DeleteBackupRequest {
1335    /// Required. The name of the backup to delete.
1336    /// Format: projects/{project}/backups/{backup}
1337    pub name: std::string::String,
1338
1339    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1340}
1341
1342impl DeleteBackupRequest {
1343    /// Creates a new default instance.
1344    pub fn new() -> Self {
1345        std::default::Default::default()
1346    }
1347
1348    /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
1349    ///
1350    /// # Example
1351    /// ```ignore,no_run
1352    /// # use google_cloud_sql_v1::model::DeleteBackupRequest;
1353    /// let x = DeleteBackupRequest::new().set_name("example");
1354    /// ```
1355    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1356        self.name = v.into();
1357        self
1358    }
1359}
1360
1361impl wkt::message::Message for DeleteBackupRequest {
1362    fn typename() -> &'static str {
1363        "type.googleapis.com/google.cloud.sql.v1.DeleteBackupRequest"
1364    }
1365}
1366
1367/// A backup resource.
1368#[derive(Clone, Default, PartialEq)]
1369#[non_exhaustive]
1370pub struct Backup {
1371    /// Output only. The resource name of the backup.
1372    /// Format: projects/{project}/backups/{backup}.
1373    pub name: std::string::String,
1374
1375    /// Output only. This is always `sql#backup`.
1376    pub kind: std::string::String,
1377
1378    /// Output only. The URI of this resource.
1379    pub self_link: std::string::String,
1380
1381    /// Output only. The type of this backup. The type can be "AUTOMATED",
1382    /// "ON_DEMAND" or “FINAL”.
1383    pub r#type: crate::model::backup::SqlBackupType,
1384
1385    /// The description of this backup.
1386    pub description: std::string::String,
1387
1388    /// The name of the source database instance.
1389    pub instance: std::string::String,
1390
1391    /// The storage location of the backups. The location can be multi-regional.
1392    pub location: std::string::String,
1393
1394    /// Output only. This output contains the following values:
1395    /// start_time: All database writes up to this time are available.
1396    /// end_time: Any database writes after this time aren't available.
1397    pub backup_interval: std::option::Option<google_cloud_type::model::Interval>,
1398
1399    /// Output only. The status of this backup.
1400    pub state: crate::model::backup::SqlBackupState,
1401
1402    /// Output only. Information about why the backup operation fails (for example,
1403    /// when the backup state fails).
1404    pub error: std::option::Option<crate::model::OperationError>,
1405
1406    /// Output only. This output contains the encryption configuration for a backup
1407    /// and the resource name of the KMS key for disk encryption.
1408    pub kms_key: std::string::String,
1409
1410    /// Output only. This output contains the encryption status for a backup and
1411    /// the version of the KMS key that's used to encrypt the Cloud SQL instance.
1412    pub kms_key_version: std::string::String,
1413
1414    /// Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
1415    pub backup_kind: crate::model::SqlBackupKind,
1416
1417    /// Output only. This output contains a backup time zone. If a Cloud SQL for
1418    /// SQL Server instance has a different time zone from the backup's time zone,
1419    /// then the restore to the instance doesn't happen.
1420    pub time_zone: std::string::String,
1421
1422    /// Output only. The database version of the instance of at the time this
1423    /// backup was made.
1424    pub database_version: crate::model::SqlDatabaseVersion,
1425
1426    /// Output only. The maximum chargeable bytes for the backup.
1427    pub max_chargeable_bytes: std::option::Option<i64>,
1428
1429    /// Optional. Output only. Timestamp in UTC of when the instance associated
1430    /// with this backup is deleted.
1431    pub instance_deletion_time: std::option::Option<wkt::Timestamp>,
1432
1433    /// Optional. Output only. The instance setting of the source instance that's
1434    /// associated with this backup.
1435    pub instance_settings: std::option::Option<crate::model::DatabaseInstance>,
1436
1437    /// Output only. The mapping to backup run resource used for IAM validations.
1438    pub backup_run: std::string::String,
1439
1440    /// Output only. This status indicates whether the backup satisfies PZS.
1441    ///
1442    /// The status is reserved for future use.
1443    pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
1444
1445    /// Output only. This status indicates whether the backup satisfies PZI.
1446    ///
1447    /// The status is reserved for future use.
1448    pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
1449
1450    #[allow(missing_docs)]
1451    pub expiration: std::option::Option<crate::model::backup::Expiration>,
1452
1453    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1454}
1455
1456impl Backup {
1457    /// Creates a new default instance.
1458    pub fn new() -> Self {
1459        std::default::Default::default()
1460    }
1461
1462    /// Sets the value of [name][crate::model::Backup::name].
1463    ///
1464    /// # Example
1465    /// ```ignore,no_run
1466    /// # use google_cloud_sql_v1::model::Backup;
1467    /// let x = Backup::new().set_name("example");
1468    /// ```
1469    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1470        self.name = v.into();
1471        self
1472    }
1473
1474    /// Sets the value of [kind][crate::model::Backup::kind].
1475    ///
1476    /// # Example
1477    /// ```ignore,no_run
1478    /// # use google_cloud_sql_v1::model::Backup;
1479    /// let x = Backup::new().set_kind("example");
1480    /// ```
1481    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1482        self.kind = v.into();
1483        self
1484    }
1485
1486    /// Sets the value of [self_link][crate::model::Backup::self_link].
1487    ///
1488    /// # Example
1489    /// ```ignore,no_run
1490    /// # use google_cloud_sql_v1::model::Backup;
1491    /// let x = Backup::new().set_self_link("example");
1492    /// ```
1493    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1494        self.self_link = v.into();
1495        self
1496    }
1497
1498    /// Sets the value of [r#type][crate::model::Backup::type].
1499    ///
1500    /// # Example
1501    /// ```ignore,no_run
1502    /// # use google_cloud_sql_v1::model::Backup;
1503    /// use google_cloud_sql_v1::model::backup::SqlBackupType;
1504    /// let x0 = Backup::new().set_type(SqlBackupType::Automated);
1505    /// let x1 = Backup::new().set_type(SqlBackupType::OnDemand);
1506    /// let x2 = Backup::new().set_type(SqlBackupType::Final);
1507    /// ```
1508    pub fn set_type<T: std::convert::Into<crate::model::backup::SqlBackupType>>(
1509        mut self,
1510        v: T,
1511    ) -> Self {
1512        self.r#type = v.into();
1513        self
1514    }
1515
1516    /// Sets the value of [description][crate::model::Backup::description].
1517    ///
1518    /// # Example
1519    /// ```ignore,no_run
1520    /// # use google_cloud_sql_v1::model::Backup;
1521    /// let x = Backup::new().set_description("example");
1522    /// ```
1523    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1524        self.description = v.into();
1525        self
1526    }
1527
1528    /// Sets the value of [instance][crate::model::Backup::instance].
1529    ///
1530    /// # Example
1531    /// ```ignore,no_run
1532    /// # use google_cloud_sql_v1::model::Backup;
1533    /// let x = Backup::new().set_instance("example");
1534    /// ```
1535    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1536        self.instance = v.into();
1537        self
1538    }
1539
1540    /// Sets the value of [location][crate::model::Backup::location].
1541    ///
1542    /// # Example
1543    /// ```ignore,no_run
1544    /// # use google_cloud_sql_v1::model::Backup;
1545    /// let x = Backup::new().set_location("example");
1546    /// ```
1547    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1548        self.location = v.into();
1549        self
1550    }
1551
1552    /// Sets the value of [backup_interval][crate::model::Backup::backup_interval].
1553    ///
1554    /// # Example
1555    /// ```ignore,no_run
1556    /// # use google_cloud_sql_v1::model::Backup;
1557    /// use google_cloud_type::model::Interval;
1558    /// let x = Backup::new().set_backup_interval(Interval::default()/* use setters */);
1559    /// ```
1560    pub fn set_backup_interval<T>(mut self, v: T) -> Self
1561    where
1562        T: std::convert::Into<google_cloud_type::model::Interval>,
1563    {
1564        self.backup_interval = std::option::Option::Some(v.into());
1565        self
1566    }
1567
1568    /// Sets or clears the value of [backup_interval][crate::model::Backup::backup_interval].
1569    ///
1570    /// # Example
1571    /// ```ignore,no_run
1572    /// # use google_cloud_sql_v1::model::Backup;
1573    /// use google_cloud_type::model::Interval;
1574    /// let x = Backup::new().set_or_clear_backup_interval(Some(Interval::default()/* use setters */));
1575    /// let x = Backup::new().set_or_clear_backup_interval(None::<Interval>);
1576    /// ```
1577    pub fn set_or_clear_backup_interval<T>(mut self, v: std::option::Option<T>) -> Self
1578    where
1579        T: std::convert::Into<google_cloud_type::model::Interval>,
1580    {
1581        self.backup_interval = v.map(|x| x.into());
1582        self
1583    }
1584
1585    /// Sets the value of [state][crate::model::Backup::state].
1586    ///
1587    /// # Example
1588    /// ```ignore,no_run
1589    /// # use google_cloud_sql_v1::model::Backup;
1590    /// use google_cloud_sql_v1::model::backup::SqlBackupState;
1591    /// let x0 = Backup::new().set_state(SqlBackupState::Enqueued);
1592    /// let x1 = Backup::new().set_state(SqlBackupState::Running);
1593    /// let x2 = Backup::new().set_state(SqlBackupState::Failed);
1594    /// ```
1595    pub fn set_state<T: std::convert::Into<crate::model::backup::SqlBackupState>>(
1596        mut self,
1597        v: T,
1598    ) -> Self {
1599        self.state = v.into();
1600        self
1601    }
1602
1603    /// Sets the value of [error][crate::model::Backup::error].
1604    ///
1605    /// # Example
1606    /// ```ignore,no_run
1607    /// # use google_cloud_sql_v1::model::Backup;
1608    /// use google_cloud_sql_v1::model::OperationError;
1609    /// let x = Backup::new().set_error(OperationError::default()/* use setters */);
1610    /// ```
1611    pub fn set_error<T>(mut self, v: T) -> Self
1612    where
1613        T: std::convert::Into<crate::model::OperationError>,
1614    {
1615        self.error = std::option::Option::Some(v.into());
1616        self
1617    }
1618
1619    /// Sets or clears the value of [error][crate::model::Backup::error].
1620    ///
1621    /// # Example
1622    /// ```ignore,no_run
1623    /// # use google_cloud_sql_v1::model::Backup;
1624    /// use google_cloud_sql_v1::model::OperationError;
1625    /// let x = Backup::new().set_or_clear_error(Some(OperationError::default()/* use setters */));
1626    /// let x = Backup::new().set_or_clear_error(None::<OperationError>);
1627    /// ```
1628    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1629    where
1630        T: std::convert::Into<crate::model::OperationError>,
1631    {
1632        self.error = v.map(|x| x.into());
1633        self
1634    }
1635
1636    /// Sets the value of [kms_key][crate::model::Backup::kms_key].
1637    ///
1638    /// # Example
1639    /// ```ignore,no_run
1640    /// # use google_cloud_sql_v1::model::Backup;
1641    /// let x = Backup::new().set_kms_key("example");
1642    /// ```
1643    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1644        self.kms_key = v.into();
1645        self
1646    }
1647
1648    /// Sets the value of [kms_key_version][crate::model::Backup::kms_key_version].
1649    ///
1650    /// # Example
1651    /// ```ignore,no_run
1652    /// # use google_cloud_sql_v1::model::Backup;
1653    /// let x = Backup::new().set_kms_key_version("example");
1654    /// ```
1655    pub fn set_kms_key_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1656        self.kms_key_version = v.into();
1657        self
1658    }
1659
1660    /// Sets the value of [backup_kind][crate::model::Backup::backup_kind].
1661    ///
1662    /// # Example
1663    /// ```ignore,no_run
1664    /// # use google_cloud_sql_v1::model::Backup;
1665    /// use google_cloud_sql_v1::model::SqlBackupKind;
1666    /// let x0 = Backup::new().set_backup_kind(SqlBackupKind::Snapshot);
1667    /// let x1 = Backup::new().set_backup_kind(SqlBackupKind::Physical);
1668    /// ```
1669    pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
1670        mut self,
1671        v: T,
1672    ) -> Self {
1673        self.backup_kind = v.into();
1674        self
1675    }
1676
1677    /// Sets the value of [time_zone][crate::model::Backup::time_zone].
1678    ///
1679    /// # Example
1680    /// ```ignore,no_run
1681    /// # use google_cloud_sql_v1::model::Backup;
1682    /// let x = Backup::new().set_time_zone("example");
1683    /// ```
1684    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1685        self.time_zone = v.into();
1686        self
1687    }
1688
1689    /// Sets the value of [database_version][crate::model::Backup::database_version].
1690    ///
1691    /// # Example
1692    /// ```ignore,no_run
1693    /// # use google_cloud_sql_v1::model::Backup;
1694    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
1695    /// let x0 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql56);
1696    /// let x1 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql57);
1697    /// let x2 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql80);
1698    /// ```
1699    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
1700        mut self,
1701        v: T,
1702    ) -> Self {
1703        self.database_version = v.into();
1704        self
1705    }
1706
1707    /// Sets the value of [max_chargeable_bytes][crate::model::Backup::max_chargeable_bytes].
1708    ///
1709    /// # Example
1710    /// ```ignore,no_run
1711    /// # use google_cloud_sql_v1::model::Backup;
1712    /// let x = Backup::new().set_max_chargeable_bytes(42);
1713    /// ```
1714    pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
1715    where
1716        T: std::convert::Into<i64>,
1717    {
1718        self.max_chargeable_bytes = std::option::Option::Some(v.into());
1719        self
1720    }
1721
1722    /// Sets or clears the value of [max_chargeable_bytes][crate::model::Backup::max_chargeable_bytes].
1723    ///
1724    /// # Example
1725    /// ```ignore,no_run
1726    /// # use google_cloud_sql_v1::model::Backup;
1727    /// let x = Backup::new().set_or_clear_max_chargeable_bytes(Some(42));
1728    /// let x = Backup::new().set_or_clear_max_chargeable_bytes(None::<i32>);
1729    /// ```
1730    pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
1731    where
1732        T: std::convert::Into<i64>,
1733    {
1734        self.max_chargeable_bytes = v.map(|x| x.into());
1735        self
1736    }
1737
1738    /// Sets the value of [instance_deletion_time][crate::model::Backup::instance_deletion_time].
1739    ///
1740    /// # Example
1741    /// ```ignore,no_run
1742    /// # use google_cloud_sql_v1::model::Backup;
1743    /// use wkt::Timestamp;
1744    /// let x = Backup::new().set_instance_deletion_time(Timestamp::default()/* use setters */);
1745    /// ```
1746    pub fn set_instance_deletion_time<T>(mut self, v: T) -> Self
1747    where
1748        T: std::convert::Into<wkt::Timestamp>,
1749    {
1750        self.instance_deletion_time = std::option::Option::Some(v.into());
1751        self
1752    }
1753
1754    /// Sets or clears the value of [instance_deletion_time][crate::model::Backup::instance_deletion_time].
1755    ///
1756    /// # Example
1757    /// ```ignore,no_run
1758    /// # use google_cloud_sql_v1::model::Backup;
1759    /// use wkt::Timestamp;
1760    /// let x = Backup::new().set_or_clear_instance_deletion_time(Some(Timestamp::default()/* use setters */));
1761    /// let x = Backup::new().set_or_clear_instance_deletion_time(None::<Timestamp>);
1762    /// ```
1763    pub fn set_or_clear_instance_deletion_time<T>(mut self, v: std::option::Option<T>) -> Self
1764    where
1765        T: std::convert::Into<wkt::Timestamp>,
1766    {
1767        self.instance_deletion_time = v.map(|x| x.into());
1768        self
1769    }
1770
1771    /// Sets the value of [instance_settings][crate::model::Backup::instance_settings].
1772    ///
1773    /// # Example
1774    /// ```ignore,no_run
1775    /// # use google_cloud_sql_v1::model::Backup;
1776    /// use google_cloud_sql_v1::model::DatabaseInstance;
1777    /// let x = Backup::new().set_instance_settings(DatabaseInstance::default()/* use setters */);
1778    /// ```
1779    pub fn set_instance_settings<T>(mut self, v: T) -> Self
1780    where
1781        T: std::convert::Into<crate::model::DatabaseInstance>,
1782    {
1783        self.instance_settings = std::option::Option::Some(v.into());
1784        self
1785    }
1786
1787    /// Sets or clears the value of [instance_settings][crate::model::Backup::instance_settings].
1788    ///
1789    /// # Example
1790    /// ```ignore,no_run
1791    /// # use google_cloud_sql_v1::model::Backup;
1792    /// use google_cloud_sql_v1::model::DatabaseInstance;
1793    /// let x = Backup::new().set_or_clear_instance_settings(Some(DatabaseInstance::default()/* use setters */));
1794    /// let x = Backup::new().set_or_clear_instance_settings(None::<DatabaseInstance>);
1795    /// ```
1796    pub fn set_or_clear_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
1797    where
1798        T: std::convert::Into<crate::model::DatabaseInstance>,
1799    {
1800        self.instance_settings = v.map(|x| x.into());
1801        self
1802    }
1803
1804    /// Sets the value of [backup_run][crate::model::Backup::backup_run].
1805    ///
1806    /// # Example
1807    /// ```ignore,no_run
1808    /// # use google_cloud_sql_v1::model::Backup;
1809    /// let x = Backup::new().set_backup_run("example");
1810    /// ```
1811    pub fn set_backup_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1812        self.backup_run = v.into();
1813        self
1814    }
1815
1816    /// Sets the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1817    ///
1818    /// # Example
1819    /// ```ignore,no_run
1820    /// # use google_cloud_sql_v1::model::Backup;
1821    /// use wkt::BoolValue;
1822    /// let x = Backup::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
1823    /// ```
1824    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
1825    where
1826        T: std::convert::Into<wkt::BoolValue>,
1827    {
1828        self.satisfies_pzs = std::option::Option::Some(v.into());
1829        self
1830    }
1831
1832    /// Sets or clears the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1833    ///
1834    /// # Example
1835    /// ```ignore,no_run
1836    /// # use google_cloud_sql_v1::model::Backup;
1837    /// use wkt::BoolValue;
1838    /// let x = Backup::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
1839    /// let x = Backup::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
1840    /// ```
1841    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
1842    where
1843        T: std::convert::Into<wkt::BoolValue>,
1844    {
1845        self.satisfies_pzs = v.map(|x| x.into());
1846        self
1847    }
1848
1849    /// Sets the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1850    ///
1851    /// # Example
1852    /// ```ignore,no_run
1853    /// # use google_cloud_sql_v1::model::Backup;
1854    /// use wkt::BoolValue;
1855    /// let x = Backup::new().set_satisfies_pzi(BoolValue::default()/* use setters */);
1856    /// ```
1857    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
1858    where
1859        T: std::convert::Into<wkt::BoolValue>,
1860    {
1861        self.satisfies_pzi = std::option::Option::Some(v.into());
1862        self
1863    }
1864
1865    /// Sets or clears the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1866    ///
1867    /// # Example
1868    /// ```ignore,no_run
1869    /// # use google_cloud_sql_v1::model::Backup;
1870    /// use wkt::BoolValue;
1871    /// let x = Backup::new().set_or_clear_satisfies_pzi(Some(BoolValue::default()/* use setters */));
1872    /// let x = Backup::new().set_or_clear_satisfies_pzi(None::<BoolValue>);
1873    /// ```
1874    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
1875    where
1876        T: std::convert::Into<wkt::BoolValue>,
1877    {
1878        self.satisfies_pzi = v.map(|x| x.into());
1879        self
1880    }
1881
1882    /// Sets the value of [expiration][crate::model::Backup::expiration].
1883    ///
1884    /// Note that all the setters affecting `expiration` are mutually
1885    /// exclusive.
1886    ///
1887    /// # Example
1888    /// ```ignore,no_run
1889    /// # use google_cloud_sql_v1::model::Backup;
1890    /// use google_cloud_sql_v1::model::backup::Expiration;
1891    /// let x = Backup::new().set_expiration(Some(Expiration::TtlDays(42)));
1892    /// ```
1893    pub fn set_expiration<
1894        T: std::convert::Into<std::option::Option<crate::model::backup::Expiration>>,
1895    >(
1896        mut self,
1897        v: T,
1898    ) -> Self {
1899        self.expiration = v.into();
1900        self
1901    }
1902
1903    /// The value of [expiration][crate::model::Backup::expiration]
1904    /// if it holds a `TtlDays`, `None` if the field is not set or
1905    /// holds a different branch.
1906    pub fn ttl_days(&self) -> std::option::Option<&i64> {
1907        #[allow(unreachable_patterns)]
1908        self.expiration.as_ref().and_then(|v| match v {
1909            crate::model::backup::Expiration::TtlDays(v) => std::option::Option::Some(v),
1910            _ => std::option::Option::None,
1911        })
1912    }
1913
1914    /// Sets the value of [expiration][crate::model::Backup::expiration]
1915    /// to hold a `TtlDays`.
1916    ///
1917    /// Note that all the setters affecting `expiration` are
1918    /// mutually exclusive.
1919    ///
1920    /// # Example
1921    /// ```ignore,no_run
1922    /// # use google_cloud_sql_v1::model::Backup;
1923    /// let x = Backup::new().set_ttl_days(42);
1924    /// assert!(x.ttl_days().is_some());
1925    /// assert!(x.expiry_time().is_none());
1926    /// ```
1927    pub fn set_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1928        self.expiration =
1929            std::option::Option::Some(crate::model::backup::Expiration::TtlDays(v.into()));
1930        self
1931    }
1932
1933    /// The value of [expiration][crate::model::Backup::expiration]
1934    /// if it holds a `ExpiryTime`, `None` if the field is not set or
1935    /// holds a different branch.
1936    pub fn expiry_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
1937        #[allow(unreachable_patterns)]
1938        self.expiration.as_ref().and_then(|v| match v {
1939            crate::model::backup::Expiration::ExpiryTime(v) => std::option::Option::Some(v),
1940            _ => std::option::Option::None,
1941        })
1942    }
1943
1944    /// Sets the value of [expiration][crate::model::Backup::expiration]
1945    /// to hold a `ExpiryTime`.
1946    ///
1947    /// Note that all the setters affecting `expiration` are
1948    /// mutually exclusive.
1949    ///
1950    /// # Example
1951    /// ```ignore,no_run
1952    /// # use google_cloud_sql_v1::model::Backup;
1953    /// use wkt::Timestamp;
1954    /// let x = Backup::new().set_expiry_time(Timestamp::default()/* use setters */);
1955    /// assert!(x.expiry_time().is_some());
1956    /// assert!(x.ttl_days().is_none());
1957    /// ```
1958    pub fn set_expiry_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
1959        mut self,
1960        v: T,
1961    ) -> Self {
1962        self.expiration =
1963            std::option::Option::Some(crate::model::backup::Expiration::ExpiryTime(v.into()));
1964        self
1965    }
1966}
1967
1968impl wkt::message::Message for Backup {
1969    fn typename() -> &'static str {
1970        "type.googleapis.com/google.cloud.sql.v1.Backup"
1971    }
1972}
1973
1974/// Defines additional types related to [Backup].
1975pub mod backup {
1976    #[allow(unused_imports)]
1977    use super::*;
1978
1979    /// The backup type.
1980    ///
1981    /// # Working with unknown values
1982    ///
1983    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1984    /// additional enum variants at any time. Adding new variants is not considered
1985    /// a breaking change. Applications should write their code in anticipation of:
1986    ///
1987    /// - New values appearing in future releases of the client library, **and**
1988    /// - New values received dynamically, without application changes.
1989    ///
1990    /// Please consult the [Working with enums] section in the user guide for some
1991    /// guidelines.
1992    ///
1993    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1994    #[derive(Clone, Debug, PartialEq)]
1995    #[non_exhaustive]
1996    pub enum SqlBackupType {
1997        /// This is an unknown backup type.
1998        Unspecified,
1999        /// The backup schedule triggers a backup automatically.
2000        Automated,
2001        /// The user triggers a backup manually.
2002        OnDemand,
2003        /// The backup created when instance is deleted.
2004        Final,
2005        /// If set, the enum was initialized with an unknown value.
2006        ///
2007        /// Applications can examine the value using [SqlBackupType::value] or
2008        /// [SqlBackupType::name].
2009        UnknownValue(sql_backup_type::UnknownValue),
2010    }
2011
2012    #[doc(hidden)]
2013    pub mod sql_backup_type {
2014        #[allow(unused_imports)]
2015        use super::*;
2016        #[derive(Clone, Debug, PartialEq)]
2017        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2018    }
2019
2020    impl SqlBackupType {
2021        /// Gets the enum value.
2022        ///
2023        /// Returns `None` if the enum contains an unknown value deserialized from
2024        /// the string representation of enums.
2025        pub fn value(&self) -> std::option::Option<i32> {
2026            match self {
2027                Self::Unspecified => std::option::Option::Some(0),
2028                Self::Automated => std::option::Option::Some(1),
2029                Self::OnDemand => std::option::Option::Some(2),
2030                Self::Final => std::option::Option::Some(3),
2031                Self::UnknownValue(u) => u.0.value(),
2032            }
2033        }
2034
2035        /// Gets the enum value as a string.
2036        ///
2037        /// Returns `None` if the enum contains an unknown value deserialized from
2038        /// the integer representation of enums.
2039        pub fn name(&self) -> std::option::Option<&str> {
2040            match self {
2041                Self::Unspecified => std::option::Option::Some("SQL_BACKUP_TYPE_UNSPECIFIED"),
2042                Self::Automated => std::option::Option::Some("AUTOMATED"),
2043                Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
2044                Self::Final => std::option::Option::Some("FINAL"),
2045                Self::UnknownValue(u) => u.0.name(),
2046            }
2047        }
2048    }
2049
2050    impl std::default::Default for SqlBackupType {
2051        fn default() -> Self {
2052            use std::convert::From;
2053            Self::from(0)
2054        }
2055    }
2056
2057    impl std::fmt::Display for SqlBackupType {
2058        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2059            wkt::internal::display_enum(f, self.name(), self.value())
2060        }
2061    }
2062
2063    impl std::convert::From<i32> for SqlBackupType {
2064        fn from(value: i32) -> Self {
2065            match value {
2066                0 => Self::Unspecified,
2067                1 => Self::Automated,
2068                2 => Self::OnDemand,
2069                3 => Self::Final,
2070                _ => Self::UnknownValue(sql_backup_type::UnknownValue(
2071                    wkt::internal::UnknownEnumValue::Integer(value),
2072                )),
2073            }
2074        }
2075    }
2076
2077    impl std::convert::From<&str> for SqlBackupType {
2078        fn from(value: &str) -> Self {
2079            use std::string::ToString;
2080            match value {
2081                "SQL_BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
2082                "AUTOMATED" => Self::Automated,
2083                "ON_DEMAND" => Self::OnDemand,
2084                "FINAL" => Self::Final,
2085                _ => Self::UnknownValue(sql_backup_type::UnknownValue(
2086                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2087                )),
2088            }
2089        }
2090    }
2091
2092    impl serde::ser::Serialize for SqlBackupType {
2093        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2094        where
2095            S: serde::Serializer,
2096        {
2097            match self {
2098                Self::Unspecified => serializer.serialize_i32(0),
2099                Self::Automated => serializer.serialize_i32(1),
2100                Self::OnDemand => serializer.serialize_i32(2),
2101                Self::Final => serializer.serialize_i32(3),
2102                Self::UnknownValue(u) => u.0.serialize(serializer),
2103            }
2104        }
2105    }
2106
2107    impl<'de> serde::de::Deserialize<'de> for SqlBackupType {
2108        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2109        where
2110            D: serde::Deserializer<'de>,
2111        {
2112            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupType>::new(
2113                ".google.cloud.sql.v1.Backup.SqlBackupType",
2114            ))
2115        }
2116    }
2117
2118    /// The backup's state
2119    ///
2120    /// # Working with unknown values
2121    ///
2122    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2123    /// additional enum variants at any time. Adding new variants is not considered
2124    /// a breaking change. Applications should write their code in anticipation of:
2125    ///
2126    /// - New values appearing in future releases of the client library, **and**
2127    /// - New values received dynamically, without application changes.
2128    ///
2129    /// Please consult the [Working with enums] section in the user guide for some
2130    /// guidelines.
2131    ///
2132    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2133    #[derive(Clone, Debug, PartialEq)]
2134    #[non_exhaustive]
2135    pub enum SqlBackupState {
2136        /// The state of the backup is unknown.
2137        Unspecified,
2138        /// The backup that's added to a queue.
2139        Enqueued,
2140        /// The backup is in progress.
2141        Running,
2142        /// The backup failed.
2143        Failed,
2144        /// The backup is successful.
2145        Successful,
2146        /// The backup is being deleted.
2147        Deleting,
2148        /// Deletion of the backup failed.
2149        DeletionFailed,
2150        /// If set, the enum was initialized with an unknown value.
2151        ///
2152        /// Applications can examine the value using [SqlBackupState::value] or
2153        /// [SqlBackupState::name].
2154        UnknownValue(sql_backup_state::UnknownValue),
2155    }
2156
2157    #[doc(hidden)]
2158    pub mod sql_backup_state {
2159        #[allow(unused_imports)]
2160        use super::*;
2161        #[derive(Clone, Debug, PartialEq)]
2162        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2163    }
2164
2165    impl SqlBackupState {
2166        /// Gets the enum value.
2167        ///
2168        /// Returns `None` if the enum contains an unknown value deserialized from
2169        /// the string representation of enums.
2170        pub fn value(&self) -> std::option::Option<i32> {
2171            match self {
2172                Self::Unspecified => std::option::Option::Some(0),
2173                Self::Enqueued => std::option::Option::Some(1),
2174                Self::Running => std::option::Option::Some(2),
2175                Self::Failed => std::option::Option::Some(3),
2176                Self::Successful => std::option::Option::Some(4),
2177                Self::Deleting => std::option::Option::Some(5),
2178                Self::DeletionFailed => std::option::Option::Some(6),
2179                Self::UnknownValue(u) => u.0.value(),
2180            }
2181        }
2182
2183        /// Gets the enum value as a string.
2184        ///
2185        /// Returns `None` if the enum contains an unknown value deserialized from
2186        /// the integer representation of enums.
2187        pub fn name(&self) -> std::option::Option<&str> {
2188            match self {
2189                Self::Unspecified => std::option::Option::Some("SQL_BACKUP_STATE_UNSPECIFIED"),
2190                Self::Enqueued => std::option::Option::Some("ENQUEUED"),
2191                Self::Running => std::option::Option::Some("RUNNING"),
2192                Self::Failed => std::option::Option::Some("FAILED"),
2193                Self::Successful => std::option::Option::Some("SUCCESSFUL"),
2194                Self::Deleting => std::option::Option::Some("DELETING"),
2195                Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
2196                Self::UnknownValue(u) => u.0.name(),
2197            }
2198        }
2199    }
2200
2201    impl std::default::Default for SqlBackupState {
2202        fn default() -> Self {
2203            use std::convert::From;
2204            Self::from(0)
2205        }
2206    }
2207
2208    impl std::fmt::Display for SqlBackupState {
2209        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2210            wkt::internal::display_enum(f, self.name(), self.value())
2211        }
2212    }
2213
2214    impl std::convert::From<i32> for SqlBackupState {
2215        fn from(value: i32) -> Self {
2216            match value {
2217                0 => Self::Unspecified,
2218                1 => Self::Enqueued,
2219                2 => Self::Running,
2220                3 => Self::Failed,
2221                4 => Self::Successful,
2222                5 => Self::Deleting,
2223                6 => Self::DeletionFailed,
2224                _ => Self::UnknownValue(sql_backup_state::UnknownValue(
2225                    wkt::internal::UnknownEnumValue::Integer(value),
2226                )),
2227            }
2228        }
2229    }
2230
2231    impl std::convert::From<&str> for SqlBackupState {
2232        fn from(value: &str) -> Self {
2233            use std::string::ToString;
2234            match value {
2235                "SQL_BACKUP_STATE_UNSPECIFIED" => Self::Unspecified,
2236                "ENQUEUED" => Self::Enqueued,
2237                "RUNNING" => Self::Running,
2238                "FAILED" => Self::Failed,
2239                "SUCCESSFUL" => Self::Successful,
2240                "DELETING" => Self::Deleting,
2241                "DELETION_FAILED" => Self::DeletionFailed,
2242                _ => Self::UnknownValue(sql_backup_state::UnknownValue(
2243                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2244                )),
2245            }
2246        }
2247    }
2248
2249    impl serde::ser::Serialize for SqlBackupState {
2250        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2251        where
2252            S: serde::Serializer,
2253        {
2254            match self {
2255                Self::Unspecified => serializer.serialize_i32(0),
2256                Self::Enqueued => serializer.serialize_i32(1),
2257                Self::Running => serializer.serialize_i32(2),
2258                Self::Failed => serializer.serialize_i32(3),
2259                Self::Successful => serializer.serialize_i32(4),
2260                Self::Deleting => serializer.serialize_i32(5),
2261                Self::DeletionFailed => serializer.serialize_i32(6),
2262                Self::UnknownValue(u) => u.0.serialize(serializer),
2263            }
2264        }
2265    }
2266
2267    impl<'de> serde::de::Deserialize<'de> for SqlBackupState {
2268        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2269        where
2270            D: serde::Deserializer<'de>,
2271        {
2272            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupState>::new(
2273                ".google.cloud.sql.v1.Backup.SqlBackupState",
2274            ))
2275        }
2276    }
2277
2278    #[allow(missing_docs)]
2279    #[derive(Clone, Debug, PartialEq)]
2280    #[non_exhaustive]
2281    pub enum Expiration {
2282        /// Input only. The time-to-live (TTL) interval for this resource (in days).
2283        /// For example: ttlDays:7, means 7 days from the current time. The
2284        /// expiration time can't exceed 365 days from the time that the backup is
2285        /// created.
2286        TtlDays(i64),
2287        /// Backup expiration time.
2288        /// A UTC timestamp of when this backup expired.
2289        ExpiryTime(std::boxed::Box<wkt::Timestamp>),
2290    }
2291}
2292
2293/// Connect settings retrieval request.
2294#[derive(Clone, Default, PartialEq)]
2295#[non_exhaustive]
2296pub struct GetConnectSettingsRequest {
2297    /// Cloud SQL instance ID. This does not include the project ID.
2298    pub instance: std::string::String,
2299
2300    /// Project ID of the project that contains the instance.
2301    pub project: std::string::String,
2302
2303    /// Optional. Optional snapshot read timestamp to trade freshness for
2304    /// performance.
2305    pub read_time: std::option::Option<wkt::Timestamp>,
2306
2307    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2308}
2309
2310impl GetConnectSettingsRequest {
2311    /// Creates a new default instance.
2312    pub fn new() -> Self {
2313        std::default::Default::default()
2314    }
2315
2316    /// Sets the value of [instance][crate::model::GetConnectSettingsRequest::instance].
2317    ///
2318    /// # Example
2319    /// ```ignore,no_run
2320    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2321    /// let x = GetConnectSettingsRequest::new().set_instance("example");
2322    /// ```
2323    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2324        self.instance = v.into();
2325        self
2326    }
2327
2328    /// Sets the value of [project][crate::model::GetConnectSettingsRequest::project].
2329    ///
2330    /// # Example
2331    /// ```ignore,no_run
2332    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2333    /// let x = GetConnectSettingsRequest::new().set_project("example");
2334    /// ```
2335    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2336        self.project = v.into();
2337        self
2338    }
2339
2340    /// Sets the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
2341    ///
2342    /// # Example
2343    /// ```ignore,no_run
2344    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2345    /// use wkt::Timestamp;
2346    /// let x = GetConnectSettingsRequest::new().set_read_time(Timestamp::default()/* use setters */);
2347    /// ```
2348    pub fn set_read_time<T>(mut self, v: T) -> Self
2349    where
2350        T: std::convert::Into<wkt::Timestamp>,
2351    {
2352        self.read_time = std::option::Option::Some(v.into());
2353        self
2354    }
2355
2356    /// Sets or clears the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
2357    ///
2358    /// # Example
2359    /// ```ignore,no_run
2360    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2361    /// use wkt::Timestamp;
2362    /// let x = GetConnectSettingsRequest::new().set_or_clear_read_time(Some(Timestamp::default()/* use setters */));
2363    /// let x = GetConnectSettingsRequest::new().set_or_clear_read_time(None::<Timestamp>);
2364    /// ```
2365    pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
2366    where
2367        T: std::convert::Into<wkt::Timestamp>,
2368    {
2369        self.read_time = v.map(|x| x.into());
2370        self
2371    }
2372}
2373
2374impl wkt::message::Message for GetConnectSettingsRequest {
2375    fn typename() -> &'static str {
2376        "type.googleapis.com/google.cloud.sql.v1.GetConnectSettingsRequest"
2377    }
2378}
2379
2380/// Connect settings retrieval response.
2381#[derive(Clone, Default, PartialEq)]
2382#[non_exhaustive]
2383pub struct ConnectSettings {
2384    /// This is always `sql#connectSettings`.
2385    pub kind: std::string::String,
2386
2387    /// SSL configuration.
2388    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
2389
2390    /// The assigned IP addresses for the instance.
2391    pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
2392
2393    /// The cloud region for the instance. For example, `us-central1`,
2394    /// `europe-west1`. The region cannot be changed after instance creation.
2395    pub region: std::string::String,
2396
2397    /// The database engine type and version. The `databaseVersion`
2398    /// field cannot be changed after instance creation.
2399    /// MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
2400    /// or `MYSQL_5_6`.
2401    /// PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
2402    /// `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
2403    /// SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
2404    /// `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
2405    /// `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
2406    /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
2407    /// `SQLSERVER_2019_WEB`.
2408    pub database_version: crate::model::SqlDatabaseVersion,
2409
2410    /// `SECOND_GEN`: Cloud SQL database instance.
2411    /// `EXTERNAL`: A database server that is not managed by Google.
2412    /// This property is read-only; use the `tier` property in the `settings`
2413    /// object to determine the database type.
2414    pub backend_type: crate::model::SqlBackendType,
2415
2416    /// Whether PSC connectivity is enabled for this instance.
2417    pub psc_enabled: bool,
2418
2419    /// The dns name of the instance.
2420    pub dns_name: std::string::String,
2421
2422    /// Specify what type of CA is used for the server certificate.
2423    pub server_ca_mode: crate::model::connect_settings::CaMode,
2424
2425    /// Custom subject alternative names for the server certificate.
2426    pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
2427
2428    /// Output only. The list of DNS names used by this instance.
2429    pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
2430
2431    /// The number of read pool nodes in a read pool.
2432    pub node_count: std::option::Option<i32>,
2433
2434    /// Output only. Entries containing information about each read pool node of
2435    /// the read pool.
2436    pub nodes: std::vec::Vec<crate::model::connect_settings::ConnectPoolNodeConfig>,
2437
2438    /// Optional. Output only. mdx_protocol_support controls how the client uses
2439    /// metadata exchange when connecting to the instance. The values in the list
2440    /// representing parts of the MDX protocol that are supported by this instance.
2441    /// When the list is empty, the instance does not support MDX, so the client
2442    /// must not send an MDX request. The default is empty.
2443    pub mdx_protocol_support: std::vec::Vec<crate::model::connect_settings::MdxProtocolSupport>,
2444
2445    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2446}
2447
2448impl ConnectSettings {
2449    /// Creates a new default instance.
2450    pub fn new() -> Self {
2451        std::default::Default::default()
2452    }
2453
2454    /// Sets the value of [kind][crate::model::ConnectSettings::kind].
2455    ///
2456    /// # Example
2457    /// ```ignore,no_run
2458    /// # use google_cloud_sql_v1::model::ConnectSettings;
2459    /// let x = ConnectSettings::new().set_kind("example");
2460    /// ```
2461    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2462        self.kind = v.into();
2463        self
2464    }
2465
2466    /// Sets 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_server_ca_cert(SslCert::default()/* use setters */);
2473    /// ```
2474    pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
2475    where
2476        T: std::convert::Into<crate::model::SslCert>,
2477    {
2478        self.server_ca_cert = std::option::Option::Some(v.into());
2479        self
2480    }
2481
2482    /// Sets or clears the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
2483    ///
2484    /// # Example
2485    /// ```ignore,no_run
2486    /// # use google_cloud_sql_v1::model::ConnectSettings;
2487    /// use google_cloud_sql_v1::model::SslCert;
2488    /// let x = ConnectSettings::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
2489    /// let x = ConnectSettings::new().set_or_clear_server_ca_cert(None::<SslCert>);
2490    /// ```
2491    pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
2492    where
2493        T: std::convert::Into<crate::model::SslCert>,
2494    {
2495        self.server_ca_cert = v.map(|x| x.into());
2496        self
2497    }
2498
2499    /// Sets the value of [ip_addresses][crate::model::ConnectSettings::ip_addresses].
2500    ///
2501    /// # Example
2502    /// ```ignore,no_run
2503    /// # use google_cloud_sql_v1::model::ConnectSettings;
2504    /// use google_cloud_sql_v1::model::IpMapping;
2505    /// let x = ConnectSettings::new()
2506    ///     .set_ip_addresses([
2507    ///         IpMapping::default()/* use setters */,
2508    ///         IpMapping::default()/* use (different) setters */,
2509    ///     ]);
2510    /// ```
2511    pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
2512    where
2513        T: std::iter::IntoIterator<Item = V>,
2514        V: std::convert::Into<crate::model::IpMapping>,
2515    {
2516        use std::iter::Iterator;
2517        self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
2518        self
2519    }
2520
2521    /// Sets the value of [region][crate::model::ConnectSettings::region].
2522    ///
2523    /// # Example
2524    /// ```ignore,no_run
2525    /// # use google_cloud_sql_v1::model::ConnectSettings;
2526    /// let x = ConnectSettings::new().set_region("example");
2527    /// ```
2528    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2529        self.region = v.into();
2530        self
2531    }
2532
2533    /// Sets the value of [database_version][crate::model::ConnectSettings::database_version].
2534    ///
2535    /// # Example
2536    /// ```ignore,no_run
2537    /// # use google_cloud_sql_v1::model::ConnectSettings;
2538    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
2539    /// let x0 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql56);
2540    /// let x1 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql57);
2541    /// let x2 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql80);
2542    /// ```
2543    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
2544        mut self,
2545        v: T,
2546    ) -> Self {
2547        self.database_version = v.into();
2548        self
2549    }
2550
2551    /// Sets the value of [backend_type][crate::model::ConnectSettings::backend_type].
2552    ///
2553    /// # Example
2554    /// ```ignore,no_run
2555    /// # use google_cloud_sql_v1::model::ConnectSettings;
2556    /// use google_cloud_sql_v1::model::SqlBackendType;
2557    /// let x0 = ConnectSettings::new().set_backend_type(SqlBackendType::SecondGen);
2558    /// let x1 = ConnectSettings::new().set_backend_type(SqlBackendType::External);
2559    /// ```
2560    pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
2561        mut self,
2562        v: T,
2563    ) -> Self {
2564        self.backend_type = v.into();
2565        self
2566    }
2567
2568    /// Sets the value of [psc_enabled][crate::model::ConnectSettings::psc_enabled].
2569    ///
2570    /// # Example
2571    /// ```ignore,no_run
2572    /// # use google_cloud_sql_v1::model::ConnectSettings;
2573    /// let x = ConnectSettings::new().set_psc_enabled(true);
2574    /// ```
2575    pub fn set_psc_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2576        self.psc_enabled = v.into();
2577        self
2578    }
2579
2580    /// Sets the value of [dns_name][crate::model::ConnectSettings::dns_name].
2581    ///
2582    /// # Example
2583    /// ```ignore,no_run
2584    /// # use google_cloud_sql_v1::model::ConnectSettings;
2585    /// let x = ConnectSettings::new().set_dns_name("example");
2586    /// ```
2587    pub fn set_dns_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2588        self.dns_name = v.into();
2589        self
2590    }
2591
2592    /// Sets the value of [server_ca_mode][crate::model::ConnectSettings::server_ca_mode].
2593    ///
2594    /// # Example
2595    /// ```ignore,no_run
2596    /// # use google_cloud_sql_v1::model::ConnectSettings;
2597    /// use google_cloud_sql_v1::model::connect_settings::CaMode;
2598    /// let x0 = ConnectSettings::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
2599    /// let x1 = ConnectSettings::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
2600    /// let x2 = ConnectSettings::new().set_server_ca_mode(CaMode::CustomerManagedCasCa);
2601    /// ```
2602    pub fn set_server_ca_mode<T: std::convert::Into<crate::model::connect_settings::CaMode>>(
2603        mut self,
2604        v: T,
2605    ) -> Self {
2606        self.server_ca_mode = v.into();
2607        self
2608    }
2609
2610    /// Sets the value of [custom_subject_alternative_names][crate::model::ConnectSettings::custom_subject_alternative_names].
2611    ///
2612    /// # Example
2613    /// ```ignore,no_run
2614    /// # use google_cloud_sql_v1::model::ConnectSettings;
2615    /// let x = ConnectSettings::new().set_custom_subject_alternative_names(["a", "b", "c"]);
2616    /// ```
2617    pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
2618    where
2619        T: std::iter::IntoIterator<Item = V>,
2620        V: std::convert::Into<std::string::String>,
2621    {
2622        use std::iter::Iterator;
2623        self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
2624        self
2625    }
2626
2627    /// Sets the value of [dns_names][crate::model::ConnectSettings::dns_names].
2628    ///
2629    /// # Example
2630    /// ```ignore,no_run
2631    /// # use google_cloud_sql_v1::model::ConnectSettings;
2632    /// use google_cloud_sql_v1::model::DnsNameMapping;
2633    /// let x = ConnectSettings::new()
2634    ///     .set_dns_names([
2635    ///         DnsNameMapping::default()/* use setters */,
2636    ///         DnsNameMapping::default()/* use (different) setters */,
2637    ///     ]);
2638    /// ```
2639    pub fn set_dns_names<T, V>(mut self, v: T) -> Self
2640    where
2641        T: std::iter::IntoIterator<Item = V>,
2642        V: std::convert::Into<crate::model::DnsNameMapping>,
2643    {
2644        use std::iter::Iterator;
2645        self.dns_names = v.into_iter().map(|i| i.into()).collect();
2646        self
2647    }
2648
2649    /// Sets the value of [node_count][crate::model::ConnectSettings::node_count].
2650    ///
2651    /// # Example
2652    /// ```ignore,no_run
2653    /// # use google_cloud_sql_v1::model::ConnectSettings;
2654    /// let x = ConnectSettings::new().set_node_count(42);
2655    /// ```
2656    pub fn set_node_count<T>(mut self, v: T) -> Self
2657    where
2658        T: std::convert::Into<i32>,
2659    {
2660        self.node_count = std::option::Option::Some(v.into());
2661        self
2662    }
2663
2664    /// Sets or clears the value of [node_count][crate::model::ConnectSettings::node_count].
2665    ///
2666    /// # Example
2667    /// ```ignore,no_run
2668    /// # use google_cloud_sql_v1::model::ConnectSettings;
2669    /// let x = ConnectSettings::new().set_or_clear_node_count(Some(42));
2670    /// let x = ConnectSettings::new().set_or_clear_node_count(None::<i32>);
2671    /// ```
2672    pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
2673    where
2674        T: std::convert::Into<i32>,
2675    {
2676        self.node_count = v.map(|x| x.into());
2677        self
2678    }
2679
2680    /// Sets the value of [nodes][crate::model::ConnectSettings::nodes].
2681    ///
2682    /// # Example
2683    /// ```ignore,no_run
2684    /// # use google_cloud_sql_v1::model::ConnectSettings;
2685    /// use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2686    /// let x = ConnectSettings::new()
2687    ///     .set_nodes([
2688    ///         ConnectPoolNodeConfig::default()/* use setters */,
2689    ///         ConnectPoolNodeConfig::default()/* use (different) setters */,
2690    ///     ]);
2691    /// ```
2692    pub fn set_nodes<T, V>(mut self, v: T) -> Self
2693    where
2694        T: std::iter::IntoIterator<Item = V>,
2695        V: std::convert::Into<crate::model::connect_settings::ConnectPoolNodeConfig>,
2696    {
2697        use std::iter::Iterator;
2698        self.nodes = v.into_iter().map(|i| i.into()).collect();
2699        self
2700    }
2701
2702    /// Sets the value of [mdx_protocol_support][crate::model::ConnectSettings::mdx_protocol_support].
2703    ///
2704    /// # Example
2705    /// ```ignore,no_run
2706    /// # use google_cloud_sql_v1::model::ConnectSettings;
2707    /// use google_cloud_sql_v1::model::connect_settings::MdxProtocolSupport;
2708    /// let x = ConnectSettings::new().set_mdx_protocol_support([
2709    ///     MdxProtocolSupport::ClientProtocolType,
2710    /// ]);
2711    /// ```
2712    pub fn set_mdx_protocol_support<T, V>(mut self, v: T) -> Self
2713    where
2714        T: std::iter::IntoIterator<Item = V>,
2715        V: std::convert::Into<crate::model::connect_settings::MdxProtocolSupport>,
2716    {
2717        use std::iter::Iterator;
2718        self.mdx_protocol_support = v.into_iter().map(|i| i.into()).collect();
2719        self
2720    }
2721}
2722
2723impl wkt::message::Message for ConnectSettings {
2724    fn typename() -> &'static str {
2725        "type.googleapis.com/google.cloud.sql.v1.ConnectSettings"
2726    }
2727}
2728
2729/// Defines additional types related to [ConnectSettings].
2730pub mod connect_settings {
2731    #[allow(unused_imports)]
2732    use super::*;
2733
2734    /// Details of a single read pool node of a read pool.
2735    #[derive(Clone, Default, PartialEq)]
2736    #[non_exhaustive]
2737    pub struct ConnectPoolNodeConfig {
2738        /// Output only. The name of the read pool node. Doesn't include the project
2739        /// ID.
2740        pub name: std::option::Option<std::string::String>,
2741
2742        /// Output only. Mappings containing IP addresses that can be used to connect
2743        /// to the read pool node.
2744        pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
2745
2746        /// Output only. The DNS name of the read pool node.
2747        pub dns_name: std::option::Option<std::string::String>,
2748
2749        /// Output only. The list of DNS names used by this read pool node.
2750        pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
2751
2752        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2753    }
2754
2755    impl ConnectPoolNodeConfig {
2756        /// Creates a new default instance.
2757        pub fn new() -> Self {
2758            std::default::Default::default()
2759        }
2760
2761        /// Sets the value of [name][crate::model::connect_settings::ConnectPoolNodeConfig::name].
2762        ///
2763        /// # Example
2764        /// ```ignore,no_run
2765        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2766        /// let x = ConnectPoolNodeConfig::new().set_name("example");
2767        /// ```
2768        pub fn set_name<T>(mut self, v: T) -> Self
2769        where
2770            T: std::convert::Into<std::string::String>,
2771        {
2772            self.name = std::option::Option::Some(v.into());
2773            self
2774        }
2775
2776        /// Sets or clears the value of [name][crate::model::connect_settings::ConnectPoolNodeConfig::name].
2777        ///
2778        /// # Example
2779        /// ```ignore,no_run
2780        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2781        /// let x = ConnectPoolNodeConfig::new().set_or_clear_name(Some("example"));
2782        /// let x = ConnectPoolNodeConfig::new().set_or_clear_name(None::<String>);
2783        /// ```
2784        pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
2785        where
2786            T: std::convert::Into<std::string::String>,
2787        {
2788            self.name = v.map(|x| x.into());
2789            self
2790        }
2791
2792        /// Sets the value of [ip_addresses][crate::model::connect_settings::ConnectPoolNodeConfig::ip_addresses].
2793        ///
2794        /// # Example
2795        /// ```ignore,no_run
2796        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2797        /// use google_cloud_sql_v1::model::IpMapping;
2798        /// let x = ConnectPoolNodeConfig::new()
2799        ///     .set_ip_addresses([
2800        ///         IpMapping::default()/* use setters */,
2801        ///         IpMapping::default()/* use (different) setters */,
2802        ///     ]);
2803        /// ```
2804        pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
2805        where
2806            T: std::iter::IntoIterator<Item = V>,
2807            V: std::convert::Into<crate::model::IpMapping>,
2808        {
2809            use std::iter::Iterator;
2810            self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
2811            self
2812        }
2813
2814        /// Sets the value of [dns_name][crate::model::connect_settings::ConnectPoolNodeConfig::dns_name].
2815        ///
2816        /// # Example
2817        /// ```ignore,no_run
2818        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2819        /// let x = ConnectPoolNodeConfig::new().set_dns_name("example");
2820        /// ```
2821        pub fn set_dns_name<T>(mut self, v: T) -> Self
2822        where
2823            T: std::convert::Into<std::string::String>,
2824        {
2825            self.dns_name = std::option::Option::Some(v.into());
2826            self
2827        }
2828
2829        /// Sets or clears the value of [dns_name][crate::model::connect_settings::ConnectPoolNodeConfig::dns_name].
2830        ///
2831        /// # Example
2832        /// ```ignore,no_run
2833        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2834        /// let x = ConnectPoolNodeConfig::new().set_or_clear_dns_name(Some("example"));
2835        /// let x = ConnectPoolNodeConfig::new().set_or_clear_dns_name(None::<String>);
2836        /// ```
2837        pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
2838        where
2839            T: std::convert::Into<std::string::String>,
2840        {
2841            self.dns_name = v.map(|x| x.into());
2842            self
2843        }
2844
2845        /// Sets the value of [dns_names][crate::model::connect_settings::ConnectPoolNodeConfig::dns_names].
2846        ///
2847        /// # Example
2848        /// ```ignore,no_run
2849        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2850        /// use google_cloud_sql_v1::model::DnsNameMapping;
2851        /// let x = ConnectPoolNodeConfig::new()
2852        ///     .set_dns_names([
2853        ///         DnsNameMapping::default()/* use setters */,
2854        ///         DnsNameMapping::default()/* use (different) setters */,
2855        ///     ]);
2856        /// ```
2857        pub fn set_dns_names<T, V>(mut self, v: T) -> Self
2858        where
2859            T: std::iter::IntoIterator<Item = V>,
2860            V: std::convert::Into<crate::model::DnsNameMapping>,
2861        {
2862            use std::iter::Iterator;
2863            self.dns_names = v.into_iter().map(|i| i.into()).collect();
2864            self
2865        }
2866    }
2867
2868    impl wkt::message::Message for ConnectPoolNodeConfig {
2869        fn typename() -> &'static str {
2870            "type.googleapis.com/google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig"
2871        }
2872    }
2873
2874    /// Various Certificate Authority (CA) modes for certificate signing.
2875    ///
2876    /// # Working with unknown values
2877    ///
2878    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2879    /// additional enum variants at any time. Adding new variants is not considered
2880    /// a breaking change. Applications should write their code in anticipation of:
2881    ///
2882    /// - New values appearing in future releases of the client library, **and**
2883    /// - New values received dynamically, without application changes.
2884    ///
2885    /// Please consult the [Working with enums] section in the user guide for some
2886    /// guidelines.
2887    ///
2888    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2889    #[derive(Clone, Debug, PartialEq)]
2890    #[non_exhaustive]
2891    pub enum CaMode {
2892        /// CA mode is unknown.
2893        Unspecified,
2894        /// Google-managed self-signed internal CA.
2895        GoogleManagedInternalCa,
2896        /// Google-managed regional CA part of root CA hierarchy hosted on Google
2897        /// Cloud's Certificate Authority Service (CAS).
2898        GoogleManagedCasCa,
2899        /// Customer-managed CA hosted on Google Cloud's Certificate Authority
2900        /// Service (CAS).
2901        CustomerManagedCasCa,
2902        /// If set, the enum was initialized with an unknown value.
2903        ///
2904        /// Applications can examine the value using [CaMode::value] or
2905        /// [CaMode::name].
2906        UnknownValue(ca_mode::UnknownValue),
2907    }
2908
2909    #[doc(hidden)]
2910    pub mod ca_mode {
2911        #[allow(unused_imports)]
2912        use super::*;
2913        #[derive(Clone, Debug, PartialEq)]
2914        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2915    }
2916
2917    impl CaMode {
2918        /// Gets the enum value.
2919        ///
2920        /// Returns `None` if the enum contains an unknown value deserialized from
2921        /// the string representation of enums.
2922        pub fn value(&self) -> std::option::Option<i32> {
2923            match self {
2924                Self::Unspecified => std::option::Option::Some(0),
2925                Self::GoogleManagedInternalCa => std::option::Option::Some(1),
2926                Self::GoogleManagedCasCa => std::option::Option::Some(2),
2927                Self::CustomerManagedCasCa => std::option::Option::Some(3),
2928                Self::UnknownValue(u) => u.0.value(),
2929            }
2930        }
2931
2932        /// Gets the enum value as a string.
2933        ///
2934        /// Returns `None` if the enum contains an unknown value deserialized from
2935        /// the integer representation of enums.
2936        pub fn name(&self) -> std::option::Option<&str> {
2937            match self {
2938                Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
2939                Self::GoogleManagedInternalCa => {
2940                    std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
2941                }
2942                Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
2943                Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
2944                Self::UnknownValue(u) => u.0.name(),
2945            }
2946        }
2947    }
2948
2949    impl std::default::Default for CaMode {
2950        fn default() -> Self {
2951            use std::convert::From;
2952            Self::from(0)
2953        }
2954    }
2955
2956    impl std::fmt::Display for CaMode {
2957        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2958            wkt::internal::display_enum(f, self.name(), self.value())
2959        }
2960    }
2961
2962    impl std::convert::From<i32> for CaMode {
2963        fn from(value: i32) -> Self {
2964            match value {
2965                0 => Self::Unspecified,
2966                1 => Self::GoogleManagedInternalCa,
2967                2 => Self::GoogleManagedCasCa,
2968                3 => Self::CustomerManagedCasCa,
2969                _ => Self::UnknownValue(ca_mode::UnknownValue(
2970                    wkt::internal::UnknownEnumValue::Integer(value),
2971                )),
2972            }
2973        }
2974    }
2975
2976    impl std::convert::From<&str> for CaMode {
2977        fn from(value: &str) -> Self {
2978            use std::string::ToString;
2979            match value {
2980                "CA_MODE_UNSPECIFIED" => Self::Unspecified,
2981                "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
2982                "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
2983                "CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
2984                _ => Self::UnknownValue(ca_mode::UnknownValue(
2985                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2986                )),
2987            }
2988        }
2989    }
2990
2991    impl serde::ser::Serialize for CaMode {
2992        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2993        where
2994            S: serde::Serializer,
2995        {
2996            match self {
2997                Self::Unspecified => serializer.serialize_i32(0),
2998                Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
2999                Self::GoogleManagedCasCa => serializer.serialize_i32(2),
3000                Self::CustomerManagedCasCa => serializer.serialize_i32(3),
3001                Self::UnknownValue(u) => u.0.serialize(serializer),
3002            }
3003        }
3004    }
3005
3006    impl<'de> serde::de::Deserialize<'de> for CaMode {
3007        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3008        where
3009            D: serde::Deserializer<'de>,
3010        {
3011            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
3012                ".google.cloud.sql.v1.ConnectSettings.CaMode",
3013            ))
3014        }
3015    }
3016
3017    /// MdxProtocolSupport describes parts of the MDX protocol supported by this
3018    /// instance.
3019    ///
3020    /// # Working with unknown values
3021    ///
3022    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3023    /// additional enum variants at any time. Adding new variants is not considered
3024    /// a breaking change. Applications should write their code in anticipation of:
3025    ///
3026    /// - New values appearing in future releases of the client library, **and**
3027    /// - New values received dynamically, without application changes.
3028    ///
3029    /// Please consult the [Working with enums] section in the user guide for some
3030    /// guidelines.
3031    ///
3032    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3033    #[derive(Clone, Debug, PartialEq)]
3034    #[non_exhaustive]
3035    pub enum MdxProtocolSupport {
3036        /// Not specified.
3037        Unspecified,
3038        /// Client should send the client protocol type in the MDX request.
3039        ClientProtocolType,
3040        /// If set, the enum was initialized with an unknown value.
3041        ///
3042        /// Applications can examine the value using [MdxProtocolSupport::value] or
3043        /// [MdxProtocolSupport::name].
3044        UnknownValue(mdx_protocol_support::UnknownValue),
3045    }
3046
3047    #[doc(hidden)]
3048    pub mod mdx_protocol_support {
3049        #[allow(unused_imports)]
3050        use super::*;
3051        #[derive(Clone, Debug, PartialEq)]
3052        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3053    }
3054
3055    impl MdxProtocolSupport {
3056        /// Gets the enum value.
3057        ///
3058        /// Returns `None` if the enum contains an unknown value deserialized from
3059        /// the string representation of enums.
3060        pub fn value(&self) -> std::option::Option<i32> {
3061            match self {
3062                Self::Unspecified => std::option::Option::Some(0),
3063                Self::ClientProtocolType => std::option::Option::Some(1),
3064                Self::UnknownValue(u) => u.0.value(),
3065            }
3066        }
3067
3068        /// Gets the enum value as a string.
3069        ///
3070        /// Returns `None` if the enum contains an unknown value deserialized from
3071        /// the integer representation of enums.
3072        pub fn name(&self) -> std::option::Option<&str> {
3073            match self {
3074                Self::Unspecified => std::option::Option::Some("MDX_PROTOCOL_SUPPORT_UNSPECIFIED"),
3075                Self::ClientProtocolType => std::option::Option::Some("CLIENT_PROTOCOL_TYPE"),
3076                Self::UnknownValue(u) => u.0.name(),
3077            }
3078        }
3079    }
3080
3081    impl std::default::Default for MdxProtocolSupport {
3082        fn default() -> Self {
3083            use std::convert::From;
3084            Self::from(0)
3085        }
3086    }
3087
3088    impl std::fmt::Display for MdxProtocolSupport {
3089        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3090            wkt::internal::display_enum(f, self.name(), self.value())
3091        }
3092    }
3093
3094    impl std::convert::From<i32> for MdxProtocolSupport {
3095        fn from(value: i32) -> Self {
3096            match value {
3097                0 => Self::Unspecified,
3098                1 => Self::ClientProtocolType,
3099                _ => Self::UnknownValue(mdx_protocol_support::UnknownValue(
3100                    wkt::internal::UnknownEnumValue::Integer(value),
3101                )),
3102            }
3103        }
3104    }
3105
3106    impl std::convert::From<&str> for MdxProtocolSupport {
3107        fn from(value: &str) -> Self {
3108            use std::string::ToString;
3109            match value {
3110                "MDX_PROTOCOL_SUPPORT_UNSPECIFIED" => Self::Unspecified,
3111                "CLIENT_PROTOCOL_TYPE" => Self::ClientProtocolType,
3112                _ => Self::UnknownValue(mdx_protocol_support::UnknownValue(
3113                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3114                )),
3115            }
3116        }
3117    }
3118
3119    impl serde::ser::Serialize for MdxProtocolSupport {
3120        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3121        where
3122            S: serde::Serializer,
3123        {
3124            match self {
3125                Self::Unspecified => serializer.serialize_i32(0),
3126                Self::ClientProtocolType => serializer.serialize_i32(1),
3127                Self::UnknownValue(u) => u.0.serialize(serializer),
3128            }
3129        }
3130    }
3131
3132    impl<'de> serde::de::Deserialize<'de> for MdxProtocolSupport {
3133        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3134        where
3135            D: serde::Deserializer<'de>,
3136        {
3137            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MdxProtocolSupport>::new(
3138                ".google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport",
3139            ))
3140        }
3141    }
3142}
3143
3144/// Ephemeral certificate creation request.
3145#[derive(Clone, Default, PartialEq)]
3146#[non_exhaustive]
3147pub struct GenerateEphemeralCertRequest {
3148    /// Cloud SQL instance ID. This does not include the project ID.
3149    pub instance: std::string::String,
3150
3151    /// Project ID of the project that contains the instance.
3152    pub project: std::string::String,
3153
3154    /// PEM encoded public key to include in the signed certificate.
3155    pub public_key: std::string::String,
3156
3157    /// Optional. Access token to include in the signed certificate.
3158    pub access_token: std::string::String,
3159
3160    /// Optional. Optional snapshot read timestamp to trade freshness for
3161    /// performance.
3162    pub read_time: std::option::Option<wkt::Timestamp>,
3163
3164    /// Optional. If set, it will contain the cert valid duration.
3165    pub valid_duration: std::option::Option<wkt::Duration>,
3166
3167    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3168}
3169
3170impl GenerateEphemeralCertRequest {
3171    /// Creates a new default instance.
3172    pub fn new() -> Self {
3173        std::default::Default::default()
3174    }
3175
3176    /// Sets the value of [instance][crate::model::GenerateEphemeralCertRequest::instance].
3177    ///
3178    /// # Example
3179    /// ```ignore,no_run
3180    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3181    /// let x = GenerateEphemeralCertRequest::new().set_instance("example");
3182    /// ```
3183    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3184        self.instance = v.into();
3185        self
3186    }
3187
3188    /// Sets the value of [project][crate::model::GenerateEphemeralCertRequest::project].
3189    ///
3190    /// # Example
3191    /// ```ignore,no_run
3192    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3193    /// let x = GenerateEphemeralCertRequest::new().set_project("example");
3194    /// ```
3195    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3196        self.project = v.into();
3197        self
3198    }
3199
3200    /// Sets the value of [public_key][crate::model::GenerateEphemeralCertRequest::public_key].
3201    ///
3202    /// # Example
3203    /// ```ignore,no_run
3204    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3205    /// let x = GenerateEphemeralCertRequest::new().set_public_key("example");
3206    /// ```
3207    pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3208        self.public_key = v.into();
3209        self
3210    }
3211
3212    /// Sets the value of [access_token][crate::model::GenerateEphemeralCertRequest::access_token].
3213    ///
3214    /// # Example
3215    /// ```ignore,no_run
3216    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3217    /// let x = GenerateEphemeralCertRequest::new().set_access_token("example");
3218    /// ```
3219    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3220        self.access_token = v.into();
3221        self
3222    }
3223
3224    /// Sets the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
3225    ///
3226    /// # Example
3227    /// ```ignore,no_run
3228    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3229    /// use wkt::Timestamp;
3230    /// let x = GenerateEphemeralCertRequest::new().set_read_time(Timestamp::default()/* use setters */);
3231    /// ```
3232    pub fn set_read_time<T>(mut self, v: T) -> Self
3233    where
3234        T: std::convert::Into<wkt::Timestamp>,
3235    {
3236        self.read_time = std::option::Option::Some(v.into());
3237        self
3238    }
3239
3240    /// Sets or clears the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
3241    ///
3242    /// # Example
3243    /// ```ignore,no_run
3244    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3245    /// use wkt::Timestamp;
3246    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_read_time(Some(Timestamp::default()/* use setters */));
3247    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_read_time(None::<Timestamp>);
3248    /// ```
3249    pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
3250    where
3251        T: std::convert::Into<wkt::Timestamp>,
3252    {
3253        self.read_time = v.map(|x| x.into());
3254        self
3255    }
3256
3257    /// Sets the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
3258    ///
3259    /// # Example
3260    /// ```ignore,no_run
3261    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3262    /// use wkt::Duration;
3263    /// let x = GenerateEphemeralCertRequest::new().set_valid_duration(Duration::default()/* use setters */);
3264    /// ```
3265    pub fn set_valid_duration<T>(mut self, v: T) -> Self
3266    where
3267        T: std::convert::Into<wkt::Duration>,
3268    {
3269        self.valid_duration = std::option::Option::Some(v.into());
3270        self
3271    }
3272
3273    /// Sets or clears the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
3274    ///
3275    /// # Example
3276    /// ```ignore,no_run
3277    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3278    /// use wkt::Duration;
3279    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_valid_duration(Some(Duration::default()/* use setters */));
3280    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_valid_duration(None::<Duration>);
3281    /// ```
3282    pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
3283    where
3284        T: std::convert::Into<wkt::Duration>,
3285    {
3286        self.valid_duration = v.map(|x| x.into());
3287        self
3288    }
3289}
3290
3291impl wkt::message::Message for GenerateEphemeralCertRequest {
3292    fn typename() -> &'static str {
3293        "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertRequest"
3294    }
3295}
3296
3297/// Ephemeral certificate creation request.
3298#[derive(Clone, Default, PartialEq)]
3299#[non_exhaustive]
3300pub struct GenerateEphemeralCertResponse {
3301    /// Generated cert
3302    pub ephemeral_cert: std::option::Option<crate::model::SslCert>,
3303
3304    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3305}
3306
3307impl GenerateEphemeralCertResponse {
3308    /// Creates a new default instance.
3309    pub fn new() -> Self {
3310        std::default::Default::default()
3311    }
3312
3313    /// Sets the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
3314    ///
3315    /// # Example
3316    /// ```ignore,no_run
3317    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertResponse;
3318    /// use google_cloud_sql_v1::model::SslCert;
3319    /// let x = GenerateEphemeralCertResponse::new().set_ephemeral_cert(SslCert::default()/* use setters */);
3320    /// ```
3321    pub fn set_ephemeral_cert<T>(mut self, v: T) -> Self
3322    where
3323        T: std::convert::Into<crate::model::SslCert>,
3324    {
3325        self.ephemeral_cert = std::option::Option::Some(v.into());
3326        self
3327    }
3328
3329    /// Sets or clears the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
3330    ///
3331    /// # Example
3332    /// ```ignore,no_run
3333    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertResponse;
3334    /// use google_cloud_sql_v1::model::SslCert;
3335    /// let x = GenerateEphemeralCertResponse::new().set_or_clear_ephemeral_cert(Some(SslCert::default()/* use setters */));
3336    /// let x = GenerateEphemeralCertResponse::new().set_or_clear_ephemeral_cert(None::<SslCert>);
3337    /// ```
3338    pub fn set_or_clear_ephemeral_cert<T>(mut self, v: std::option::Option<T>) -> Self
3339    where
3340        T: std::convert::Into<crate::model::SslCert>,
3341    {
3342        self.ephemeral_cert = v.map(|x| x.into());
3343        self
3344    }
3345}
3346
3347impl wkt::message::Message for GenerateEphemeralCertResponse {
3348    fn typename() -> &'static str {
3349        "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertResponse"
3350    }
3351}
3352
3353/// Database delete request.
3354#[derive(Clone, Default, PartialEq)]
3355#[non_exhaustive]
3356pub struct SqlDatabasesDeleteRequest {
3357    /// Name of the database to be deleted in the instance.
3358    pub database: std::string::String,
3359
3360    /// Database instance ID. This does not include the project ID.
3361    pub instance: std::string::String,
3362
3363    /// Project ID of the project that contains the instance.
3364    pub project: std::string::String,
3365
3366    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3367}
3368
3369impl SqlDatabasesDeleteRequest {
3370    /// Creates a new default instance.
3371    pub fn new() -> Self {
3372        std::default::Default::default()
3373    }
3374
3375    /// Sets the value of [database][crate::model::SqlDatabasesDeleteRequest::database].
3376    ///
3377    /// # Example
3378    /// ```ignore,no_run
3379    /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3380    /// let x = SqlDatabasesDeleteRequest::new().set_database("example");
3381    /// ```
3382    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3383        self.database = v.into();
3384        self
3385    }
3386
3387    /// Sets the value of [instance][crate::model::SqlDatabasesDeleteRequest::instance].
3388    ///
3389    /// # Example
3390    /// ```ignore,no_run
3391    /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3392    /// let x = SqlDatabasesDeleteRequest::new().set_instance("example");
3393    /// ```
3394    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3395        self.instance = v.into();
3396        self
3397    }
3398
3399    /// Sets the value of [project][crate::model::SqlDatabasesDeleteRequest::project].
3400    ///
3401    /// # Example
3402    /// ```ignore,no_run
3403    /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3404    /// let x = SqlDatabasesDeleteRequest::new().set_project("example");
3405    /// ```
3406    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3407        self.project = v.into();
3408        self
3409    }
3410}
3411
3412impl wkt::message::Message for SqlDatabasesDeleteRequest {
3413    fn typename() -> &'static str {
3414        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesDeleteRequest"
3415    }
3416}
3417
3418/// Database get request.
3419#[derive(Clone, Default, PartialEq)]
3420#[non_exhaustive]
3421pub struct SqlDatabasesGetRequest {
3422    /// Name of the database in the instance.
3423    pub database: std::string::String,
3424
3425    /// Database instance ID. This does not include the project ID.
3426    pub instance: std::string::String,
3427
3428    /// Project ID of the project that contains the instance.
3429    pub project: std::string::String,
3430
3431    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3432}
3433
3434impl SqlDatabasesGetRequest {
3435    /// Creates a new default instance.
3436    pub fn new() -> Self {
3437        std::default::Default::default()
3438    }
3439
3440    /// Sets the value of [database][crate::model::SqlDatabasesGetRequest::database].
3441    ///
3442    /// # Example
3443    /// ```ignore,no_run
3444    /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3445    /// let x = SqlDatabasesGetRequest::new().set_database("example");
3446    /// ```
3447    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3448        self.database = v.into();
3449        self
3450    }
3451
3452    /// Sets the value of [instance][crate::model::SqlDatabasesGetRequest::instance].
3453    ///
3454    /// # Example
3455    /// ```ignore,no_run
3456    /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3457    /// let x = SqlDatabasesGetRequest::new().set_instance("example");
3458    /// ```
3459    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3460        self.instance = v.into();
3461        self
3462    }
3463
3464    /// Sets the value of [project][crate::model::SqlDatabasesGetRequest::project].
3465    ///
3466    /// # Example
3467    /// ```ignore,no_run
3468    /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3469    /// let x = SqlDatabasesGetRequest::new().set_project("example");
3470    /// ```
3471    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3472        self.project = v.into();
3473        self
3474    }
3475}
3476
3477impl wkt::message::Message for SqlDatabasesGetRequest {
3478    fn typename() -> &'static str {
3479        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesGetRequest"
3480    }
3481}
3482
3483/// Database insert request.
3484#[derive(Clone, Default, PartialEq)]
3485#[non_exhaustive]
3486pub struct SqlDatabasesInsertRequest {
3487    /// Database instance ID. This does not include the project ID.
3488    pub instance: std::string::String,
3489
3490    /// Project ID of the project that contains the instance.
3491    pub project: std::string::String,
3492
3493    #[allow(missing_docs)]
3494    pub body: std::option::Option<crate::model::Database>,
3495
3496    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3497}
3498
3499impl SqlDatabasesInsertRequest {
3500    /// Creates a new default instance.
3501    pub fn new() -> Self {
3502        std::default::Default::default()
3503    }
3504
3505    /// Sets the value of [instance][crate::model::SqlDatabasesInsertRequest::instance].
3506    ///
3507    /// # Example
3508    /// ```ignore,no_run
3509    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3510    /// let x = SqlDatabasesInsertRequest::new().set_instance("example");
3511    /// ```
3512    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3513        self.instance = v.into();
3514        self
3515    }
3516
3517    /// Sets the value of [project][crate::model::SqlDatabasesInsertRequest::project].
3518    ///
3519    /// # Example
3520    /// ```ignore,no_run
3521    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3522    /// let x = SqlDatabasesInsertRequest::new().set_project("example");
3523    /// ```
3524    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3525        self.project = v.into();
3526        self
3527    }
3528
3529    /// Sets the value of [body][crate::model::SqlDatabasesInsertRequest::body].
3530    ///
3531    /// # Example
3532    /// ```ignore,no_run
3533    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3534    /// use google_cloud_sql_v1::model::Database;
3535    /// let x = SqlDatabasesInsertRequest::new().set_body(Database::default()/* use setters */);
3536    /// ```
3537    pub fn set_body<T>(mut self, v: T) -> Self
3538    where
3539        T: std::convert::Into<crate::model::Database>,
3540    {
3541        self.body = std::option::Option::Some(v.into());
3542        self
3543    }
3544
3545    /// Sets or clears the value of [body][crate::model::SqlDatabasesInsertRequest::body].
3546    ///
3547    /// # Example
3548    /// ```ignore,no_run
3549    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3550    /// use google_cloud_sql_v1::model::Database;
3551    /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
3552    /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(None::<Database>);
3553    /// ```
3554    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3555    where
3556        T: std::convert::Into<crate::model::Database>,
3557    {
3558        self.body = v.map(|x| x.into());
3559        self
3560    }
3561}
3562
3563impl wkt::message::Message for SqlDatabasesInsertRequest {
3564    fn typename() -> &'static str {
3565        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesInsertRequest"
3566    }
3567}
3568
3569/// Database list request.
3570#[derive(Clone, Default, PartialEq)]
3571#[non_exhaustive]
3572pub struct SqlDatabasesListRequest {
3573    /// Cloud SQL instance ID. This does not include the project ID.
3574    pub instance: std::string::String,
3575
3576    /// Project ID of the project that contains the instance.
3577    pub project: std::string::String,
3578
3579    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3580}
3581
3582impl SqlDatabasesListRequest {
3583    /// Creates a new default instance.
3584    pub fn new() -> Self {
3585        std::default::Default::default()
3586    }
3587
3588    /// Sets the value of [instance][crate::model::SqlDatabasesListRequest::instance].
3589    ///
3590    /// # Example
3591    /// ```ignore,no_run
3592    /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
3593    /// let x = SqlDatabasesListRequest::new().set_instance("example");
3594    /// ```
3595    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3596        self.instance = v.into();
3597        self
3598    }
3599
3600    /// Sets the value of [project][crate::model::SqlDatabasesListRequest::project].
3601    ///
3602    /// # Example
3603    /// ```ignore,no_run
3604    /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
3605    /// let x = SqlDatabasesListRequest::new().set_project("example");
3606    /// ```
3607    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3608        self.project = v.into();
3609        self
3610    }
3611}
3612
3613impl wkt::message::Message for SqlDatabasesListRequest {
3614    fn typename() -> &'static str {
3615        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesListRequest"
3616    }
3617}
3618
3619/// Database update request.
3620#[derive(Clone, Default, PartialEq)]
3621#[non_exhaustive]
3622pub struct SqlDatabasesUpdateRequest {
3623    /// Name of the database to be updated in the instance.
3624    pub database: std::string::String,
3625
3626    /// Database instance ID. This does not include the project ID.
3627    pub instance: std::string::String,
3628
3629    /// Project ID of the project that contains the instance.
3630    pub project: std::string::String,
3631
3632    #[allow(missing_docs)]
3633    pub body: std::option::Option<crate::model::Database>,
3634
3635    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3636}
3637
3638impl SqlDatabasesUpdateRequest {
3639    /// Creates a new default instance.
3640    pub fn new() -> Self {
3641        std::default::Default::default()
3642    }
3643
3644    /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
3645    ///
3646    /// # Example
3647    /// ```ignore,no_run
3648    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3649    /// let x = SqlDatabasesUpdateRequest::new().set_database("example");
3650    /// ```
3651    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3652        self.database = v.into();
3653        self
3654    }
3655
3656    /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
3657    ///
3658    /// # Example
3659    /// ```ignore,no_run
3660    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3661    /// let x = SqlDatabasesUpdateRequest::new().set_instance("example");
3662    /// ```
3663    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3664        self.instance = v.into();
3665        self
3666    }
3667
3668    /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
3669    ///
3670    /// # Example
3671    /// ```ignore,no_run
3672    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3673    /// let x = SqlDatabasesUpdateRequest::new().set_project("example");
3674    /// ```
3675    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3676        self.project = v.into();
3677        self
3678    }
3679
3680    /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
3681    ///
3682    /// # Example
3683    /// ```ignore,no_run
3684    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3685    /// use google_cloud_sql_v1::model::Database;
3686    /// let x = SqlDatabasesUpdateRequest::new().set_body(Database::default()/* use setters */);
3687    /// ```
3688    pub fn set_body<T>(mut self, v: T) -> Self
3689    where
3690        T: std::convert::Into<crate::model::Database>,
3691    {
3692        self.body = std::option::Option::Some(v.into());
3693        self
3694    }
3695
3696    /// Sets or clears the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
3697    ///
3698    /// # Example
3699    /// ```ignore,no_run
3700    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3701    /// use google_cloud_sql_v1::model::Database;
3702    /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
3703    /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(None::<Database>);
3704    /// ```
3705    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3706    where
3707        T: std::convert::Into<crate::model::Database>,
3708    {
3709        self.body = v.map(|x| x.into());
3710        self
3711    }
3712}
3713
3714impl wkt::message::Message for SqlDatabasesUpdateRequest {
3715    fn typename() -> &'static str {
3716        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesUpdateRequest"
3717    }
3718}
3719
3720/// Database list response.
3721#[derive(Clone, Default, PartialEq)]
3722#[non_exhaustive]
3723pub struct DatabasesListResponse {
3724    /// This is always `sql#databasesList`.
3725    pub kind: std::string::String,
3726
3727    /// List of database resources in the instance.
3728    pub items: std::vec::Vec<crate::model::Database>,
3729
3730    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3731}
3732
3733impl DatabasesListResponse {
3734    /// Creates a new default instance.
3735    pub fn new() -> Self {
3736        std::default::Default::default()
3737    }
3738
3739    /// Sets the value of [kind][crate::model::DatabasesListResponse::kind].
3740    ///
3741    /// # Example
3742    /// ```ignore,no_run
3743    /// # use google_cloud_sql_v1::model::DatabasesListResponse;
3744    /// let x = DatabasesListResponse::new().set_kind("example");
3745    /// ```
3746    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3747        self.kind = v.into();
3748        self
3749    }
3750
3751    /// Sets the value of [items][crate::model::DatabasesListResponse::items].
3752    ///
3753    /// # Example
3754    /// ```ignore,no_run
3755    /// # use google_cloud_sql_v1::model::DatabasesListResponse;
3756    /// use google_cloud_sql_v1::model::Database;
3757    /// let x = DatabasesListResponse::new()
3758    ///     .set_items([
3759    ///         Database::default()/* use setters */,
3760    ///         Database::default()/* use (different) setters */,
3761    ///     ]);
3762    /// ```
3763    pub fn set_items<T, V>(mut self, v: T) -> Self
3764    where
3765        T: std::iter::IntoIterator<Item = V>,
3766        V: std::convert::Into<crate::model::Database>,
3767    {
3768        use std::iter::Iterator;
3769        self.items = v.into_iter().map(|i| i.into()).collect();
3770        self
3771    }
3772}
3773
3774impl wkt::message::Message for DatabasesListResponse {
3775    fn typename() -> &'static str {
3776        "type.googleapis.com/google.cloud.sql.v1.DatabasesListResponse"
3777    }
3778}
3779
3780/// Flags list request.
3781#[derive(Clone, Default, PartialEq)]
3782#[non_exhaustive]
3783pub struct SqlFlagsListRequest {
3784    /// Database type and version you want to retrieve flags for. By default, this
3785    /// method returns flags for all database types and versions.
3786    pub database_version: std::string::String,
3787
3788    /// Optional. Specify the scope of flags to be returned by SqlFlagsListService.
3789    /// Return list of database flags if unspecified.
3790    pub flag_scope: std::option::Option<crate::model::SqlFlagScope>,
3791
3792    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3793}
3794
3795impl SqlFlagsListRequest {
3796    /// Creates a new default instance.
3797    pub fn new() -> Self {
3798        std::default::Default::default()
3799    }
3800
3801    /// Sets the value of [database_version][crate::model::SqlFlagsListRequest::database_version].
3802    ///
3803    /// # Example
3804    /// ```ignore,no_run
3805    /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3806    /// let x = SqlFlagsListRequest::new().set_database_version("example");
3807    /// ```
3808    pub fn set_database_version<T: std::convert::Into<std::string::String>>(
3809        mut self,
3810        v: T,
3811    ) -> Self {
3812        self.database_version = v.into();
3813        self
3814    }
3815
3816    /// Sets the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
3817    ///
3818    /// # Example
3819    /// ```ignore,no_run
3820    /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3821    /// use google_cloud_sql_v1::model::SqlFlagScope;
3822    /// let x0 = SqlFlagsListRequest::new().set_flag_scope(SqlFlagScope::Database);
3823    /// let x1 = SqlFlagsListRequest::new().set_flag_scope(SqlFlagScope::ConnectionPool);
3824    /// ```
3825    pub fn set_flag_scope<T>(mut self, v: T) -> Self
3826    where
3827        T: std::convert::Into<crate::model::SqlFlagScope>,
3828    {
3829        self.flag_scope = std::option::Option::Some(v.into());
3830        self
3831    }
3832
3833    /// Sets or clears the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
3834    ///
3835    /// # Example
3836    /// ```ignore,no_run
3837    /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3838    /// use google_cloud_sql_v1::model::SqlFlagScope;
3839    /// let x0 = SqlFlagsListRequest::new().set_or_clear_flag_scope(Some(SqlFlagScope::Database));
3840    /// let x1 = SqlFlagsListRequest::new().set_or_clear_flag_scope(Some(SqlFlagScope::ConnectionPool));
3841    /// let x_none = SqlFlagsListRequest::new().set_or_clear_flag_scope(None::<SqlFlagScope>);
3842    /// ```
3843    pub fn set_or_clear_flag_scope<T>(mut self, v: std::option::Option<T>) -> Self
3844    where
3845        T: std::convert::Into<crate::model::SqlFlagScope>,
3846    {
3847        self.flag_scope = v.map(|x| x.into());
3848        self
3849    }
3850}
3851
3852impl wkt::message::Message for SqlFlagsListRequest {
3853    fn typename() -> &'static str {
3854        "type.googleapis.com/google.cloud.sql.v1.SqlFlagsListRequest"
3855    }
3856}
3857
3858/// Flags list response.
3859#[derive(Clone, Default, PartialEq)]
3860#[non_exhaustive]
3861pub struct FlagsListResponse {
3862    /// This is always `sql#flagsList`.
3863    pub kind: std::string::String,
3864
3865    /// List of flags.
3866    pub items: std::vec::Vec<crate::model::Flag>,
3867
3868    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3869}
3870
3871impl FlagsListResponse {
3872    /// Creates a new default instance.
3873    pub fn new() -> Self {
3874        std::default::Default::default()
3875    }
3876
3877    /// Sets the value of [kind][crate::model::FlagsListResponse::kind].
3878    ///
3879    /// # Example
3880    /// ```ignore,no_run
3881    /// # use google_cloud_sql_v1::model::FlagsListResponse;
3882    /// let x = FlagsListResponse::new().set_kind("example");
3883    /// ```
3884    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3885        self.kind = v.into();
3886        self
3887    }
3888
3889    /// Sets the value of [items][crate::model::FlagsListResponse::items].
3890    ///
3891    /// # Example
3892    /// ```ignore,no_run
3893    /// # use google_cloud_sql_v1::model::FlagsListResponse;
3894    /// use google_cloud_sql_v1::model::Flag;
3895    /// let x = FlagsListResponse::new()
3896    ///     .set_items([
3897    ///         Flag::default()/* use setters */,
3898    ///         Flag::default()/* use (different) setters */,
3899    ///     ]);
3900    /// ```
3901    pub fn set_items<T, V>(mut self, v: T) -> Self
3902    where
3903        T: std::iter::IntoIterator<Item = V>,
3904        V: std::convert::Into<crate::model::Flag>,
3905    {
3906        use std::iter::Iterator;
3907        self.items = v.into_iter().map(|i| i.into()).collect();
3908        self
3909    }
3910}
3911
3912impl wkt::message::Message for FlagsListResponse {
3913    fn typename() -> &'static str {
3914        "type.googleapis.com/google.cloud.sql.v1.FlagsListResponse"
3915    }
3916}
3917
3918/// A flag resource.
3919#[derive(Clone, Default, PartialEq)]
3920#[non_exhaustive]
3921pub struct Flag {
3922    /// This is the name of the flag. Flag names always use underscores, not
3923    /// hyphens, for example: `max_allowed_packet`
3924    pub name: std::string::String,
3925
3926    /// The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
3927    /// `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
3928    /// value, such as `skip_grant_tables`.
3929    pub r#type: crate::model::SqlFlagType,
3930
3931    /// The database version this flag applies to. Can be
3932    /// MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
3933    /// or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
3934    /// `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
3935    /// `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
3936    /// `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
3937    /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
3938    /// `SQLSERVER_2019_WEB`.
3939    /// See [the complete
3940    /// list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
3941    pub applies_to: std::vec::Vec<crate::model::SqlDatabaseVersion>,
3942
3943    /// For `STRING` flags, a list of strings that the value can be set to.
3944    pub allowed_string_values: std::vec::Vec<std::string::String>,
3945
3946    /// For `INTEGER` flags, the minimum allowed value.
3947    pub min_value: std::option::Option<wkt::Int64Value>,
3948
3949    /// For `INTEGER` flags, the maximum allowed value.
3950    pub max_value: std::option::Option<wkt::Int64Value>,
3951
3952    /// Indicates whether changing this flag will trigger a database restart. Only
3953    /// applicable to Second Generation instances.
3954    pub requires_restart: std::option::Option<wkt::BoolValue>,
3955
3956    /// This is always `sql#flag`.
3957    pub kind: std::string::String,
3958
3959    /// Whether or not the flag is considered in beta.
3960    pub in_beta: std::option::Option<wkt::BoolValue>,
3961
3962    /// Use this field if only certain integers are accepted. Can be combined
3963    /// with min_value and max_value to add additional values.
3964    pub allowed_int_values: std::vec::Vec<i64>,
3965
3966    /// Scope of flag.
3967    pub flag_scope: crate::model::SqlFlagScope,
3968
3969    /// Recommended flag value for UI display.
3970    pub recommended_value: std::option::Option<crate::model::flag::RecommendedValue>,
3971
3972    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3973}
3974
3975impl Flag {
3976    /// Creates a new default instance.
3977    pub fn new() -> Self {
3978        std::default::Default::default()
3979    }
3980
3981    /// Sets the value of [name][crate::model::Flag::name].
3982    ///
3983    /// # Example
3984    /// ```ignore,no_run
3985    /// # use google_cloud_sql_v1::model::Flag;
3986    /// let x = Flag::new().set_name("example");
3987    /// ```
3988    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3989        self.name = v.into();
3990        self
3991    }
3992
3993    /// Sets the value of [r#type][crate::model::Flag::type].
3994    ///
3995    /// # Example
3996    /// ```ignore,no_run
3997    /// # use google_cloud_sql_v1::model::Flag;
3998    /// use google_cloud_sql_v1::model::SqlFlagType;
3999    /// let x0 = Flag::new().set_type(SqlFlagType::Boolean);
4000    /// let x1 = Flag::new().set_type(SqlFlagType::String);
4001    /// let x2 = Flag::new().set_type(SqlFlagType::Integer);
4002    /// ```
4003    pub fn set_type<T: std::convert::Into<crate::model::SqlFlagType>>(mut self, v: T) -> Self {
4004        self.r#type = v.into();
4005        self
4006    }
4007
4008    /// Sets the value of [applies_to][crate::model::Flag::applies_to].
4009    ///
4010    /// # Example
4011    /// ```ignore,no_run
4012    /// # use google_cloud_sql_v1::model::Flag;
4013    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
4014    /// let x = Flag::new().set_applies_to([
4015    ///     SqlDatabaseVersion::Mysql56,
4016    ///     SqlDatabaseVersion::Mysql57,
4017    ///     SqlDatabaseVersion::Mysql80,
4018    /// ]);
4019    /// ```
4020    pub fn set_applies_to<T, V>(mut self, v: T) -> Self
4021    where
4022        T: std::iter::IntoIterator<Item = V>,
4023        V: std::convert::Into<crate::model::SqlDatabaseVersion>,
4024    {
4025        use std::iter::Iterator;
4026        self.applies_to = v.into_iter().map(|i| i.into()).collect();
4027        self
4028    }
4029
4030    /// Sets the value of [allowed_string_values][crate::model::Flag::allowed_string_values].
4031    ///
4032    /// # Example
4033    /// ```ignore,no_run
4034    /// # use google_cloud_sql_v1::model::Flag;
4035    /// let x = Flag::new().set_allowed_string_values(["a", "b", "c"]);
4036    /// ```
4037    pub fn set_allowed_string_values<T, V>(mut self, v: T) -> Self
4038    where
4039        T: std::iter::IntoIterator<Item = V>,
4040        V: std::convert::Into<std::string::String>,
4041    {
4042        use std::iter::Iterator;
4043        self.allowed_string_values = v.into_iter().map(|i| i.into()).collect();
4044        self
4045    }
4046
4047    /// Sets the value of [min_value][crate::model::Flag::min_value].
4048    ///
4049    /// # Example
4050    /// ```ignore,no_run
4051    /// # use google_cloud_sql_v1::model::Flag;
4052    /// use wkt::Int64Value;
4053    /// let x = Flag::new().set_min_value(Int64Value::default()/* use setters */);
4054    /// ```
4055    pub fn set_min_value<T>(mut self, v: T) -> Self
4056    where
4057        T: std::convert::Into<wkt::Int64Value>,
4058    {
4059        self.min_value = std::option::Option::Some(v.into());
4060        self
4061    }
4062
4063    /// Sets or clears the value of [min_value][crate::model::Flag::min_value].
4064    ///
4065    /// # Example
4066    /// ```ignore,no_run
4067    /// # use google_cloud_sql_v1::model::Flag;
4068    /// use wkt::Int64Value;
4069    /// let x = Flag::new().set_or_clear_min_value(Some(Int64Value::default()/* use setters */));
4070    /// let x = Flag::new().set_or_clear_min_value(None::<Int64Value>);
4071    /// ```
4072    pub fn set_or_clear_min_value<T>(mut self, v: std::option::Option<T>) -> Self
4073    where
4074        T: std::convert::Into<wkt::Int64Value>,
4075    {
4076        self.min_value = v.map(|x| x.into());
4077        self
4078    }
4079
4080    /// Sets the value of [max_value][crate::model::Flag::max_value].
4081    ///
4082    /// # Example
4083    /// ```ignore,no_run
4084    /// # use google_cloud_sql_v1::model::Flag;
4085    /// use wkt::Int64Value;
4086    /// let x = Flag::new().set_max_value(Int64Value::default()/* use setters */);
4087    /// ```
4088    pub fn set_max_value<T>(mut self, v: T) -> Self
4089    where
4090        T: std::convert::Into<wkt::Int64Value>,
4091    {
4092        self.max_value = std::option::Option::Some(v.into());
4093        self
4094    }
4095
4096    /// Sets or clears the value of [max_value][crate::model::Flag::max_value].
4097    ///
4098    /// # Example
4099    /// ```ignore,no_run
4100    /// # use google_cloud_sql_v1::model::Flag;
4101    /// use wkt::Int64Value;
4102    /// let x = Flag::new().set_or_clear_max_value(Some(Int64Value::default()/* use setters */));
4103    /// let x = Flag::new().set_or_clear_max_value(None::<Int64Value>);
4104    /// ```
4105    pub fn set_or_clear_max_value<T>(mut self, v: std::option::Option<T>) -> Self
4106    where
4107        T: std::convert::Into<wkt::Int64Value>,
4108    {
4109        self.max_value = v.map(|x| x.into());
4110        self
4111    }
4112
4113    /// Sets the value of [requires_restart][crate::model::Flag::requires_restart].
4114    ///
4115    /// # Example
4116    /// ```ignore,no_run
4117    /// # use google_cloud_sql_v1::model::Flag;
4118    /// use wkt::BoolValue;
4119    /// let x = Flag::new().set_requires_restart(BoolValue::default()/* use setters */);
4120    /// ```
4121    pub fn set_requires_restart<T>(mut self, v: T) -> Self
4122    where
4123        T: std::convert::Into<wkt::BoolValue>,
4124    {
4125        self.requires_restart = std::option::Option::Some(v.into());
4126        self
4127    }
4128
4129    /// Sets or clears the value of [requires_restart][crate::model::Flag::requires_restart].
4130    ///
4131    /// # Example
4132    /// ```ignore,no_run
4133    /// # use google_cloud_sql_v1::model::Flag;
4134    /// use wkt::BoolValue;
4135    /// let x = Flag::new().set_or_clear_requires_restart(Some(BoolValue::default()/* use setters */));
4136    /// let x = Flag::new().set_or_clear_requires_restart(None::<BoolValue>);
4137    /// ```
4138    pub fn set_or_clear_requires_restart<T>(mut self, v: std::option::Option<T>) -> Self
4139    where
4140        T: std::convert::Into<wkt::BoolValue>,
4141    {
4142        self.requires_restart = v.map(|x| x.into());
4143        self
4144    }
4145
4146    /// Sets the value of [kind][crate::model::Flag::kind].
4147    ///
4148    /// # Example
4149    /// ```ignore,no_run
4150    /// # use google_cloud_sql_v1::model::Flag;
4151    /// let x = Flag::new().set_kind("example");
4152    /// ```
4153    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4154        self.kind = v.into();
4155        self
4156    }
4157
4158    /// Sets the value of [in_beta][crate::model::Flag::in_beta].
4159    ///
4160    /// # Example
4161    /// ```ignore,no_run
4162    /// # use google_cloud_sql_v1::model::Flag;
4163    /// use wkt::BoolValue;
4164    /// let x = Flag::new().set_in_beta(BoolValue::default()/* use setters */);
4165    /// ```
4166    pub fn set_in_beta<T>(mut self, v: T) -> Self
4167    where
4168        T: std::convert::Into<wkt::BoolValue>,
4169    {
4170        self.in_beta = std::option::Option::Some(v.into());
4171        self
4172    }
4173
4174    /// Sets or clears the value of [in_beta][crate::model::Flag::in_beta].
4175    ///
4176    /// # Example
4177    /// ```ignore,no_run
4178    /// # use google_cloud_sql_v1::model::Flag;
4179    /// use wkt::BoolValue;
4180    /// let x = Flag::new().set_or_clear_in_beta(Some(BoolValue::default()/* use setters */));
4181    /// let x = Flag::new().set_or_clear_in_beta(None::<BoolValue>);
4182    /// ```
4183    pub fn set_or_clear_in_beta<T>(mut self, v: std::option::Option<T>) -> Self
4184    where
4185        T: std::convert::Into<wkt::BoolValue>,
4186    {
4187        self.in_beta = v.map(|x| x.into());
4188        self
4189    }
4190
4191    /// Sets the value of [allowed_int_values][crate::model::Flag::allowed_int_values].
4192    ///
4193    /// # Example
4194    /// ```ignore,no_run
4195    /// # use google_cloud_sql_v1::model::Flag;
4196    /// let x = Flag::new().set_allowed_int_values([1, 2, 3]);
4197    /// ```
4198    pub fn set_allowed_int_values<T, V>(mut self, v: T) -> Self
4199    where
4200        T: std::iter::IntoIterator<Item = V>,
4201        V: std::convert::Into<i64>,
4202    {
4203        use std::iter::Iterator;
4204        self.allowed_int_values = v.into_iter().map(|i| i.into()).collect();
4205        self
4206    }
4207
4208    /// Sets the value of [flag_scope][crate::model::Flag::flag_scope].
4209    ///
4210    /// # Example
4211    /// ```ignore,no_run
4212    /// # use google_cloud_sql_v1::model::Flag;
4213    /// use google_cloud_sql_v1::model::SqlFlagScope;
4214    /// let x0 = Flag::new().set_flag_scope(SqlFlagScope::Database);
4215    /// let x1 = Flag::new().set_flag_scope(SqlFlagScope::ConnectionPool);
4216    /// ```
4217    pub fn set_flag_scope<T: std::convert::Into<crate::model::SqlFlagScope>>(
4218        mut self,
4219        v: T,
4220    ) -> Self {
4221        self.flag_scope = v.into();
4222        self
4223    }
4224
4225    /// Sets the value of [recommended_value][crate::model::Flag::recommended_value].
4226    ///
4227    /// Note that all the setters affecting `recommended_value` are mutually
4228    /// exclusive.
4229    ///
4230    /// # Example
4231    /// ```ignore,no_run
4232    /// # use google_cloud_sql_v1::model::Flag;
4233    /// use google_cloud_sql_v1::model::flag::RecommendedValue;
4234    /// let x = Flag::new().set_recommended_value(Some(RecommendedValue::RecommendedStringValue("example".to_string())));
4235    /// ```
4236    pub fn set_recommended_value<
4237        T: std::convert::Into<std::option::Option<crate::model::flag::RecommendedValue>>,
4238    >(
4239        mut self,
4240        v: T,
4241    ) -> Self {
4242        self.recommended_value = v.into();
4243        self
4244    }
4245
4246    /// The value of [recommended_value][crate::model::Flag::recommended_value]
4247    /// if it holds a `RecommendedStringValue`, `None` if the field is not set or
4248    /// holds a different branch.
4249    pub fn recommended_string_value(&self) -> std::option::Option<&std::string::String> {
4250        #[allow(unreachable_patterns)]
4251        self.recommended_value.as_ref().and_then(|v| match v {
4252            crate::model::flag::RecommendedValue::RecommendedStringValue(v) => {
4253                std::option::Option::Some(v)
4254            }
4255            _ => std::option::Option::None,
4256        })
4257    }
4258
4259    /// Sets the value of [recommended_value][crate::model::Flag::recommended_value]
4260    /// to hold a `RecommendedStringValue`.
4261    ///
4262    /// Note that all the setters affecting `recommended_value` are
4263    /// mutually exclusive.
4264    ///
4265    /// # Example
4266    /// ```ignore,no_run
4267    /// # use google_cloud_sql_v1::model::Flag;
4268    /// let x = Flag::new().set_recommended_string_value("example");
4269    /// assert!(x.recommended_string_value().is_some());
4270    /// assert!(x.recommended_int_value().is_none());
4271    /// ```
4272    pub fn set_recommended_string_value<T: std::convert::Into<std::string::String>>(
4273        mut self,
4274        v: T,
4275    ) -> Self {
4276        self.recommended_value = std::option::Option::Some(
4277            crate::model::flag::RecommendedValue::RecommendedStringValue(v.into()),
4278        );
4279        self
4280    }
4281
4282    /// The value of [recommended_value][crate::model::Flag::recommended_value]
4283    /// if it holds a `RecommendedIntValue`, `None` if the field is not set or
4284    /// holds a different branch.
4285    pub fn recommended_int_value(&self) -> std::option::Option<&std::boxed::Box<wkt::Int64Value>> {
4286        #[allow(unreachable_patterns)]
4287        self.recommended_value.as_ref().and_then(|v| match v {
4288            crate::model::flag::RecommendedValue::RecommendedIntValue(v) => {
4289                std::option::Option::Some(v)
4290            }
4291            _ => std::option::Option::None,
4292        })
4293    }
4294
4295    /// Sets the value of [recommended_value][crate::model::Flag::recommended_value]
4296    /// to hold a `RecommendedIntValue`.
4297    ///
4298    /// Note that all the setters affecting `recommended_value` are
4299    /// mutually exclusive.
4300    ///
4301    /// # Example
4302    /// ```ignore,no_run
4303    /// # use google_cloud_sql_v1::model::Flag;
4304    /// use wkt::Int64Value;
4305    /// let x = Flag::new().set_recommended_int_value(Int64Value::default()/* use setters */);
4306    /// assert!(x.recommended_int_value().is_some());
4307    /// assert!(x.recommended_string_value().is_none());
4308    /// ```
4309    pub fn set_recommended_int_value<T: std::convert::Into<std::boxed::Box<wkt::Int64Value>>>(
4310        mut self,
4311        v: T,
4312    ) -> Self {
4313        self.recommended_value = std::option::Option::Some(
4314            crate::model::flag::RecommendedValue::RecommendedIntValue(v.into()),
4315        );
4316        self
4317    }
4318}
4319
4320impl wkt::message::Message for Flag {
4321    fn typename() -> &'static str {
4322        "type.googleapis.com/google.cloud.sql.v1.Flag"
4323    }
4324}
4325
4326/// Defines additional types related to [Flag].
4327pub mod flag {
4328    #[allow(unused_imports)]
4329    use super::*;
4330
4331    /// Recommended flag value for UI display.
4332    #[derive(Clone, Debug, PartialEq)]
4333    #[non_exhaustive]
4334    pub enum RecommendedValue {
4335        /// Recommended string value in string format for UI display.
4336        RecommendedStringValue(std::string::String),
4337        /// Recommended int value in integer format for UI display.
4338        RecommendedIntValue(std::boxed::Box<wkt::Int64Value>),
4339    }
4340}
4341
4342/// Instance add server CA request.
4343#[derive(Clone, Default, PartialEq)]
4344#[non_exhaustive]
4345pub struct SqlInstancesAddServerCaRequest {
4346    /// Cloud SQL instance ID. This does not include the project ID.
4347    pub instance: std::string::String,
4348
4349    /// Project ID of the project that contains the instance.
4350    pub project: std::string::String,
4351
4352    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4353}
4354
4355impl SqlInstancesAddServerCaRequest {
4356    /// Creates a new default instance.
4357    pub fn new() -> Self {
4358        std::default::Default::default()
4359    }
4360
4361    /// Sets the value of [instance][crate::model::SqlInstancesAddServerCaRequest::instance].
4362    ///
4363    /// # Example
4364    /// ```ignore,no_run
4365    /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
4366    /// let x = SqlInstancesAddServerCaRequest::new().set_instance("example");
4367    /// ```
4368    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4369        self.instance = v.into();
4370        self
4371    }
4372
4373    /// Sets the value of [project][crate::model::SqlInstancesAddServerCaRequest::project].
4374    ///
4375    /// # Example
4376    /// ```ignore,no_run
4377    /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
4378    /// let x = SqlInstancesAddServerCaRequest::new().set_project("example");
4379    /// ```
4380    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4381        self.project = v.into();
4382        self
4383    }
4384}
4385
4386impl wkt::message::Message for SqlInstancesAddServerCaRequest {
4387    fn typename() -> &'static str {
4388        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCaRequest"
4389    }
4390}
4391
4392/// Instance add server certificate request.
4393#[derive(Clone, Default, PartialEq)]
4394#[non_exhaustive]
4395pub struct SqlInstancesAddServerCertificateRequest {
4396    /// Cloud SQL instance ID. This does not include the project ID.
4397    pub instance: std::string::String,
4398
4399    /// Project ID of the project that contains the instance.
4400    pub project: std::string::String,
4401
4402    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4403}
4404
4405impl SqlInstancesAddServerCertificateRequest {
4406    /// Creates a new default instance.
4407    pub fn new() -> Self {
4408        std::default::Default::default()
4409    }
4410
4411    /// Sets the value of [instance][crate::model::SqlInstancesAddServerCertificateRequest::instance].
4412    ///
4413    /// # Example
4414    /// ```ignore,no_run
4415    /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCertificateRequest;
4416    /// let x = SqlInstancesAddServerCertificateRequest::new().set_instance("example");
4417    /// ```
4418    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4419        self.instance = v.into();
4420        self
4421    }
4422
4423    /// Sets the value of [project][crate::model::SqlInstancesAddServerCertificateRequest::project].
4424    ///
4425    /// # Example
4426    /// ```ignore,no_run
4427    /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCertificateRequest;
4428    /// let x = SqlInstancesAddServerCertificateRequest::new().set_project("example");
4429    /// ```
4430    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4431        self.project = v.into();
4432        self
4433    }
4434}
4435
4436impl wkt::message::Message for SqlInstancesAddServerCertificateRequest {
4437    fn typename() -> &'static str {
4438        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest"
4439    }
4440}
4441
4442/// Instance add Entra ID certificate request.
4443#[derive(Clone, Default, PartialEq)]
4444#[non_exhaustive]
4445pub struct SqlInstancesAddEntraIdCertificateRequest {
4446    /// Required. Cloud SQL instance ID. This does not include the project ID.
4447    pub instance: std::string::String,
4448
4449    /// Required. Project ID of the project that contains the instance.
4450    pub project: std::string::String,
4451
4452    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4453}
4454
4455impl SqlInstancesAddEntraIdCertificateRequest {
4456    /// Creates a new default instance.
4457    pub fn new() -> Self {
4458        std::default::Default::default()
4459    }
4460
4461    /// Sets the value of [instance][crate::model::SqlInstancesAddEntraIdCertificateRequest::instance].
4462    ///
4463    /// # Example
4464    /// ```ignore,no_run
4465    /// # use google_cloud_sql_v1::model::SqlInstancesAddEntraIdCertificateRequest;
4466    /// let x = SqlInstancesAddEntraIdCertificateRequest::new().set_instance("example");
4467    /// ```
4468    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4469        self.instance = v.into();
4470        self
4471    }
4472
4473    /// Sets the value of [project][crate::model::SqlInstancesAddEntraIdCertificateRequest::project].
4474    ///
4475    /// # Example
4476    /// ```ignore,no_run
4477    /// # use google_cloud_sql_v1::model::SqlInstancesAddEntraIdCertificateRequest;
4478    /// let x = SqlInstancesAddEntraIdCertificateRequest::new().set_project("example");
4479    /// ```
4480    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4481        self.project = v.into();
4482        self
4483    }
4484}
4485
4486impl wkt::message::Message for SqlInstancesAddEntraIdCertificateRequest {
4487    fn typename() -> &'static str {
4488        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest"
4489    }
4490}
4491
4492/// Instance clone request.
4493#[derive(Clone, Default, PartialEq)]
4494#[non_exhaustive]
4495pub struct SqlInstancesCloneRequest {
4496    /// Required. The ID of the Cloud SQL instance to be cloned (source). This does
4497    /// not include the project ID.
4498    pub instance: std::string::String,
4499
4500    /// Required. Project ID of the source as well as the clone Cloud SQL instance.
4501    pub project: std::string::String,
4502
4503    #[allow(missing_docs)]
4504    pub body: std::option::Option<crate::model::InstancesCloneRequest>,
4505
4506    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4507}
4508
4509impl SqlInstancesCloneRequest {
4510    /// Creates a new default instance.
4511    pub fn new() -> Self {
4512        std::default::Default::default()
4513    }
4514
4515    /// Sets the value of [instance][crate::model::SqlInstancesCloneRequest::instance].
4516    ///
4517    /// # Example
4518    /// ```ignore,no_run
4519    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4520    /// let x = SqlInstancesCloneRequest::new().set_instance("example");
4521    /// ```
4522    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4523        self.instance = v.into();
4524        self
4525    }
4526
4527    /// Sets the value of [project][crate::model::SqlInstancesCloneRequest::project].
4528    ///
4529    /// # Example
4530    /// ```ignore,no_run
4531    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4532    /// let x = SqlInstancesCloneRequest::new().set_project("example");
4533    /// ```
4534    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4535        self.project = v.into();
4536        self
4537    }
4538
4539    /// Sets the value of [body][crate::model::SqlInstancesCloneRequest::body].
4540    ///
4541    /// # Example
4542    /// ```ignore,no_run
4543    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4544    /// use google_cloud_sql_v1::model::InstancesCloneRequest;
4545    /// let x = SqlInstancesCloneRequest::new().set_body(InstancesCloneRequest::default()/* use setters */);
4546    /// ```
4547    pub fn set_body<T>(mut self, v: T) -> Self
4548    where
4549        T: std::convert::Into<crate::model::InstancesCloneRequest>,
4550    {
4551        self.body = std::option::Option::Some(v.into());
4552        self
4553    }
4554
4555    /// Sets or clears the value of [body][crate::model::SqlInstancesCloneRequest::body].
4556    ///
4557    /// # Example
4558    /// ```ignore,no_run
4559    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4560    /// use google_cloud_sql_v1::model::InstancesCloneRequest;
4561    /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(Some(InstancesCloneRequest::default()/* use setters */));
4562    /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(None::<InstancesCloneRequest>);
4563    /// ```
4564    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4565    where
4566        T: std::convert::Into<crate::model::InstancesCloneRequest>,
4567    {
4568        self.body = v.map(|x| x.into());
4569        self
4570    }
4571}
4572
4573impl wkt::message::Message for SqlInstancesCloneRequest {
4574    fn typename() -> &'static str {
4575        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCloneRequest"
4576    }
4577}
4578
4579/// Instance delete request.
4580#[derive(Clone, Default, PartialEq)]
4581#[non_exhaustive]
4582pub struct SqlInstancesDeleteRequest {
4583    /// Cloud SQL instance ID. This does not include the project ID.
4584    pub instance: std::string::String,
4585
4586    /// Project ID of the project that contains the instance to be deleted.
4587    pub project: std::string::String,
4588
4589    /// Flag to opt-in for final backup. By default, it is turned off.
4590    pub enable_final_backup: std::option::Option<bool>,
4591
4592    /// Optional. The description of the final backup.
4593    pub final_backup_description: std::string::String,
4594
4595    #[allow(missing_docs)]
4596    pub expiration: std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
4597
4598    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4599}
4600
4601impl SqlInstancesDeleteRequest {
4602    /// Creates a new default instance.
4603    pub fn new() -> Self {
4604        std::default::Default::default()
4605    }
4606
4607    /// Sets the value of [instance][crate::model::SqlInstancesDeleteRequest::instance].
4608    ///
4609    /// # Example
4610    /// ```ignore,no_run
4611    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4612    /// let x = SqlInstancesDeleteRequest::new().set_instance("example");
4613    /// ```
4614    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4615        self.instance = v.into();
4616        self
4617    }
4618
4619    /// Sets the value of [project][crate::model::SqlInstancesDeleteRequest::project].
4620    ///
4621    /// # Example
4622    /// ```ignore,no_run
4623    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4624    /// let x = SqlInstancesDeleteRequest::new().set_project("example");
4625    /// ```
4626    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4627        self.project = v.into();
4628        self
4629    }
4630
4631    /// Sets the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
4632    ///
4633    /// # Example
4634    /// ```ignore,no_run
4635    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4636    /// let x = SqlInstancesDeleteRequest::new().set_enable_final_backup(true);
4637    /// ```
4638    pub fn set_enable_final_backup<T>(mut self, v: T) -> Self
4639    where
4640        T: std::convert::Into<bool>,
4641    {
4642        self.enable_final_backup = std::option::Option::Some(v.into());
4643        self
4644    }
4645
4646    /// Sets or clears the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
4647    ///
4648    /// # Example
4649    /// ```ignore,no_run
4650    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4651    /// let x = SqlInstancesDeleteRequest::new().set_or_clear_enable_final_backup(Some(false));
4652    /// let x = SqlInstancesDeleteRequest::new().set_or_clear_enable_final_backup(None::<bool>);
4653    /// ```
4654    pub fn set_or_clear_enable_final_backup<T>(mut self, v: std::option::Option<T>) -> Self
4655    where
4656        T: std::convert::Into<bool>,
4657    {
4658        self.enable_final_backup = v.map(|x| x.into());
4659        self
4660    }
4661
4662    /// Sets the value of [final_backup_description][crate::model::SqlInstancesDeleteRequest::final_backup_description].
4663    ///
4664    /// # Example
4665    /// ```ignore,no_run
4666    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4667    /// let x = SqlInstancesDeleteRequest::new().set_final_backup_description("example");
4668    /// ```
4669    pub fn set_final_backup_description<T: std::convert::Into<std::string::String>>(
4670        mut self,
4671        v: T,
4672    ) -> Self {
4673        self.final_backup_description = v.into();
4674        self
4675    }
4676
4677    /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration].
4678    ///
4679    /// Note that all the setters affecting `expiration` are mutually
4680    /// exclusive.
4681    ///
4682    /// # Example
4683    /// ```ignore,no_run
4684    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4685    /// use google_cloud_sql_v1::model::sql_instances_delete_request::Expiration;
4686    /// let x = SqlInstancesDeleteRequest::new().set_expiration(Some(Expiration::FinalBackupTtlDays(42)));
4687    /// ```
4688    pub fn set_expiration<
4689        T: std::convert::Into<
4690                std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
4691            >,
4692    >(
4693        mut self,
4694        v: T,
4695    ) -> Self {
4696        self.expiration = v.into();
4697        self
4698    }
4699
4700    /// The value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4701    /// if it holds a `FinalBackupTtlDays`, `None` if the field is not set or
4702    /// holds a different branch.
4703    pub fn final_backup_ttl_days(&self) -> std::option::Option<&i64> {
4704        #[allow(unreachable_patterns)]
4705        self.expiration.as_ref().and_then(|v| match v {
4706            crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v) => {
4707                std::option::Option::Some(v)
4708            }
4709            _ => std::option::Option::None,
4710        })
4711    }
4712
4713    /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4714    /// to hold a `FinalBackupTtlDays`.
4715    ///
4716    /// Note that all the setters affecting `expiration` are
4717    /// mutually exclusive.
4718    ///
4719    /// # Example
4720    /// ```ignore,no_run
4721    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4722    /// let x = SqlInstancesDeleteRequest::new().set_final_backup_ttl_days(42);
4723    /// assert!(x.final_backup_ttl_days().is_some());
4724    /// assert!(x.final_backup_expiry_time().is_none());
4725    /// ```
4726    pub fn set_final_backup_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4727        self.expiration = std::option::Option::Some(
4728            crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v.into()),
4729        );
4730        self
4731    }
4732
4733    /// The value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4734    /// if it holds a `FinalBackupExpiryTime`, `None` if the field is not set or
4735    /// holds a different branch.
4736    pub fn final_backup_expiry_time(
4737        &self,
4738    ) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
4739        #[allow(unreachable_patterns)]
4740        self.expiration.as_ref().and_then(|v| match v {
4741            crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v) => {
4742                std::option::Option::Some(v)
4743            }
4744            _ => std::option::Option::None,
4745        })
4746    }
4747
4748    /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4749    /// to hold a `FinalBackupExpiryTime`.
4750    ///
4751    /// Note that all the setters affecting `expiration` are
4752    /// mutually exclusive.
4753    ///
4754    /// # Example
4755    /// ```ignore,no_run
4756    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4757    /// use wkt::Timestamp;
4758    /// let x = SqlInstancesDeleteRequest::new().set_final_backup_expiry_time(Timestamp::default()/* use setters */);
4759    /// assert!(x.final_backup_expiry_time().is_some());
4760    /// assert!(x.final_backup_ttl_days().is_none());
4761    /// ```
4762    pub fn set_final_backup_expiry_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
4763        mut self,
4764        v: T,
4765    ) -> Self {
4766        self.expiration = std::option::Option::Some(
4767            crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v.into()),
4768        );
4769        self
4770    }
4771}
4772
4773impl wkt::message::Message for SqlInstancesDeleteRequest {
4774    fn typename() -> &'static str {
4775        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDeleteRequest"
4776    }
4777}
4778
4779/// Defines additional types related to [SqlInstancesDeleteRequest].
4780pub mod sql_instances_delete_request {
4781    #[allow(unused_imports)]
4782    use super::*;
4783
4784    #[allow(missing_docs)]
4785    #[derive(Clone, Debug, PartialEq)]
4786    #[non_exhaustive]
4787    pub enum Expiration {
4788        /// Optional. Retention period of the final backup.
4789        FinalBackupTtlDays(i64),
4790        /// Optional. Final Backup expiration time.
4791        /// Timestamp in UTC of when this resource is considered expired.
4792        FinalBackupExpiryTime(std::boxed::Box<wkt::Timestamp>),
4793    }
4794}
4795
4796/// Instance demote master request.
4797#[derive(Clone, Default, PartialEq)]
4798#[non_exhaustive]
4799pub struct SqlInstancesDemoteMasterRequest {
4800    /// Cloud SQL instance name.
4801    pub instance: std::string::String,
4802
4803    /// ID of the project that contains the instance.
4804    pub project: std::string::String,
4805
4806    #[allow(missing_docs)]
4807    pub body: std::option::Option<crate::model::InstancesDemoteMasterRequest>,
4808
4809    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4810}
4811
4812impl SqlInstancesDemoteMasterRequest {
4813    /// Creates a new default instance.
4814    pub fn new() -> Self {
4815        std::default::Default::default()
4816    }
4817
4818    /// Sets the value of [instance][crate::model::SqlInstancesDemoteMasterRequest::instance].
4819    ///
4820    /// # Example
4821    /// ```ignore,no_run
4822    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4823    /// let x = SqlInstancesDemoteMasterRequest::new().set_instance("example");
4824    /// ```
4825    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4826        self.instance = v.into();
4827        self
4828    }
4829
4830    /// Sets the value of [project][crate::model::SqlInstancesDemoteMasterRequest::project].
4831    ///
4832    /// # Example
4833    /// ```ignore,no_run
4834    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4835    /// let x = SqlInstancesDemoteMasterRequest::new().set_project("example");
4836    /// ```
4837    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4838        self.project = v.into();
4839        self
4840    }
4841
4842    /// Sets the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
4843    ///
4844    /// # Example
4845    /// ```ignore,no_run
4846    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4847    /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
4848    /// let x = SqlInstancesDemoteMasterRequest::new().set_body(InstancesDemoteMasterRequest::default()/* use setters */);
4849    /// ```
4850    pub fn set_body<T>(mut self, v: T) -> Self
4851    where
4852        T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
4853    {
4854        self.body = std::option::Option::Some(v.into());
4855        self
4856    }
4857
4858    /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
4859    ///
4860    /// # Example
4861    /// ```ignore,no_run
4862    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4863    /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
4864    /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(Some(InstancesDemoteMasterRequest::default()/* use setters */));
4865    /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(None::<InstancesDemoteMasterRequest>);
4866    /// ```
4867    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4868    where
4869        T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
4870    {
4871        self.body = v.map(|x| x.into());
4872        self
4873    }
4874}
4875
4876impl wkt::message::Message for SqlInstancesDemoteMasterRequest {
4877    fn typename() -> &'static str {
4878        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteMasterRequest"
4879    }
4880}
4881
4882/// Instance demote request.
4883#[derive(Clone, Default, PartialEq)]
4884#[non_exhaustive]
4885pub struct SqlInstancesDemoteRequest {
4886    /// Required. Cloud SQL instance name.
4887    pub instance: std::string::String,
4888
4889    /// Required. ID of the project that contains the instance.
4890    pub project: std::string::String,
4891
4892    /// Required. The request body.
4893    pub body: std::option::Option<crate::model::InstancesDemoteRequest>,
4894
4895    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4896}
4897
4898impl SqlInstancesDemoteRequest {
4899    /// Creates a new default instance.
4900    pub fn new() -> Self {
4901        std::default::Default::default()
4902    }
4903
4904    /// Sets the value of [instance][crate::model::SqlInstancesDemoteRequest::instance].
4905    ///
4906    /// # Example
4907    /// ```ignore,no_run
4908    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4909    /// let x = SqlInstancesDemoteRequest::new().set_instance("example");
4910    /// ```
4911    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4912        self.instance = v.into();
4913        self
4914    }
4915
4916    /// Sets the value of [project][crate::model::SqlInstancesDemoteRequest::project].
4917    ///
4918    /// # Example
4919    /// ```ignore,no_run
4920    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4921    /// let x = SqlInstancesDemoteRequest::new().set_project("example");
4922    /// ```
4923    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4924        self.project = v.into();
4925        self
4926    }
4927
4928    /// Sets the value of [body][crate::model::SqlInstancesDemoteRequest::body].
4929    ///
4930    /// # Example
4931    /// ```ignore,no_run
4932    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4933    /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
4934    /// let x = SqlInstancesDemoteRequest::new().set_body(InstancesDemoteRequest::default()/* use setters */);
4935    /// ```
4936    pub fn set_body<T>(mut self, v: T) -> Self
4937    where
4938        T: std::convert::Into<crate::model::InstancesDemoteRequest>,
4939    {
4940        self.body = std::option::Option::Some(v.into());
4941        self
4942    }
4943
4944    /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteRequest::body].
4945    ///
4946    /// # Example
4947    /// ```ignore,no_run
4948    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4949    /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
4950    /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(Some(InstancesDemoteRequest::default()/* use setters */));
4951    /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(None::<InstancesDemoteRequest>);
4952    /// ```
4953    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4954    where
4955        T: std::convert::Into<crate::model::InstancesDemoteRequest>,
4956    {
4957        self.body = v.map(|x| x.into());
4958        self
4959    }
4960}
4961
4962impl wkt::message::Message for SqlInstancesDemoteRequest {
4963    fn typename() -> &'static str {
4964        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteRequest"
4965    }
4966}
4967
4968/// Instance export request.
4969#[derive(Clone, Default, PartialEq)]
4970#[non_exhaustive]
4971pub struct SqlInstancesExportRequest {
4972    /// Cloud SQL instance ID. This does not include the project ID.
4973    pub instance: std::string::String,
4974
4975    /// Project ID of the project that contains the instance to be exported.
4976    pub project: std::string::String,
4977
4978    #[allow(missing_docs)]
4979    pub body: std::option::Option<crate::model::InstancesExportRequest>,
4980
4981    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4982}
4983
4984impl SqlInstancesExportRequest {
4985    /// Creates a new default instance.
4986    pub fn new() -> Self {
4987        std::default::Default::default()
4988    }
4989
4990    /// Sets the value of [instance][crate::model::SqlInstancesExportRequest::instance].
4991    ///
4992    /// # Example
4993    /// ```ignore,no_run
4994    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
4995    /// let x = SqlInstancesExportRequest::new().set_instance("example");
4996    /// ```
4997    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4998        self.instance = v.into();
4999        self
5000    }
5001
5002    /// Sets the value of [project][crate::model::SqlInstancesExportRequest::project].
5003    ///
5004    /// # Example
5005    /// ```ignore,no_run
5006    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5007    /// let x = SqlInstancesExportRequest::new().set_project("example");
5008    /// ```
5009    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5010        self.project = v.into();
5011        self
5012    }
5013
5014    /// Sets the value of [body][crate::model::SqlInstancesExportRequest::body].
5015    ///
5016    /// # Example
5017    /// ```ignore,no_run
5018    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5019    /// use google_cloud_sql_v1::model::InstancesExportRequest;
5020    /// let x = SqlInstancesExportRequest::new().set_body(InstancesExportRequest::default()/* use setters */);
5021    /// ```
5022    pub fn set_body<T>(mut self, v: T) -> Self
5023    where
5024        T: std::convert::Into<crate::model::InstancesExportRequest>,
5025    {
5026        self.body = std::option::Option::Some(v.into());
5027        self
5028    }
5029
5030    /// Sets or clears the value of [body][crate::model::SqlInstancesExportRequest::body].
5031    ///
5032    /// # Example
5033    /// ```ignore,no_run
5034    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5035    /// use google_cloud_sql_v1::model::InstancesExportRequest;
5036    /// let x = SqlInstancesExportRequest::new().set_or_clear_body(Some(InstancesExportRequest::default()/* use setters */));
5037    /// let x = SqlInstancesExportRequest::new().set_or_clear_body(None::<InstancesExportRequest>);
5038    /// ```
5039    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5040    where
5041        T: std::convert::Into<crate::model::InstancesExportRequest>,
5042    {
5043        self.body = v.map(|x| x.into());
5044        self
5045    }
5046}
5047
5048impl wkt::message::Message for SqlInstancesExportRequest {
5049    fn typename() -> &'static str {
5050        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExportRequest"
5051    }
5052}
5053
5054/// Instance failover request.
5055#[derive(Clone, Default, PartialEq)]
5056#[non_exhaustive]
5057pub struct SqlInstancesFailoverRequest {
5058    /// Cloud SQL instance ID. This does not include the project ID.
5059    pub instance: std::string::String,
5060
5061    /// ID of the project that contains the read replica.
5062    pub project: std::string::String,
5063
5064    #[allow(missing_docs)]
5065    pub body: std::option::Option<crate::model::InstancesFailoverRequest>,
5066
5067    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5068}
5069
5070impl SqlInstancesFailoverRequest {
5071    /// Creates a new default instance.
5072    pub fn new() -> Self {
5073        std::default::Default::default()
5074    }
5075
5076    /// Sets the value of [instance][crate::model::SqlInstancesFailoverRequest::instance].
5077    ///
5078    /// # Example
5079    /// ```ignore,no_run
5080    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5081    /// let x = SqlInstancesFailoverRequest::new().set_instance("example");
5082    /// ```
5083    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5084        self.instance = v.into();
5085        self
5086    }
5087
5088    /// Sets the value of [project][crate::model::SqlInstancesFailoverRequest::project].
5089    ///
5090    /// # Example
5091    /// ```ignore,no_run
5092    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5093    /// let x = SqlInstancesFailoverRequest::new().set_project("example");
5094    /// ```
5095    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5096        self.project = v.into();
5097        self
5098    }
5099
5100    /// Sets the value of [body][crate::model::SqlInstancesFailoverRequest::body].
5101    ///
5102    /// # Example
5103    /// ```ignore,no_run
5104    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5105    /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
5106    /// let x = SqlInstancesFailoverRequest::new().set_body(InstancesFailoverRequest::default()/* use setters */);
5107    /// ```
5108    pub fn set_body<T>(mut self, v: T) -> Self
5109    where
5110        T: std::convert::Into<crate::model::InstancesFailoverRequest>,
5111    {
5112        self.body = std::option::Option::Some(v.into());
5113        self
5114    }
5115
5116    /// Sets or clears the value of [body][crate::model::SqlInstancesFailoverRequest::body].
5117    ///
5118    /// # Example
5119    /// ```ignore,no_run
5120    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5121    /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
5122    /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(Some(InstancesFailoverRequest::default()/* use setters */));
5123    /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(None::<InstancesFailoverRequest>);
5124    /// ```
5125    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5126    where
5127        T: std::convert::Into<crate::model::InstancesFailoverRequest>,
5128    {
5129        self.body = v.map(|x| x.into());
5130        self
5131    }
5132}
5133
5134impl wkt::message::Message for SqlInstancesFailoverRequest {
5135    fn typename() -> &'static str {
5136        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesFailoverRequest"
5137    }
5138}
5139
5140/// Instance get request.
5141#[derive(Clone, Default, PartialEq)]
5142#[non_exhaustive]
5143pub struct SqlInstancesGetRequest {
5144    /// Required. Database instance ID. This does not include the project ID.
5145    pub instance: std::string::String,
5146
5147    /// Required. Project ID of the project that contains the instance.
5148    pub project: std::string::String,
5149
5150    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5151}
5152
5153impl SqlInstancesGetRequest {
5154    /// Creates a new default instance.
5155    pub fn new() -> Self {
5156        std::default::Default::default()
5157    }
5158
5159    /// Sets the value of [instance][crate::model::SqlInstancesGetRequest::instance].
5160    ///
5161    /// # Example
5162    /// ```ignore,no_run
5163    /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
5164    /// let x = SqlInstancesGetRequest::new().set_instance("example");
5165    /// ```
5166    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5167        self.instance = v.into();
5168        self
5169    }
5170
5171    /// Sets the value of [project][crate::model::SqlInstancesGetRequest::project].
5172    ///
5173    /// # Example
5174    /// ```ignore,no_run
5175    /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
5176    /// let x = SqlInstancesGetRequest::new().set_project("example");
5177    /// ```
5178    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5179        self.project = v.into();
5180        self
5181    }
5182}
5183
5184impl wkt::message::Message for SqlInstancesGetRequest {
5185    fn typename() -> &'static str {
5186        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetRequest"
5187    }
5188}
5189
5190/// Instance import request.
5191#[derive(Clone, Default, PartialEq)]
5192#[non_exhaustive]
5193pub struct SqlInstancesImportRequest {
5194    /// Cloud SQL instance ID. This does not include the project ID.
5195    pub instance: std::string::String,
5196
5197    /// Project ID of the project that contains the instance.
5198    pub project: std::string::String,
5199
5200    #[allow(missing_docs)]
5201    pub body: std::option::Option<crate::model::InstancesImportRequest>,
5202
5203    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5204}
5205
5206impl SqlInstancesImportRequest {
5207    /// Creates a new default instance.
5208    pub fn new() -> Self {
5209        std::default::Default::default()
5210    }
5211
5212    /// Sets the value of [instance][crate::model::SqlInstancesImportRequest::instance].
5213    ///
5214    /// # Example
5215    /// ```ignore,no_run
5216    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5217    /// let x = SqlInstancesImportRequest::new().set_instance("example");
5218    /// ```
5219    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5220        self.instance = v.into();
5221        self
5222    }
5223
5224    /// Sets the value of [project][crate::model::SqlInstancesImportRequest::project].
5225    ///
5226    /// # Example
5227    /// ```ignore,no_run
5228    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5229    /// let x = SqlInstancesImportRequest::new().set_project("example");
5230    /// ```
5231    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5232        self.project = v.into();
5233        self
5234    }
5235
5236    /// Sets the value of [body][crate::model::SqlInstancesImportRequest::body].
5237    ///
5238    /// # Example
5239    /// ```ignore,no_run
5240    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5241    /// use google_cloud_sql_v1::model::InstancesImportRequest;
5242    /// let x = SqlInstancesImportRequest::new().set_body(InstancesImportRequest::default()/* use setters */);
5243    /// ```
5244    pub fn set_body<T>(mut self, v: T) -> Self
5245    where
5246        T: std::convert::Into<crate::model::InstancesImportRequest>,
5247    {
5248        self.body = std::option::Option::Some(v.into());
5249        self
5250    }
5251
5252    /// Sets or clears the value of [body][crate::model::SqlInstancesImportRequest::body].
5253    ///
5254    /// # Example
5255    /// ```ignore,no_run
5256    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5257    /// use google_cloud_sql_v1::model::InstancesImportRequest;
5258    /// let x = SqlInstancesImportRequest::new().set_or_clear_body(Some(InstancesImportRequest::default()/* use setters */));
5259    /// let x = SqlInstancesImportRequest::new().set_or_clear_body(None::<InstancesImportRequest>);
5260    /// ```
5261    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5262    where
5263        T: std::convert::Into<crate::model::InstancesImportRequest>,
5264    {
5265        self.body = v.map(|x| x.into());
5266        self
5267    }
5268}
5269
5270impl wkt::message::Message for SqlInstancesImportRequest {
5271    fn typename() -> &'static str {
5272        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesImportRequest"
5273    }
5274}
5275
5276/// Instance insert request.
5277#[derive(Clone, Default, PartialEq)]
5278#[non_exhaustive]
5279pub struct SqlInstancesInsertRequest {
5280    /// Project ID of the project to which the newly created Cloud SQL instances
5281    /// should belong.
5282    pub project: std::string::String,
5283
5284    #[allow(missing_docs)]
5285    pub body: std::option::Option<crate::model::DatabaseInstance>,
5286
5287    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5288}
5289
5290impl SqlInstancesInsertRequest {
5291    /// Creates a new default instance.
5292    pub fn new() -> Self {
5293        std::default::Default::default()
5294    }
5295
5296    /// Sets the value of [project][crate::model::SqlInstancesInsertRequest::project].
5297    ///
5298    /// # Example
5299    /// ```ignore,no_run
5300    /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5301    /// let x = SqlInstancesInsertRequest::new().set_project("example");
5302    /// ```
5303    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5304        self.project = v.into();
5305        self
5306    }
5307
5308    /// Sets the value of [body][crate::model::SqlInstancesInsertRequest::body].
5309    ///
5310    /// # Example
5311    /// ```ignore,no_run
5312    /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5313    /// use google_cloud_sql_v1::model::DatabaseInstance;
5314    /// let x = SqlInstancesInsertRequest::new().set_body(DatabaseInstance::default()/* use setters */);
5315    /// ```
5316    pub fn set_body<T>(mut self, v: T) -> Self
5317    where
5318        T: std::convert::Into<crate::model::DatabaseInstance>,
5319    {
5320        self.body = std::option::Option::Some(v.into());
5321        self
5322    }
5323
5324    /// Sets or clears the value of [body][crate::model::SqlInstancesInsertRequest::body].
5325    ///
5326    /// # Example
5327    /// ```ignore,no_run
5328    /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5329    /// use google_cloud_sql_v1::model::DatabaseInstance;
5330    /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
5331    /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(None::<DatabaseInstance>);
5332    /// ```
5333    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5334    where
5335        T: std::convert::Into<crate::model::DatabaseInstance>,
5336    {
5337        self.body = v.map(|x| x.into());
5338        self
5339    }
5340}
5341
5342impl wkt::message::Message for SqlInstancesInsertRequest {
5343    fn typename() -> &'static str {
5344        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesInsertRequest"
5345    }
5346}
5347
5348/// Instance list request.
5349#[derive(Clone, Default, PartialEq)]
5350#[non_exhaustive]
5351pub struct SqlInstancesListRequest {
5352    /// A filter expression that filters resources listed in the response.
5353    /// The expression is in the form of field:value. For example,
5354    /// 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
5355    /// their JSON representation, such as 'settings.userLabels.auto_start:true'.
5356    ///
5357    /// Multiple filter queries are space-separated. For example.
5358    /// 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
5359    /// expression is an AND expression. However, you can include AND and OR
5360    /// expressions explicitly.
5361    pub filter: std::string::String,
5362
5363    /// The maximum number of instances to return. The service may return fewer
5364    /// than this value.
5365    /// If unspecified, at most 500 instances are returned.
5366    /// The maximum value is 1000; values above 1000 are coerced to 1000.
5367    pub max_results: u32,
5368
5369    /// A previously-returned page token representing part of the larger set of
5370    /// results to view.
5371    pub page_token: std::string::String,
5372
5373    /// Project ID of the project for which to list Cloud SQL instances.
5374    pub project: std::string::String,
5375
5376    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5377}
5378
5379impl SqlInstancesListRequest {
5380    /// Creates a new default instance.
5381    pub fn new() -> Self {
5382        std::default::Default::default()
5383    }
5384
5385    /// Sets the value of [filter][crate::model::SqlInstancesListRequest::filter].
5386    ///
5387    /// # Example
5388    /// ```ignore,no_run
5389    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5390    /// let x = SqlInstancesListRequest::new().set_filter("example");
5391    /// ```
5392    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5393        self.filter = v.into();
5394        self
5395    }
5396
5397    /// Sets the value of [max_results][crate::model::SqlInstancesListRequest::max_results].
5398    ///
5399    /// # Example
5400    /// ```ignore,no_run
5401    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5402    /// let x = SqlInstancesListRequest::new().set_max_results(42_u32);
5403    /// ```
5404    pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
5405        self.max_results = v.into();
5406        self
5407    }
5408
5409    /// Sets the value of [page_token][crate::model::SqlInstancesListRequest::page_token].
5410    ///
5411    /// # Example
5412    /// ```ignore,no_run
5413    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5414    /// let x = SqlInstancesListRequest::new().set_page_token("example");
5415    /// ```
5416    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5417        self.page_token = v.into();
5418        self
5419    }
5420
5421    /// Sets the value of [project][crate::model::SqlInstancesListRequest::project].
5422    ///
5423    /// # Example
5424    /// ```ignore,no_run
5425    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5426    /// let x = SqlInstancesListRequest::new().set_project("example");
5427    /// ```
5428    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5429        self.project = v.into();
5430        self
5431    }
5432}
5433
5434impl wkt::message::Message for SqlInstancesListRequest {
5435    fn typename() -> &'static str {
5436        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListRequest"
5437    }
5438}
5439
5440/// Instance list server CAs request.
5441#[derive(Clone, Default, PartialEq)]
5442#[non_exhaustive]
5443pub struct SqlInstancesListServerCasRequest {
5444    /// Cloud SQL instance ID. This does not include the project ID.
5445    pub instance: std::string::String,
5446
5447    /// Project ID of the project that contains the instance.
5448    pub project: std::string::String,
5449
5450    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5451}
5452
5453impl SqlInstancesListServerCasRequest {
5454    /// Creates a new default instance.
5455    pub fn new() -> Self {
5456        std::default::Default::default()
5457    }
5458
5459    /// Sets the value of [instance][crate::model::SqlInstancesListServerCasRequest::instance].
5460    ///
5461    /// # Example
5462    /// ```ignore,no_run
5463    /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
5464    /// let x = SqlInstancesListServerCasRequest::new().set_instance("example");
5465    /// ```
5466    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5467        self.instance = v.into();
5468        self
5469    }
5470
5471    /// Sets the value of [project][crate::model::SqlInstancesListServerCasRequest::project].
5472    ///
5473    /// # Example
5474    /// ```ignore,no_run
5475    /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
5476    /// let x = SqlInstancesListServerCasRequest::new().set_project("example");
5477    /// ```
5478    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5479        self.project = v.into();
5480        self
5481    }
5482}
5483
5484impl wkt::message::Message for SqlInstancesListServerCasRequest {
5485    fn typename() -> &'static str {
5486        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCasRequest"
5487    }
5488}
5489
5490/// Instance list server certificates request.
5491#[derive(Clone, Default, PartialEq)]
5492#[non_exhaustive]
5493pub struct SqlInstancesListServerCertificatesRequest {
5494    /// Required. Cloud SQL instance ID. This does not include the project ID.
5495    pub instance: std::string::String,
5496
5497    /// Required. Project ID of the project that contains the instance.
5498    pub project: std::string::String,
5499
5500    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5501}
5502
5503impl SqlInstancesListServerCertificatesRequest {
5504    /// Creates a new default instance.
5505    pub fn new() -> Self {
5506        std::default::Default::default()
5507    }
5508
5509    /// Sets the value of [instance][crate::model::SqlInstancesListServerCertificatesRequest::instance].
5510    ///
5511    /// # Example
5512    /// ```ignore,no_run
5513    /// # use google_cloud_sql_v1::model::SqlInstancesListServerCertificatesRequest;
5514    /// let x = SqlInstancesListServerCertificatesRequest::new().set_instance("example");
5515    /// ```
5516    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5517        self.instance = v.into();
5518        self
5519    }
5520
5521    /// Sets the value of [project][crate::model::SqlInstancesListServerCertificatesRequest::project].
5522    ///
5523    /// # Example
5524    /// ```ignore,no_run
5525    /// # use google_cloud_sql_v1::model::SqlInstancesListServerCertificatesRequest;
5526    /// let x = SqlInstancesListServerCertificatesRequest::new().set_project("example");
5527    /// ```
5528    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5529        self.project = v.into();
5530        self
5531    }
5532}
5533
5534impl wkt::message::Message for SqlInstancesListServerCertificatesRequest {
5535    fn typename() -> &'static str {
5536        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest"
5537    }
5538}
5539
5540/// Instance list Entra ID certificates request.
5541#[derive(Clone, Default, PartialEq)]
5542#[non_exhaustive]
5543pub struct SqlInstancesListEntraIdCertificatesRequest {
5544    /// Required. Cloud SQL instance ID. This does not include the project ID.
5545    pub instance: std::string::String,
5546
5547    /// Required. Project ID of the project that contains the instance.
5548    pub project: std::string::String,
5549
5550    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5551}
5552
5553impl SqlInstancesListEntraIdCertificatesRequest {
5554    /// Creates a new default instance.
5555    pub fn new() -> Self {
5556        std::default::Default::default()
5557    }
5558
5559    /// Sets the value of [instance][crate::model::SqlInstancesListEntraIdCertificatesRequest::instance].
5560    ///
5561    /// # Example
5562    /// ```ignore,no_run
5563    /// # use google_cloud_sql_v1::model::SqlInstancesListEntraIdCertificatesRequest;
5564    /// let x = SqlInstancesListEntraIdCertificatesRequest::new().set_instance("example");
5565    /// ```
5566    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5567        self.instance = v.into();
5568        self
5569    }
5570
5571    /// Sets the value of [project][crate::model::SqlInstancesListEntraIdCertificatesRequest::project].
5572    ///
5573    /// # Example
5574    /// ```ignore,no_run
5575    /// # use google_cloud_sql_v1::model::SqlInstancesListEntraIdCertificatesRequest;
5576    /// let x = SqlInstancesListEntraIdCertificatesRequest::new().set_project("example");
5577    /// ```
5578    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5579        self.project = v.into();
5580        self
5581    }
5582}
5583
5584impl wkt::message::Message for SqlInstancesListEntraIdCertificatesRequest {
5585    fn typename() -> &'static str {
5586        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest"
5587    }
5588}
5589
5590/// Instance patch request.
5591#[derive(Clone, Default, PartialEq)]
5592#[non_exhaustive]
5593pub struct SqlInstancesPatchRequest {
5594    /// Cloud SQL instance ID. This does not include the project ID.
5595    pub instance: std::string::String,
5596
5597    /// Project ID of the project that contains the instance.
5598    pub project: std::string::String,
5599
5600    #[allow(missing_docs)]
5601    pub body: std::option::Option<crate::model::DatabaseInstance>,
5602
5603    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5604}
5605
5606impl SqlInstancesPatchRequest {
5607    /// Creates a new default instance.
5608    pub fn new() -> Self {
5609        std::default::Default::default()
5610    }
5611
5612    /// Sets the value of [instance][crate::model::SqlInstancesPatchRequest::instance].
5613    ///
5614    /// # Example
5615    /// ```ignore,no_run
5616    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5617    /// let x = SqlInstancesPatchRequest::new().set_instance("example");
5618    /// ```
5619    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5620        self.instance = v.into();
5621        self
5622    }
5623
5624    /// Sets the value of [project][crate::model::SqlInstancesPatchRequest::project].
5625    ///
5626    /// # Example
5627    /// ```ignore,no_run
5628    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5629    /// let x = SqlInstancesPatchRequest::new().set_project("example");
5630    /// ```
5631    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5632        self.project = v.into();
5633        self
5634    }
5635
5636    /// Sets the value of [body][crate::model::SqlInstancesPatchRequest::body].
5637    ///
5638    /// # Example
5639    /// ```ignore,no_run
5640    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5641    /// use google_cloud_sql_v1::model::DatabaseInstance;
5642    /// let x = SqlInstancesPatchRequest::new().set_body(DatabaseInstance::default()/* use setters */);
5643    /// ```
5644    pub fn set_body<T>(mut self, v: T) -> Self
5645    where
5646        T: std::convert::Into<crate::model::DatabaseInstance>,
5647    {
5648        self.body = std::option::Option::Some(v.into());
5649        self
5650    }
5651
5652    /// Sets or clears the value of [body][crate::model::SqlInstancesPatchRequest::body].
5653    ///
5654    /// # Example
5655    /// ```ignore,no_run
5656    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5657    /// use google_cloud_sql_v1::model::DatabaseInstance;
5658    /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
5659    /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(None::<DatabaseInstance>);
5660    /// ```
5661    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5662    where
5663        T: std::convert::Into<crate::model::DatabaseInstance>,
5664    {
5665        self.body = v.map(|x| x.into());
5666        self
5667    }
5668}
5669
5670impl wkt::message::Message for SqlInstancesPatchRequest {
5671    fn typename() -> &'static str {
5672        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPatchRequest"
5673    }
5674}
5675
5676/// Instance promote replica request.
5677#[derive(Clone, Default, PartialEq)]
5678#[non_exhaustive]
5679pub struct SqlInstancesPromoteReplicaRequest {
5680    /// Cloud SQL read replica instance name.
5681    pub instance: std::string::String,
5682
5683    /// ID of the project that contains the read replica.
5684    pub project: std::string::String,
5685
5686    /// Set to true to invoke a replica failover to the DR
5687    /// replica. As part of replica failover, the promote operation attempts
5688    /// to add the original primary instance as a replica of the promoted
5689    /// DR replica when the original primary instance comes back online.
5690    /// If set to false or not specified, then the original primary
5691    /// instance becomes an independent Cloud SQL primary instance.
5692    pub failover: bool,
5693
5694    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5695}
5696
5697impl SqlInstancesPromoteReplicaRequest {
5698    /// Creates a new default instance.
5699    pub fn new() -> Self {
5700        std::default::Default::default()
5701    }
5702
5703    /// Sets the value of [instance][crate::model::SqlInstancesPromoteReplicaRequest::instance].
5704    ///
5705    /// # Example
5706    /// ```ignore,no_run
5707    /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5708    /// let x = SqlInstancesPromoteReplicaRequest::new().set_instance("example");
5709    /// ```
5710    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5711        self.instance = v.into();
5712        self
5713    }
5714
5715    /// Sets the value of [project][crate::model::SqlInstancesPromoteReplicaRequest::project].
5716    ///
5717    /// # Example
5718    /// ```ignore,no_run
5719    /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5720    /// let x = SqlInstancesPromoteReplicaRequest::new().set_project("example");
5721    /// ```
5722    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5723        self.project = v.into();
5724        self
5725    }
5726
5727    /// Sets the value of [failover][crate::model::SqlInstancesPromoteReplicaRequest::failover].
5728    ///
5729    /// # Example
5730    /// ```ignore,no_run
5731    /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5732    /// let x = SqlInstancesPromoteReplicaRequest::new().set_failover(true);
5733    /// ```
5734    pub fn set_failover<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5735        self.failover = v.into();
5736        self
5737    }
5738}
5739
5740impl wkt::message::Message for SqlInstancesPromoteReplicaRequest {
5741    fn typename() -> &'static str {
5742        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest"
5743    }
5744}
5745
5746/// Instance switchover request.
5747#[derive(Clone, Default, PartialEq)]
5748#[non_exhaustive]
5749pub struct SqlInstancesSwitchoverRequest {
5750    /// Cloud SQL read replica instance name.
5751    pub instance: std::string::String,
5752
5753    /// ID of the project that contains the replica.
5754    pub project: std::string::String,
5755
5756    /// Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
5757    /// timeout, which is a sum of all database operations. Default value is 10
5758    /// minutes and can be modified to a maximum value of 24 hours.
5759    pub db_timeout: std::option::Option<wkt::Duration>,
5760
5761    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5762}
5763
5764impl SqlInstancesSwitchoverRequest {
5765    /// Creates a new default instance.
5766    pub fn new() -> Self {
5767        std::default::Default::default()
5768    }
5769
5770    /// Sets the value of [instance][crate::model::SqlInstancesSwitchoverRequest::instance].
5771    ///
5772    /// # Example
5773    /// ```ignore,no_run
5774    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5775    /// let x = SqlInstancesSwitchoverRequest::new().set_instance("example");
5776    /// ```
5777    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5778        self.instance = v.into();
5779        self
5780    }
5781
5782    /// Sets the value of [project][crate::model::SqlInstancesSwitchoverRequest::project].
5783    ///
5784    /// # Example
5785    /// ```ignore,no_run
5786    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5787    /// let x = SqlInstancesSwitchoverRequest::new().set_project("example");
5788    /// ```
5789    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5790        self.project = v.into();
5791        self
5792    }
5793
5794    /// Sets the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
5795    ///
5796    /// # Example
5797    /// ```ignore,no_run
5798    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5799    /// use wkt::Duration;
5800    /// let x = SqlInstancesSwitchoverRequest::new().set_db_timeout(Duration::default()/* use setters */);
5801    /// ```
5802    pub fn set_db_timeout<T>(mut self, v: T) -> Self
5803    where
5804        T: std::convert::Into<wkt::Duration>,
5805    {
5806        self.db_timeout = std::option::Option::Some(v.into());
5807        self
5808    }
5809
5810    /// Sets or clears the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
5811    ///
5812    /// # Example
5813    /// ```ignore,no_run
5814    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5815    /// use wkt::Duration;
5816    /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(Some(Duration::default()/* use setters */));
5817    /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(None::<Duration>);
5818    /// ```
5819    pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
5820    where
5821        T: std::convert::Into<wkt::Duration>,
5822    {
5823        self.db_timeout = v.map(|x| x.into());
5824        self
5825    }
5826}
5827
5828impl wkt::message::Message for SqlInstancesSwitchoverRequest {
5829    fn typename() -> &'static str {
5830        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesSwitchoverRequest"
5831    }
5832}
5833
5834/// Instance reset SSL config request.
5835#[derive(Clone, Default, PartialEq)]
5836#[non_exhaustive]
5837pub struct SqlInstancesResetSslConfigRequest {
5838    /// Cloud SQL instance ID. This does not include the project ID.
5839    pub instance: std::string::String,
5840
5841    /// Project ID of the project that contains the instance.
5842    pub project: std::string::String,
5843
5844    /// Optional. Reset SSL mode to use.
5845    pub mode: crate::model::sql_instances_reset_ssl_config_request::ResetSslMode,
5846
5847    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5848}
5849
5850impl SqlInstancesResetSslConfigRequest {
5851    /// Creates a new default instance.
5852    pub fn new() -> Self {
5853        std::default::Default::default()
5854    }
5855
5856    /// Sets the value of [instance][crate::model::SqlInstancesResetSslConfigRequest::instance].
5857    ///
5858    /// # Example
5859    /// ```ignore,no_run
5860    /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
5861    /// let x = SqlInstancesResetSslConfigRequest::new().set_instance("example");
5862    /// ```
5863    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5864        self.instance = v.into();
5865        self
5866    }
5867
5868    /// Sets the value of [project][crate::model::SqlInstancesResetSslConfigRequest::project].
5869    ///
5870    /// # Example
5871    /// ```ignore,no_run
5872    /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
5873    /// let x = SqlInstancesResetSslConfigRequest::new().set_project("example");
5874    /// ```
5875    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5876        self.project = v.into();
5877        self
5878    }
5879
5880    /// Sets the value of [mode][crate::model::SqlInstancesResetSslConfigRequest::mode].
5881    ///
5882    /// # Example
5883    /// ```ignore,no_run
5884    /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
5885    /// use google_cloud_sql_v1::model::sql_instances_reset_ssl_config_request::ResetSslMode;
5886    /// let x0 = SqlInstancesResetSslConfigRequest::new().set_mode(ResetSslMode::All);
5887    /// let x1 = SqlInstancesResetSslConfigRequest::new().set_mode(ResetSslMode::SyncFromPrimary);
5888    /// ```
5889    pub fn set_mode<
5890        T: std::convert::Into<crate::model::sql_instances_reset_ssl_config_request::ResetSslMode>,
5891    >(
5892        mut self,
5893        v: T,
5894    ) -> Self {
5895        self.mode = v.into();
5896        self
5897    }
5898}
5899
5900impl wkt::message::Message for SqlInstancesResetSslConfigRequest {
5901    fn typename() -> &'static str {
5902        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetSslConfigRequest"
5903    }
5904}
5905
5906/// Defines additional types related to [SqlInstancesResetSslConfigRequest].
5907pub mod sql_instances_reset_ssl_config_request {
5908    #[allow(unused_imports)]
5909    use super::*;
5910
5911    /// Reset SSL mode to selectively refresh the SSL materials.
5912    ///
5913    /// # Working with unknown values
5914    ///
5915    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5916    /// additional enum variants at any time. Adding new variants is not considered
5917    /// a breaking change. Applications should write their code in anticipation of:
5918    ///
5919    /// - New values appearing in future releases of the client library, **and**
5920    /// - New values received dynamically, without application changes.
5921    ///
5922    /// Please consult the [Working with enums] section in the user guide for some
5923    /// guidelines.
5924    ///
5925    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5926    #[derive(Clone, Debug, PartialEq)]
5927    #[non_exhaustive]
5928    pub enum ResetSslMode {
5929        /// Reset SSL mode is not specified.
5930        Unspecified,
5931        /// Refresh all TLS configs. This is the default behaviour.
5932        All,
5933        /// Refreshes the replication-related TLS configuration settings provided by
5934        /// the primary instance.
5935        /// Not applicable to on-premises replication instances.
5936        SyncFromPrimary,
5937        /// If set, the enum was initialized with an unknown value.
5938        ///
5939        /// Applications can examine the value using [ResetSslMode::value] or
5940        /// [ResetSslMode::name].
5941        UnknownValue(reset_ssl_mode::UnknownValue),
5942    }
5943
5944    #[doc(hidden)]
5945    pub mod reset_ssl_mode {
5946        #[allow(unused_imports)]
5947        use super::*;
5948        #[derive(Clone, Debug, PartialEq)]
5949        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5950    }
5951
5952    impl ResetSslMode {
5953        /// Gets the enum value.
5954        ///
5955        /// Returns `None` if the enum contains an unknown value deserialized from
5956        /// the string representation of enums.
5957        pub fn value(&self) -> std::option::Option<i32> {
5958            match self {
5959                Self::Unspecified => std::option::Option::Some(0),
5960                Self::All => std::option::Option::Some(1),
5961                Self::SyncFromPrimary => std::option::Option::Some(2),
5962                Self::UnknownValue(u) => u.0.value(),
5963            }
5964        }
5965
5966        /// Gets the enum value as a string.
5967        ///
5968        /// Returns `None` if the enum contains an unknown value deserialized from
5969        /// the integer representation of enums.
5970        pub fn name(&self) -> std::option::Option<&str> {
5971            match self {
5972                Self::Unspecified => std::option::Option::Some("RESET_SSL_MODE_UNSPECIFIED"),
5973                Self::All => std::option::Option::Some("ALL"),
5974                Self::SyncFromPrimary => std::option::Option::Some("SYNC_FROM_PRIMARY"),
5975                Self::UnknownValue(u) => u.0.name(),
5976            }
5977        }
5978    }
5979
5980    impl std::default::Default for ResetSslMode {
5981        fn default() -> Self {
5982            use std::convert::From;
5983            Self::from(0)
5984        }
5985    }
5986
5987    impl std::fmt::Display for ResetSslMode {
5988        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5989            wkt::internal::display_enum(f, self.name(), self.value())
5990        }
5991    }
5992
5993    impl std::convert::From<i32> for ResetSslMode {
5994        fn from(value: i32) -> Self {
5995            match value {
5996                0 => Self::Unspecified,
5997                1 => Self::All,
5998                2 => Self::SyncFromPrimary,
5999                _ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
6000                    wkt::internal::UnknownEnumValue::Integer(value),
6001                )),
6002            }
6003        }
6004    }
6005
6006    impl std::convert::From<&str> for ResetSslMode {
6007        fn from(value: &str) -> Self {
6008            use std::string::ToString;
6009            match value {
6010                "RESET_SSL_MODE_UNSPECIFIED" => Self::Unspecified,
6011                "ALL" => Self::All,
6012                "SYNC_FROM_PRIMARY" => Self::SyncFromPrimary,
6013                _ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
6014                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6015                )),
6016            }
6017        }
6018    }
6019
6020    impl serde::ser::Serialize for ResetSslMode {
6021        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6022        where
6023            S: serde::Serializer,
6024        {
6025            match self {
6026                Self::Unspecified => serializer.serialize_i32(0),
6027                Self::All => serializer.serialize_i32(1),
6028                Self::SyncFromPrimary => serializer.serialize_i32(2),
6029                Self::UnknownValue(u) => u.0.serialize(serializer),
6030            }
6031        }
6032    }
6033
6034    impl<'de> serde::de::Deserialize<'de> for ResetSslMode {
6035        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6036        where
6037            D: serde::Deserializer<'de>,
6038        {
6039            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResetSslMode>::new(
6040                ".google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode",
6041            ))
6042        }
6043    }
6044}
6045
6046/// Instance restart request.
6047#[derive(Clone, Default, PartialEq)]
6048#[non_exhaustive]
6049pub struct SqlInstancesRestartRequest {
6050    /// Cloud SQL instance ID. This does not include the project ID.
6051    pub instance: std::string::String,
6052
6053    /// Project ID of the project that contains the instance to be restarted.
6054    pub project: std::string::String,
6055
6056    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6057}
6058
6059impl SqlInstancesRestartRequest {
6060    /// Creates a new default instance.
6061    pub fn new() -> Self {
6062        std::default::Default::default()
6063    }
6064
6065    /// Sets the value of [instance][crate::model::SqlInstancesRestartRequest::instance].
6066    ///
6067    /// # Example
6068    /// ```ignore,no_run
6069    /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
6070    /// let x = SqlInstancesRestartRequest::new().set_instance("example");
6071    /// ```
6072    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6073        self.instance = v.into();
6074        self
6075    }
6076
6077    /// Sets the value of [project][crate::model::SqlInstancesRestartRequest::project].
6078    ///
6079    /// # Example
6080    /// ```ignore,no_run
6081    /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
6082    /// let x = SqlInstancesRestartRequest::new().set_project("example");
6083    /// ```
6084    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6085        self.project = v.into();
6086        self
6087    }
6088}
6089
6090impl wkt::message::Message for SqlInstancesRestartRequest {
6091    fn typename() -> &'static str {
6092        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestartRequest"
6093    }
6094}
6095
6096/// Instance restore backup request.
6097#[derive(Clone, Default, PartialEq)]
6098#[non_exhaustive]
6099pub struct SqlInstancesRestoreBackupRequest {
6100    /// Cloud SQL instance ID. This does not include the project ID.
6101    pub instance: std::string::String,
6102
6103    /// Project ID of the project that contains the instance.
6104    pub project: std::string::String,
6105
6106    #[allow(missing_docs)]
6107    pub body: std::option::Option<crate::model::InstancesRestoreBackupRequest>,
6108
6109    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6110}
6111
6112impl SqlInstancesRestoreBackupRequest {
6113    /// Creates a new default instance.
6114    pub fn new() -> Self {
6115        std::default::Default::default()
6116    }
6117
6118    /// Sets the value of [instance][crate::model::SqlInstancesRestoreBackupRequest::instance].
6119    ///
6120    /// # Example
6121    /// ```ignore,no_run
6122    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6123    /// let x = SqlInstancesRestoreBackupRequest::new().set_instance("example");
6124    /// ```
6125    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6126        self.instance = v.into();
6127        self
6128    }
6129
6130    /// Sets the value of [project][crate::model::SqlInstancesRestoreBackupRequest::project].
6131    ///
6132    /// # Example
6133    /// ```ignore,no_run
6134    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6135    /// let x = SqlInstancesRestoreBackupRequest::new().set_project("example");
6136    /// ```
6137    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6138        self.project = v.into();
6139        self
6140    }
6141
6142    /// Sets the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
6143    ///
6144    /// # Example
6145    /// ```ignore,no_run
6146    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6147    /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6148    /// let x = SqlInstancesRestoreBackupRequest::new().set_body(InstancesRestoreBackupRequest::default()/* use setters */);
6149    /// ```
6150    pub fn set_body<T>(mut self, v: T) -> Self
6151    where
6152        T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
6153    {
6154        self.body = std::option::Option::Some(v.into());
6155        self
6156    }
6157
6158    /// Sets or clears the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
6159    ///
6160    /// # Example
6161    /// ```ignore,no_run
6162    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6163    /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6164    /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(Some(InstancesRestoreBackupRequest::default()/* use setters */));
6165    /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(None::<InstancesRestoreBackupRequest>);
6166    /// ```
6167    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6168    where
6169        T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
6170    {
6171        self.body = v.map(|x| x.into());
6172        self
6173    }
6174}
6175
6176impl wkt::message::Message for SqlInstancesRestoreBackupRequest {
6177    fn typename() -> &'static str {
6178        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestoreBackupRequest"
6179    }
6180}
6181
6182/// Instance rotate server CA request.
6183#[derive(Clone, Default, PartialEq)]
6184#[non_exhaustive]
6185pub struct SqlInstancesRotateServerCaRequest {
6186    /// Cloud SQL instance ID. This does not include the project ID.
6187    pub instance: std::string::String,
6188
6189    /// Project ID of the project that contains the instance.
6190    pub project: std::string::String,
6191
6192    #[allow(missing_docs)]
6193    pub body: std::option::Option<crate::model::InstancesRotateServerCaRequest>,
6194
6195    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6196}
6197
6198impl SqlInstancesRotateServerCaRequest {
6199    /// Creates a new default instance.
6200    pub fn new() -> Self {
6201        std::default::Default::default()
6202    }
6203
6204    /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCaRequest::instance].
6205    ///
6206    /// # Example
6207    /// ```ignore,no_run
6208    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6209    /// let x = SqlInstancesRotateServerCaRequest::new().set_instance("example");
6210    /// ```
6211    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6212        self.instance = v.into();
6213        self
6214    }
6215
6216    /// Sets the value of [project][crate::model::SqlInstancesRotateServerCaRequest::project].
6217    ///
6218    /// # Example
6219    /// ```ignore,no_run
6220    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6221    /// let x = SqlInstancesRotateServerCaRequest::new().set_project("example");
6222    /// ```
6223    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6224        self.project = v.into();
6225        self
6226    }
6227
6228    /// Sets the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
6229    ///
6230    /// # Example
6231    /// ```ignore,no_run
6232    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6233    /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6234    /// let x = SqlInstancesRotateServerCaRequest::new().set_body(InstancesRotateServerCaRequest::default()/* use setters */);
6235    /// ```
6236    pub fn set_body<T>(mut self, v: T) -> Self
6237    where
6238        T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
6239    {
6240        self.body = std::option::Option::Some(v.into());
6241        self
6242    }
6243
6244    /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
6245    ///
6246    /// # Example
6247    /// ```ignore,no_run
6248    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6249    /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6250    /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(Some(InstancesRotateServerCaRequest::default()/* use setters */));
6251    /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(None::<InstancesRotateServerCaRequest>);
6252    /// ```
6253    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6254    where
6255        T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
6256    {
6257        self.body = v.map(|x| x.into());
6258        self
6259    }
6260}
6261
6262impl wkt::message::Message for SqlInstancesRotateServerCaRequest {
6263    fn typename() -> &'static str {
6264        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCaRequest"
6265    }
6266}
6267
6268/// Instance rotate server certificate request.
6269#[derive(Clone, Default, PartialEq)]
6270#[non_exhaustive]
6271pub struct SqlInstancesRotateServerCertificateRequest {
6272    /// Required. Cloud SQL instance ID. This does not include the project ID.
6273    pub instance: std::string::String,
6274
6275    /// Required. Project ID of the project that contains the instance.
6276    pub project: std::string::String,
6277
6278    /// Optional. Rotate server certificate request body.
6279    pub body: std::option::Option<crate::model::InstancesRotateServerCertificateRequest>,
6280
6281    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6282}
6283
6284impl SqlInstancesRotateServerCertificateRequest {
6285    /// Creates a new default instance.
6286    pub fn new() -> Self {
6287        std::default::Default::default()
6288    }
6289
6290    /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCertificateRequest::instance].
6291    ///
6292    /// # Example
6293    /// ```ignore,no_run
6294    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6295    /// let x = SqlInstancesRotateServerCertificateRequest::new().set_instance("example");
6296    /// ```
6297    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6298        self.instance = v.into();
6299        self
6300    }
6301
6302    /// Sets the value of [project][crate::model::SqlInstancesRotateServerCertificateRequest::project].
6303    ///
6304    /// # Example
6305    /// ```ignore,no_run
6306    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6307    /// let x = SqlInstancesRotateServerCertificateRequest::new().set_project("example");
6308    /// ```
6309    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6310        self.project = v.into();
6311        self
6312    }
6313
6314    /// Sets the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
6315    ///
6316    /// # Example
6317    /// ```ignore,no_run
6318    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6319    /// use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
6320    /// let x = SqlInstancesRotateServerCertificateRequest::new().set_body(InstancesRotateServerCertificateRequest::default()/* use setters */);
6321    /// ```
6322    pub fn set_body<T>(mut self, v: T) -> Self
6323    where
6324        T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
6325    {
6326        self.body = std::option::Option::Some(v.into());
6327        self
6328    }
6329
6330    /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
6331    ///
6332    /// # Example
6333    /// ```ignore,no_run
6334    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6335    /// use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
6336    /// let x = SqlInstancesRotateServerCertificateRequest::new().set_or_clear_body(Some(InstancesRotateServerCertificateRequest::default()/* use setters */));
6337    /// let x = SqlInstancesRotateServerCertificateRequest::new().set_or_clear_body(None::<InstancesRotateServerCertificateRequest>);
6338    /// ```
6339    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6340    where
6341        T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
6342    {
6343        self.body = v.map(|x| x.into());
6344        self
6345    }
6346}
6347
6348impl wkt::message::Message for SqlInstancesRotateServerCertificateRequest {
6349    fn typename() -> &'static str {
6350        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest"
6351    }
6352}
6353
6354/// Instance rotate server certificate request.
6355#[derive(Clone, Default, PartialEq)]
6356#[non_exhaustive]
6357pub struct SqlInstancesRotateEntraIdCertificateRequest {
6358    /// Required. Cloud SQL instance ID. This does not include the project ID.
6359    pub instance: std::string::String,
6360
6361    /// Required. Project ID of the project that contains the instance.
6362    pub project: std::string::String,
6363
6364    /// Optional. Rotate Entra ID certificate request body.
6365    pub body: std::option::Option<crate::model::InstancesRotateEntraIdCertificateRequest>,
6366
6367    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6368}
6369
6370impl SqlInstancesRotateEntraIdCertificateRequest {
6371    /// Creates a new default instance.
6372    pub fn new() -> Self {
6373        std::default::Default::default()
6374    }
6375
6376    /// Sets the value of [instance][crate::model::SqlInstancesRotateEntraIdCertificateRequest::instance].
6377    ///
6378    /// # Example
6379    /// ```ignore,no_run
6380    /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6381    /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_instance("example");
6382    /// ```
6383    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6384        self.instance = v.into();
6385        self
6386    }
6387
6388    /// Sets the value of [project][crate::model::SqlInstancesRotateEntraIdCertificateRequest::project].
6389    ///
6390    /// # Example
6391    /// ```ignore,no_run
6392    /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6393    /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_project("example");
6394    /// ```
6395    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6396        self.project = v.into();
6397        self
6398    }
6399
6400    /// Sets the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
6401    ///
6402    /// # Example
6403    /// ```ignore,no_run
6404    /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6405    /// use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
6406    /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_body(InstancesRotateEntraIdCertificateRequest::default()/* use setters */);
6407    /// ```
6408    pub fn set_body<T>(mut self, v: T) -> Self
6409    where
6410        T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
6411    {
6412        self.body = std::option::Option::Some(v.into());
6413        self
6414    }
6415
6416    /// Sets or clears the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
6417    ///
6418    /// # Example
6419    /// ```ignore,no_run
6420    /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6421    /// use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
6422    /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_or_clear_body(Some(InstancesRotateEntraIdCertificateRequest::default()/* use setters */));
6423    /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_or_clear_body(None::<InstancesRotateEntraIdCertificateRequest>);
6424    /// ```
6425    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6426    where
6427        T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
6428    {
6429        self.body = v.map(|x| x.into());
6430        self
6431    }
6432}
6433
6434impl wkt::message::Message for SqlInstancesRotateEntraIdCertificateRequest {
6435    fn typename() -> &'static str {
6436        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest"
6437    }
6438}
6439
6440/// Instance start replica request.
6441#[derive(Clone, Default, PartialEq)]
6442#[non_exhaustive]
6443pub struct SqlInstancesStartReplicaRequest {
6444    /// Cloud SQL read replica instance name.
6445    pub instance: std::string::String,
6446
6447    /// ID of the project that contains the read replica.
6448    pub project: std::string::String,
6449
6450    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6451}
6452
6453impl SqlInstancesStartReplicaRequest {
6454    /// Creates a new default instance.
6455    pub fn new() -> Self {
6456        std::default::Default::default()
6457    }
6458
6459    /// Sets the value of [instance][crate::model::SqlInstancesStartReplicaRequest::instance].
6460    ///
6461    /// # Example
6462    /// ```ignore,no_run
6463    /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
6464    /// let x = SqlInstancesStartReplicaRequest::new().set_instance("example");
6465    /// ```
6466    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6467        self.instance = v.into();
6468        self
6469    }
6470
6471    /// Sets the value of [project][crate::model::SqlInstancesStartReplicaRequest::project].
6472    ///
6473    /// # Example
6474    /// ```ignore,no_run
6475    /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
6476    /// let x = SqlInstancesStartReplicaRequest::new().set_project("example");
6477    /// ```
6478    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6479        self.project = v.into();
6480        self
6481    }
6482}
6483
6484impl wkt::message::Message for SqlInstancesStartReplicaRequest {
6485    fn typename() -> &'static str {
6486        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartReplicaRequest"
6487    }
6488}
6489
6490/// Instance stop replica request.
6491#[derive(Clone, Default, PartialEq)]
6492#[non_exhaustive]
6493pub struct SqlInstancesStopReplicaRequest {
6494    /// Cloud SQL read replica instance name.
6495    pub instance: std::string::String,
6496
6497    /// ID of the project that contains the read replica.
6498    pub project: std::string::String,
6499
6500    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6501}
6502
6503impl SqlInstancesStopReplicaRequest {
6504    /// Creates a new default instance.
6505    pub fn new() -> Self {
6506        std::default::Default::default()
6507    }
6508
6509    /// Sets the value of [instance][crate::model::SqlInstancesStopReplicaRequest::instance].
6510    ///
6511    /// # Example
6512    /// ```ignore,no_run
6513    /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
6514    /// let x = SqlInstancesStopReplicaRequest::new().set_instance("example");
6515    /// ```
6516    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6517        self.instance = v.into();
6518        self
6519    }
6520
6521    /// Sets the value of [project][crate::model::SqlInstancesStopReplicaRequest::project].
6522    ///
6523    /// # Example
6524    /// ```ignore,no_run
6525    /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
6526    /// let x = SqlInstancesStopReplicaRequest::new().set_project("example");
6527    /// ```
6528    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6529        self.project = v.into();
6530        self
6531    }
6532}
6533
6534impl wkt::message::Message for SqlInstancesStopReplicaRequest {
6535    fn typename() -> &'static str {
6536        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStopReplicaRequest"
6537    }
6538}
6539
6540/// Instance truncate log request.
6541#[derive(Clone, Default, PartialEq)]
6542#[non_exhaustive]
6543pub struct SqlInstancesTruncateLogRequest {
6544    /// Cloud SQL instance ID. This does not include the project ID.
6545    pub instance: std::string::String,
6546
6547    /// Project ID of the Cloud SQL project.
6548    pub project: std::string::String,
6549
6550    #[allow(missing_docs)]
6551    pub body: std::option::Option<crate::model::InstancesTruncateLogRequest>,
6552
6553    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6554}
6555
6556impl SqlInstancesTruncateLogRequest {
6557    /// Creates a new default instance.
6558    pub fn new() -> Self {
6559        std::default::Default::default()
6560    }
6561
6562    /// Sets the value of [instance][crate::model::SqlInstancesTruncateLogRequest::instance].
6563    ///
6564    /// # Example
6565    /// ```ignore,no_run
6566    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6567    /// let x = SqlInstancesTruncateLogRequest::new().set_instance("example");
6568    /// ```
6569    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6570        self.instance = v.into();
6571        self
6572    }
6573
6574    /// Sets the value of [project][crate::model::SqlInstancesTruncateLogRequest::project].
6575    ///
6576    /// # Example
6577    /// ```ignore,no_run
6578    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6579    /// let x = SqlInstancesTruncateLogRequest::new().set_project("example");
6580    /// ```
6581    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6582        self.project = v.into();
6583        self
6584    }
6585
6586    /// Sets the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
6587    ///
6588    /// # Example
6589    /// ```ignore,no_run
6590    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6591    /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
6592    /// let x = SqlInstancesTruncateLogRequest::new().set_body(InstancesTruncateLogRequest::default()/* use setters */);
6593    /// ```
6594    pub fn set_body<T>(mut self, v: T) -> Self
6595    where
6596        T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
6597    {
6598        self.body = std::option::Option::Some(v.into());
6599        self
6600    }
6601
6602    /// Sets or clears the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
6603    ///
6604    /// # Example
6605    /// ```ignore,no_run
6606    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6607    /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
6608    /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(Some(InstancesTruncateLogRequest::default()/* use setters */));
6609    /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(None::<InstancesTruncateLogRequest>);
6610    /// ```
6611    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6612    where
6613        T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
6614    {
6615        self.body = v.map(|x| x.into());
6616        self
6617    }
6618}
6619
6620impl wkt::message::Message for SqlInstancesTruncateLogRequest {
6621    fn typename() -> &'static str {
6622        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesTruncateLogRequest"
6623    }
6624}
6625
6626/// Instance perform disk shrink request.
6627#[derive(Clone, Default, PartialEq)]
6628#[non_exhaustive]
6629pub struct SqlInstancesPerformDiskShrinkRequest {
6630    /// Cloud SQL instance ID. This does not include the project ID.
6631    pub instance: std::string::String,
6632
6633    /// Project ID of the project that contains the instance.
6634    pub project: std::string::String,
6635
6636    /// Perform disk shrink context.
6637    pub body: std::option::Option<crate::model::PerformDiskShrinkContext>,
6638
6639    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6640}
6641
6642impl SqlInstancesPerformDiskShrinkRequest {
6643    /// Creates a new default instance.
6644    pub fn new() -> Self {
6645        std::default::Default::default()
6646    }
6647
6648    /// Sets the value of [instance][crate::model::SqlInstancesPerformDiskShrinkRequest::instance].
6649    ///
6650    /// # Example
6651    /// ```ignore,no_run
6652    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6653    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_instance("example");
6654    /// ```
6655    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6656        self.instance = v.into();
6657        self
6658    }
6659
6660    /// Sets the value of [project][crate::model::SqlInstancesPerformDiskShrinkRequest::project].
6661    ///
6662    /// # Example
6663    /// ```ignore,no_run
6664    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6665    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_project("example");
6666    /// ```
6667    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6668        self.project = v.into();
6669        self
6670    }
6671
6672    /// Sets the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
6673    ///
6674    /// # Example
6675    /// ```ignore,no_run
6676    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6677    /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
6678    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_body(PerformDiskShrinkContext::default()/* use setters */);
6679    /// ```
6680    pub fn set_body<T>(mut self, v: T) -> Self
6681    where
6682        T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
6683    {
6684        self.body = std::option::Option::Some(v.into());
6685        self
6686    }
6687
6688    /// Sets or clears the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
6689    ///
6690    /// # Example
6691    /// ```ignore,no_run
6692    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6693    /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
6694    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(Some(PerformDiskShrinkContext::default()/* use setters */));
6695    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(None::<PerformDiskShrinkContext>);
6696    /// ```
6697    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6698    where
6699        T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
6700    {
6701        self.body = v.map(|x| x.into());
6702        self
6703    }
6704}
6705
6706impl wkt::message::Message for SqlInstancesPerformDiskShrinkRequest {
6707    fn typename() -> &'static str {
6708        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest"
6709    }
6710}
6711
6712/// Instance update request.
6713#[derive(Clone, Default, PartialEq)]
6714#[non_exhaustive]
6715pub struct SqlInstancesUpdateRequest {
6716    /// Cloud SQL instance ID. This does not include the project ID.
6717    pub instance: std::string::String,
6718
6719    /// Project ID of the project that contains the instance.
6720    pub project: std::string::String,
6721
6722    #[allow(missing_docs)]
6723    pub body: std::option::Option<crate::model::DatabaseInstance>,
6724
6725    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6726}
6727
6728impl SqlInstancesUpdateRequest {
6729    /// Creates a new default instance.
6730    pub fn new() -> Self {
6731        std::default::Default::default()
6732    }
6733
6734    /// Sets the value of [instance][crate::model::SqlInstancesUpdateRequest::instance].
6735    ///
6736    /// # Example
6737    /// ```ignore,no_run
6738    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6739    /// let x = SqlInstancesUpdateRequest::new().set_instance("example");
6740    /// ```
6741    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6742        self.instance = v.into();
6743        self
6744    }
6745
6746    /// Sets the value of [project][crate::model::SqlInstancesUpdateRequest::project].
6747    ///
6748    /// # Example
6749    /// ```ignore,no_run
6750    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6751    /// let x = SqlInstancesUpdateRequest::new().set_project("example");
6752    /// ```
6753    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6754        self.project = v.into();
6755        self
6756    }
6757
6758    /// Sets the value of [body][crate::model::SqlInstancesUpdateRequest::body].
6759    ///
6760    /// # Example
6761    /// ```ignore,no_run
6762    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6763    /// use google_cloud_sql_v1::model::DatabaseInstance;
6764    /// let x = SqlInstancesUpdateRequest::new().set_body(DatabaseInstance::default()/* use setters */);
6765    /// ```
6766    pub fn set_body<T>(mut self, v: T) -> Self
6767    where
6768        T: std::convert::Into<crate::model::DatabaseInstance>,
6769    {
6770        self.body = std::option::Option::Some(v.into());
6771        self
6772    }
6773
6774    /// Sets or clears the value of [body][crate::model::SqlInstancesUpdateRequest::body].
6775    ///
6776    /// # Example
6777    /// ```ignore,no_run
6778    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6779    /// use google_cloud_sql_v1::model::DatabaseInstance;
6780    /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
6781    /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(None::<DatabaseInstance>);
6782    /// ```
6783    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6784    where
6785        T: std::convert::Into<crate::model::DatabaseInstance>,
6786    {
6787        self.body = v.map(|x| x.into());
6788        self
6789    }
6790}
6791
6792impl wkt::message::Message for SqlInstancesUpdateRequest {
6793    fn typename() -> &'static str {
6794        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesUpdateRequest"
6795    }
6796}
6797
6798/// Instance reschedule maintenance request.
6799#[derive(Clone, Default, PartialEq)]
6800#[non_exhaustive]
6801pub struct SqlInstancesRescheduleMaintenanceRequest {
6802    /// Cloud SQL instance ID. This does not include the project ID.
6803    pub instance: std::string::String,
6804
6805    /// ID of the project that contains the instance.
6806    pub project: std::string::String,
6807
6808    #[allow(missing_docs)]
6809    pub body: std::option::Option<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6810
6811    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6812}
6813
6814impl SqlInstancesRescheduleMaintenanceRequest {
6815    /// Creates a new default instance.
6816    pub fn new() -> Self {
6817        std::default::Default::default()
6818    }
6819
6820    /// Sets the value of [instance][crate::model::SqlInstancesRescheduleMaintenanceRequest::instance].
6821    ///
6822    /// # Example
6823    /// ```ignore,no_run
6824    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6825    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_instance("example");
6826    /// ```
6827    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6828        self.instance = v.into();
6829        self
6830    }
6831
6832    /// Sets the value of [project][crate::model::SqlInstancesRescheduleMaintenanceRequest::project].
6833    ///
6834    /// # Example
6835    /// ```ignore,no_run
6836    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6837    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_project("example");
6838    /// ```
6839    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6840        self.project = v.into();
6841        self
6842    }
6843
6844    /// Sets the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
6845    ///
6846    /// # Example
6847    /// ```ignore,no_run
6848    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6849    /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
6850    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_body(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */);
6851    /// ```
6852    pub fn set_body<T>(mut self, v: T) -> Self
6853    where
6854        T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6855    {
6856        self.body = std::option::Option::Some(v.into());
6857        self
6858    }
6859
6860    /// Sets or clears the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
6861    ///
6862    /// # Example
6863    /// ```ignore,no_run
6864    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6865    /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
6866    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(Some(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */));
6867    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(None::<SqlInstancesRescheduleMaintenanceRequestBody>);
6868    /// ```
6869    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6870    where
6871        T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6872    {
6873        self.body = v.map(|x| x.into());
6874        self
6875    }
6876}
6877
6878impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequest {
6879    fn typename() -> &'static str {
6880        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest"
6881    }
6882}
6883
6884/// Instance reencrypt request.
6885#[derive(Clone, Default, PartialEq)]
6886#[non_exhaustive]
6887pub struct SqlInstancesReencryptRequest {
6888    /// Cloud SQL instance ID. This does not include the project ID.
6889    pub instance: std::string::String,
6890
6891    /// ID of the project that contains the instance.
6892    pub project: std::string::String,
6893
6894    /// Reencrypt body that users request
6895    pub body: std::option::Option<crate::model::InstancesReencryptRequest>,
6896
6897    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6898}
6899
6900impl SqlInstancesReencryptRequest {
6901    /// Creates a new default instance.
6902    pub fn new() -> Self {
6903        std::default::Default::default()
6904    }
6905
6906    /// Sets the value of [instance][crate::model::SqlInstancesReencryptRequest::instance].
6907    ///
6908    /// # Example
6909    /// ```ignore,no_run
6910    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6911    /// let x = SqlInstancesReencryptRequest::new().set_instance("example");
6912    /// ```
6913    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6914        self.instance = v.into();
6915        self
6916    }
6917
6918    /// Sets the value of [project][crate::model::SqlInstancesReencryptRequest::project].
6919    ///
6920    /// # Example
6921    /// ```ignore,no_run
6922    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6923    /// let x = SqlInstancesReencryptRequest::new().set_project("example");
6924    /// ```
6925    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6926        self.project = v.into();
6927        self
6928    }
6929
6930    /// Sets the value of [body][crate::model::SqlInstancesReencryptRequest::body].
6931    ///
6932    /// # Example
6933    /// ```ignore,no_run
6934    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6935    /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
6936    /// let x = SqlInstancesReencryptRequest::new().set_body(InstancesReencryptRequest::default()/* use setters */);
6937    /// ```
6938    pub fn set_body<T>(mut self, v: T) -> Self
6939    where
6940        T: std::convert::Into<crate::model::InstancesReencryptRequest>,
6941    {
6942        self.body = std::option::Option::Some(v.into());
6943        self
6944    }
6945
6946    /// Sets or clears the value of [body][crate::model::SqlInstancesReencryptRequest::body].
6947    ///
6948    /// # Example
6949    /// ```ignore,no_run
6950    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6951    /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
6952    /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(Some(InstancesReencryptRequest::default()/* use setters */));
6953    /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(None::<InstancesReencryptRequest>);
6954    /// ```
6955    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6956    where
6957        T: std::convert::Into<crate::model::InstancesReencryptRequest>,
6958    {
6959        self.body = v.map(|x| x.into());
6960        self
6961    }
6962}
6963
6964impl wkt::message::Message for SqlInstancesReencryptRequest {
6965    fn typename() -> &'static str {
6966        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReencryptRequest"
6967    }
6968}
6969
6970/// Database Instance reencrypt request.
6971#[derive(Clone, Default, PartialEq)]
6972#[non_exhaustive]
6973pub struct InstancesReencryptRequest {
6974    /// Configuration specific to backup re-encryption
6975    pub backup_reencryption_config: std::option::Option<crate::model::BackupReencryptionConfig>,
6976
6977    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6978}
6979
6980impl InstancesReencryptRequest {
6981    /// Creates a new default instance.
6982    pub fn new() -> Self {
6983        std::default::Default::default()
6984    }
6985
6986    /// Sets the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
6987    ///
6988    /// # Example
6989    /// ```ignore,no_run
6990    /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
6991    /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
6992    /// let x = InstancesReencryptRequest::new().set_backup_reencryption_config(BackupReencryptionConfig::default()/* use setters */);
6993    /// ```
6994    pub fn set_backup_reencryption_config<T>(mut self, v: T) -> Self
6995    where
6996        T: std::convert::Into<crate::model::BackupReencryptionConfig>,
6997    {
6998        self.backup_reencryption_config = std::option::Option::Some(v.into());
6999        self
7000    }
7001
7002    /// Sets or clears the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
7003    ///
7004    /// # Example
7005    /// ```ignore,no_run
7006    /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
7007    /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
7008    /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(Some(BackupReencryptionConfig::default()/* use setters */));
7009    /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(None::<BackupReencryptionConfig>);
7010    /// ```
7011    pub fn set_or_clear_backup_reencryption_config<T>(mut self, v: std::option::Option<T>) -> Self
7012    where
7013        T: std::convert::Into<crate::model::BackupReencryptionConfig>,
7014    {
7015        self.backup_reencryption_config = v.map(|x| x.into());
7016        self
7017    }
7018}
7019
7020impl wkt::message::Message for InstancesReencryptRequest {
7021    fn typename() -> &'static str {
7022        "type.googleapis.com/google.cloud.sql.v1.InstancesReencryptRequest"
7023    }
7024}
7025
7026/// Backup Reencryption Config
7027#[derive(Clone, Default, PartialEq)]
7028#[non_exhaustive]
7029pub struct BackupReencryptionConfig {
7030    /// Backup re-encryption limit
7031    pub backup_limit: std::option::Option<i32>,
7032
7033    /// Type of backups users want to re-encrypt.
7034    pub backup_type: std::option::Option<crate::model::backup_reencryption_config::BackupType>,
7035
7036    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7037}
7038
7039impl BackupReencryptionConfig {
7040    /// Creates a new default instance.
7041    pub fn new() -> Self {
7042        std::default::Default::default()
7043    }
7044
7045    /// Sets the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
7046    ///
7047    /// # Example
7048    /// ```ignore,no_run
7049    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7050    /// let x = BackupReencryptionConfig::new().set_backup_limit(42);
7051    /// ```
7052    pub fn set_backup_limit<T>(mut self, v: T) -> Self
7053    where
7054        T: std::convert::Into<i32>,
7055    {
7056        self.backup_limit = std::option::Option::Some(v.into());
7057        self
7058    }
7059
7060    /// Sets or clears the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
7061    ///
7062    /// # Example
7063    /// ```ignore,no_run
7064    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7065    /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(Some(42));
7066    /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(None::<i32>);
7067    /// ```
7068    pub fn set_or_clear_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
7069    where
7070        T: std::convert::Into<i32>,
7071    {
7072        self.backup_limit = v.map(|x| x.into());
7073        self
7074    }
7075
7076    /// Sets the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
7077    ///
7078    /// # Example
7079    /// ```ignore,no_run
7080    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7081    /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
7082    /// let x0 = BackupReencryptionConfig::new().set_backup_type(BackupType::Automated);
7083    /// let x1 = BackupReencryptionConfig::new().set_backup_type(BackupType::OnDemand);
7084    /// ```
7085    pub fn set_backup_type<T>(mut self, v: T) -> Self
7086    where
7087        T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
7088    {
7089        self.backup_type = std::option::Option::Some(v.into());
7090        self
7091    }
7092
7093    /// Sets or clears the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
7094    ///
7095    /// # Example
7096    /// ```ignore,no_run
7097    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7098    /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
7099    /// let x0 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::Automated));
7100    /// let x1 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::OnDemand));
7101    /// let x_none = BackupReencryptionConfig::new().set_or_clear_backup_type(None::<BackupType>);
7102    /// ```
7103    pub fn set_or_clear_backup_type<T>(mut self, v: std::option::Option<T>) -> Self
7104    where
7105        T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
7106    {
7107        self.backup_type = v.map(|x| x.into());
7108        self
7109    }
7110}
7111
7112impl wkt::message::Message for BackupReencryptionConfig {
7113    fn typename() -> &'static str {
7114        "type.googleapis.com/google.cloud.sql.v1.BackupReencryptionConfig"
7115    }
7116}
7117
7118/// Defines additional types related to [BackupReencryptionConfig].
7119pub mod backup_reencryption_config {
7120    #[allow(unused_imports)]
7121    use super::*;
7122
7123    /// Backup type for re-encryption
7124    ///
7125    /// # Working with unknown values
7126    ///
7127    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7128    /// additional enum variants at any time. Adding new variants is not considered
7129    /// a breaking change. Applications should write their code in anticipation of:
7130    ///
7131    /// - New values appearing in future releases of the client library, **and**
7132    /// - New values received dynamically, without application changes.
7133    ///
7134    /// Please consult the [Working with enums] section in the user guide for some
7135    /// guidelines.
7136    ///
7137    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7138    #[derive(Clone, Debug, PartialEq)]
7139    #[non_exhaustive]
7140    pub enum BackupType {
7141        /// Unknown backup type, will be defaulted to AUTOMATIC backup type
7142        Unspecified,
7143        /// Reencrypt automatic backups
7144        Automated,
7145        /// Reencrypt on-demand backups
7146        OnDemand,
7147        /// If set, the enum was initialized with an unknown value.
7148        ///
7149        /// Applications can examine the value using [BackupType::value] or
7150        /// [BackupType::name].
7151        UnknownValue(backup_type::UnknownValue),
7152    }
7153
7154    #[doc(hidden)]
7155    pub mod backup_type {
7156        #[allow(unused_imports)]
7157        use super::*;
7158        #[derive(Clone, Debug, PartialEq)]
7159        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7160    }
7161
7162    impl BackupType {
7163        /// Gets the enum value.
7164        ///
7165        /// Returns `None` if the enum contains an unknown value deserialized from
7166        /// the string representation of enums.
7167        pub fn value(&self) -> std::option::Option<i32> {
7168            match self {
7169                Self::Unspecified => std::option::Option::Some(0),
7170                Self::Automated => std::option::Option::Some(1),
7171                Self::OnDemand => std::option::Option::Some(2),
7172                Self::UnknownValue(u) => u.0.value(),
7173            }
7174        }
7175
7176        /// Gets the enum value as a string.
7177        ///
7178        /// Returns `None` if the enum contains an unknown value deserialized from
7179        /// the integer representation of enums.
7180        pub fn name(&self) -> std::option::Option<&str> {
7181            match self {
7182                Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
7183                Self::Automated => std::option::Option::Some("AUTOMATED"),
7184                Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
7185                Self::UnknownValue(u) => u.0.name(),
7186            }
7187        }
7188    }
7189
7190    impl std::default::Default for BackupType {
7191        fn default() -> Self {
7192            use std::convert::From;
7193            Self::from(0)
7194        }
7195    }
7196
7197    impl std::fmt::Display for BackupType {
7198        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7199            wkt::internal::display_enum(f, self.name(), self.value())
7200        }
7201    }
7202
7203    impl std::convert::From<i32> for BackupType {
7204        fn from(value: i32) -> Self {
7205            match value {
7206                0 => Self::Unspecified,
7207                1 => Self::Automated,
7208                2 => Self::OnDemand,
7209                _ => Self::UnknownValue(backup_type::UnknownValue(
7210                    wkt::internal::UnknownEnumValue::Integer(value),
7211                )),
7212            }
7213        }
7214    }
7215
7216    impl std::convert::From<&str> for BackupType {
7217        fn from(value: &str) -> Self {
7218            use std::string::ToString;
7219            match value {
7220                "BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
7221                "AUTOMATED" => Self::Automated,
7222                "ON_DEMAND" => Self::OnDemand,
7223                _ => Self::UnknownValue(backup_type::UnknownValue(
7224                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7225                )),
7226            }
7227        }
7228    }
7229
7230    impl serde::ser::Serialize for BackupType {
7231        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7232        where
7233            S: serde::Serializer,
7234        {
7235            match self {
7236                Self::Unspecified => serializer.serialize_i32(0),
7237                Self::Automated => serializer.serialize_i32(1),
7238                Self::OnDemand => serializer.serialize_i32(2),
7239                Self::UnknownValue(u) => u.0.serialize(serializer),
7240            }
7241        }
7242    }
7243
7244    impl<'de> serde::de::Deserialize<'de> for BackupType {
7245        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7246        where
7247            D: serde::Deserializer<'de>,
7248        {
7249            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
7250                ".google.cloud.sql.v1.BackupReencryptionConfig.BackupType",
7251            ))
7252        }
7253    }
7254}
7255
7256/// The selected object that Cloud SQL migrates.
7257#[derive(Clone, Default, PartialEq)]
7258#[non_exhaustive]
7259pub struct ExternalSyncSelectedObject {
7260    /// The name of the database that Cloud SQL migrates.
7261    pub database: std::string::String,
7262
7263    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7264}
7265
7266impl ExternalSyncSelectedObject {
7267    /// Creates a new default instance.
7268    pub fn new() -> Self {
7269        std::default::Default::default()
7270    }
7271
7272    /// Sets the value of [database][crate::model::ExternalSyncSelectedObject::database].
7273    ///
7274    /// # Example
7275    /// ```ignore,no_run
7276    /// # use google_cloud_sql_v1::model::ExternalSyncSelectedObject;
7277    /// let x = ExternalSyncSelectedObject::new().set_database("example");
7278    /// ```
7279    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7280        self.database = v.into();
7281        self
7282    }
7283}
7284
7285impl wkt::message::Message for ExternalSyncSelectedObject {
7286    fn typename() -> &'static str {
7287        "type.googleapis.com/google.cloud.sql.v1.ExternalSyncSelectedObject"
7288    }
7289}
7290
7291/// Instance get disk shrink config request.
7292#[derive(Clone, Default, PartialEq)]
7293#[non_exhaustive]
7294pub struct SqlInstancesGetDiskShrinkConfigRequest {
7295    /// Cloud SQL instance ID. This does not include the project ID.
7296    pub instance: std::string::String,
7297
7298    /// Project ID of the project that contains the instance.
7299    pub project: std::string::String,
7300
7301    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7302}
7303
7304impl SqlInstancesGetDiskShrinkConfigRequest {
7305    /// Creates a new default instance.
7306    pub fn new() -> Self {
7307        std::default::Default::default()
7308    }
7309
7310    /// Sets the value of [instance][crate::model::SqlInstancesGetDiskShrinkConfigRequest::instance].
7311    ///
7312    /// # Example
7313    /// ```ignore,no_run
7314    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
7315    /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_instance("example");
7316    /// ```
7317    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7318        self.instance = v.into();
7319        self
7320    }
7321
7322    /// Sets the value of [project][crate::model::SqlInstancesGetDiskShrinkConfigRequest::project].
7323    ///
7324    /// # Example
7325    /// ```ignore,no_run
7326    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
7327    /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_project("example");
7328    /// ```
7329    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7330        self.project = v.into();
7331        self
7332    }
7333}
7334
7335impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigRequest {
7336    fn typename() -> &'static str {
7337        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest"
7338    }
7339}
7340
7341/// Instance verify external sync settings request.
7342#[derive(Clone, Default, PartialEq)]
7343#[non_exhaustive]
7344pub struct SqlInstancesVerifyExternalSyncSettingsRequest {
7345    /// Cloud SQL instance ID. This does not include the project ID.
7346    pub instance: std::string::String,
7347
7348    /// Project ID of the project that contains the instance.
7349    pub project: std::string::String,
7350
7351    /// Flag to enable verifying connection only
7352    pub verify_connection_only: bool,
7353
7354    /// External sync mode
7355    pub sync_mode:
7356        crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7357
7358    /// Optional. Flag to verify settings required by replication setup only
7359    pub verify_replication_only: bool,
7360
7361    /// Optional. MigrationType configures the migration to use physical files or
7362    /// logical dump files. If not set, then the logical dump file configuration is
7363    /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
7364    pub migration_type:
7365        crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7366
7367    /// Optional. Parallel level for initial data sync. Only applicable for
7368    /// PostgreSQL.
7369    pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
7370
7371    /// Optional. Migrate only the specified objects from the source instance. If
7372    /// this field is empty, then migrate all objects.
7373    pub selected_objects: std::vec::Vec<crate::model::ExternalSyncSelectedObject>,
7374
7375    #[allow(missing_docs)]
7376    pub sync_config: std::option::Option<
7377        crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
7378    >,
7379
7380    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7381}
7382
7383impl SqlInstancesVerifyExternalSyncSettingsRequest {
7384    /// Creates a new default instance.
7385    pub fn new() -> Self {
7386        std::default::Default::default()
7387    }
7388
7389    /// Sets the value of [instance][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::instance].
7390    ///
7391    /// # Example
7392    /// ```ignore,no_run
7393    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7394    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_instance("example");
7395    /// ```
7396    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7397        self.instance = v.into();
7398        self
7399    }
7400
7401    /// Sets the value of [project][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::project].
7402    ///
7403    /// # Example
7404    /// ```ignore,no_run
7405    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7406    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_project("example");
7407    /// ```
7408    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7409        self.project = v.into();
7410        self
7411    }
7412
7413    /// Sets the value of [verify_connection_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_connection_only].
7414    ///
7415    /// # Example
7416    /// ```ignore,no_run
7417    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7418    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_connection_only(true);
7419    /// ```
7420    pub fn set_verify_connection_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7421        self.verify_connection_only = v.into();
7422        self
7423    }
7424
7425    /// Sets the value of [sync_mode][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_mode].
7426    ///
7427    /// # Example
7428    /// ```ignore,no_run
7429    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7430    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
7431    /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Online);
7432    /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Offline);
7433    /// ```
7434    pub fn set_sync_mode<
7435        T: std::convert::Into<
7436                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7437            >,
7438    >(
7439        mut self,
7440        v: T,
7441    ) -> Self {
7442        self.sync_mode = v.into();
7443        self
7444    }
7445
7446    /// Sets the value of [verify_replication_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_replication_only].
7447    ///
7448    /// # Example
7449    /// ```ignore,no_run
7450    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7451    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_replication_only(true);
7452    /// ```
7453    pub fn set_verify_replication_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7454        self.verify_replication_only = v.into();
7455        self
7456    }
7457
7458    /// Sets the value of [migration_type][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::migration_type].
7459    ///
7460    /// # Example
7461    /// ```ignore,no_run
7462    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7463    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
7464    /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Logical);
7465    /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Physical);
7466    /// ```
7467    pub fn set_migration_type<
7468        T: std::convert::Into<
7469                crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7470            >,
7471    >(
7472        mut self,
7473        v: T,
7474    ) -> Self {
7475        self.migration_type = v.into();
7476        self
7477    }
7478
7479    /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_parallel_level].
7480    ///
7481    /// # Example
7482    /// ```ignore,no_run
7483    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7484    /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
7485    /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
7486    /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
7487    /// let x2 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
7488    /// ```
7489    pub fn set_sync_parallel_level<
7490        T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
7491    >(
7492        mut self,
7493        v: T,
7494    ) -> Self {
7495        self.sync_parallel_level = v.into();
7496        self
7497    }
7498
7499    /// Sets the value of [selected_objects][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::selected_objects].
7500    ///
7501    /// # Example
7502    /// ```ignore,no_run
7503    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7504    /// use google_cloud_sql_v1::model::ExternalSyncSelectedObject;
7505    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new()
7506    ///     .set_selected_objects([
7507    ///         ExternalSyncSelectedObject::default()/* use setters */,
7508    ///         ExternalSyncSelectedObject::default()/* use (different) setters */,
7509    ///     ]);
7510    /// ```
7511    pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
7512    where
7513        T: std::iter::IntoIterator<Item = V>,
7514        V: std::convert::Into<crate::model::ExternalSyncSelectedObject>,
7515    {
7516        use std::iter::Iterator;
7517        self.selected_objects = v.into_iter().map(|i| i.into()).collect();
7518        self
7519    }
7520
7521    /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config].
7522    ///
7523    /// Note that all the setters affecting `sync_config` are mutually
7524    /// exclusive.
7525    ///
7526    /// # Example
7527    /// ```ignore,no_run
7528    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7529    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7530    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_config(Some(
7531    ///     google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
7532    /// ```
7533    pub fn set_sync_config<
7534        T: std::convert::Into<
7535                std::option::Option<
7536                    crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
7537                >,
7538            >,
7539    >(
7540        mut self,
7541        v: T,
7542    ) -> Self {
7543        self.sync_config = v.into();
7544        self
7545    }
7546
7547    /// The value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
7548    /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
7549    /// holds a different branch.
7550    pub fn mysql_sync_config(
7551        &self,
7552    ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
7553        #[allow(unreachable_patterns)]
7554        self.sync_config.as_ref().and_then(|v| match v {
7555            crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
7556            _ => std::option::Option::None,
7557        })
7558    }
7559
7560    /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
7561    /// to hold a `MysqlSyncConfig`.
7562    ///
7563    /// Note that all the setters affecting `sync_config` are
7564    /// mutually exclusive.
7565    ///
7566    /// # Example
7567    /// ```ignore,no_run
7568    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7569    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7570    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
7571    /// assert!(x.mysql_sync_config().is_some());
7572    /// ```
7573    pub fn set_mysql_sync_config<
7574        T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
7575    >(
7576        mut self,
7577        v: T,
7578    ) -> Self {
7579        self.sync_config = std::option::Option::Some(
7580            crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(
7581                v.into()
7582            )
7583        );
7584        self
7585    }
7586}
7587
7588impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsRequest {
7589    fn typename() -> &'static str {
7590        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest"
7591    }
7592}
7593
7594/// Defines additional types related to [SqlInstancesVerifyExternalSyncSettingsRequest].
7595pub mod sql_instances_verify_external_sync_settings_request {
7596    #[allow(unused_imports)]
7597    use super::*;
7598
7599    /// Enum for [ExternalSyncMode].
7600    ///
7601    /// # Working with unknown values
7602    ///
7603    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7604    /// additional enum variants at any time. Adding new variants is not considered
7605    /// a breaking change. Applications should write their code in anticipation of:
7606    ///
7607    /// - New values appearing in future releases of the client library, **and**
7608    /// - New values received dynamically, without application changes.
7609    ///
7610    /// Please consult the [Working with enums] section in the user guide for some
7611    /// guidelines.
7612    ///
7613    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7614    #[derive(Clone, Debug, PartialEq)]
7615    #[non_exhaustive]
7616    pub enum ExternalSyncMode {
7617        /// Unknown external sync mode, will be defaulted to ONLINE mode
7618        Unspecified,
7619        /// Online external sync will set up replication after initial data external
7620        /// sync
7621        Online,
7622        /// Offline external sync only dumps and loads a one-time snapshot of
7623        /// the primary instance's data
7624        Offline,
7625        /// If set, the enum was initialized with an unknown value.
7626        ///
7627        /// Applications can examine the value using [ExternalSyncMode::value] or
7628        /// [ExternalSyncMode::name].
7629        UnknownValue(external_sync_mode::UnknownValue),
7630    }
7631
7632    #[doc(hidden)]
7633    pub mod external_sync_mode {
7634        #[allow(unused_imports)]
7635        use super::*;
7636        #[derive(Clone, Debug, PartialEq)]
7637        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7638    }
7639
7640    impl ExternalSyncMode {
7641        /// Gets the enum value.
7642        ///
7643        /// Returns `None` if the enum contains an unknown value deserialized from
7644        /// the string representation of enums.
7645        pub fn value(&self) -> std::option::Option<i32> {
7646            match self {
7647                Self::Unspecified => std::option::Option::Some(0),
7648                Self::Online => std::option::Option::Some(1),
7649                Self::Offline => std::option::Option::Some(2),
7650                Self::UnknownValue(u) => u.0.value(),
7651            }
7652        }
7653
7654        /// Gets the enum value as a string.
7655        ///
7656        /// Returns `None` if the enum contains an unknown value deserialized from
7657        /// the integer representation of enums.
7658        pub fn name(&self) -> std::option::Option<&str> {
7659            match self {
7660                Self::Unspecified => std::option::Option::Some("EXTERNAL_SYNC_MODE_UNSPECIFIED"),
7661                Self::Online => std::option::Option::Some("ONLINE"),
7662                Self::Offline => std::option::Option::Some("OFFLINE"),
7663                Self::UnknownValue(u) => u.0.name(),
7664            }
7665        }
7666    }
7667
7668    impl std::default::Default for ExternalSyncMode {
7669        fn default() -> Self {
7670            use std::convert::From;
7671            Self::from(0)
7672        }
7673    }
7674
7675    impl std::fmt::Display for ExternalSyncMode {
7676        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7677            wkt::internal::display_enum(f, self.name(), self.value())
7678        }
7679    }
7680
7681    impl std::convert::From<i32> for ExternalSyncMode {
7682        fn from(value: i32) -> Self {
7683            match value {
7684                0 => Self::Unspecified,
7685                1 => Self::Online,
7686                2 => Self::Offline,
7687                _ => Self::UnknownValue(external_sync_mode::UnknownValue(
7688                    wkt::internal::UnknownEnumValue::Integer(value),
7689                )),
7690            }
7691        }
7692    }
7693
7694    impl std::convert::From<&str> for ExternalSyncMode {
7695        fn from(value: &str) -> Self {
7696            use std::string::ToString;
7697            match value {
7698                "EXTERNAL_SYNC_MODE_UNSPECIFIED" => Self::Unspecified,
7699                "ONLINE" => Self::Online,
7700                "OFFLINE" => Self::Offline,
7701                _ => Self::UnknownValue(external_sync_mode::UnknownValue(
7702                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7703                )),
7704            }
7705        }
7706    }
7707
7708    impl serde::ser::Serialize for ExternalSyncMode {
7709        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7710        where
7711            S: serde::Serializer,
7712        {
7713            match self {
7714                Self::Unspecified => serializer.serialize_i32(0),
7715                Self::Online => serializer.serialize_i32(1),
7716                Self::Offline => serializer.serialize_i32(2),
7717                Self::UnknownValue(u) => u.0.serialize(serializer),
7718            }
7719        }
7720    }
7721
7722    impl<'de> serde::de::Deserialize<'de> for ExternalSyncMode {
7723        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7724        where
7725            D: serde::Deserializer<'de>,
7726        {
7727            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExternalSyncMode>::new(
7728                ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode"))
7729        }
7730    }
7731
7732    /// MigrationType determines whether the migration is a physical file-based
7733    /// migration or a logical dump file-based migration.
7734    ///
7735    /// # Working with unknown values
7736    ///
7737    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7738    /// additional enum variants at any time. Adding new variants is not considered
7739    /// a breaking change. Applications should write their code in anticipation of:
7740    ///
7741    /// - New values appearing in future releases of the client library, **and**
7742    /// - New values received dynamically, without application changes.
7743    ///
7744    /// Please consult the [Working with enums] section in the user guide for some
7745    /// guidelines.
7746    ///
7747    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7748    #[derive(Clone, Debug, PartialEq)]
7749    #[non_exhaustive]
7750    pub enum MigrationType {
7751        /// Default value is a logical dump file-based migration
7752        Unspecified,
7753        /// Logical dump file-based migration
7754        Logical,
7755        /// Physical file-based migration
7756        Physical,
7757        /// If set, the enum was initialized with an unknown value.
7758        ///
7759        /// Applications can examine the value using [MigrationType::value] or
7760        /// [MigrationType::name].
7761        UnknownValue(migration_type::UnknownValue),
7762    }
7763
7764    #[doc(hidden)]
7765    pub mod migration_type {
7766        #[allow(unused_imports)]
7767        use super::*;
7768        #[derive(Clone, Debug, PartialEq)]
7769        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7770    }
7771
7772    impl MigrationType {
7773        /// Gets the enum value.
7774        ///
7775        /// Returns `None` if the enum contains an unknown value deserialized from
7776        /// the string representation of enums.
7777        pub fn value(&self) -> std::option::Option<i32> {
7778            match self {
7779                Self::Unspecified => std::option::Option::Some(0),
7780                Self::Logical => std::option::Option::Some(1),
7781                Self::Physical => std::option::Option::Some(2),
7782                Self::UnknownValue(u) => u.0.value(),
7783            }
7784        }
7785
7786        /// Gets the enum value as a string.
7787        ///
7788        /// Returns `None` if the enum contains an unknown value deserialized from
7789        /// the integer representation of enums.
7790        pub fn name(&self) -> std::option::Option<&str> {
7791            match self {
7792                Self::Unspecified => std::option::Option::Some("MIGRATION_TYPE_UNSPECIFIED"),
7793                Self::Logical => std::option::Option::Some("LOGICAL"),
7794                Self::Physical => std::option::Option::Some("PHYSICAL"),
7795                Self::UnknownValue(u) => u.0.name(),
7796            }
7797        }
7798    }
7799
7800    impl std::default::Default for MigrationType {
7801        fn default() -> Self {
7802            use std::convert::From;
7803            Self::from(0)
7804        }
7805    }
7806
7807    impl std::fmt::Display for MigrationType {
7808        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7809            wkt::internal::display_enum(f, self.name(), self.value())
7810        }
7811    }
7812
7813    impl std::convert::From<i32> for MigrationType {
7814        fn from(value: i32) -> Self {
7815            match value {
7816                0 => Self::Unspecified,
7817                1 => Self::Logical,
7818                2 => Self::Physical,
7819                _ => Self::UnknownValue(migration_type::UnknownValue(
7820                    wkt::internal::UnknownEnumValue::Integer(value),
7821                )),
7822            }
7823        }
7824    }
7825
7826    impl std::convert::From<&str> for MigrationType {
7827        fn from(value: &str) -> Self {
7828            use std::string::ToString;
7829            match value {
7830                "MIGRATION_TYPE_UNSPECIFIED" => Self::Unspecified,
7831                "LOGICAL" => Self::Logical,
7832                "PHYSICAL" => Self::Physical,
7833                _ => Self::UnknownValue(migration_type::UnknownValue(
7834                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7835                )),
7836            }
7837        }
7838    }
7839
7840    impl serde::ser::Serialize for MigrationType {
7841        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7842        where
7843            S: serde::Serializer,
7844        {
7845            match self {
7846                Self::Unspecified => serializer.serialize_i32(0),
7847                Self::Logical => serializer.serialize_i32(1),
7848                Self::Physical => serializer.serialize_i32(2),
7849                Self::UnknownValue(u) => u.0.serialize(serializer),
7850            }
7851        }
7852    }
7853
7854    impl<'de> serde::de::Deserialize<'de> for MigrationType {
7855        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7856        where
7857            D: serde::Deserializer<'de>,
7858        {
7859            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationType>::new(
7860                ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType",
7861            ))
7862        }
7863    }
7864
7865    #[allow(missing_docs)]
7866    #[derive(Clone, Debug, PartialEq)]
7867    #[non_exhaustive]
7868    pub enum SyncConfig {
7869        /// Optional. MySQL-specific settings for start external sync.
7870        MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
7871    }
7872}
7873
7874/// Instance start external sync request.
7875#[derive(Clone, Default, PartialEq)]
7876#[non_exhaustive]
7877pub struct SqlInstancesStartExternalSyncRequest {
7878    /// Cloud SQL instance ID. This does not include the project ID.
7879    pub instance: std::string::String,
7880
7881    /// ID of the project that contains the instance.
7882    pub project: std::string::String,
7883
7884    /// External sync mode.
7885    pub sync_mode:
7886        crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7887
7888    /// Whether to skip the verification step (VESS).
7889    pub skip_verification: bool,
7890
7891    /// Optional. Parallel level for initial data sync. Currently only applicable
7892    /// for MySQL.
7893    pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
7894
7895    /// Optional. MigrationType configures the migration to use physical files or
7896    /// logical dump files. If not set, then the logical dump file configuration is
7897    /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
7898    pub migration_type:
7899        crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7900
7901    /// Optional. MySQL only. True if end-user has confirmed that this SES call
7902    /// will wipe replica databases overlapping with the proposed selected_objects.
7903    /// If this field is not set and there are both overlapping and additional
7904    /// databases proposed, an error will be returned.
7905    pub replica_overwrite_enabled: bool,
7906
7907    #[allow(missing_docs)]
7908    pub sync_config:
7909        std::option::Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>,
7910
7911    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7912}
7913
7914impl SqlInstancesStartExternalSyncRequest {
7915    /// Creates a new default instance.
7916    pub fn new() -> Self {
7917        std::default::Default::default()
7918    }
7919
7920    /// Sets the value of [instance][crate::model::SqlInstancesStartExternalSyncRequest::instance].
7921    ///
7922    /// # Example
7923    /// ```ignore,no_run
7924    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7925    /// let x = SqlInstancesStartExternalSyncRequest::new().set_instance("example");
7926    /// ```
7927    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7928        self.instance = v.into();
7929        self
7930    }
7931
7932    /// Sets the value of [project][crate::model::SqlInstancesStartExternalSyncRequest::project].
7933    ///
7934    /// # Example
7935    /// ```ignore,no_run
7936    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7937    /// let x = SqlInstancesStartExternalSyncRequest::new().set_project("example");
7938    /// ```
7939    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7940        self.project = v.into();
7941        self
7942    }
7943
7944    /// Sets the value of [sync_mode][crate::model::SqlInstancesStartExternalSyncRequest::sync_mode].
7945    ///
7946    /// # Example
7947    /// ```ignore,no_run
7948    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7949    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
7950    /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Online);
7951    /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Offline);
7952    /// ```
7953    pub fn set_sync_mode<
7954        T: std::convert::Into<
7955                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7956            >,
7957    >(
7958        mut self,
7959        v: T,
7960    ) -> Self {
7961        self.sync_mode = v.into();
7962        self
7963    }
7964
7965    /// Sets the value of [skip_verification][crate::model::SqlInstancesStartExternalSyncRequest::skip_verification].
7966    ///
7967    /// # Example
7968    /// ```ignore,no_run
7969    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7970    /// let x = SqlInstancesStartExternalSyncRequest::new().set_skip_verification(true);
7971    /// ```
7972    pub fn set_skip_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7973        self.skip_verification = v.into();
7974        self
7975    }
7976
7977    /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesStartExternalSyncRequest::sync_parallel_level].
7978    ///
7979    /// # Example
7980    /// ```ignore,no_run
7981    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7982    /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
7983    /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
7984    /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
7985    /// let x2 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
7986    /// ```
7987    pub fn set_sync_parallel_level<
7988        T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
7989    >(
7990        mut self,
7991        v: T,
7992    ) -> Self {
7993        self.sync_parallel_level = v.into();
7994        self
7995    }
7996
7997    /// Sets the value of [migration_type][crate::model::SqlInstancesStartExternalSyncRequest::migration_type].
7998    ///
7999    /// # Example
8000    /// ```ignore,no_run
8001    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8002    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
8003    /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Logical);
8004    /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Physical);
8005    /// ```
8006    pub fn set_migration_type<
8007        T: std::convert::Into<
8008                crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
8009            >,
8010    >(
8011        mut self,
8012        v: T,
8013    ) -> Self {
8014        self.migration_type = v.into();
8015        self
8016    }
8017
8018    /// Sets the value of [replica_overwrite_enabled][crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled].
8019    ///
8020    /// # Example
8021    /// ```ignore,no_run
8022    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8023    /// let x = SqlInstancesStartExternalSyncRequest::new().set_replica_overwrite_enabled(true);
8024    /// ```
8025    pub fn set_replica_overwrite_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8026        self.replica_overwrite_enabled = v.into();
8027        self
8028    }
8029
8030    /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config].
8031    ///
8032    /// Note that all the setters affecting `sync_config` are mutually
8033    /// exclusive.
8034    ///
8035    /// # Example
8036    /// ```ignore,no_run
8037    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8038    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
8039    /// let x = SqlInstancesStartExternalSyncRequest::new().set_sync_config(Some(
8040    ///     google_cloud_sql_v1::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
8041    /// ```
8042    pub fn set_sync_config<
8043        T: std::convert::Into<
8044                std::option::Option<
8045                    crate::model::sql_instances_start_external_sync_request::SyncConfig,
8046                >,
8047            >,
8048    >(
8049        mut self,
8050        v: T,
8051    ) -> Self {
8052        self.sync_config = v.into();
8053        self
8054    }
8055
8056    /// The value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
8057    /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
8058    /// holds a different branch.
8059    pub fn mysql_sync_config(
8060        &self,
8061    ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
8062        #[allow(unreachable_patterns)]
8063        self.sync_config.as_ref().and_then(|v| match v {
8064            crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
8065            _ => std::option::Option::None,
8066        })
8067    }
8068
8069    /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
8070    /// to hold a `MysqlSyncConfig`.
8071    ///
8072    /// Note that all the setters affecting `sync_config` are
8073    /// mutually exclusive.
8074    ///
8075    /// # Example
8076    /// ```ignore,no_run
8077    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8078    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
8079    /// let x = SqlInstancesStartExternalSyncRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
8080    /// assert!(x.mysql_sync_config().is_some());
8081    /// ```
8082    pub fn set_mysql_sync_config<
8083        T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
8084    >(
8085        mut self,
8086        v: T,
8087    ) -> Self {
8088        self.sync_config = std::option::Option::Some(
8089            crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(
8090                v.into(),
8091            ),
8092        );
8093        self
8094    }
8095}
8096
8097impl wkt::message::Message for SqlInstancesStartExternalSyncRequest {
8098    fn typename() -> &'static str {
8099        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest"
8100    }
8101}
8102
8103/// Defines additional types related to [SqlInstancesStartExternalSyncRequest].
8104pub mod sql_instances_start_external_sync_request {
8105    #[allow(unused_imports)]
8106    use super::*;
8107
8108    #[allow(missing_docs)]
8109    #[derive(Clone, Debug, PartialEq)]
8110    #[non_exhaustive]
8111    pub enum SyncConfig {
8112        /// MySQL-specific settings for start external sync.
8113        MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
8114    }
8115}
8116
8117/// Instance reset replica size request.
8118#[derive(Clone, Default, PartialEq)]
8119#[non_exhaustive]
8120pub struct SqlInstancesResetReplicaSizeRequest {
8121    /// Cloud SQL read replica instance name.
8122    pub instance: std::string::String,
8123
8124    /// ID of the project that contains the read replica.
8125    pub project: std::string::String,
8126
8127    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8128}
8129
8130impl SqlInstancesResetReplicaSizeRequest {
8131    /// Creates a new default instance.
8132    pub fn new() -> Self {
8133        std::default::Default::default()
8134    }
8135
8136    /// Sets the value of [instance][crate::model::SqlInstancesResetReplicaSizeRequest::instance].
8137    ///
8138    /// # Example
8139    /// ```ignore,no_run
8140    /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
8141    /// let x = SqlInstancesResetReplicaSizeRequest::new().set_instance("example");
8142    /// ```
8143    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8144        self.instance = v.into();
8145        self
8146    }
8147
8148    /// Sets the value of [project][crate::model::SqlInstancesResetReplicaSizeRequest::project].
8149    ///
8150    /// # Example
8151    /// ```ignore,no_run
8152    /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
8153    /// let x = SqlInstancesResetReplicaSizeRequest::new().set_project("example");
8154    /// ```
8155    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8156        self.project = v.into();
8157        self
8158    }
8159}
8160
8161impl wkt::message::Message for SqlInstancesResetReplicaSizeRequest {
8162    fn typename() -> &'static str {
8163        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest"
8164    }
8165}
8166
8167/// Instance create ephemeral certificate request.
8168#[derive(Clone, Default, PartialEq)]
8169#[non_exhaustive]
8170pub struct SqlInstancesCreateEphemeralCertRequest {
8171    /// Cloud SQL instance ID. This does not include the project ID.
8172    pub instance: std::string::String,
8173
8174    /// Project ID of the Cloud SQL project.
8175    pub project: std::string::String,
8176
8177    #[allow(missing_docs)]
8178    pub body: std::option::Option<crate::model::SslCertsCreateEphemeralRequest>,
8179
8180    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8181}
8182
8183impl SqlInstancesCreateEphemeralCertRequest {
8184    /// Creates a new default instance.
8185    pub fn new() -> Self {
8186        std::default::Default::default()
8187    }
8188
8189    /// Sets the value of [instance][crate::model::SqlInstancesCreateEphemeralCertRequest::instance].
8190    ///
8191    /// # Example
8192    /// ```ignore,no_run
8193    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8194    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_instance("example");
8195    /// ```
8196    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8197        self.instance = v.into();
8198        self
8199    }
8200
8201    /// Sets the value of [project][crate::model::SqlInstancesCreateEphemeralCertRequest::project].
8202    ///
8203    /// # Example
8204    /// ```ignore,no_run
8205    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8206    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_project("example");
8207    /// ```
8208    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8209        self.project = v.into();
8210        self
8211    }
8212
8213    /// Sets the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
8214    ///
8215    /// # Example
8216    /// ```ignore,no_run
8217    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8218    /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8219    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_body(SslCertsCreateEphemeralRequest::default()/* use setters */);
8220    /// ```
8221    pub fn set_body<T>(mut self, v: T) -> Self
8222    where
8223        T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
8224    {
8225        self.body = std::option::Option::Some(v.into());
8226        self
8227    }
8228
8229    /// Sets or clears the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
8230    ///
8231    /// # Example
8232    /// ```ignore,no_run
8233    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8234    /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8235    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(Some(SslCertsCreateEphemeralRequest::default()/* use setters */));
8236    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(None::<SslCertsCreateEphemeralRequest>);
8237    /// ```
8238    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
8239    where
8240        T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
8241    {
8242        self.body = v.map(|x| x.into());
8243        self
8244    }
8245}
8246
8247impl wkt::message::Message for SqlInstancesCreateEphemeralCertRequest {
8248    fn typename() -> &'static str {
8249        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest"
8250    }
8251}
8252
8253/// Database instance clone request.
8254#[derive(Clone, Default, PartialEq)]
8255#[non_exhaustive]
8256pub struct InstancesCloneRequest {
8257    /// Required. Contains details about the clone operation.
8258    pub clone_context: std::option::Option<crate::model::CloneContext>,
8259
8260    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8261}
8262
8263impl InstancesCloneRequest {
8264    /// Creates a new default instance.
8265    pub fn new() -> Self {
8266        std::default::Default::default()
8267    }
8268
8269    /// Sets the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
8270    ///
8271    /// # Example
8272    /// ```ignore,no_run
8273    /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
8274    /// use google_cloud_sql_v1::model::CloneContext;
8275    /// let x = InstancesCloneRequest::new().set_clone_context(CloneContext::default()/* use setters */);
8276    /// ```
8277    pub fn set_clone_context<T>(mut self, v: T) -> Self
8278    where
8279        T: std::convert::Into<crate::model::CloneContext>,
8280    {
8281        self.clone_context = std::option::Option::Some(v.into());
8282        self
8283    }
8284
8285    /// Sets or clears the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
8286    ///
8287    /// # Example
8288    /// ```ignore,no_run
8289    /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
8290    /// use google_cloud_sql_v1::model::CloneContext;
8291    /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(Some(CloneContext::default()/* use setters */));
8292    /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(None::<CloneContext>);
8293    /// ```
8294    pub fn set_or_clear_clone_context<T>(mut self, v: std::option::Option<T>) -> Self
8295    where
8296        T: std::convert::Into<crate::model::CloneContext>,
8297    {
8298        self.clone_context = v.map(|x| x.into());
8299        self
8300    }
8301}
8302
8303impl wkt::message::Message for InstancesCloneRequest {
8304    fn typename() -> &'static str {
8305        "type.googleapis.com/google.cloud.sql.v1.InstancesCloneRequest"
8306    }
8307}
8308
8309/// Database demote primary instance request.
8310#[derive(Clone, Default, PartialEq)]
8311#[non_exhaustive]
8312pub struct InstancesDemoteMasterRequest {
8313    /// Contains details about the demoteMaster operation.
8314    pub demote_master_context: std::option::Option<crate::model::DemoteMasterContext>,
8315
8316    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8317}
8318
8319impl InstancesDemoteMasterRequest {
8320    /// Creates a new default instance.
8321    pub fn new() -> Self {
8322        std::default::Default::default()
8323    }
8324
8325    /// Sets the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
8326    ///
8327    /// # Example
8328    /// ```ignore,no_run
8329    /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
8330    /// use google_cloud_sql_v1::model::DemoteMasterContext;
8331    /// let x = InstancesDemoteMasterRequest::new().set_demote_master_context(DemoteMasterContext::default()/* use setters */);
8332    /// ```
8333    pub fn set_demote_master_context<T>(mut self, v: T) -> Self
8334    where
8335        T: std::convert::Into<crate::model::DemoteMasterContext>,
8336    {
8337        self.demote_master_context = std::option::Option::Some(v.into());
8338        self
8339    }
8340
8341    /// Sets or clears the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
8342    ///
8343    /// # Example
8344    /// ```ignore,no_run
8345    /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
8346    /// use google_cloud_sql_v1::model::DemoteMasterContext;
8347    /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(Some(DemoteMasterContext::default()/* use setters */));
8348    /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(None::<DemoteMasterContext>);
8349    /// ```
8350    pub fn set_or_clear_demote_master_context<T>(mut self, v: std::option::Option<T>) -> Self
8351    where
8352        T: std::convert::Into<crate::model::DemoteMasterContext>,
8353    {
8354        self.demote_master_context = v.map(|x| x.into());
8355        self
8356    }
8357}
8358
8359impl wkt::message::Message for InstancesDemoteMasterRequest {
8360    fn typename() -> &'static str {
8361        "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteMasterRequest"
8362    }
8363}
8364
8365/// This request is used to demote an existing standalone instance to be a
8366/// Cloud SQL read replica for an external database server.
8367#[derive(Clone, Default, PartialEq)]
8368#[non_exhaustive]
8369pub struct InstancesDemoteRequest {
8370    /// Required. Contains details about the demote operation.
8371    pub demote_context: std::option::Option<crate::model::DemoteContext>,
8372
8373    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8374}
8375
8376impl InstancesDemoteRequest {
8377    /// Creates a new default instance.
8378    pub fn new() -> Self {
8379        std::default::Default::default()
8380    }
8381
8382    /// Sets the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
8383    ///
8384    /// # Example
8385    /// ```ignore,no_run
8386    /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
8387    /// use google_cloud_sql_v1::model::DemoteContext;
8388    /// let x = InstancesDemoteRequest::new().set_demote_context(DemoteContext::default()/* use setters */);
8389    /// ```
8390    pub fn set_demote_context<T>(mut self, v: T) -> Self
8391    where
8392        T: std::convert::Into<crate::model::DemoteContext>,
8393    {
8394        self.demote_context = std::option::Option::Some(v.into());
8395        self
8396    }
8397
8398    /// Sets or clears the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
8399    ///
8400    /// # Example
8401    /// ```ignore,no_run
8402    /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
8403    /// use google_cloud_sql_v1::model::DemoteContext;
8404    /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(Some(DemoteContext::default()/* use setters */));
8405    /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(None::<DemoteContext>);
8406    /// ```
8407    pub fn set_or_clear_demote_context<T>(mut self, v: std::option::Option<T>) -> Self
8408    where
8409        T: std::convert::Into<crate::model::DemoteContext>,
8410    {
8411        self.demote_context = v.map(|x| x.into());
8412        self
8413    }
8414}
8415
8416impl wkt::message::Message for InstancesDemoteRequest {
8417    fn typename() -> &'static str {
8418        "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteRequest"
8419    }
8420}
8421
8422/// Database instance export request.
8423#[derive(Clone, Default, PartialEq)]
8424#[non_exhaustive]
8425pub struct InstancesExportRequest {
8426    /// Contains details about the export operation.
8427    pub export_context: std::option::Option<crate::model::ExportContext>,
8428
8429    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8430}
8431
8432impl InstancesExportRequest {
8433    /// Creates a new default instance.
8434    pub fn new() -> Self {
8435        std::default::Default::default()
8436    }
8437
8438    /// Sets the value of [export_context][crate::model::InstancesExportRequest::export_context].
8439    ///
8440    /// # Example
8441    /// ```ignore,no_run
8442    /// # use google_cloud_sql_v1::model::InstancesExportRequest;
8443    /// use google_cloud_sql_v1::model::ExportContext;
8444    /// let x = InstancesExportRequest::new().set_export_context(ExportContext::default()/* use setters */);
8445    /// ```
8446    pub fn set_export_context<T>(mut self, v: T) -> Self
8447    where
8448        T: std::convert::Into<crate::model::ExportContext>,
8449    {
8450        self.export_context = std::option::Option::Some(v.into());
8451        self
8452    }
8453
8454    /// Sets or clears the value of [export_context][crate::model::InstancesExportRequest::export_context].
8455    ///
8456    /// # Example
8457    /// ```ignore,no_run
8458    /// # use google_cloud_sql_v1::model::InstancesExportRequest;
8459    /// use google_cloud_sql_v1::model::ExportContext;
8460    /// let x = InstancesExportRequest::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
8461    /// let x = InstancesExportRequest::new().set_or_clear_export_context(None::<ExportContext>);
8462    /// ```
8463    pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
8464    where
8465        T: std::convert::Into<crate::model::ExportContext>,
8466    {
8467        self.export_context = v.map(|x| x.into());
8468        self
8469    }
8470}
8471
8472impl wkt::message::Message for InstancesExportRequest {
8473    fn typename() -> &'static str {
8474        "type.googleapis.com/google.cloud.sql.v1.InstancesExportRequest"
8475    }
8476}
8477
8478/// Instance failover request.
8479#[derive(Clone, Default, PartialEq)]
8480#[non_exhaustive]
8481pub struct InstancesFailoverRequest {
8482    /// Failover Context.
8483    pub failover_context: std::option::Option<crate::model::FailoverContext>,
8484
8485    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8486}
8487
8488impl InstancesFailoverRequest {
8489    /// Creates a new default instance.
8490    pub fn new() -> Self {
8491        std::default::Default::default()
8492    }
8493
8494    /// Sets the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
8495    ///
8496    /// # Example
8497    /// ```ignore,no_run
8498    /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
8499    /// use google_cloud_sql_v1::model::FailoverContext;
8500    /// let x = InstancesFailoverRequest::new().set_failover_context(FailoverContext::default()/* use setters */);
8501    /// ```
8502    pub fn set_failover_context<T>(mut self, v: T) -> Self
8503    where
8504        T: std::convert::Into<crate::model::FailoverContext>,
8505    {
8506        self.failover_context = std::option::Option::Some(v.into());
8507        self
8508    }
8509
8510    /// Sets or clears the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
8511    ///
8512    /// # Example
8513    /// ```ignore,no_run
8514    /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
8515    /// use google_cloud_sql_v1::model::FailoverContext;
8516    /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(Some(FailoverContext::default()/* use setters */));
8517    /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(None::<FailoverContext>);
8518    /// ```
8519    pub fn set_or_clear_failover_context<T>(mut self, v: std::option::Option<T>) -> Self
8520    where
8521        T: std::convert::Into<crate::model::FailoverContext>,
8522    {
8523        self.failover_context = v.map(|x| x.into());
8524        self
8525    }
8526}
8527
8528impl wkt::message::Message for InstancesFailoverRequest {
8529    fn typename() -> &'static str {
8530        "type.googleapis.com/google.cloud.sql.v1.InstancesFailoverRequest"
8531    }
8532}
8533
8534/// SslCerts create ephemeral certificate request.
8535#[derive(Clone, Default, PartialEq)]
8536#[non_exhaustive]
8537pub struct SslCertsCreateEphemeralRequest {
8538    /// PEM encoded public key to include in the signed certificate.
8539    pub public_key: std::string::String,
8540
8541    /// Access token to include in the signed certificate.
8542    pub access_token: std::string::String,
8543
8544    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8545}
8546
8547impl SslCertsCreateEphemeralRequest {
8548    /// Creates a new default instance.
8549    pub fn new() -> Self {
8550        std::default::Default::default()
8551    }
8552
8553    /// Sets the value of [public_key][crate::model::SslCertsCreateEphemeralRequest::public_key].
8554    ///
8555    /// # Example
8556    /// ```ignore,no_run
8557    /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8558    /// let x = SslCertsCreateEphemeralRequest::new().set_public_key("example");
8559    /// ```
8560    pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8561        self.public_key = v.into();
8562        self
8563    }
8564
8565    /// Sets the value of [access_token][crate::model::SslCertsCreateEphemeralRequest::access_token].
8566    ///
8567    /// # Example
8568    /// ```ignore,no_run
8569    /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8570    /// let x = SslCertsCreateEphemeralRequest::new().set_access_token("example");
8571    /// ```
8572    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8573        self.access_token = v.into();
8574        self
8575    }
8576}
8577
8578impl wkt::message::Message for SslCertsCreateEphemeralRequest {
8579    fn typename() -> &'static str {
8580        "type.googleapis.com/google.cloud.sql.v1.SslCertsCreateEphemeralRequest"
8581    }
8582}
8583
8584/// Database instance import request.
8585#[derive(Clone, Default, PartialEq)]
8586#[non_exhaustive]
8587pub struct InstancesImportRequest {
8588    /// Contains details about the import operation.
8589    pub import_context: std::option::Option<crate::model::ImportContext>,
8590
8591    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8592}
8593
8594impl InstancesImportRequest {
8595    /// Creates a new default instance.
8596    pub fn new() -> Self {
8597        std::default::Default::default()
8598    }
8599
8600    /// Sets the value of [import_context][crate::model::InstancesImportRequest::import_context].
8601    ///
8602    /// # Example
8603    /// ```ignore,no_run
8604    /// # use google_cloud_sql_v1::model::InstancesImportRequest;
8605    /// use google_cloud_sql_v1::model::ImportContext;
8606    /// let x = InstancesImportRequest::new().set_import_context(ImportContext::default()/* use setters */);
8607    /// ```
8608    pub fn set_import_context<T>(mut self, v: T) -> Self
8609    where
8610        T: std::convert::Into<crate::model::ImportContext>,
8611    {
8612        self.import_context = std::option::Option::Some(v.into());
8613        self
8614    }
8615
8616    /// Sets or clears the value of [import_context][crate::model::InstancesImportRequest::import_context].
8617    ///
8618    /// # Example
8619    /// ```ignore,no_run
8620    /// # use google_cloud_sql_v1::model::InstancesImportRequest;
8621    /// use google_cloud_sql_v1::model::ImportContext;
8622    /// let x = InstancesImportRequest::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
8623    /// let x = InstancesImportRequest::new().set_or_clear_import_context(None::<ImportContext>);
8624    /// ```
8625    pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
8626    where
8627        T: std::convert::Into<crate::model::ImportContext>,
8628    {
8629        self.import_context = v.map(|x| x.into());
8630        self
8631    }
8632}
8633
8634impl wkt::message::Message for InstancesImportRequest {
8635    fn typename() -> &'static str {
8636        "type.googleapis.com/google.cloud.sql.v1.InstancesImportRequest"
8637    }
8638}
8639
8640/// Request for Pre-checks for MVU
8641#[derive(Clone, Default, PartialEq)]
8642#[non_exhaustive]
8643pub struct InstancesPreCheckMajorVersionUpgradeRequest {
8644    /// Required. Contains details about the pre-check major version upgrade
8645    /// operation.
8646    pub pre_check_major_version_upgrade_context:
8647        std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
8648
8649    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8650}
8651
8652impl InstancesPreCheckMajorVersionUpgradeRequest {
8653    /// Creates a new default instance.
8654    pub fn new() -> Self {
8655        std::default::Default::default()
8656    }
8657
8658    /// Sets the value of [pre_check_major_version_upgrade_context][crate::model::InstancesPreCheckMajorVersionUpgradeRequest::pre_check_major_version_upgrade_context].
8659    ///
8660    /// # Example
8661    /// ```ignore,no_run
8662    /// # use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
8663    /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
8664    /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_pre_check_major_version_upgrade_context(PreCheckMajorVersionUpgradeContext::default()/* use setters */);
8665    /// ```
8666    pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
8667    where
8668        T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
8669    {
8670        self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
8671        self
8672    }
8673
8674    /// Sets or clears the value of [pre_check_major_version_upgrade_context][crate::model::InstancesPreCheckMajorVersionUpgradeRequest::pre_check_major_version_upgrade_context].
8675    ///
8676    /// # Example
8677    /// ```ignore,no_run
8678    /// # use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
8679    /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
8680    /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_pre_check_major_version_upgrade_context(Some(PreCheckMajorVersionUpgradeContext::default()/* use setters */));
8681    /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_pre_check_major_version_upgrade_context(None::<PreCheckMajorVersionUpgradeContext>);
8682    /// ```
8683    pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
8684        mut self,
8685        v: std::option::Option<T>,
8686    ) -> Self
8687    where
8688        T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
8689    {
8690        self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
8691        self
8692    }
8693}
8694
8695impl wkt::message::Message for InstancesPreCheckMajorVersionUpgradeRequest {
8696    fn typename() -> &'static str {
8697        "type.googleapis.com/google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest"
8698    }
8699}
8700
8701/// Database instances list response.
8702#[derive(Clone, Default, PartialEq)]
8703#[non_exhaustive]
8704pub struct InstancesListResponse {
8705    /// This is always `sql#instancesList`.
8706    pub kind: std::string::String,
8707
8708    /// List of warnings that occurred while handling the request.
8709    pub warnings: std::vec::Vec<crate::model::ApiWarning>,
8710
8711    /// List of database instance resources.
8712    pub items: std::vec::Vec<crate::model::DatabaseInstance>,
8713
8714    /// The continuation token, used to page through large result sets. Provide
8715    /// this value in a subsequent request to return the next page of results.
8716    pub next_page_token: std::string::String,
8717
8718    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8719}
8720
8721impl InstancesListResponse {
8722    /// Creates a new default instance.
8723    pub fn new() -> Self {
8724        std::default::Default::default()
8725    }
8726
8727    /// Sets the value of [kind][crate::model::InstancesListResponse::kind].
8728    ///
8729    /// # Example
8730    /// ```ignore,no_run
8731    /// # use google_cloud_sql_v1::model::InstancesListResponse;
8732    /// let x = InstancesListResponse::new().set_kind("example");
8733    /// ```
8734    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8735        self.kind = v.into();
8736        self
8737    }
8738
8739    /// Sets the value of [warnings][crate::model::InstancesListResponse::warnings].
8740    ///
8741    /// # Example
8742    /// ```ignore,no_run
8743    /// # use google_cloud_sql_v1::model::InstancesListResponse;
8744    /// use google_cloud_sql_v1::model::ApiWarning;
8745    /// let x = InstancesListResponse::new()
8746    ///     .set_warnings([
8747    ///         ApiWarning::default()/* use setters */,
8748    ///         ApiWarning::default()/* use (different) setters */,
8749    ///     ]);
8750    /// ```
8751    pub fn set_warnings<T, V>(mut self, v: T) -> Self
8752    where
8753        T: std::iter::IntoIterator<Item = V>,
8754        V: std::convert::Into<crate::model::ApiWarning>,
8755    {
8756        use std::iter::Iterator;
8757        self.warnings = v.into_iter().map(|i| i.into()).collect();
8758        self
8759    }
8760
8761    /// Sets the value of [items][crate::model::InstancesListResponse::items].
8762    ///
8763    /// # Example
8764    /// ```ignore,no_run
8765    /// # use google_cloud_sql_v1::model::InstancesListResponse;
8766    /// use google_cloud_sql_v1::model::DatabaseInstance;
8767    /// let x = InstancesListResponse::new()
8768    ///     .set_items([
8769    ///         DatabaseInstance::default()/* use setters */,
8770    ///         DatabaseInstance::default()/* use (different) setters */,
8771    ///     ]);
8772    /// ```
8773    pub fn set_items<T, V>(mut self, v: T) -> Self
8774    where
8775        T: std::iter::IntoIterator<Item = V>,
8776        V: std::convert::Into<crate::model::DatabaseInstance>,
8777    {
8778        use std::iter::Iterator;
8779        self.items = v.into_iter().map(|i| i.into()).collect();
8780        self
8781    }
8782
8783    /// Sets the value of [next_page_token][crate::model::InstancesListResponse::next_page_token].
8784    ///
8785    /// # Example
8786    /// ```ignore,no_run
8787    /// # use google_cloud_sql_v1::model::InstancesListResponse;
8788    /// let x = InstancesListResponse::new().set_next_page_token("example");
8789    /// ```
8790    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8791        self.next_page_token = v.into();
8792        self
8793    }
8794}
8795
8796impl wkt::message::Message for InstancesListResponse {
8797    fn typename() -> &'static str {
8798        "type.googleapis.com/google.cloud.sql.v1.InstancesListResponse"
8799    }
8800}
8801
8802#[doc(hidden)]
8803impl google_cloud_gax::paginator::internal::PageableResponse for InstancesListResponse {
8804    type PageItem = crate::model::DatabaseInstance;
8805
8806    fn items(self) -> std::vec::Vec<Self::PageItem> {
8807        self.items
8808    }
8809
8810    fn next_page_token(&self) -> std::string::String {
8811        use std::clone::Clone;
8812        self.next_page_token.clone()
8813    }
8814}
8815
8816/// Instances ListServerCas response.
8817#[derive(Clone, Default, PartialEq)]
8818#[non_exhaustive]
8819pub struct InstancesListServerCasResponse {
8820    /// List of server CA certificates for the instance.
8821    pub certs: std::vec::Vec<crate::model::SslCert>,
8822
8823    #[allow(missing_docs)]
8824    pub active_version: std::string::String,
8825
8826    /// This is always `sql#instancesListServerCas`.
8827    pub kind: std::string::String,
8828
8829    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8830}
8831
8832impl InstancesListServerCasResponse {
8833    /// Creates a new default instance.
8834    pub fn new() -> Self {
8835        std::default::Default::default()
8836    }
8837
8838    /// Sets the value of [certs][crate::model::InstancesListServerCasResponse::certs].
8839    ///
8840    /// # Example
8841    /// ```ignore,no_run
8842    /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8843    /// use google_cloud_sql_v1::model::SslCert;
8844    /// let x = InstancesListServerCasResponse::new()
8845    ///     .set_certs([
8846    ///         SslCert::default()/* use setters */,
8847    ///         SslCert::default()/* use (different) setters */,
8848    ///     ]);
8849    /// ```
8850    pub fn set_certs<T, V>(mut self, v: T) -> Self
8851    where
8852        T: std::iter::IntoIterator<Item = V>,
8853        V: std::convert::Into<crate::model::SslCert>,
8854    {
8855        use std::iter::Iterator;
8856        self.certs = v.into_iter().map(|i| i.into()).collect();
8857        self
8858    }
8859
8860    /// Sets the value of [active_version][crate::model::InstancesListServerCasResponse::active_version].
8861    ///
8862    /// # Example
8863    /// ```ignore,no_run
8864    /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8865    /// let x = InstancesListServerCasResponse::new().set_active_version("example");
8866    /// ```
8867    pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8868        self.active_version = v.into();
8869        self
8870    }
8871
8872    /// Sets the value of [kind][crate::model::InstancesListServerCasResponse::kind].
8873    ///
8874    /// # Example
8875    /// ```ignore,no_run
8876    /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8877    /// let x = InstancesListServerCasResponse::new().set_kind("example");
8878    /// ```
8879    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8880        self.kind = v.into();
8881        self
8882    }
8883}
8884
8885impl wkt::message::Message for InstancesListServerCasResponse {
8886    fn typename() -> &'static str {
8887        "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCasResponse"
8888    }
8889}
8890
8891/// Instances ListServerCertificates response.
8892#[derive(Clone, Default, PartialEq)]
8893#[non_exhaustive]
8894pub struct InstancesListServerCertificatesResponse {
8895    /// List of server CA certificates for the instance.
8896    pub ca_certs: std::vec::Vec<crate::model::SslCert>,
8897
8898    /// List of server certificates for the instance, signed by the corresponding
8899    /// CA from the `ca_certs` list.
8900    pub server_certs: std::vec::Vec<crate::model::SslCert>,
8901
8902    /// The `sha1_fingerprint` of the active certificate from `server_certs`.
8903    pub active_version: std::string::String,
8904
8905    /// This is always `sql#instancesListServerCertificates`.
8906    pub kind: std::string::String,
8907
8908    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8909}
8910
8911impl InstancesListServerCertificatesResponse {
8912    /// Creates a new default instance.
8913    pub fn new() -> Self {
8914        std::default::Default::default()
8915    }
8916
8917    /// Sets the value of [ca_certs][crate::model::InstancesListServerCertificatesResponse::ca_certs].
8918    ///
8919    /// # Example
8920    /// ```ignore,no_run
8921    /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8922    /// use google_cloud_sql_v1::model::SslCert;
8923    /// let x = InstancesListServerCertificatesResponse::new()
8924    ///     .set_ca_certs([
8925    ///         SslCert::default()/* use setters */,
8926    ///         SslCert::default()/* use (different) setters */,
8927    ///     ]);
8928    /// ```
8929    pub fn set_ca_certs<T, V>(mut self, v: T) -> Self
8930    where
8931        T: std::iter::IntoIterator<Item = V>,
8932        V: std::convert::Into<crate::model::SslCert>,
8933    {
8934        use std::iter::Iterator;
8935        self.ca_certs = v.into_iter().map(|i| i.into()).collect();
8936        self
8937    }
8938
8939    /// Sets the value of [server_certs][crate::model::InstancesListServerCertificatesResponse::server_certs].
8940    ///
8941    /// # Example
8942    /// ```ignore,no_run
8943    /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8944    /// use google_cloud_sql_v1::model::SslCert;
8945    /// let x = InstancesListServerCertificatesResponse::new()
8946    ///     .set_server_certs([
8947    ///         SslCert::default()/* use setters */,
8948    ///         SslCert::default()/* use (different) setters */,
8949    ///     ]);
8950    /// ```
8951    pub fn set_server_certs<T, V>(mut self, v: T) -> Self
8952    where
8953        T: std::iter::IntoIterator<Item = V>,
8954        V: std::convert::Into<crate::model::SslCert>,
8955    {
8956        use std::iter::Iterator;
8957        self.server_certs = v.into_iter().map(|i| i.into()).collect();
8958        self
8959    }
8960
8961    /// Sets the value of [active_version][crate::model::InstancesListServerCertificatesResponse::active_version].
8962    ///
8963    /// # Example
8964    /// ```ignore,no_run
8965    /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8966    /// let x = InstancesListServerCertificatesResponse::new().set_active_version("example");
8967    /// ```
8968    pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8969        self.active_version = v.into();
8970        self
8971    }
8972
8973    /// Sets the value of [kind][crate::model::InstancesListServerCertificatesResponse::kind].
8974    ///
8975    /// # Example
8976    /// ```ignore,no_run
8977    /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8978    /// let x = InstancesListServerCertificatesResponse::new().set_kind("example");
8979    /// ```
8980    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8981        self.kind = v.into();
8982        self
8983    }
8984}
8985
8986impl wkt::message::Message for InstancesListServerCertificatesResponse {
8987    fn typename() -> &'static str {
8988        "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCertificatesResponse"
8989    }
8990}
8991
8992/// Instances ListEntraIdCertificates response.
8993#[derive(Clone, Default, PartialEq)]
8994#[non_exhaustive]
8995pub struct InstancesListEntraIdCertificatesResponse {
8996    /// List of Entra ID certificates for the instance.
8997    pub certs: std::vec::Vec<crate::model::SslCert>,
8998
8999    /// The `sha1_fingerprint` of the active certificate from `certs`.
9000    pub active_version: std::string::String,
9001
9002    /// This is always `sql#instancesListEntraIdCertificates`.
9003    pub kind: std::string::String,
9004
9005    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9006}
9007
9008impl InstancesListEntraIdCertificatesResponse {
9009    /// Creates a new default instance.
9010    pub fn new() -> Self {
9011        std::default::Default::default()
9012    }
9013
9014    /// Sets the value of [certs][crate::model::InstancesListEntraIdCertificatesResponse::certs].
9015    ///
9016    /// # Example
9017    /// ```ignore,no_run
9018    /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
9019    /// use google_cloud_sql_v1::model::SslCert;
9020    /// let x = InstancesListEntraIdCertificatesResponse::new()
9021    ///     .set_certs([
9022    ///         SslCert::default()/* use setters */,
9023    ///         SslCert::default()/* use (different) setters */,
9024    ///     ]);
9025    /// ```
9026    pub fn set_certs<T, V>(mut self, v: T) -> Self
9027    where
9028        T: std::iter::IntoIterator<Item = V>,
9029        V: std::convert::Into<crate::model::SslCert>,
9030    {
9031        use std::iter::Iterator;
9032        self.certs = v.into_iter().map(|i| i.into()).collect();
9033        self
9034    }
9035
9036    /// Sets the value of [active_version][crate::model::InstancesListEntraIdCertificatesResponse::active_version].
9037    ///
9038    /// # Example
9039    /// ```ignore,no_run
9040    /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
9041    /// let x = InstancesListEntraIdCertificatesResponse::new().set_active_version("example");
9042    /// ```
9043    pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9044        self.active_version = v.into();
9045        self
9046    }
9047
9048    /// Sets the value of [kind][crate::model::InstancesListEntraIdCertificatesResponse::kind].
9049    ///
9050    /// # Example
9051    /// ```ignore,no_run
9052    /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
9053    /// let x = InstancesListEntraIdCertificatesResponse::new().set_kind("example");
9054    /// ```
9055    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9056        self.kind = v.into();
9057        self
9058    }
9059}
9060
9061impl wkt::message::Message for InstancesListEntraIdCertificatesResponse {
9062    fn typename() -> &'static str {
9063        "type.googleapis.com/google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse"
9064    }
9065}
9066
9067/// Database instance restore backup request.
9068#[derive(Clone, Default, PartialEq)]
9069#[non_exhaustive]
9070pub struct InstancesRestoreBackupRequest {
9071    /// Parameters required to perform the restore backup operation.
9072    pub restore_backup_context: std::option::Option<crate::model::RestoreBackupContext>,
9073
9074    /// The name of the backup that's used to restore a Cloud SQL instance:
9075    /// Format:  projects/{project-id}/backups/{backup-uid}. Only one of
9076    /// restore_backup_context, backup, backupdr_backup can be passed to the input.
9077    pub backup: std::string::String,
9078
9079    /// The name of the backup that's used to restore a Cloud SQL instance:
9080    /// Format:
9081    /// "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
9082    /// Only one of restore_backup_context, backup, backupdr_backup can be
9083    /// passed to the input.
9084    pub backupdr_backup: std::string::String,
9085
9086    /// Optional. By using this parameter, Cloud SQL overrides any instance
9087    /// settings stored in the backup you are restoring from. You can't change the
9088    /// instance's major database version and you can only increase the disk size.
9089    /// You can use this field to restore new instances only. This field is not
9090    /// applicable for restore to existing instances.
9091    pub restore_instance_settings: std::option::Option<crate::model::DatabaseInstance>,
9092
9093    /// Optional. This field has the same purpose as restore_instance_settings,
9094    /// changes any instance settings stored in the backup you are restoring from.
9095    /// With the difference that these fields are cleared in the settings.
9096    pub restore_instance_clear_overrides_field_names: std::vec::Vec<std::string::String>,
9097
9098    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9099}
9100
9101impl InstancesRestoreBackupRequest {
9102    /// Creates a new default instance.
9103    pub fn new() -> Self {
9104        std::default::Default::default()
9105    }
9106
9107    /// Sets the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
9108    ///
9109    /// # Example
9110    /// ```ignore,no_run
9111    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9112    /// use google_cloud_sql_v1::model::RestoreBackupContext;
9113    /// let x = InstancesRestoreBackupRequest::new().set_restore_backup_context(RestoreBackupContext::default()/* use setters */);
9114    /// ```
9115    pub fn set_restore_backup_context<T>(mut self, v: T) -> Self
9116    where
9117        T: std::convert::Into<crate::model::RestoreBackupContext>,
9118    {
9119        self.restore_backup_context = std::option::Option::Some(v.into());
9120        self
9121    }
9122
9123    /// Sets or clears the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
9124    ///
9125    /// # Example
9126    /// ```ignore,no_run
9127    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9128    /// use google_cloud_sql_v1::model::RestoreBackupContext;
9129    /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(Some(RestoreBackupContext::default()/* use setters */));
9130    /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(None::<RestoreBackupContext>);
9131    /// ```
9132    pub fn set_or_clear_restore_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
9133    where
9134        T: std::convert::Into<crate::model::RestoreBackupContext>,
9135    {
9136        self.restore_backup_context = v.map(|x| x.into());
9137        self
9138    }
9139
9140    /// Sets the value of [backup][crate::model::InstancesRestoreBackupRequest::backup].
9141    ///
9142    /// # Example
9143    /// ```ignore,no_run
9144    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9145    /// let x = InstancesRestoreBackupRequest::new().set_backup("example");
9146    /// ```
9147    pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9148        self.backup = v.into();
9149        self
9150    }
9151
9152    /// Sets the value of [backupdr_backup][crate::model::InstancesRestoreBackupRequest::backupdr_backup].
9153    ///
9154    /// # Example
9155    /// ```ignore,no_run
9156    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9157    /// let x = InstancesRestoreBackupRequest::new().set_backupdr_backup("example");
9158    /// ```
9159    pub fn set_backupdr_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9160        self.backupdr_backup = v.into();
9161        self
9162    }
9163
9164    /// Sets the value of [restore_instance_settings][crate::model::InstancesRestoreBackupRequest::restore_instance_settings].
9165    ///
9166    /// # Example
9167    /// ```ignore,no_run
9168    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9169    /// use google_cloud_sql_v1::model::DatabaseInstance;
9170    /// let x = InstancesRestoreBackupRequest::new().set_restore_instance_settings(DatabaseInstance::default()/* use setters */);
9171    /// ```
9172    pub fn set_restore_instance_settings<T>(mut self, v: T) -> Self
9173    where
9174        T: std::convert::Into<crate::model::DatabaseInstance>,
9175    {
9176        self.restore_instance_settings = std::option::Option::Some(v.into());
9177        self
9178    }
9179
9180    /// Sets or clears the value of [restore_instance_settings][crate::model::InstancesRestoreBackupRequest::restore_instance_settings].
9181    ///
9182    /// # Example
9183    /// ```ignore,no_run
9184    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9185    /// use google_cloud_sql_v1::model::DatabaseInstance;
9186    /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_instance_settings(Some(DatabaseInstance::default()/* use setters */));
9187    /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_instance_settings(None::<DatabaseInstance>);
9188    /// ```
9189    pub fn set_or_clear_restore_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
9190    where
9191        T: std::convert::Into<crate::model::DatabaseInstance>,
9192    {
9193        self.restore_instance_settings = v.map(|x| x.into());
9194        self
9195    }
9196
9197    /// Sets the value of [restore_instance_clear_overrides_field_names][crate::model::InstancesRestoreBackupRequest::restore_instance_clear_overrides_field_names].
9198    ///
9199    /// # Example
9200    /// ```ignore,no_run
9201    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9202    /// let x = InstancesRestoreBackupRequest::new().set_restore_instance_clear_overrides_field_names(["a", "b", "c"]);
9203    /// ```
9204    pub fn set_restore_instance_clear_overrides_field_names<T, V>(mut self, v: T) -> Self
9205    where
9206        T: std::iter::IntoIterator<Item = V>,
9207        V: std::convert::Into<std::string::String>,
9208    {
9209        use std::iter::Iterator;
9210        self.restore_instance_clear_overrides_field_names =
9211            v.into_iter().map(|i| i.into()).collect();
9212        self
9213    }
9214}
9215
9216impl wkt::message::Message for InstancesRestoreBackupRequest {
9217    fn typename() -> &'static str {
9218        "type.googleapis.com/google.cloud.sql.v1.InstancesRestoreBackupRequest"
9219    }
9220}
9221
9222/// Rotate server CA request.
9223#[derive(Clone, Default, PartialEq)]
9224#[non_exhaustive]
9225pub struct InstancesRotateServerCaRequest {
9226    /// Contains details about the rotate server CA operation.
9227    pub rotate_server_ca_context: std::option::Option<crate::model::RotateServerCaContext>,
9228
9229    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9230}
9231
9232impl InstancesRotateServerCaRequest {
9233    /// Creates a new default instance.
9234    pub fn new() -> Self {
9235        std::default::Default::default()
9236    }
9237
9238    /// Sets the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
9239    ///
9240    /// # Example
9241    /// ```ignore,no_run
9242    /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
9243    /// use google_cloud_sql_v1::model::RotateServerCaContext;
9244    /// let x = InstancesRotateServerCaRequest::new().set_rotate_server_ca_context(RotateServerCaContext::default()/* use setters */);
9245    /// ```
9246    pub fn set_rotate_server_ca_context<T>(mut self, v: T) -> Self
9247    where
9248        T: std::convert::Into<crate::model::RotateServerCaContext>,
9249    {
9250        self.rotate_server_ca_context = std::option::Option::Some(v.into());
9251        self
9252    }
9253
9254    /// Sets or clears the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
9255    ///
9256    /// # Example
9257    /// ```ignore,no_run
9258    /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
9259    /// use google_cloud_sql_v1::model::RotateServerCaContext;
9260    /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(Some(RotateServerCaContext::default()/* use setters */));
9261    /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(None::<RotateServerCaContext>);
9262    /// ```
9263    pub fn set_or_clear_rotate_server_ca_context<T>(mut self, v: std::option::Option<T>) -> Self
9264    where
9265        T: std::convert::Into<crate::model::RotateServerCaContext>,
9266    {
9267        self.rotate_server_ca_context = v.map(|x| x.into());
9268        self
9269    }
9270}
9271
9272impl wkt::message::Message for InstancesRotateServerCaRequest {
9273    fn typename() -> &'static str {
9274        "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCaRequest"
9275    }
9276}
9277
9278/// Rotate server certificate request.
9279#[derive(Clone, Default, PartialEq)]
9280#[non_exhaustive]
9281pub struct InstancesRotateServerCertificateRequest {
9282    /// Optional. Contains details about the rotate server certificate operation.
9283    pub rotate_server_certificate_context:
9284        std::option::Option<crate::model::RotateServerCertificateContext>,
9285
9286    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9287}
9288
9289impl InstancesRotateServerCertificateRequest {
9290    /// Creates a new default instance.
9291    pub fn new() -> Self {
9292        std::default::Default::default()
9293    }
9294
9295    /// Sets the value of [rotate_server_certificate_context][crate::model::InstancesRotateServerCertificateRequest::rotate_server_certificate_context].
9296    ///
9297    /// # Example
9298    /// ```ignore,no_run
9299    /// # use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
9300    /// use google_cloud_sql_v1::model::RotateServerCertificateContext;
9301    /// let x = InstancesRotateServerCertificateRequest::new().set_rotate_server_certificate_context(RotateServerCertificateContext::default()/* use setters */);
9302    /// ```
9303    pub fn set_rotate_server_certificate_context<T>(mut self, v: T) -> Self
9304    where
9305        T: std::convert::Into<crate::model::RotateServerCertificateContext>,
9306    {
9307        self.rotate_server_certificate_context = std::option::Option::Some(v.into());
9308        self
9309    }
9310
9311    /// Sets or clears the value of [rotate_server_certificate_context][crate::model::InstancesRotateServerCertificateRequest::rotate_server_certificate_context].
9312    ///
9313    /// # Example
9314    /// ```ignore,no_run
9315    /// # use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
9316    /// use google_cloud_sql_v1::model::RotateServerCertificateContext;
9317    /// let x = InstancesRotateServerCertificateRequest::new().set_or_clear_rotate_server_certificate_context(Some(RotateServerCertificateContext::default()/* use setters */));
9318    /// let x = InstancesRotateServerCertificateRequest::new().set_or_clear_rotate_server_certificate_context(None::<RotateServerCertificateContext>);
9319    /// ```
9320    pub fn set_or_clear_rotate_server_certificate_context<T>(
9321        mut self,
9322        v: std::option::Option<T>,
9323    ) -> Self
9324    where
9325        T: std::convert::Into<crate::model::RotateServerCertificateContext>,
9326    {
9327        self.rotate_server_certificate_context = v.map(|x| x.into());
9328        self
9329    }
9330}
9331
9332impl wkt::message::Message for InstancesRotateServerCertificateRequest {
9333    fn typename() -> &'static str {
9334        "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCertificateRequest"
9335    }
9336}
9337
9338/// Rotate Entra ID certificate request.
9339#[derive(Clone, Default, PartialEq)]
9340#[non_exhaustive]
9341pub struct InstancesRotateEntraIdCertificateRequest {
9342    /// Optional. Contains details about the rotate server certificate operation.
9343    pub rotate_entra_id_certificate_context:
9344        std::option::Option<crate::model::RotateEntraIdCertificateContext>,
9345
9346    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9347}
9348
9349impl InstancesRotateEntraIdCertificateRequest {
9350    /// Creates a new default instance.
9351    pub fn new() -> Self {
9352        std::default::Default::default()
9353    }
9354
9355    /// Sets the value of [rotate_entra_id_certificate_context][crate::model::InstancesRotateEntraIdCertificateRequest::rotate_entra_id_certificate_context].
9356    ///
9357    /// # Example
9358    /// ```ignore,no_run
9359    /// # use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
9360    /// use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
9361    /// let x = InstancesRotateEntraIdCertificateRequest::new().set_rotate_entra_id_certificate_context(RotateEntraIdCertificateContext::default()/* use setters */);
9362    /// ```
9363    pub fn set_rotate_entra_id_certificate_context<T>(mut self, v: T) -> Self
9364    where
9365        T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
9366    {
9367        self.rotate_entra_id_certificate_context = std::option::Option::Some(v.into());
9368        self
9369    }
9370
9371    /// Sets or clears the value of [rotate_entra_id_certificate_context][crate::model::InstancesRotateEntraIdCertificateRequest::rotate_entra_id_certificate_context].
9372    ///
9373    /// # Example
9374    /// ```ignore,no_run
9375    /// # use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
9376    /// use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
9377    /// let x = InstancesRotateEntraIdCertificateRequest::new().set_or_clear_rotate_entra_id_certificate_context(Some(RotateEntraIdCertificateContext::default()/* use setters */));
9378    /// let x = InstancesRotateEntraIdCertificateRequest::new().set_or_clear_rotate_entra_id_certificate_context(None::<RotateEntraIdCertificateContext>);
9379    /// ```
9380    pub fn set_or_clear_rotate_entra_id_certificate_context<T>(
9381        mut self,
9382        v: std::option::Option<T>,
9383    ) -> Self
9384    where
9385        T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
9386    {
9387        self.rotate_entra_id_certificate_context = v.map(|x| x.into());
9388        self
9389    }
9390}
9391
9392impl wkt::message::Message for InstancesRotateEntraIdCertificateRequest {
9393    fn typename() -> &'static str {
9394        "type.googleapis.com/google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest"
9395    }
9396}
9397
9398/// Instance truncate log request.
9399#[derive(Clone, Default, PartialEq)]
9400#[non_exhaustive]
9401pub struct InstancesTruncateLogRequest {
9402    /// Contains details about the truncate log operation.
9403    pub truncate_log_context: std::option::Option<crate::model::TruncateLogContext>,
9404
9405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9406}
9407
9408impl InstancesTruncateLogRequest {
9409    /// Creates a new default instance.
9410    pub fn new() -> Self {
9411        std::default::Default::default()
9412    }
9413
9414    /// Sets the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
9415    ///
9416    /// # Example
9417    /// ```ignore,no_run
9418    /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
9419    /// use google_cloud_sql_v1::model::TruncateLogContext;
9420    /// let x = InstancesTruncateLogRequest::new().set_truncate_log_context(TruncateLogContext::default()/* use setters */);
9421    /// ```
9422    pub fn set_truncate_log_context<T>(mut self, v: T) -> Self
9423    where
9424        T: std::convert::Into<crate::model::TruncateLogContext>,
9425    {
9426        self.truncate_log_context = std::option::Option::Some(v.into());
9427        self
9428    }
9429
9430    /// Sets or clears the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
9431    ///
9432    /// # Example
9433    /// ```ignore,no_run
9434    /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
9435    /// use google_cloud_sql_v1::model::TruncateLogContext;
9436    /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(Some(TruncateLogContext::default()/* use setters */));
9437    /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(None::<TruncateLogContext>);
9438    /// ```
9439    pub fn set_or_clear_truncate_log_context<T>(mut self, v: std::option::Option<T>) -> Self
9440    where
9441        T: std::convert::Into<crate::model::TruncateLogContext>,
9442    {
9443        self.truncate_log_context = v.map(|x| x.into());
9444        self
9445    }
9446}
9447
9448impl wkt::message::Message for InstancesTruncateLogRequest {
9449    fn typename() -> &'static str {
9450        "type.googleapis.com/google.cloud.sql.v1.InstancesTruncateLogRequest"
9451    }
9452}
9453
9454/// Request to acquire a lease for SSRS.
9455#[derive(Clone, Default, PartialEq)]
9456#[non_exhaustive]
9457pub struct InstancesAcquireSsrsLeaseRequest {
9458    /// Contains details about the acquire SSRS lease operation.
9459    pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
9460
9461    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9462}
9463
9464impl InstancesAcquireSsrsLeaseRequest {
9465    /// Creates a new default instance.
9466    pub fn new() -> Self {
9467        std::default::Default::default()
9468    }
9469
9470    /// Sets the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
9471    ///
9472    /// # Example
9473    /// ```ignore,no_run
9474    /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
9475    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
9476    /// let x = InstancesAcquireSsrsLeaseRequest::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
9477    /// ```
9478    pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
9479    where
9480        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
9481    {
9482        self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
9483        self
9484    }
9485
9486    /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
9487    ///
9488    /// # Example
9489    /// ```ignore,no_run
9490    /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
9491    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
9492    /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
9493    /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
9494    /// ```
9495    pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
9496    where
9497        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
9498    {
9499        self.acquire_ssrs_lease_context = v.map(|x| x.into());
9500        self
9501    }
9502}
9503
9504impl wkt::message::Message for InstancesAcquireSsrsLeaseRequest {
9505    fn typename() -> &'static str {
9506        "type.googleapis.com/google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest"
9507    }
9508}
9509
9510/// Request for Pre-checks for MVU
9511#[derive(Clone, Default, PartialEq)]
9512#[non_exhaustive]
9513pub struct SqlInstancesPreCheckMajorVersionUpgradeRequest {
9514    /// Required. Cloud SQL instance ID. This does not include the project ID.
9515    pub instance: std::string::String,
9516
9517    /// Required. Project ID of the project that contains the instance.
9518    pub project: std::string::String,
9519
9520    /// Required. The context for request to perform the pre-check major version
9521    /// upgrade operation.
9522    pub body: std::option::Option<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9523
9524    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9525}
9526
9527impl SqlInstancesPreCheckMajorVersionUpgradeRequest {
9528    /// Creates a new default instance.
9529    pub fn new() -> Self {
9530        std::default::Default::default()
9531    }
9532
9533    /// Sets the value of [instance][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::instance].
9534    ///
9535    /// # Example
9536    /// ```ignore,no_run
9537    /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9538    /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_instance("example");
9539    /// ```
9540    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9541        self.instance = v.into();
9542        self
9543    }
9544
9545    /// Sets the value of [project][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::project].
9546    ///
9547    /// # Example
9548    /// ```ignore,no_run
9549    /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9550    /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_project("example");
9551    /// ```
9552    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9553        self.project = v.into();
9554        self
9555    }
9556
9557    /// Sets the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
9558    ///
9559    /// # Example
9560    /// ```ignore,no_run
9561    /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9562    /// use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
9563    /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_body(InstancesPreCheckMajorVersionUpgradeRequest::default()/* use setters */);
9564    /// ```
9565    pub fn set_body<T>(mut self, v: T) -> Self
9566    where
9567        T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9568    {
9569        self.body = std::option::Option::Some(v.into());
9570        self
9571    }
9572
9573    /// Sets or clears the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
9574    ///
9575    /// # Example
9576    /// ```ignore,no_run
9577    /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9578    /// use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
9579    /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_body(Some(InstancesPreCheckMajorVersionUpgradeRequest::default()/* use setters */));
9580    /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_body(None::<InstancesPreCheckMajorVersionUpgradeRequest>);
9581    /// ```
9582    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
9583    where
9584        T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9585    {
9586        self.body = v.map(|x| x.into());
9587        self
9588    }
9589}
9590
9591impl wkt::message::Message for SqlInstancesPreCheckMajorVersionUpgradeRequest {
9592    fn typename() -> &'static str {
9593        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest"
9594    }
9595}
9596
9597/// Instance verify external sync settings response.
9598#[derive(Clone, Default, PartialEq)]
9599#[non_exhaustive]
9600pub struct SqlInstancesVerifyExternalSyncSettingsResponse {
9601    /// This is always `sql#migrationSettingErrorList`.
9602    pub kind: std::string::String,
9603
9604    /// List of migration violations.
9605    pub errors: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
9606
9607    /// List of migration warnings.
9608    pub warnings: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
9609
9610    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9611}
9612
9613impl SqlInstancesVerifyExternalSyncSettingsResponse {
9614    /// Creates a new default instance.
9615    pub fn new() -> Self {
9616        std::default::Default::default()
9617    }
9618
9619    /// Sets the value of [kind][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::kind].
9620    ///
9621    /// # Example
9622    /// ```ignore,no_run
9623    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9624    /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new().set_kind("example");
9625    /// ```
9626    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9627        self.kind = v.into();
9628        self
9629    }
9630
9631    /// Sets the value of [errors][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::errors].
9632    ///
9633    /// # Example
9634    /// ```ignore,no_run
9635    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9636    /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
9637    /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
9638    ///     .set_errors([
9639    ///         SqlExternalSyncSettingError::default()/* use setters */,
9640    ///         SqlExternalSyncSettingError::default()/* use (different) setters */,
9641    ///     ]);
9642    /// ```
9643    pub fn set_errors<T, V>(mut self, v: T) -> Self
9644    where
9645        T: std::iter::IntoIterator<Item = V>,
9646        V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
9647    {
9648        use std::iter::Iterator;
9649        self.errors = v.into_iter().map(|i| i.into()).collect();
9650        self
9651    }
9652
9653    /// Sets the value of [warnings][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::warnings].
9654    ///
9655    /// # Example
9656    /// ```ignore,no_run
9657    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9658    /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
9659    /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
9660    ///     .set_warnings([
9661    ///         SqlExternalSyncSettingError::default()/* use setters */,
9662    ///         SqlExternalSyncSettingError::default()/* use (different) setters */,
9663    ///     ]);
9664    /// ```
9665    pub fn set_warnings<T, V>(mut self, v: T) -> Self
9666    where
9667        T: std::iter::IntoIterator<Item = V>,
9668        V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
9669    {
9670        use std::iter::Iterator;
9671        self.warnings = v.into_iter().map(|i| i.into()).collect();
9672        self
9673    }
9674}
9675
9676impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsResponse {
9677    fn typename() -> &'static str {
9678        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse"
9679    }
9680}
9681
9682/// Instance get disk shrink config response.
9683#[derive(Clone, Default, PartialEq)]
9684#[non_exhaustive]
9685pub struct SqlInstancesGetDiskShrinkConfigResponse {
9686    /// This is always `sql#getDiskShrinkConfig`.
9687    pub kind: std::string::String,
9688
9689    /// The minimum size to which a disk can be shrunk in GigaBytes.
9690    pub minimal_target_size_gb: i64,
9691
9692    /// Additional message to customers.
9693    pub message: std::string::String,
9694
9695    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9696}
9697
9698impl SqlInstancesGetDiskShrinkConfigResponse {
9699    /// Creates a new default instance.
9700    pub fn new() -> Self {
9701        std::default::Default::default()
9702    }
9703
9704    /// Sets the value of [kind][crate::model::SqlInstancesGetDiskShrinkConfigResponse::kind].
9705    ///
9706    /// # Example
9707    /// ```ignore,no_run
9708    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9709    /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_kind("example");
9710    /// ```
9711    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9712        self.kind = v.into();
9713        self
9714    }
9715
9716    /// Sets the value of [minimal_target_size_gb][crate::model::SqlInstancesGetDiskShrinkConfigResponse::minimal_target_size_gb].
9717    ///
9718    /// # Example
9719    /// ```ignore,no_run
9720    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9721    /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_minimal_target_size_gb(42);
9722    /// ```
9723    pub fn set_minimal_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9724        self.minimal_target_size_gb = v.into();
9725        self
9726    }
9727
9728    /// Sets the value of [message][crate::model::SqlInstancesGetDiskShrinkConfigResponse::message].
9729    ///
9730    /// # Example
9731    /// ```ignore,no_run
9732    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9733    /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_message("example");
9734    /// ```
9735    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9736        self.message = v.into();
9737        self
9738    }
9739}
9740
9741impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigResponse {
9742    fn typename() -> &'static str {
9743        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse"
9744    }
9745}
9746
9747/// Instance get latest recovery time request.
9748#[derive(Clone, Default, PartialEq)]
9749#[non_exhaustive]
9750pub struct SqlInstancesGetLatestRecoveryTimeRequest {
9751    /// Cloud SQL instance ID. This does not include the project ID.
9752    pub instance: std::string::String,
9753
9754    /// Project ID of the project that contains the instance.
9755    pub project: std::string::String,
9756
9757    /// The timestamp used to identify the time when the source instance is
9758    /// deleted. If this instance is deleted, then you must set the timestamp.
9759    pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
9760
9761    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9762}
9763
9764impl SqlInstancesGetLatestRecoveryTimeRequest {
9765    /// Creates a new default instance.
9766    pub fn new() -> Self {
9767        std::default::Default::default()
9768    }
9769
9770    /// Sets the value of [instance][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::instance].
9771    ///
9772    /// # Example
9773    /// ```ignore,no_run
9774    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9775    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_instance("example");
9776    /// ```
9777    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9778        self.instance = v.into();
9779        self
9780    }
9781
9782    /// Sets the value of [project][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::project].
9783    ///
9784    /// # Example
9785    /// ```ignore,no_run
9786    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9787    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_project("example");
9788    /// ```
9789    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9790        self.project = v.into();
9791        self
9792    }
9793
9794    /// Sets the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
9795    ///
9796    /// # Example
9797    /// ```ignore,no_run
9798    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9799    /// use wkt::Timestamp;
9800    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_source_instance_deletion_time(Timestamp::default()/* use setters */);
9801    /// ```
9802    pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
9803    where
9804        T: std::convert::Into<wkt::Timestamp>,
9805    {
9806        self.source_instance_deletion_time = std::option::Option::Some(v.into());
9807        self
9808    }
9809
9810    /// Sets or clears the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
9811    ///
9812    /// # Example
9813    /// ```ignore,no_run
9814    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9815    /// use wkt::Timestamp;
9816    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_or_clear_source_instance_deletion_time(Some(Timestamp::default()/* use setters */));
9817    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_or_clear_source_instance_deletion_time(None::<Timestamp>);
9818    /// ```
9819    pub fn set_or_clear_source_instance_deletion_time<T>(
9820        mut self,
9821        v: std::option::Option<T>,
9822    ) -> Self
9823    where
9824        T: std::convert::Into<wkt::Timestamp>,
9825    {
9826        self.source_instance_deletion_time = v.map(|x| x.into());
9827        self
9828    }
9829}
9830
9831impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeRequest {
9832    fn typename() -> &'static str {
9833        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest"
9834    }
9835}
9836
9837/// Instance get latest recovery time response.
9838#[derive(Clone, Default, PartialEq)]
9839#[non_exhaustive]
9840pub struct SqlInstancesGetLatestRecoveryTimeResponse {
9841    /// This is always `sql#getLatestRecoveryTime`.
9842    pub kind: std::string::String,
9843
9844    /// Timestamp, identifies the latest recovery time of the source instance.
9845    pub latest_recovery_time: std::option::Option<wkt::Timestamp>,
9846
9847    /// Timestamp, identifies the earliest recovery time of the source instance.
9848    pub earliest_recovery_time: std::option::Option<wkt::Timestamp>,
9849
9850    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9851}
9852
9853impl SqlInstancesGetLatestRecoveryTimeResponse {
9854    /// Creates a new default instance.
9855    pub fn new() -> Self {
9856        std::default::Default::default()
9857    }
9858
9859    /// Sets the value of [kind][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::kind].
9860    ///
9861    /// # Example
9862    /// ```ignore,no_run
9863    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9864    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_kind("example");
9865    /// ```
9866    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9867        self.kind = v.into();
9868        self
9869    }
9870
9871    /// Sets the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
9872    ///
9873    /// # Example
9874    /// ```ignore,no_run
9875    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9876    /// use wkt::Timestamp;
9877    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_latest_recovery_time(Timestamp::default()/* use setters */);
9878    /// ```
9879    pub fn set_latest_recovery_time<T>(mut self, v: T) -> Self
9880    where
9881        T: std::convert::Into<wkt::Timestamp>,
9882    {
9883        self.latest_recovery_time = std::option::Option::Some(v.into());
9884        self
9885    }
9886
9887    /// Sets or clears the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
9888    ///
9889    /// # Example
9890    /// ```ignore,no_run
9891    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9892    /// use wkt::Timestamp;
9893    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(Some(Timestamp::default()/* use setters */));
9894    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(None::<Timestamp>);
9895    /// ```
9896    pub fn set_or_clear_latest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
9897    where
9898        T: std::convert::Into<wkt::Timestamp>,
9899    {
9900        self.latest_recovery_time = v.map(|x| x.into());
9901        self
9902    }
9903
9904    /// Sets the value of [earliest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::earliest_recovery_time].
9905    ///
9906    /// # Example
9907    /// ```ignore,no_run
9908    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9909    /// use wkt::Timestamp;
9910    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_earliest_recovery_time(Timestamp::default()/* use setters */);
9911    /// ```
9912    pub fn set_earliest_recovery_time<T>(mut self, v: T) -> Self
9913    where
9914        T: std::convert::Into<wkt::Timestamp>,
9915    {
9916        self.earliest_recovery_time = std::option::Option::Some(v.into());
9917        self
9918    }
9919
9920    /// Sets or clears the value of [earliest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::earliest_recovery_time].
9921    ///
9922    /// # Example
9923    /// ```ignore,no_run
9924    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9925    /// use wkt::Timestamp;
9926    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_earliest_recovery_time(Some(Timestamp::default()/* use setters */));
9927    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_earliest_recovery_time(None::<Timestamp>);
9928    /// ```
9929    pub fn set_or_clear_earliest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
9930    where
9931        T: std::convert::Into<wkt::Timestamp>,
9932    {
9933        self.earliest_recovery_time = v.map(|x| x.into());
9934        self
9935    }
9936}
9937
9938impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeResponse {
9939    fn typename() -> &'static str {
9940        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse"
9941    }
9942}
9943
9944/// Database instance clone context.
9945#[derive(Clone, Default, PartialEq)]
9946#[non_exhaustive]
9947pub struct CloneContext {
9948    /// This is always `sql#cloneContext`.
9949    pub kind: std::string::String,
9950
9951    /// Reserved for future use.
9952    pub pitr_timestamp_ms: i64,
9953
9954    /// Required. Name of the Cloud SQL instance to be created as a clone.
9955    pub destination_instance_name: std::string::String,
9956
9957    /// Binary log coordinates, if specified, identify the position up to which the
9958    /// source instance is cloned. If not specified, the source instance is
9959    /// cloned up to the most recent binary log coordinates.
9960    pub bin_log_coordinates: std::option::Option<crate::model::BinLogCoordinates>,
9961
9962    /// Timestamp, if specified, identifies the time to which the source instance
9963    /// is cloned.
9964    pub point_in_time: std::option::Option<wkt::Timestamp>,
9965
9966    /// The name of the allocated ip range for the private ip Cloud SQL instance.
9967    /// For example: "google-managed-services-default". If set, the cloned instance
9968    /// ip will be created in the allocated range. The range name must comply with
9969    /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
9970    /// must be 1-63 characters long and match the regular expression
9971    /// [a-z]([-a-z0-9]*[a-z0-9])?.
9972    /// Reserved for future use.
9973    pub allocated_ip_range: std::string::String,
9974
9975    /// (SQL Server only) Clone only the specified databases from the source
9976    /// instance. Clone all databases if empty.
9977    pub database_names: std::vec::Vec<std::string::String>,
9978
9979    /// Optional. Copy clone and point-in-time recovery clone of an instance to the
9980    /// specified zone. If no zone is specified, clone to the same primary zone as
9981    /// the source instance. This field applies to all DB types.
9982    pub preferred_zone: std::option::Option<std::string::String>,
9983
9984    /// Optional. Copy clone and point-in-time recovery clone of a regional
9985    /// instance in the specified zones. If not specified, clone to the same
9986    /// secondary zone as the source instance. This value cannot be the same as the
9987    /// preferred_zone field. This field applies to all DB types.
9988    pub preferred_secondary_zone: std::option::Option<std::string::String>,
9989
9990    /// The timestamp used to identify the time when the source instance is
9991    /// deleted. If this instance is deleted, then you must set the timestamp.
9992    pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
9993
9994    /// Optional. The project ID of the destination project where the cloned
9995    /// instance will be created. To perform a cross-project clone, this field is
9996    /// required. If not specified, the clone is created in the same project
9997    /// as the source instance.
9998    pub destination_project: std::option::Option<std::string::String>,
9999
10000    /// Optional. The fully qualified URI of the VPC network to which the cloned
10001    /// instance will be connected via Private Services Access for private IP. For
10002    /// example:`projects/my-network-project/global/networks/my-network`. This
10003    /// field is only required for cross-project cloning.
10004    pub destination_network: std::option::Option<std::string::String>,
10005
10006    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10007}
10008
10009impl CloneContext {
10010    /// Creates a new default instance.
10011    pub fn new() -> Self {
10012        std::default::Default::default()
10013    }
10014
10015    /// Sets the value of [kind][crate::model::CloneContext::kind].
10016    ///
10017    /// # Example
10018    /// ```ignore,no_run
10019    /// # use google_cloud_sql_v1::model::CloneContext;
10020    /// let x = CloneContext::new().set_kind("example");
10021    /// ```
10022    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10023        self.kind = v.into();
10024        self
10025    }
10026
10027    /// Sets the value of [pitr_timestamp_ms][crate::model::CloneContext::pitr_timestamp_ms].
10028    ///
10029    /// # Example
10030    /// ```ignore,no_run
10031    /// # use google_cloud_sql_v1::model::CloneContext;
10032    /// let x = CloneContext::new().set_pitr_timestamp_ms(42);
10033    /// ```
10034    pub fn set_pitr_timestamp_ms<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10035        self.pitr_timestamp_ms = v.into();
10036        self
10037    }
10038
10039    /// Sets the value of [destination_instance_name][crate::model::CloneContext::destination_instance_name].
10040    ///
10041    /// # Example
10042    /// ```ignore,no_run
10043    /// # use google_cloud_sql_v1::model::CloneContext;
10044    /// let x = CloneContext::new().set_destination_instance_name("example");
10045    /// ```
10046    pub fn set_destination_instance_name<T: std::convert::Into<std::string::String>>(
10047        mut self,
10048        v: T,
10049    ) -> Self {
10050        self.destination_instance_name = v.into();
10051        self
10052    }
10053
10054    /// Sets the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
10055    ///
10056    /// # Example
10057    /// ```ignore,no_run
10058    /// # use google_cloud_sql_v1::model::CloneContext;
10059    /// use google_cloud_sql_v1::model::BinLogCoordinates;
10060    /// let x = CloneContext::new().set_bin_log_coordinates(BinLogCoordinates::default()/* use setters */);
10061    /// ```
10062    pub fn set_bin_log_coordinates<T>(mut self, v: T) -> Self
10063    where
10064        T: std::convert::Into<crate::model::BinLogCoordinates>,
10065    {
10066        self.bin_log_coordinates = std::option::Option::Some(v.into());
10067        self
10068    }
10069
10070    /// Sets or clears the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
10071    ///
10072    /// # Example
10073    /// ```ignore,no_run
10074    /// # use google_cloud_sql_v1::model::CloneContext;
10075    /// use google_cloud_sql_v1::model::BinLogCoordinates;
10076    /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(Some(BinLogCoordinates::default()/* use setters */));
10077    /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(None::<BinLogCoordinates>);
10078    /// ```
10079    pub fn set_or_clear_bin_log_coordinates<T>(mut self, v: std::option::Option<T>) -> Self
10080    where
10081        T: std::convert::Into<crate::model::BinLogCoordinates>,
10082    {
10083        self.bin_log_coordinates = v.map(|x| x.into());
10084        self
10085    }
10086
10087    /// Sets the value of [point_in_time][crate::model::CloneContext::point_in_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_point_in_time(Timestamp::default()/* use setters */);
10094    /// ```
10095    pub fn set_point_in_time<T>(mut self, v: T) -> Self
10096    where
10097        T: std::convert::Into<wkt::Timestamp>,
10098    {
10099        self.point_in_time = std::option::Option::Some(v.into());
10100        self
10101    }
10102
10103    /// Sets or clears the value of [point_in_time][crate::model::CloneContext::point_in_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_point_in_time(Some(Timestamp::default()/* use setters */));
10110    /// let x = CloneContext::new().set_or_clear_point_in_time(None::<Timestamp>);
10111    /// ```
10112    pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
10113    where
10114        T: std::convert::Into<wkt::Timestamp>,
10115    {
10116        self.point_in_time = v.map(|x| x.into());
10117        self
10118    }
10119
10120    /// Sets the value of [allocated_ip_range][crate::model::CloneContext::allocated_ip_range].
10121    ///
10122    /// # Example
10123    /// ```ignore,no_run
10124    /// # use google_cloud_sql_v1::model::CloneContext;
10125    /// let x = CloneContext::new().set_allocated_ip_range("example");
10126    /// ```
10127    pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
10128        mut self,
10129        v: T,
10130    ) -> Self {
10131        self.allocated_ip_range = v.into();
10132        self
10133    }
10134
10135    /// Sets the value of [database_names][crate::model::CloneContext::database_names].
10136    ///
10137    /// # Example
10138    /// ```ignore,no_run
10139    /// # use google_cloud_sql_v1::model::CloneContext;
10140    /// let x = CloneContext::new().set_database_names(["a", "b", "c"]);
10141    /// ```
10142    pub fn set_database_names<T, V>(mut self, v: T) -> Self
10143    where
10144        T: std::iter::IntoIterator<Item = V>,
10145        V: std::convert::Into<std::string::String>,
10146    {
10147        use std::iter::Iterator;
10148        self.database_names = v.into_iter().map(|i| i.into()).collect();
10149        self
10150    }
10151
10152    /// Sets the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
10153    ///
10154    /// # Example
10155    /// ```ignore,no_run
10156    /// # use google_cloud_sql_v1::model::CloneContext;
10157    /// let x = CloneContext::new().set_preferred_zone("example");
10158    /// ```
10159    pub fn set_preferred_zone<T>(mut self, v: T) -> Self
10160    where
10161        T: std::convert::Into<std::string::String>,
10162    {
10163        self.preferred_zone = std::option::Option::Some(v.into());
10164        self
10165    }
10166
10167    /// Sets or clears the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
10168    ///
10169    /// # Example
10170    /// ```ignore,no_run
10171    /// # use google_cloud_sql_v1::model::CloneContext;
10172    /// let x = CloneContext::new().set_or_clear_preferred_zone(Some("example"));
10173    /// let x = CloneContext::new().set_or_clear_preferred_zone(None::<String>);
10174    /// ```
10175    pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
10176    where
10177        T: std::convert::Into<std::string::String>,
10178    {
10179        self.preferred_zone = v.map(|x| x.into());
10180        self
10181    }
10182
10183    /// Sets the value of [preferred_secondary_zone][crate::model::CloneContext::preferred_secondary_zone].
10184    ///
10185    /// # Example
10186    /// ```ignore,no_run
10187    /// # use google_cloud_sql_v1::model::CloneContext;
10188    /// let x = CloneContext::new().set_preferred_secondary_zone("example");
10189    /// ```
10190    pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
10191    where
10192        T: std::convert::Into<std::string::String>,
10193    {
10194        self.preferred_secondary_zone = std::option::Option::Some(v.into());
10195        self
10196    }
10197
10198    /// Sets or clears the value of [preferred_secondary_zone][crate::model::CloneContext::preferred_secondary_zone].
10199    ///
10200    /// # Example
10201    /// ```ignore,no_run
10202    /// # use google_cloud_sql_v1::model::CloneContext;
10203    /// let x = CloneContext::new().set_or_clear_preferred_secondary_zone(Some("example"));
10204    /// let x = CloneContext::new().set_or_clear_preferred_secondary_zone(None::<String>);
10205    /// ```
10206    pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
10207    where
10208        T: std::convert::Into<std::string::String>,
10209    {
10210        self.preferred_secondary_zone = v.map(|x| x.into());
10211        self
10212    }
10213
10214    /// Sets the value of [source_instance_deletion_time][crate::model::CloneContext::source_instance_deletion_time].
10215    ///
10216    /// # Example
10217    /// ```ignore,no_run
10218    /// # use google_cloud_sql_v1::model::CloneContext;
10219    /// use wkt::Timestamp;
10220    /// let x = CloneContext::new().set_source_instance_deletion_time(Timestamp::default()/* use setters */);
10221    /// ```
10222    pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
10223    where
10224        T: std::convert::Into<wkt::Timestamp>,
10225    {
10226        self.source_instance_deletion_time = std::option::Option::Some(v.into());
10227        self
10228    }
10229
10230    /// Sets or clears the value of [source_instance_deletion_time][crate::model::CloneContext::source_instance_deletion_time].
10231    ///
10232    /// # Example
10233    /// ```ignore,no_run
10234    /// # use google_cloud_sql_v1::model::CloneContext;
10235    /// use wkt::Timestamp;
10236    /// let x = CloneContext::new().set_or_clear_source_instance_deletion_time(Some(Timestamp::default()/* use setters */));
10237    /// let x = CloneContext::new().set_or_clear_source_instance_deletion_time(None::<Timestamp>);
10238    /// ```
10239    pub fn set_or_clear_source_instance_deletion_time<T>(
10240        mut self,
10241        v: std::option::Option<T>,
10242    ) -> Self
10243    where
10244        T: std::convert::Into<wkt::Timestamp>,
10245    {
10246        self.source_instance_deletion_time = v.map(|x| x.into());
10247        self
10248    }
10249
10250    /// Sets the value of [destination_project][crate::model::CloneContext::destination_project].
10251    ///
10252    /// # Example
10253    /// ```ignore,no_run
10254    /// # use google_cloud_sql_v1::model::CloneContext;
10255    /// let x = CloneContext::new().set_destination_project("example");
10256    /// ```
10257    pub fn set_destination_project<T>(mut self, v: T) -> Self
10258    where
10259        T: std::convert::Into<std::string::String>,
10260    {
10261        self.destination_project = std::option::Option::Some(v.into());
10262        self
10263    }
10264
10265    /// Sets or clears the value of [destination_project][crate::model::CloneContext::destination_project].
10266    ///
10267    /// # Example
10268    /// ```ignore,no_run
10269    /// # use google_cloud_sql_v1::model::CloneContext;
10270    /// let x = CloneContext::new().set_or_clear_destination_project(Some("example"));
10271    /// let x = CloneContext::new().set_or_clear_destination_project(None::<String>);
10272    /// ```
10273    pub fn set_or_clear_destination_project<T>(mut self, v: std::option::Option<T>) -> Self
10274    where
10275        T: std::convert::Into<std::string::String>,
10276    {
10277        self.destination_project = v.map(|x| x.into());
10278        self
10279    }
10280
10281    /// Sets the value of [destination_network][crate::model::CloneContext::destination_network].
10282    ///
10283    /// # Example
10284    /// ```ignore,no_run
10285    /// # use google_cloud_sql_v1::model::CloneContext;
10286    /// let x = CloneContext::new().set_destination_network("example");
10287    /// ```
10288    pub fn set_destination_network<T>(mut self, v: T) -> Self
10289    where
10290        T: std::convert::Into<std::string::String>,
10291    {
10292        self.destination_network = std::option::Option::Some(v.into());
10293        self
10294    }
10295
10296    /// Sets or clears the value of [destination_network][crate::model::CloneContext::destination_network].
10297    ///
10298    /// # Example
10299    /// ```ignore,no_run
10300    /// # use google_cloud_sql_v1::model::CloneContext;
10301    /// let x = CloneContext::new().set_or_clear_destination_network(Some("example"));
10302    /// let x = CloneContext::new().set_or_clear_destination_network(None::<String>);
10303    /// ```
10304    pub fn set_or_clear_destination_network<T>(mut self, v: std::option::Option<T>) -> Self
10305    where
10306        T: std::convert::Into<std::string::String>,
10307    {
10308        self.destination_network = v.map(|x| x.into());
10309        self
10310    }
10311}
10312
10313impl wkt::message::Message for CloneContext {
10314    fn typename() -> &'static str {
10315        "type.googleapis.com/google.cloud.sql.v1.CloneContext"
10316    }
10317}
10318
10319/// The context to perform a point-in-time recovery of an instance managed by
10320/// Backup and Disaster Recovery (DR) Service.
10321#[derive(Clone, Default, PartialEq)]
10322#[non_exhaustive]
10323pub struct PointInTimeRestoreContext {
10324    /// The Backup and Disaster Recovery (DR) Service Datasource URI.
10325    /// Format:
10326    /// projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
10327    pub datasource: std::option::Option<std::string::String>,
10328
10329    /// Required. The date and time to which you want to restore the instance.
10330    pub point_in_time: std::option::Option<wkt::Timestamp>,
10331
10332    /// Target instance name.
10333    pub target_instance: std::option::Option<std::string::String>,
10334
10335    /// Optional. The resource link for the VPC network from which the Cloud SQL
10336    /// instance is accessible for private IP. For example,
10337    /// `/projects/myProject/global/networks/default`.
10338    pub private_network: std::option::Option<std::string::String>,
10339
10340    /// Optional. The name of the allocated IP range for the internal IP Cloud SQL
10341    /// instance. For example: "google-managed-services-default". If you set this,
10342    /// then Cloud SQL creates the IP address for the cloned instance in the
10343    /// allocated range. This range must comply with [RFC
10344    /// 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
10345    /// name must be 1-63 characters long and match the regular expression
10346    /// [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
10347    pub allocated_ip_range: std::option::Option<std::string::String>,
10348
10349    /// Optional. Point-in-time recovery of an instance to the specified zone. If
10350    /// no zone is specified, then clone to the same primary zone as the source
10351    /// instance.
10352    pub preferred_zone: std::option::Option<std::string::String>,
10353
10354    /// Optional. Point-in-time recovery of a regional instance in the specified
10355    /// zones. If not specified, clone to the same secondary zone as the source
10356    /// instance. This value cannot be the same as the preferred_zone field.
10357    pub preferred_secondary_zone: std::option::Option<std::string::String>,
10358
10359    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10360}
10361
10362impl PointInTimeRestoreContext {
10363    /// Creates a new default instance.
10364    pub fn new() -> Self {
10365        std::default::Default::default()
10366    }
10367
10368    /// Sets the value of [datasource][crate::model::PointInTimeRestoreContext::datasource].
10369    ///
10370    /// # Example
10371    /// ```ignore,no_run
10372    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10373    /// let x = PointInTimeRestoreContext::new().set_datasource("example");
10374    /// ```
10375    pub fn set_datasource<T>(mut self, v: T) -> Self
10376    where
10377        T: std::convert::Into<std::string::String>,
10378    {
10379        self.datasource = std::option::Option::Some(v.into());
10380        self
10381    }
10382
10383    /// Sets or clears the value of [datasource][crate::model::PointInTimeRestoreContext::datasource].
10384    ///
10385    /// # Example
10386    /// ```ignore,no_run
10387    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10388    /// let x = PointInTimeRestoreContext::new().set_or_clear_datasource(Some("example"));
10389    /// let x = PointInTimeRestoreContext::new().set_or_clear_datasource(None::<String>);
10390    /// ```
10391    pub fn set_or_clear_datasource<T>(mut self, v: std::option::Option<T>) -> Self
10392    where
10393        T: std::convert::Into<std::string::String>,
10394    {
10395        self.datasource = v.map(|x| x.into());
10396        self
10397    }
10398
10399    /// Sets the value of [point_in_time][crate::model::PointInTimeRestoreContext::point_in_time].
10400    ///
10401    /// # Example
10402    /// ```ignore,no_run
10403    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10404    /// use wkt::Timestamp;
10405    /// let x = PointInTimeRestoreContext::new().set_point_in_time(Timestamp::default()/* use setters */);
10406    /// ```
10407    pub fn set_point_in_time<T>(mut self, v: T) -> Self
10408    where
10409        T: std::convert::Into<wkt::Timestamp>,
10410    {
10411        self.point_in_time = std::option::Option::Some(v.into());
10412        self
10413    }
10414
10415    /// Sets or clears the value of [point_in_time][crate::model::PointInTimeRestoreContext::point_in_time].
10416    ///
10417    /// # Example
10418    /// ```ignore,no_run
10419    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10420    /// use wkt::Timestamp;
10421    /// let x = PointInTimeRestoreContext::new().set_or_clear_point_in_time(Some(Timestamp::default()/* use setters */));
10422    /// let x = PointInTimeRestoreContext::new().set_or_clear_point_in_time(None::<Timestamp>);
10423    /// ```
10424    pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
10425    where
10426        T: std::convert::Into<wkt::Timestamp>,
10427    {
10428        self.point_in_time = v.map(|x| x.into());
10429        self
10430    }
10431
10432    /// Sets the value of [target_instance][crate::model::PointInTimeRestoreContext::target_instance].
10433    ///
10434    /// # Example
10435    /// ```ignore,no_run
10436    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10437    /// let x = PointInTimeRestoreContext::new().set_target_instance("example");
10438    /// ```
10439    pub fn set_target_instance<T>(mut self, v: T) -> Self
10440    where
10441        T: std::convert::Into<std::string::String>,
10442    {
10443        self.target_instance = std::option::Option::Some(v.into());
10444        self
10445    }
10446
10447    /// Sets or clears the value of [target_instance][crate::model::PointInTimeRestoreContext::target_instance].
10448    ///
10449    /// # Example
10450    /// ```ignore,no_run
10451    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10452    /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance(Some("example"));
10453    /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance(None::<String>);
10454    /// ```
10455    pub fn set_or_clear_target_instance<T>(mut self, v: std::option::Option<T>) -> Self
10456    where
10457        T: std::convert::Into<std::string::String>,
10458    {
10459        self.target_instance = v.map(|x| x.into());
10460        self
10461    }
10462
10463    /// Sets the value of [private_network][crate::model::PointInTimeRestoreContext::private_network].
10464    ///
10465    /// # Example
10466    /// ```ignore,no_run
10467    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10468    /// let x = PointInTimeRestoreContext::new().set_private_network("example");
10469    /// ```
10470    pub fn set_private_network<T>(mut self, v: T) -> Self
10471    where
10472        T: std::convert::Into<std::string::String>,
10473    {
10474        self.private_network = std::option::Option::Some(v.into());
10475        self
10476    }
10477
10478    /// Sets or clears the value of [private_network][crate::model::PointInTimeRestoreContext::private_network].
10479    ///
10480    /// # Example
10481    /// ```ignore,no_run
10482    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10483    /// let x = PointInTimeRestoreContext::new().set_or_clear_private_network(Some("example"));
10484    /// let x = PointInTimeRestoreContext::new().set_or_clear_private_network(None::<String>);
10485    /// ```
10486    pub fn set_or_clear_private_network<T>(mut self, v: std::option::Option<T>) -> Self
10487    where
10488        T: std::convert::Into<std::string::String>,
10489    {
10490        self.private_network = v.map(|x| x.into());
10491        self
10492    }
10493
10494    /// Sets the value of [allocated_ip_range][crate::model::PointInTimeRestoreContext::allocated_ip_range].
10495    ///
10496    /// # Example
10497    /// ```ignore,no_run
10498    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10499    /// let x = PointInTimeRestoreContext::new().set_allocated_ip_range("example");
10500    /// ```
10501    pub fn set_allocated_ip_range<T>(mut self, v: T) -> Self
10502    where
10503        T: std::convert::Into<std::string::String>,
10504    {
10505        self.allocated_ip_range = std::option::Option::Some(v.into());
10506        self
10507    }
10508
10509    /// Sets or clears the value of [allocated_ip_range][crate::model::PointInTimeRestoreContext::allocated_ip_range].
10510    ///
10511    /// # Example
10512    /// ```ignore,no_run
10513    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10514    /// let x = PointInTimeRestoreContext::new().set_or_clear_allocated_ip_range(Some("example"));
10515    /// let x = PointInTimeRestoreContext::new().set_or_clear_allocated_ip_range(None::<String>);
10516    /// ```
10517    pub fn set_or_clear_allocated_ip_range<T>(mut self, v: std::option::Option<T>) -> Self
10518    where
10519        T: std::convert::Into<std::string::String>,
10520    {
10521        self.allocated_ip_range = v.map(|x| x.into());
10522        self
10523    }
10524
10525    /// Sets the value of [preferred_zone][crate::model::PointInTimeRestoreContext::preferred_zone].
10526    ///
10527    /// # Example
10528    /// ```ignore,no_run
10529    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10530    /// let x = PointInTimeRestoreContext::new().set_preferred_zone("example");
10531    /// ```
10532    pub fn set_preferred_zone<T>(mut self, v: T) -> Self
10533    where
10534        T: std::convert::Into<std::string::String>,
10535    {
10536        self.preferred_zone = std::option::Option::Some(v.into());
10537        self
10538    }
10539
10540    /// Sets or clears the value of [preferred_zone][crate::model::PointInTimeRestoreContext::preferred_zone].
10541    ///
10542    /// # Example
10543    /// ```ignore,no_run
10544    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10545    /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_zone(Some("example"));
10546    /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_zone(None::<String>);
10547    /// ```
10548    pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
10549    where
10550        T: std::convert::Into<std::string::String>,
10551    {
10552        self.preferred_zone = v.map(|x| x.into());
10553        self
10554    }
10555
10556    /// Sets the value of [preferred_secondary_zone][crate::model::PointInTimeRestoreContext::preferred_secondary_zone].
10557    ///
10558    /// # Example
10559    /// ```ignore,no_run
10560    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10561    /// let x = PointInTimeRestoreContext::new().set_preferred_secondary_zone("example");
10562    /// ```
10563    pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
10564    where
10565        T: std::convert::Into<std::string::String>,
10566    {
10567        self.preferred_secondary_zone = std::option::Option::Some(v.into());
10568        self
10569    }
10570
10571    /// Sets or clears the value of [preferred_secondary_zone][crate::model::PointInTimeRestoreContext::preferred_secondary_zone].
10572    ///
10573    /// # Example
10574    /// ```ignore,no_run
10575    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10576    /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_secondary_zone(Some("example"));
10577    /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_secondary_zone(None::<String>);
10578    /// ```
10579    pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
10580    where
10581        T: std::convert::Into<std::string::String>,
10582    {
10583        self.preferred_secondary_zone = v.map(|x| x.into());
10584        self
10585    }
10586}
10587
10588impl wkt::message::Message for PointInTimeRestoreContext {
10589    fn typename() -> &'static str {
10590        "type.googleapis.com/google.cloud.sql.v1.PointInTimeRestoreContext"
10591    }
10592}
10593
10594/// Binary log coordinates.
10595#[derive(Clone, Default, PartialEq)]
10596#[non_exhaustive]
10597pub struct BinLogCoordinates {
10598    /// Name of the binary log file for a Cloud SQL instance.
10599    pub bin_log_file_name: std::string::String,
10600
10601    /// Position (offset) within the binary log file.
10602    pub bin_log_position: i64,
10603
10604    /// This is always `sql#binLogCoordinates`.
10605    pub kind: std::string::String,
10606
10607    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10608}
10609
10610impl BinLogCoordinates {
10611    /// Creates a new default instance.
10612    pub fn new() -> Self {
10613        std::default::Default::default()
10614    }
10615
10616    /// Sets the value of [bin_log_file_name][crate::model::BinLogCoordinates::bin_log_file_name].
10617    ///
10618    /// # Example
10619    /// ```ignore,no_run
10620    /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10621    /// let x = BinLogCoordinates::new().set_bin_log_file_name("example");
10622    /// ```
10623    pub fn set_bin_log_file_name<T: std::convert::Into<std::string::String>>(
10624        mut self,
10625        v: T,
10626    ) -> Self {
10627        self.bin_log_file_name = v.into();
10628        self
10629    }
10630
10631    /// Sets the value of [bin_log_position][crate::model::BinLogCoordinates::bin_log_position].
10632    ///
10633    /// # Example
10634    /// ```ignore,no_run
10635    /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10636    /// let x = BinLogCoordinates::new().set_bin_log_position(42);
10637    /// ```
10638    pub fn set_bin_log_position<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10639        self.bin_log_position = v.into();
10640        self
10641    }
10642
10643    /// Sets the value of [kind][crate::model::BinLogCoordinates::kind].
10644    ///
10645    /// # Example
10646    /// ```ignore,no_run
10647    /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10648    /// let x = BinLogCoordinates::new().set_kind("example");
10649    /// ```
10650    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10651        self.kind = v.into();
10652        self
10653    }
10654}
10655
10656impl wkt::message::Message for BinLogCoordinates {
10657    fn typename() -> &'static str {
10658        "type.googleapis.com/google.cloud.sql.v1.BinLogCoordinates"
10659    }
10660}
10661
10662/// A Cloud SQL instance resource.
10663#[derive(Clone, Default, PartialEq)]
10664#[non_exhaustive]
10665pub struct DatabaseInstance {
10666    /// This is always `sql#instance`.
10667    pub kind: std::string::String,
10668
10669    /// The current serving state of the Cloud SQL instance.
10670    pub state: crate::model::database_instance::SqlInstanceState,
10671
10672    /// The database engine type and version. The `databaseVersion` field cannot
10673    /// be changed after instance creation.
10674    pub database_version: crate::model::SqlDatabaseVersion,
10675
10676    /// The user settings.
10677    pub settings: std::option::Option<crate::model::Settings>,
10678
10679    /// This field is deprecated and will be removed from a future version of the
10680    /// API. Use the `settings.settingsVersion` field instead.
10681    pub etag: std::string::String,
10682
10683    /// The name and status of the failover replica.
10684    pub failover_replica: std::option::Option<crate::model::database_instance::SqlFailoverReplica>,
10685
10686    /// The name of the instance which will act as primary in the replication
10687    /// setup.
10688    pub master_instance_name: std::string::String,
10689
10690    /// The replicas of the instance.
10691    pub replica_names: std::vec::Vec<std::string::String>,
10692
10693    /// The maximum disk size of the instance in bytes.
10694    #[deprecated]
10695    pub max_disk_size: std::option::Option<wkt::Int64Value>,
10696
10697    /// The current disk usage of the instance in bytes. This property has been
10698    /// deprecated. Use the
10699    /// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
10700    /// Monitoring API instead. Please see [this
10701    /// announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
10702    /// for details.
10703    #[deprecated]
10704    pub current_disk_size: std::option::Option<wkt::Int64Value>,
10705
10706    /// The assigned IP addresses for the instance.
10707    pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
10708
10709    /// SSL configuration.
10710    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
10711
10712    /// The instance type.
10713    pub instance_type: crate::model::SqlInstanceType,
10714
10715    /// The project ID of the project containing the Cloud SQL instance. The Google
10716    /// apps domain is prefixed if applicable.
10717    pub project: std::string::String,
10718
10719    /// The IPv6 address assigned to the instance.
10720    /// (Deprecated) This property was applicable only
10721    /// to First Generation instances.
10722    #[deprecated]
10723    pub ipv6_address: std::string::String,
10724
10725    /// The service account email address assigned to the instance.\This
10726    /// property is read-only.
10727    pub service_account_email_address: std::string::String,
10728
10729    /// Configuration specific to on-premises instances.
10730    pub on_premises_configuration: std::option::Option<crate::model::OnPremisesConfiguration>,
10731
10732    /// Configuration specific to failover replicas and read replicas.
10733    pub replica_configuration: std::option::Option<crate::model::ReplicaConfiguration>,
10734
10735    /// The backend type.
10736    /// `SECOND_GEN`: Cloud SQL database instance.
10737    /// `EXTERNAL`: A database server that is not managed by Google.
10738    ///
10739    /// This property is read-only; use the `tier` property in the `settings`
10740    /// object to determine the database type.
10741    pub backend_type: crate::model::SqlBackendType,
10742
10743    /// The URI of this resource.
10744    pub self_link: std::string::String,
10745
10746    /// If the instance state is SUSPENDED, the reason for the suspension.
10747    pub suspension_reason: std::vec::Vec<crate::model::SqlSuspensionReason>,
10748
10749    /// Connection name of the Cloud SQL instance used in connection strings.
10750    pub connection_name: std::string::String,
10751
10752    /// Name of the Cloud SQL instance. This does not include the project ID.
10753    pub name: std::string::String,
10754
10755    /// The geographical region of the Cloud SQL instance.
10756    ///
10757    /// It can be one of the
10758    /// [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
10759    /// where Cloud SQL operates:
10760    ///
10761    /// For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
10762    /// The default value is `us-central1`.
10763    pub region: std::string::String,
10764
10765    /// The Compute Engine zone that the instance is currently serving from. This
10766    /// value could be different from the zone that was specified when the instance
10767    /// was created if the instance has failed over to its secondary zone. WARNING:
10768    /// Changing this might restart the instance.
10769    pub gce_zone: std::string::String,
10770
10771    /// The Compute Engine zone that the failover instance is currently serving
10772    /// from for a regional instance. This value could be different
10773    /// from the zone that was specified when the instance
10774    /// was created if the instance has failed over to its secondary/failover zone.
10775    pub secondary_gce_zone: std::string::String,
10776
10777    /// Disk encryption configuration specific to an instance.
10778    pub disk_encryption_configuration:
10779        std::option::Option<crate::model::DiskEncryptionConfiguration>,
10780
10781    /// Disk encryption status specific to an instance.
10782    pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
10783
10784    /// Initial root password. Use only on creation. You must set root passwords
10785    /// before you can connect to PostgreSQL instances.
10786    pub root_password: std::string::String,
10787
10788    /// The start time of any upcoming scheduled maintenance for this instance.
10789    pub scheduled_maintenance:
10790        std::option::Option<crate::model::database_instance::SqlScheduledMaintenance>,
10791
10792    /// This status indicates whether the instance satisfies PZS.
10793    ///
10794    /// The status is reserved for future use.
10795    pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
10796
10797    /// Output only. Stores the current database version running on the instance
10798    /// including minor version such as `MYSQL_8_0_18`.
10799    pub database_installed_version: std::string::String,
10800
10801    /// This field represents the report generated by the proactive database
10802    /// wellness job for OutOfDisk issues.
10803    ///
10804    /// * Writers:
10805    /// * the proactive database wellness job for OOD.
10806    /// * Readers:
10807    /// * the proactive database wellness job
10808    pub out_of_disk_report:
10809        std::option::Option<crate::model::database_instance::SqlOutOfDiskReport>,
10810
10811    /// Output only. The time when the instance was created in
10812    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
10813    /// `2012-11-15T16:19:00.094Z`.
10814    pub create_time: std::option::Option<wkt::Timestamp>,
10815
10816    /// Output only. List all maintenance versions applicable on the instance
10817    pub available_maintenance_versions: std::vec::Vec<std::string::String>,
10818
10819    /// The current software version on the instance.
10820    pub maintenance_version: std::string::String,
10821
10822    /// Output only. All database versions that are available for upgrade.
10823    pub upgradable_database_versions: std::vec::Vec<crate::model::AvailableDatabaseVersion>,
10824
10825    #[allow(missing_docs)]
10826    pub sql_network_architecture:
10827        std::option::Option<crate::model::database_instance::SqlNetworkArchitecture>,
10828
10829    /// Output only. The link to service attachment of PSC instance.
10830    pub psc_service_attachment_link: std::option::Option<std::string::String>,
10831
10832    /// Output only. The dns name of the instance.
10833    pub dns_name: std::option::Option<std::string::String>,
10834
10835    /// Output only. DEPRECATED: please use write_endpoint instead.
10836    #[deprecated]
10837    pub primary_dns_name: std::option::Option<std::string::String>,
10838
10839    /// Output only. The dns name of the primary instance in a replication group.
10840    pub write_endpoint: std::option::Option<std::string::String>,
10841
10842    /// Optional. A primary instance and disaster recovery (DR) replica pair.
10843    /// A DR replica is a cross-region replica that you designate
10844    /// for failover in the event that the primary instance
10845    /// experiences regional failure.
10846    /// Applicable to MySQL and PostgreSQL.
10847    pub replication_cluster: std::option::Option<crate::model::ReplicationCluster>,
10848
10849    /// Gemini instance configuration.
10850    pub gemini_config: std::option::Option<crate::model::GeminiInstanceConfig>,
10851
10852    /// Output only. This status indicates whether the instance satisfies PZI.
10853    ///
10854    /// The status is reserved for future use.
10855    pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
10856
10857    /// Input only. Whether Cloud SQL is enabled to switch storing point-in-time
10858    /// recovery log files from a data disk to Cloud Storage.
10859    pub switch_transaction_logs_to_cloud_storage_enabled: std::option::Option<wkt::BoolValue>,
10860
10861    /// Input only. Determines whether an in-place major version upgrade of
10862    /// replicas happens when an in-place major version upgrade of a primary
10863    /// instance is initiated.
10864    pub include_replicas_for_major_version_upgrade: std::option::Option<wkt::BoolValue>,
10865
10866    /// Optional. Input only. Immutable. Tag keys and tag values that are bound to
10867    /// this instance. You must represent each item in the map as:
10868    /// `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
10869    ///
10870    /// For example, a single resource can have the following tags:
10871    ///
10872    /// ```norust
10873    ///   "123/environment": "production",
10874    ///   "123/costCenter": "marketing",
10875    /// ```
10876    ///
10877    /// For more information on tag creation and management, see
10878    /// <https://cloud.google.com/resource-manager/docs/tags/tags-overview>.
10879    pub tags: std::collections::HashMap<std::string::String, std::string::String>,
10880
10881    /// The number of read pool nodes in a read pool.
10882    pub node_count: std::option::Option<i32>,
10883
10884    /// Output only. Entries containing information about each read pool node of
10885    /// the read pool.
10886    pub nodes: std::vec::Vec<crate::model::database_instance::PoolNodeConfig>,
10887
10888    /// Output only. The list of DNS names used by this instance.
10889    pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
10890
10891    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10892}
10893
10894impl DatabaseInstance {
10895    /// Creates a new default instance.
10896    pub fn new() -> Self {
10897        std::default::Default::default()
10898    }
10899
10900    /// Sets the value of [kind][crate::model::DatabaseInstance::kind].
10901    ///
10902    /// # Example
10903    /// ```ignore,no_run
10904    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10905    /// let x = DatabaseInstance::new().set_kind("example");
10906    /// ```
10907    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10908        self.kind = v.into();
10909        self
10910    }
10911
10912    /// Sets the value of [state][crate::model::DatabaseInstance::state].
10913    ///
10914    /// # Example
10915    /// ```ignore,no_run
10916    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10917    /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
10918    /// let x0 = DatabaseInstance::new().set_state(SqlInstanceState::Runnable);
10919    /// let x1 = DatabaseInstance::new().set_state(SqlInstanceState::Suspended);
10920    /// let x2 = DatabaseInstance::new().set_state(SqlInstanceState::PendingDelete);
10921    /// ```
10922    pub fn set_state<T: std::convert::Into<crate::model::database_instance::SqlInstanceState>>(
10923        mut self,
10924        v: T,
10925    ) -> Self {
10926        self.state = v.into();
10927        self
10928    }
10929
10930    /// Sets the value of [database_version][crate::model::DatabaseInstance::database_version].
10931    ///
10932    /// # Example
10933    /// ```ignore,no_run
10934    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10935    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
10936    /// let x0 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql56);
10937    /// let x1 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql57);
10938    /// let x2 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql80);
10939    /// ```
10940    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
10941        mut self,
10942        v: T,
10943    ) -> Self {
10944        self.database_version = v.into();
10945        self
10946    }
10947
10948    /// Sets the value of [settings][crate::model::DatabaseInstance::settings].
10949    ///
10950    /// # Example
10951    /// ```ignore,no_run
10952    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10953    /// use google_cloud_sql_v1::model::Settings;
10954    /// let x = DatabaseInstance::new().set_settings(Settings::default()/* use setters */);
10955    /// ```
10956    pub fn set_settings<T>(mut self, v: T) -> Self
10957    where
10958        T: std::convert::Into<crate::model::Settings>,
10959    {
10960        self.settings = std::option::Option::Some(v.into());
10961        self
10962    }
10963
10964    /// Sets or clears the value of [settings][crate::model::DatabaseInstance::settings].
10965    ///
10966    /// # Example
10967    /// ```ignore,no_run
10968    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10969    /// use google_cloud_sql_v1::model::Settings;
10970    /// let x = DatabaseInstance::new().set_or_clear_settings(Some(Settings::default()/* use setters */));
10971    /// let x = DatabaseInstance::new().set_or_clear_settings(None::<Settings>);
10972    /// ```
10973    pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
10974    where
10975        T: std::convert::Into<crate::model::Settings>,
10976    {
10977        self.settings = v.map(|x| x.into());
10978        self
10979    }
10980
10981    /// Sets the value of [etag][crate::model::DatabaseInstance::etag].
10982    ///
10983    /// # Example
10984    /// ```ignore,no_run
10985    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10986    /// let x = DatabaseInstance::new().set_etag("example");
10987    /// ```
10988    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10989        self.etag = v.into();
10990        self
10991    }
10992
10993    /// Sets the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
10994    ///
10995    /// # Example
10996    /// ```ignore,no_run
10997    /// # use google_cloud_sql_v1::model::DatabaseInstance;
10998    /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
10999    /// let x = DatabaseInstance::new().set_failover_replica(SqlFailoverReplica::default()/* use setters */);
11000    /// ```
11001    pub fn set_failover_replica<T>(mut self, v: T) -> Self
11002    where
11003        T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
11004    {
11005        self.failover_replica = std::option::Option::Some(v.into());
11006        self
11007    }
11008
11009    /// Sets or clears the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
11010    ///
11011    /// # Example
11012    /// ```ignore,no_run
11013    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11014    /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
11015    /// let x = DatabaseInstance::new().set_or_clear_failover_replica(Some(SqlFailoverReplica::default()/* use setters */));
11016    /// let x = DatabaseInstance::new().set_or_clear_failover_replica(None::<SqlFailoverReplica>);
11017    /// ```
11018    pub fn set_or_clear_failover_replica<T>(mut self, v: std::option::Option<T>) -> Self
11019    where
11020        T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
11021    {
11022        self.failover_replica = v.map(|x| x.into());
11023        self
11024    }
11025
11026    /// Sets the value of [master_instance_name][crate::model::DatabaseInstance::master_instance_name].
11027    ///
11028    /// # Example
11029    /// ```ignore,no_run
11030    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11031    /// let x = DatabaseInstance::new().set_master_instance_name("example");
11032    /// ```
11033    pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
11034        mut self,
11035        v: T,
11036    ) -> Self {
11037        self.master_instance_name = v.into();
11038        self
11039    }
11040
11041    /// Sets the value of [replica_names][crate::model::DatabaseInstance::replica_names].
11042    ///
11043    /// # Example
11044    /// ```ignore,no_run
11045    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11046    /// let x = DatabaseInstance::new().set_replica_names(["a", "b", "c"]);
11047    /// ```
11048    pub fn set_replica_names<T, V>(mut self, v: T) -> Self
11049    where
11050        T: std::iter::IntoIterator<Item = V>,
11051        V: std::convert::Into<std::string::String>,
11052    {
11053        use std::iter::Iterator;
11054        self.replica_names = v.into_iter().map(|i| i.into()).collect();
11055        self
11056    }
11057
11058    /// Sets the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
11059    ///
11060    /// # Example
11061    /// ```ignore,no_run
11062    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11063    /// use wkt::Int64Value;
11064    /// let x = DatabaseInstance::new().set_max_disk_size(Int64Value::default()/* use setters */);
11065    /// ```
11066    #[deprecated]
11067    pub fn set_max_disk_size<T>(mut self, v: T) -> Self
11068    where
11069        T: std::convert::Into<wkt::Int64Value>,
11070    {
11071        self.max_disk_size = std::option::Option::Some(v.into());
11072        self
11073    }
11074
11075    /// Sets or clears the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
11076    ///
11077    /// # Example
11078    /// ```ignore,no_run
11079    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11080    /// use wkt::Int64Value;
11081    /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(Some(Int64Value::default()/* use setters */));
11082    /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(None::<Int64Value>);
11083    /// ```
11084    #[deprecated]
11085    pub fn set_or_clear_max_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
11086    where
11087        T: std::convert::Into<wkt::Int64Value>,
11088    {
11089        self.max_disk_size = v.map(|x| x.into());
11090        self
11091    }
11092
11093    /// Sets the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
11094    ///
11095    /// # Example
11096    /// ```ignore,no_run
11097    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11098    /// use wkt::Int64Value;
11099    /// let x = DatabaseInstance::new().set_current_disk_size(Int64Value::default()/* use setters */);
11100    /// ```
11101    #[deprecated]
11102    pub fn set_current_disk_size<T>(mut self, v: T) -> Self
11103    where
11104        T: std::convert::Into<wkt::Int64Value>,
11105    {
11106        self.current_disk_size = std::option::Option::Some(v.into());
11107        self
11108    }
11109
11110    /// Sets or clears the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
11111    ///
11112    /// # Example
11113    /// ```ignore,no_run
11114    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11115    /// use wkt::Int64Value;
11116    /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(Some(Int64Value::default()/* use setters */));
11117    /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(None::<Int64Value>);
11118    /// ```
11119    #[deprecated]
11120    pub fn set_or_clear_current_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
11121    where
11122        T: std::convert::Into<wkt::Int64Value>,
11123    {
11124        self.current_disk_size = v.map(|x| x.into());
11125        self
11126    }
11127
11128    /// Sets the value of [ip_addresses][crate::model::DatabaseInstance::ip_addresses].
11129    ///
11130    /// # Example
11131    /// ```ignore,no_run
11132    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11133    /// use google_cloud_sql_v1::model::IpMapping;
11134    /// let x = DatabaseInstance::new()
11135    ///     .set_ip_addresses([
11136    ///         IpMapping::default()/* use setters */,
11137    ///         IpMapping::default()/* use (different) setters */,
11138    ///     ]);
11139    /// ```
11140    pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
11141    where
11142        T: std::iter::IntoIterator<Item = V>,
11143        V: std::convert::Into<crate::model::IpMapping>,
11144    {
11145        use std::iter::Iterator;
11146        self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
11147        self
11148    }
11149
11150    /// Sets the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
11151    ///
11152    /// # Example
11153    /// ```ignore,no_run
11154    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11155    /// use google_cloud_sql_v1::model::SslCert;
11156    /// let x = DatabaseInstance::new().set_server_ca_cert(SslCert::default()/* use setters */);
11157    /// ```
11158    pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
11159    where
11160        T: std::convert::Into<crate::model::SslCert>,
11161    {
11162        self.server_ca_cert = std::option::Option::Some(v.into());
11163        self
11164    }
11165
11166    /// Sets or clears the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
11167    ///
11168    /// # Example
11169    /// ```ignore,no_run
11170    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11171    /// use google_cloud_sql_v1::model::SslCert;
11172    /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
11173    /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(None::<SslCert>);
11174    /// ```
11175    pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
11176    where
11177        T: std::convert::Into<crate::model::SslCert>,
11178    {
11179        self.server_ca_cert = v.map(|x| x.into());
11180        self
11181    }
11182
11183    /// Sets the value of [instance_type][crate::model::DatabaseInstance::instance_type].
11184    ///
11185    /// # Example
11186    /// ```ignore,no_run
11187    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11188    /// use google_cloud_sql_v1::model::SqlInstanceType;
11189    /// let x0 = DatabaseInstance::new().set_instance_type(SqlInstanceType::CloudSqlInstance);
11190    /// let x1 = DatabaseInstance::new().set_instance_type(SqlInstanceType::OnPremisesInstance);
11191    /// let x2 = DatabaseInstance::new().set_instance_type(SqlInstanceType::ReadReplicaInstance);
11192    /// ```
11193    pub fn set_instance_type<T: std::convert::Into<crate::model::SqlInstanceType>>(
11194        mut self,
11195        v: T,
11196    ) -> Self {
11197        self.instance_type = v.into();
11198        self
11199    }
11200
11201    /// Sets the value of [project][crate::model::DatabaseInstance::project].
11202    ///
11203    /// # Example
11204    /// ```ignore,no_run
11205    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11206    /// let x = DatabaseInstance::new().set_project("example");
11207    /// ```
11208    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11209        self.project = v.into();
11210        self
11211    }
11212
11213    /// Sets the value of [ipv6_address][crate::model::DatabaseInstance::ipv6_address].
11214    ///
11215    /// # Example
11216    /// ```ignore,no_run
11217    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11218    /// let x = DatabaseInstance::new().set_ipv6_address("example");
11219    /// ```
11220    #[deprecated]
11221    pub fn set_ipv6_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11222        self.ipv6_address = v.into();
11223        self
11224    }
11225
11226    /// Sets the value of [service_account_email_address][crate::model::DatabaseInstance::service_account_email_address].
11227    ///
11228    /// # Example
11229    /// ```ignore,no_run
11230    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11231    /// let x = DatabaseInstance::new().set_service_account_email_address("example");
11232    /// ```
11233    pub fn set_service_account_email_address<T: std::convert::Into<std::string::String>>(
11234        mut self,
11235        v: T,
11236    ) -> Self {
11237        self.service_account_email_address = v.into();
11238        self
11239    }
11240
11241    /// Sets the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
11242    ///
11243    /// # Example
11244    /// ```ignore,no_run
11245    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11246    /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
11247    /// let x = DatabaseInstance::new().set_on_premises_configuration(OnPremisesConfiguration::default()/* use setters */);
11248    /// ```
11249    pub fn set_on_premises_configuration<T>(mut self, v: T) -> Self
11250    where
11251        T: std::convert::Into<crate::model::OnPremisesConfiguration>,
11252    {
11253        self.on_premises_configuration = std::option::Option::Some(v.into());
11254        self
11255    }
11256
11257    /// Sets or clears the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
11258    ///
11259    /// # Example
11260    /// ```ignore,no_run
11261    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11262    /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
11263    /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(Some(OnPremisesConfiguration::default()/* use setters */));
11264    /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(None::<OnPremisesConfiguration>);
11265    /// ```
11266    pub fn set_or_clear_on_premises_configuration<T>(mut self, v: std::option::Option<T>) -> Self
11267    where
11268        T: std::convert::Into<crate::model::OnPremisesConfiguration>,
11269    {
11270        self.on_premises_configuration = v.map(|x| x.into());
11271        self
11272    }
11273
11274    /// Sets the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
11275    ///
11276    /// # Example
11277    /// ```ignore,no_run
11278    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11279    /// use google_cloud_sql_v1::model::ReplicaConfiguration;
11280    /// let x = DatabaseInstance::new().set_replica_configuration(ReplicaConfiguration::default()/* use setters */);
11281    /// ```
11282    pub fn set_replica_configuration<T>(mut self, v: T) -> Self
11283    where
11284        T: std::convert::Into<crate::model::ReplicaConfiguration>,
11285    {
11286        self.replica_configuration = std::option::Option::Some(v.into());
11287        self
11288    }
11289
11290    /// Sets or clears the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
11291    ///
11292    /// # Example
11293    /// ```ignore,no_run
11294    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11295    /// use google_cloud_sql_v1::model::ReplicaConfiguration;
11296    /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(Some(ReplicaConfiguration::default()/* use setters */));
11297    /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(None::<ReplicaConfiguration>);
11298    /// ```
11299    pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
11300    where
11301        T: std::convert::Into<crate::model::ReplicaConfiguration>,
11302    {
11303        self.replica_configuration = v.map(|x| x.into());
11304        self
11305    }
11306
11307    /// Sets the value of [backend_type][crate::model::DatabaseInstance::backend_type].
11308    ///
11309    /// # Example
11310    /// ```ignore,no_run
11311    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11312    /// use google_cloud_sql_v1::model::SqlBackendType;
11313    /// let x0 = DatabaseInstance::new().set_backend_type(SqlBackendType::SecondGen);
11314    /// let x1 = DatabaseInstance::new().set_backend_type(SqlBackendType::External);
11315    /// ```
11316    pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
11317        mut self,
11318        v: T,
11319    ) -> Self {
11320        self.backend_type = v.into();
11321        self
11322    }
11323
11324    /// Sets the value of [self_link][crate::model::DatabaseInstance::self_link].
11325    ///
11326    /// # Example
11327    /// ```ignore,no_run
11328    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11329    /// let x = DatabaseInstance::new().set_self_link("example");
11330    /// ```
11331    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11332        self.self_link = v.into();
11333        self
11334    }
11335
11336    /// Sets the value of [suspension_reason][crate::model::DatabaseInstance::suspension_reason].
11337    ///
11338    /// # Example
11339    /// ```ignore,no_run
11340    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11341    /// use google_cloud_sql_v1::model::SqlSuspensionReason;
11342    /// let x = DatabaseInstance::new().set_suspension_reason([
11343    ///     SqlSuspensionReason::BillingIssue,
11344    ///     SqlSuspensionReason::LegalIssue,
11345    ///     SqlSuspensionReason::OperationalIssue,
11346    /// ]);
11347    /// ```
11348    pub fn set_suspension_reason<T, V>(mut self, v: T) -> Self
11349    where
11350        T: std::iter::IntoIterator<Item = V>,
11351        V: std::convert::Into<crate::model::SqlSuspensionReason>,
11352    {
11353        use std::iter::Iterator;
11354        self.suspension_reason = v.into_iter().map(|i| i.into()).collect();
11355        self
11356    }
11357
11358    /// Sets the value of [connection_name][crate::model::DatabaseInstance::connection_name].
11359    ///
11360    /// # Example
11361    /// ```ignore,no_run
11362    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11363    /// let x = DatabaseInstance::new().set_connection_name("example");
11364    /// ```
11365    pub fn set_connection_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11366        self.connection_name = v.into();
11367        self
11368    }
11369
11370    /// Sets the value of [name][crate::model::DatabaseInstance::name].
11371    ///
11372    /// # Example
11373    /// ```ignore,no_run
11374    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11375    /// let x = DatabaseInstance::new().set_name("example");
11376    /// ```
11377    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11378        self.name = v.into();
11379        self
11380    }
11381
11382    /// Sets the value of [region][crate::model::DatabaseInstance::region].
11383    ///
11384    /// # Example
11385    /// ```ignore,no_run
11386    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11387    /// let x = DatabaseInstance::new().set_region("example");
11388    /// ```
11389    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11390        self.region = v.into();
11391        self
11392    }
11393
11394    /// Sets the value of [gce_zone][crate::model::DatabaseInstance::gce_zone].
11395    ///
11396    /// # Example
11397    /// ```ignore,no_run
11398    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11399    /// let x = DatabaseInstance::new().set_gce_zone("example");
11400    /// ```
11401    pub fn set_gce_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11402        self.gce_zone = v.into();
11403        self
11404    }
11405
11406    /// Sets the value of [secondary_gce_zone][crate::model::DatabaseInstance::secondary_gce_zone].
11407    ///
11408    /// # Example
11409    /// ```ignore,no_run
11410    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11411    /// let x = DatabaseInstance::new().set_secondary_gce_zone("example");
11412    /// ```
11413    pub fn set_secondary_gce_zone<T: std::convert::Into<std::string::String>>(
11414        mut self,
11415        v: T,
11416    ) -> Self {
11417        self.secondary_gce_zone = v.into();
11418        self
11419    }
11420
11421    /// Sets the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
11422    ///
11423    /// # Example
11424    /// ```ignore,no_run
11425    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11426    /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
11427    /// let x = DatabaseInstance::new().set_disk_encryption_configuration(DiskEncryptionConfiguration::default()/* use setters */);
11428    /// ```
11429    pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
11430    where
11431        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
11432    {
11433        self.disk_encryption_configuration = std::option::Option::Some(v.into());
11434        self
11435    }
11436
11437    /// Sets or clears the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
11438    ///
11439    /// # Example
11440    /// ```ignore,no_run
11441    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11442    /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
11443    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(Some(DiskEncryptionConfiguration::default()/* use setters */));
11444    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(None::<DiskEncryptionConfiguration>);
11445    /// ```
11446    pub fn set_or_clear_disk_encryption_configuration<T>(
11447        mut self,
11448        v: std::option::Option<T>,
11449    ) -> Self
11450    where
11451        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
11452    {
11453        self.disk_encryption_configuration = v.map(|x| x.into());
11454        self
11455    }
11456
11457    /// Sets the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
11458    ///
11459    /// # Example
11460    /// ```ignore,no_run
11461    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11462    /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
11463    /// let x = DatabaseInstance::new().set_disk_encryption_status(DiskEncryptionStatus::default()/* use setters */);
11464    /// ```
11465    pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
11466    where
11467        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
11468    {
11469        self.disk_encryption_status = std::option::Option::Some(v.into());
11470        self
11471    }
11472
11473    /// Sets or clears the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
11474    ///
11475    /// # Example
11476    /// ```ignore,no_run
11477    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11478    /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
11479    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(Some(DiskEncryptionStatus::default()/* use setters */));
11480    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(None::<DiskEncryptionStatus>);
11481    /// ```
11482    pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
11483    where
11484        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
11485    {
11486        self.disk_encryption_status = v.map(|x| x.into());
11487        self
11488    }
11489
11490    /// Sets the value of [root_password][crate::model::DatabaseInstance::root_password].
11491    ///
11492    /// # Example
11493    /// ```ignore,no_run
11494    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11495    /// let x = DatabaseInstance::new().set_root_password("example");
11496    /// ```
11497    pub fn set_root_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11498        self.root_password = v.into();
11499        self
11500    }
11501
11502    /// Sets the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
11503    ///
11504    /// # Example
11505    /// ```ignore,no_run
11506    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11507    /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
11508    /// let x = DatabaseInstance::new().set_scheduled_maintenance(SqlScheduledMaintenance::default()/* use setters */);
11509    /// ```
11510    pub fn set_scheduled_maintenance<T>(mut self, v: T) -> Self
11511    where
11512        T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
11513    {
11514        self.scheduled_maintenance = std::option::Option::Some(v.into());
11515        self
11516    }
11517
11518    /// Sets or clears the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
11519    ///
11520    /// # Example
11521    /// ```ignore,no_run
11522    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11523    /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
11524    /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(Some(SqlScheduledMaintenance::default()/* use setters */));
11525    /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(None::<SqlScheduledMaintenance>);
11526    /// ```
11527    pub fn set_or_clear_scheduled_maintenance<T>(mut self, v: std::option::Option<T>) -> Self
11528    where
11529        T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
11530    {
11531        self.scheduled_maintenance = v.map(|x| x.into());
11532        self
11533    }
11534
11535    /// Sets the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
11536    ///
11537    /// # Example
11538    /// ```ignore,no_run
11539    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11540    /// use wkt::BoolValue;
11541    /// let x = DatabaseInstance::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
11542    /// ```
11543    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
11544    where
11545        T: std::convert::Into<wkt::BoolValue>,
11546    {
11547        self.satisfies_pzs = std::option::Option::Some(v.into());
11548        self
11549    }
11550
11551    /// Sets or clears the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
11552    ///
11553    /// # Example
11554    /// ```ignore,no_run
11555    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11556    /// use wkt::BoolValue;
11557    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
11558    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
11559    /// ```
11560    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
11561    where
11562        T: std::convert::Into<wkt::BoolValue>,
11563    {
11564        self.satisfies_pzs = v.map(|x| x.into());
11565        self
11566    }
11567
11568    /// Sets the value of [database_installed_version][crate::model::DatabaseInstance::database_installed_version].
11569    ///
11570    /// # Example
11571    /// ```ignore,no_run
11572    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11573    /// let x = DatabaseInstance::new().set_database_installed_version("example");
11574    /// ```
11575    pub fn set_database_installed_version<T: std::convert::Into<std::string::String>>(
11576        mut self,
11577        v: T,
11578    ) -> Self {
11579        self.database_installed_version = v.into();
11580        self
11581    }
11582
11583    /// Sets the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
11584    ///
11585    /// # Example
11586    /// ```ignore,no_run
11587    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11588    /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
11589    /// let x = DatabaseInstance::new().set_out_of_disk_report(SqlOutOfDiskReport::default()/* use setters */);
11590    /// ```
11591    pub fn set_out_of_disk_report<T>(mut self, v: T) -> Self
11592    where
11593        T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
11594    {
11595        self.out_of_disk_report = std::option::Option::Some(v.into());
11596        self
11597    }
11598
11599    /// Sets or clears the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
11600    ///
11601    /// # Example
11602    /// ```ignore,no_run
11603    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11604    /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
11605    /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(Some(SqlOutOfDiskReport::default()/* use setters */));
11606    /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(None::<SqlOutOfDiskReport>);
11607    /// ```
11608    pub fn set_or_clear_out_of_disk_report<T>(mut self, v: std::option::Option<T>) -> Self
11609    where
11610        T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
11611    {
11612        self.out_of_disk_report = v.map(|x| x.into());
11613        self
11614    }
11615
11616    /// Sets the value of [create_time][crate::model::DatabaseInstance::create_time].
11617    ///
11618    /// # Example
11619    /// ```ignore,no_run
11620    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11621    /// use wkt::Timestamp;
11622    /// let x = DatabaseInstance::new().set_create_time(Timestamp::default()/* use setters */);
11623    /// ```
11624    pub fn set_create_time<T>(mut self, v: T) -> Self
11625    where
11626        T: std::convert::Into<wkt::Timestamp>,
11627    {
11628        self.create_time = std::option::Option::Some(v.into());
11629        self
11630    }
11631
11632    /// Sets or clears the value of [create_time][crate::model::DatabaseInstance::create_time].
11633    ///
11634    /// # Example
11635    /// ```ignore,no_run
11636    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11637    /// use wkt::Timestamp;
11638    /// let x = DatabaseInstance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11639    /// let x = DatabaseInstance::new().set_or_clear_create_time(None::<Timestamp>);
11640    /// ```
11641    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11642    where
11643        T: std::convert::Into<wkt::Timestamp>,
11644    {
11645        self.create_time = v.map(|x| x.into());
11646        self
11647    }
11648
11649    /// Sets the value of [available_maintenance_versions][crate::model::DatabaseInstance::available_maintenance_versions].
11650    ///
11651    /// # Example
11652    /// ```ignore,no_run
11653    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11654    /// let x = DatabaseInstance::new().set_available_maintenance_versions(["a", "b", "c"]);
11655    /// ```
11656    pub fn set_available_maintenance_versions<T, V>(mut self, v: T) -> Self
11657    where
11658        T: std::iter::IntoIterator<Item = V>,
11659        V: std::convert::Into<std::string::String>,
11660    {
11661        use std::iter::Iterator;
11662        self.available_maintenance_versions = v.into_iter().map(|i| i.into()).collect();
11663        self
11664    }
11665
11666    /// Sets the value of [maintenance_version][crate::model::DatabaseInstance::maintenance_version].
11667    ///
11668    /// # Example
11669    /// ```ignore,no_run
11670    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11671    /// let x = DatabaseInstance::new().set_maintenance_version("example");
11672    /// ```
11673    pub fn set_maintenance_version<T: std::convert::Into<std::string::String>>(
11674        mut self,
11675        v: T,
11676    ) -> Self {
11677        self.maintenance_version = v.into();
11678        self
11679    }
11680
11681    /// Sets the value of [upgradable_database_versions][crate::model::DatabaseInstance::upgradable_database_versions].
11682    ///
11683    /// # Example
11684    /// ```ignore,no_run
11685    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11686    /// use google_cloud_sql_v1::model::AvailableDatabaseVersion;
11687    /// let x = DatabaseInstance::new()
11688    ///     .set_upgradable_database_versions([
11689    ///         AvailableDatabaseVersion::default()/* use setters */,
11690    ///         AvailableDatabaseVersion::default()/* use (different) setters */,
11691    ///     ]);
11692    /// ```
11693    pub fn set_upgradable_database_versions<T, V>(mut self, v: T) -> Self
11694    where
11695        T: std::iter::IntoIterator<Item = V>,
11696        V: std::convert::Into<crate::model::AvailableDatabaseVersion>,
11697    {
11698        use std::iter::Iterator;
11699        self.upgradable_database_versions = v.into_iter().map(|i| i.into()).collect();
11700        self
11701    }
11702
11703    /// Sets the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
11704    ///
11705    /// # Example
11706    /// ```ignore,no_run
11707    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11708    /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
11709    /// let x0 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::NewNetworkArchitecture);
11710    /// let x1 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::OldNetworkArchitecture);
11711    /// ```
11712    pub fn set_sql_network_architecture<T>(mut self, v: T) -> Self
11713    where
11714        T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
11715    {
11716        self.sql_network_architecture = std::option::Option::Some(v.into());
11717        self
11718    }
11719
11720    /// Sets or clears the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
11721    ///
11722    /// # Example
11723    /// ```ignore,no_run
11724    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11725    /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
11726    /// let x0 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::NewNetworkArchitecture));
11727    /// let x1 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::OldNetworkArchitecture));
11728    /// let x_none = DatabaseInstance::new().set_or_clear_sql_network_architecture(None::<SqlNetworkArchitecture>);
11729    /// ```
11730    pub fn set_or_clear_sql_network_architecture<T>(mut self, v: std::option::Option<T>) -> Self
11731    where
11732        T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
11733    {
11734        self.sql_network_architecture = v.map(|x| x.into());
11735        self
11736    }
11737
11738    /// Sets the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
11739    ///
11740    /// # Example
11741    /// ```ignore,no_run
11742    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11743    /// let x = DatabaseInstance::new().set_psc_service_attachment_link("example");
11744    /// ```
11745    pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
11746    where
11747        T: std::convert::Into<std::string::String>,
11748    {
11749        self.psc_service_attachment_link = std::option::Option::Some(v.into());
11750        self
11751    }
11752
11753    /// Sets or clears the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
11754    ///
11755    /// # Example
11756    /// ```ignore,no_run
11757    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11758    /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(Some("example"));
11759    /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(None::<String>);
11760    /// ```
11761    pub fn set_or_clear_psc_service_attachment_link<T>(mut self, v: std::option::Option<T>) -> Self
11762    where
11763        T: std::convert::Into<std::string::String>,
11764    {
11765        self.psc_service_attachment_link = v.map(|x| x.into());
11766        self
11767    }
11768
11769    /// Sets the value of [dns_name][crate::model::DatabaseInstance::dns_name].
11770    ///
11771    /// # Example
11772    /// ```ignore,no_run
11773    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11774    /// let x = DatabaseInstance::new().set_dns_name("example");
11775    /// ```
11776    pub fn set_dns_name<T>(mut self, v: T) -> Self
11777    where
11778        T: std::convert::Into<std::string::String>,
11779    {
11780        self.dns_name = std::option::Option::Some(v.into());
11781        self
11782    }
11783
11784    /// Sets or clears the value of [dns_name][crate::model::DatabaseInstance::dns_name].
11785    ///
11786    /// # Example
11787    /// ```ignore,no_run
11788    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11789    /// let x = DatabaseInstance::new().set_or_clear_dns_name(Some("example"));
11790    /// let x = DatabaseInstance::new().set_or_clear_dns_name(None::<String>);
11791    /// ```
11792    pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
11793    where
11794        T: std::convert::Into<std::string::String>,
11795    {
11796        self.dns_name = v.map(|x| x.into());
11797        self
11798    }
11799
11800    /// Sets the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
11801    ///
11802    /// # Example
11803    /// ```ignore,no_run
11804    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11805    /// let x = DatabaseInstance::new().set_primary_dns_name("example");
11806    /// ```
11807    #[deprecated]
11808    pub fn set_primary_dns_name<T>(mut self, v: T) -> Self
11809    where
11810        T: std::convert::Into<std::string::String>,
11811    {
11812        self.primary_dns_name = std::option::Option::Some(v.into());
11813        self
11814    }
11815
11816    /// Sets or clears the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
11817    ///
11818    /// # Example
11819    /// ```ignore,no_run
11820    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11821    /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(Some("example"));
11822    /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(None::<String>);
11823    /// ```
11824    #[deprecated]
11825    pub fn set_or_clear_primary_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
11826    where
11827        T: std::convert::Into<std::string::String>,
11828    {
11829        self.primary_dns_name = v.map(|x| x.into());
11830        self
11831    }
11832
11833    /// Sets the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
11834    ///
11835    /// # Example
11836    /// ```ignore,no_run
11837    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11838    /// let x = DatabaseInstance::new().set_write_endpoint("example");
11839    /// ```
11840    pub fn set_write_endpoint<T>(mut self, v: T) -> Self
11841    where
11842        T: std::convert::Into<std::string::String>,
11843    {
11844        self.write_endpoint = std::option::Option::Some(v.into());
11845        self
11846    }
11847
11848    /// Sets or clears the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
11849    ///
11850    /// # Example
11851    /// ```ignore,no_run
11852    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11853    /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(Some("example"));
11854    /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(None::<String>);
11855    /// ```
11856    pub fn set_or_clear_write_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
11857    where
11858        T: std::convert::Into<std::string::String>,
11859    {
11860        self.write_endpoint = v.map(|x| x.into());
11861        self
11862    }
11863
11864    /// Sets the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
11865    ///
11866    /// # Example
11867    /// ```ignore,no_run
11868    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11869    /// use google_cloud_sql_v1::model::ReplicationCluster;
11870    /// let x = DatabaseInstance::new().set_replication_cluster(ReplicationCluster::default()/* use setters */);
11871    /// ```
11872    pub fn set_replication_cluster<T>(mut self, v: T) -> Self
11873    where
11874        T: std::convert::Into<crate::model::ReplicationCluster>,
11875    {
11876        self.replication_cluster = std::option::Option::Some(v.into());
11877        self
11878    }
11879
11880    /// Sets or clears the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
11881    ///
11882    /// # Example
11883    /// ```ignore,no_run
11884    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11885    /// use google_cloud_sql_v1::model::ReplicationCluster;
11886    /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(Some(ReplicationCluster::default()/* use setters */));
11887    /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(None::<ReplicationCluster>);
11888    /// ```
11889    pub fn set_or_clear_replication_cluster<T>(mut self, v: std::option::Option<T>) -> Self
11890    where
11891        T: std::convert::Into<crate::model::ReplicationCluster>,
11892    {
11893        self.replication_cluster = v.map(|x| x.into());
11894        self
11895    }
11896
11897    /// Sets the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
11898    ///
11899    /// # Example
11900    /// ```ignore,no_run
11901    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11902    /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
11903    /// let x = DatabaseInstance::new().set_gemini_config(GeminiInstanceConfig::default()/* use setters */);
11904    /// ```
11905    pub fn set_gemini_config<T>(mut self, v: T) -> Self
11906    where
11907        T: std::convert::Into<crate::model::GeminiInstanceConfig>,
11908    {
11909        self.gemini_config = std::option::Option::Some(v.into());
11910        self
11911    }
11912
11913    /// Sets or clears the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
11914    ///
11915    /// # Example
11916    /// ```ignore,no_run
11917    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11918    /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
11919    /// let x = DatabaseInstance::new().set_or_clear_gemini_config(Some(GeminiInstanceConfig::default()/* use setters */));
11920    /// let x = DatabaseInstance::new().set_or_clear_gemini_config(None::<GeminiInstanceConfig>);
11921    /// ```
11922    pub fn set_or_clear_gemini_config<T>(mut self, v: std::option::Option<T>) -> Self
11923    where
11924        T: std::convert::Into<crate::model::GeminiInstanceConfig>,
11925    {
11926        self.gemini_config = v.map(|x| x.into());
11927        self
11928    }
11929
11930    /// Sets the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
11931    ///
11932    /// # Example
11933    /// ```ignore,no_run
11934    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11935    /// use wkt::BoolValue;
11936    /// let x = DatabaseInstance::new().set_satisfies_pzi(BoolValue::default()/* use setters */);
11937    /// ```
11938    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
11939    where
11940        T: std::convert::Into<wkt::BoolValue>,
11941    {
11942        self.satisfies_pzi = std::option::Option::Some(v.into());
11943        self
11944    }
11945
11946    /// Sets or clears the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
11947    ///
11948    /// # Example
11949    /// ```ignore,no_run
11950    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11951    /// use wkt::BoolValue;
11952    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(Some(BoolValue::default()/* use setters */));
11953    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(None::<BoolValue>);
11954    /// ```
11955    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
11956    where
11957        T: std::convert::Into<wkt::BoolValue>,
11958    {
11959        self.satisfies_pzi = v.map(|x| x.into());
11960        self
11961    }
11962
11963    /// Sets the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
11964    ///
11965    /// # Example
11966    /// ```ignore,no_run
11967    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11968    /// use wkt::BoolValue;
11969    /// let x = DatabaseInstance::new().set_switch_transaction_logs_to_cloud_storage_enabled(BoolValue::default()/* use setters */);
11970    /// ```
11971    pub fn set_switch_transaction_logs_to_cloud_storage_enabled<T>(mut self, v: T) -> Self
11972    where
11973        T: std::convert::Into<wkt::BoolValue>,
11974    {
11975        self.switch_transaction_logs_to_cloud_storage_enabled = std::option::Option::Some(v.into());
11976        self
11977    }
11978
11979    /// Sets or clears the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
11980    ///
11981    /// # Example
11982    /// ```ignore,no_run
11983    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11984    /// use wkt::BoolValue;
11985    /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(Some(BoolValue::default()/* use setters */));
11986    /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(None::<BoolValue>);
11987    /// ```
11988    pub fn set_or_clear_switch_transaction_logs_to_cloud_storage_enabled<T>(
11989        mut self,
11990        v: std::option::Option<T>,
11991    ) -> Self
11992    where
11993        T: std::convert::Into<wkt::BoolValue>,
11994    {
11995        self.switch_transaction_logs_to_cloud_storage_enabled = v.map(|x| x.into());
11996        self
11997    }
11998
11999    /// Sets the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
12000    ///
12001    /// # Example
12002    /// ```ignore,no_run
12003    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12004    /// use wkt::BoolValue;
12005    /// let x = DatabaseInstance::new().set_include_replicas_for_major_version_upgrade(BoolValue::default()/* use setters */);
12006    /// ```
12007    pub fn set_include_replicas_for_major_version_upgrade<T>(mut self, v: T) -> Self
12008    where
12009        T: std::convert::Into<wkt::BoolValue>,
12010    {
12011        self.include_replicas_for_major_version_upgrade = std::option::Option::Some(v.into());
12012        self
12013    }
12014
12015    /// Sets or clears the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
12016    ///
12017    /// # Example
12018    /// ```ignore,no_run
12019    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12020    /// use wkt::BoolValue;
12021    /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(Some(BoolValue::default()/* use setters */));
12022    /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(None::<BoolValue>);
12023    /// ```
12024    pub fn set_or_clear_include_replicas_for_major_version_upgrade<T>(
12025        mut self,
12026        v: std::option::Option<T>,
12027    ) -> Self
12028    where
12029        T: std::convert::Into<wkt::BoolValue>,
12030    {
12031        self.include_replicas_for_major_version_upgrade = v.map(|x| x.into());
12032        self
12033    }
12034
12035    /// Sets the value of [tags][crate::model::DatabaseInstance::tags].
12036    ///
12037    /// # Example
12038    /// ```ignore,no_run
12039    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12040    /// let x = DatabaseInstance::new().set_tags([
12041    ///     ("key0", "abc"),
12042    ///     ("key1", "xyz"),
12043    /// ]);
12044    /// ```
12045    pub fn set_tags<T, K, V>(mut self, v: T) -> Self
12046    where
12047        T: std::iter::IntoIterator<Item = (K, V)>,
12048        K: std::convert::Into<std::string::String>,
12049        V: std::convert::Into<std::string::String>,
12050    {
12051        use std::iter::Iterator;
12052        self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12053        self
12054    }
12055
12056    /// Sets the value of [node_count][crate::model::DatabaseInstance::node_count].
12057    ///
12058    /// # Example
12059    /// ```ignore,no_run
12060    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12061    /// let x = DatabaseInstance::new().set_node_count(42);
12062    /// ```
12063    pub fn set_node_count<T>(mut self, v: T) -> Self
12064    where
12065        T: std::convert::Into<i32>,
12066    {
12067        self.node_count = std::option::Option::Some(v.into());
12068        self
12069    }
12070
12071    /// Sets or clears the value of [node_count][crate::model::DatabaseInstance::node_count].
12072    ///
12073    /// # Example
12074    /// ```ignore,no_run
12075    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12076    /// let x = DatabaseInstance::new().set_or_clear_node_count(Some(42));
12077    /// let x = DatabaseInstance::new().set_or_clear_node_count(None::<i32>);
12078    /// ```
12079    pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
12080    where
12081        T: std::convert::Into<i32>,
12082    {
12083        self.node_count = v.map(|x| x.into());
12084        self
12085    }
12086
12087    /// Sets the value of [nodes][crate::model::DatabaseInstance::nodes].
12088    ///
12089    /// # Example
12090    /// ```ignore,no_run
12091    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12092    /// use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12093    /// let x = DatabaseInstance::new()
12094    ///     .set_nodes([
12095    ///         PoolNodeConfig::default()/* use setters */,
12096    ///         PoolNodeConfig::default()/* use (different) setters */,
12097    ///     ]);
12098    /// ```
12099    pub fn set_nodes<T, V>(mut self, v: T) -> Self
12100    where
12101        T: std::iter::IntoIterator<Item = V>,
12102        V: std::convert::Into<crate::model::database_instance::PoolNodeConfig>,
12103    {
12104        use std::iter::Iterator;
12105        self.nodes = v.into_iter().map(|i| i.into()).collect();
12106        self
12107    }
12108
12109    /// Sets the value of [dns_names][crate::model::DatabaseInstance::dns_names].
12110    ///
12111    /// # Example
12112    /// ```ignore,no_run
12113    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12114    /// use google_cloud_sql_v1::model::DnsNameMapping;
12115    /// let x = DatabaseInstance::new()
12116    ///     .set_dns_names([
12117    ///         DnsNameMapping::default()/* use setters */,
12118    ///         DnsNameMapping::default()/* use (different) setters */,
12119    ///     ]);
12120    /// ```
12121    pub fn set_dns_names<T, V>(mut self, v: T) -> Self
12122    where
12123        T: std::iter::IntoIterator<Item = V>,
12124        V: std::convert::Into<crate::model::DnsNameMapping>,
12125    {
12126        use std::iter::Iterator;
12127        self.dns_names = v.into_iter().map(|i| i.into()).collect();
12128        self
12129    }
12130}
12131
12132impl wkt::message::Message for DatabaseInstance {
12133    fn typename() -> &'static str {
12134        "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance"
12135    }
12136}
12137
12138/// Defines additional types related to [DatabaseInstance].
12139pub mod database_instance {
12140    #[allow(unused_imports)]
12141    use super::*;
12142
12143    #[allow(missing_docs)]
12144    #[derive(Clone, Default, PartialEq)]
12145    #[non_exhaustive]
12146    pub struct SqlFailoverReplica {
12147        /// The name of the failover replica. If specified at instance creation, a
12148        /// failover replica is created for the instance. The name
12149        /// doesn't include the project ID.
12150        pub name: std::string::String,
12151
12152        /// The availability status of the failover replica. A false status indicates
12153        /// that the failover replica is out of sync. The primary instance can only
12154        /// failover to the failover replica when the status is true.
12155        pub available: std::option::Option<wkt::BoolValue>,
12156
12157        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12158    }
12159
12160    impl SqlFailoverReplica {
12161        /// Creates a new default instance.
12162        pub fn new() -> Self {
12163            std::default::Default::default()
12164        }
12165
12166        /// Sets the value of [name][crate::model::database_instance::SqlFailoverReplica::name].
12167        ///
12168        /// # Example
12169        /// ```ignore,no_run
12170        /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12171        /// let x = SqlFailoverReplica::new().set_name("example");
12172        /// ```
12173        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12174            self.name = v.into();
12175            self
12176        }
12177
12178        /// Sets the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
12179        ///
12180        /// # Example
12181        /// ```ignore,no_run
12182        /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12183        /// use wkt::BoolValue;
12184        /// let x = SqlFailoverReplica::new().set_available(BoolValue::default()/* use setters */);
12185        /// ```
12186        pub fn set_available<T>(mut self, v: T) -> Self
12187        where
12188            T: std::convert::Into<wkt::BoolValue>,
12189        {
12190            self.available = std::option::Option::Some(v.into());
12191            self
12192        }
12193
12194        /// Sets or clears the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
12195        ///
12196        /// # Example
12197        /// ```ignore,no_run
12198        /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12199        /// use wkt::BoolValue;
12200        /// let x = SqlFailoverReplica::new().set_or_clear_available(Some(BoolValue::default()/* use setters */));
12201        /// let x = SqlFailoverReplica::new().set_or_clear_available(None::<BoolValue>);
12202        /// ```
12203        pub fn set_or_clear_available<T>(mut self, v: std::option::Option<T>) -> Self
12204        where
12205            T: std::convert::Into<wkt::BoolValue>,
12206        {
12207            self.available = v.map(|x| x.into());
12208            self
12209        }
12210    }
12211
12212    impl wkt::message::Message for SqlFailoverReplica {
12213        fn typename() -> &'static str {
12214            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica"
12215        }
12216    }
12217
12218    /// Any scheduled maintenance for this instance.
12219    #[derive(Clone, Default, PartialEq)]
12220    #[non_exhaustive]
12221    pub struct SqlScheduledMaintenance {
12222        /// The start time of any upcoming scheduled maintenance for this instance.
12223        pub start_time: std::option::Option<wkt::Timestamp>,
12224
12225        #[allow(missing_docs)]
12226        #[deprecated]
12227        pub can_defer: bool,
12228
12229        /// If the scheduled maintenance can be rescheduled.
12230        pub can_reschedule: bool,
12231
12232        /// Maintenance cannot be rescheduled to start beyond this deadline.
12233        pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
12234
12235        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12236    }
12237
12238    impl SqlScheduledMaintenance {
12239        /// Creates a new default instance.
12240        pub fn new() -> Self {
12241            std::default::Default::default()
12242        }
12243
12244        /// Sets the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
12245        ///
12246        /// # Example
12247        /// ```ignore,no_run
12248        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12249        /// use wkt::Timestamp;
12250        /// let x = SqlScheduledMaintenance::new().set_start_time(Timestamp::default()/* use setters */);
12251        /// ```
12252        pub fn set_start_time<T>(mut self, v: T) -> Self
12253        where
12254            T: std::convert::Into<wkt::Timestamp>,
12255        {
12256            self.start_time = std::option::Option::Some(v.into());
12257            self
12258        }
12259
12260        /// Sets or clears the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
12261        ///
12262        /// # Example
12263        /// ```ignore,no_run
12264        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12265        /// use wkt::Timestamp;
12266        /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
12267        /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(None::<Timestamp>);
12268        /// ```
12269        pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12270        where
12271            T: std::convert::Into<wkt::Timestamp>,
12272        {
12273            self.start_time = v.map(|x| x.into());
12274            self
12275        }
12276
12277        /// Sets the value of [can_defer][crate::model::database_instance::SqlScheduledMaintenance::can_defer].
12278        ///
12279        /// # Example
12280        /// ```ignore,no_run
12281        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12282        /// let x = SqlScheduledMaintenance::new().set_can_defer(true);
12283        /// ```
12284        #[deprecated]
12285        pub fn set_can_defer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12286            self.can_defer = v.into();
12287            self
12288        }
12289
12290        /// Sets the value of [can_reschedule][crate::model::database_instance::SqlScheduledMaintenance::can_reschedule].
12291        ///
12292        /// # Example
12293        /// ```ignore,no_run
12294        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12295        /// let x = SqlScheduledMaintenance::new().set_can_reschedule(true);
12296        /// ```
12297        pub fn set_can_reschedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12298            self.can_reschedule = v.into();
12299            self
12300        }
12301
12302        /// Sets the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
12303        ///
12304        /// # Example
12305        /// ```ignore,no_run
12306        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12307        /// use wkt::Timestamp;
12308        /// let x = SqlScheduledMaintenance::new().set_schedule_deadline_time(Timestamp::default()/* use setters */);
12309        /// ```
12310        pub fn set_schedule_deadline_time<T>(mut self, v: T) -> Self
12311        where
12312            T: std::convert::Into<wkt::Timestamp>,
12313        {
12314            self.schedule_deadline_time = std::option::Option::Some(v.into());
12315            self
12316        }
12317
12318        /// Sets or clears the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
12319        ///
12320        /// # Example
12321        /// ```ignore,no_run
12322        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12323        /// use wkt::Timestamp;
12324        /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(Some(Timestamp::default()/* use setters */));
12325        /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(None::<Timestamp>);
12326        /// ```
12327        pub fn set_or_clear_schedule_deadline_time<T>(mut self, v: std::option::Option<T>) -> Self
12328        where
12329            T: std::convert::Into<wkt::Timestamp>,
12330        {
12331            self.schedule_deadline_time = v.map(|x| x.into());
12332            self
12333        }
12334    }
12335
12336    impl wkt::message::Message for SqlScheduledMaintenance {
12337        fn typename() -> &'static str {
12338            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance"
12339        }
12340    }
12341
12342    /// This message wraps up the information written by out-of-disk detection job.
12343    #[derive(Clone, Default, PartialEq)]
12344    #[non_exhaustive]
12345    pub struct SqlOutOfDiskReport {
12346        /// This field represents the state generated by the proactive database
12347        /// wellness job for OutOfDisk issues.
12348        ///
12349        /// * Writers:
12350        /// * the proactive database wellness job for OOD.
12351        /// * Readers:
12352        /// * the proactive database wellness job
12353        pub sql_out_of_disk_state: std::option::Option<
12354            crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12355        >,
12356
12357        /// The minimum recommended increase size in GigaBytes
12358        /// This field is consumed by the frontend
12359        ///
12360        /// * Writers:
12361        /// * the proactive database wellness job for OOD.
12362        /// * Readers:
12363        pub sql_min_recommended_increase_size_gb: std::option::Option<i32>,
12364
12365        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12366    }
12367
12368    impl SqlOutOfDiskReport {
12369        /// Creates a new default instance.
12370        pub fn new() -> Self {
12371            std::default::Default::default()
12372        }
12373
12374        /// Sets the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
12375        ///
12376        /// # Example
12377        /// ```ignore,no_run
12378        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12379        /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
12380        /// let x0 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::Normal);
12381        /// let x1 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::SoftShutdown);
12382        /// ```
12383        pub fn set_sql_out_of_disk_state<T>(mut self, v: T) -> Self
12384        where
12385            T: std::convert::Into<
12386                    crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12387                >,
12388        {
12389            self.sql_out_of_disk_state = std::option::Option::Some(v.into());
12390            self
12391        }
12392
12393        /// Sets or clears the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
12394        ///
12395        /// # Example
12396        /// ```ignore,no_run
12397        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12398        /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
12399        /// let x0 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::Normal));
12400        /// let x1 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::SoftShutdown));
12401        /// let x_none = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(None::<SqlOutOfDiskState>);
12402        /// ```
12403        pub fn set_or_clear_sql_out_of_disk_state<T>(mut self, v: std::option::Option<T>) -> Self
12404        where
12405            T: std::convert::Into<
12406                    crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12407                >,
12408        {
12409            self.sql_out_of_disk_state = v.map(|x| x.into());
12410            self
12411        }
12412
12413        /// Sets the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
12414        ///
12415        /// # Example
12416        /// ```ignore,no_run
12417        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12418        /// let x = SqlOutOfDiskReport::new().set_sql_min_recommended_increase_size_gb(42);
12419        /// ```
12420        pub fn set_sql_min_recommended_increase_size_gb<T>(mut self, v: T) -> Self
12421        where
12422            T: std::convert::Into<i32>,
12423        {
12424            self.sql_min_recommended_increase_size_gb = std::option::Option::Some(v.into());
12425            self
12426        }
12427
12428        /// Sets or clears the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
12429        ///
12430        /// # Example
12431        /// ```ignore,no_run
12432        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12433        /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(Some(42));
12434        /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(None::<i32>);
12435        /// ```
12436        pub fn set_or_clear_sql_min_recommended_increase_size_gb<T>(
12437            mut self,
12438            v: std::option::Option<T>,
12439        ) -> Self
12440        where
12441            T: std::convert::Into<i32>,
12442        {
12443            self.sql_min_recommended_increase_size_gb = v.map(|x| x.into());
12444            self
12445        }
12446    }
12447
12448    impl wkt::message::Message for SqlOutOfDiskReport {
12449        fn typename() -> &'static str {
12450            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport"
12451        }
12452    }
12453
12454    /// Defines additional types related to [SqlOutOfDiskReport].
12455    pub mod sql_out_of_disk_report {
12456        #[allow(unused_imports)]
12457        use super::*;
12458
12459        /// This enum lists all possible states regarding out-of-disk issues.
12460        ///
12461        /// # Working with unknown values
12462        ///
12463        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12464        /// additional enum variants at any time. Adding new variants is not considered
12465        /// a breaking change. Applications should write their code in anticipation of:
12466        ///
12467        /// - New values appearing in future releases of the client library, **and**
12468        /// - New values received dynamically, without application changes.
12469        ///
12470        /// Please consult the [Working with enums] section in the user guide for some
12471        /// guidelines.
12472        ///
12473        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12474        #[derive(Clone, Debug, PartialEq)]
12475        #[non_exhaustive]
12476        pub enum SqlOutOfDiskState {
12477            /// Unspecified state
12478            Unspecified,
12479            /// The instance has plenty space on data disk
12480            Normal,
12481            /// Data disk is almost used up. It is shutdown to prevent data
12482            /// corruption.
12483            SoftShutdown,
12484            /// If set, the enum was initialized with an unknown value.
12485            ///
12486            /// Applications can examine the value using [SqlOutOfDiskState::value] or
12487            /// [SqlOutOfDiskState::name].
12488            UnknownValue(sql_out_of_disk_state::UnknownValue),
12489        }
12490
12491        #[doc(hidden)]
12492        pub mod sql_out_of_disk_state {
12493            #[allow(unused_imports)]
12494            use super::*;
12495            #[derive(Clone, Debug, PartialEq)]
12496            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12497        }
12498
12499        impl SqlOutOfDiskState {
12500            /// Gets the enum value.
12501            ///
12502            /// Returns `None` if the enum contains an unknown value deserialized from
12503            /// the string representation of enums.
12504            pub fn value(&self) -> std::option::Option<i32> {
12505                match self {
12506                    Self::Unspecified => std::option::Option::Some(0),
12507                    Self::Normal => std::option::Option::Some(1),
12508                    Self::SoftShutdown => std::option::Option::Some(2),
12509                    Self::UnknownValue(u) => u.0.value(),
12510                }
12511            }
12512
12513            /// Gets the enum value as a string.
12514            ///
12515            /// Returns `None` if the enum contains an unknown value deserialized from
12516            /// the integer representation of enums.
12517            pub fn name(&self) -> std::option::Option<&str> {
12518                match self {
12519                    Self::Unspecified => {
12520                        std::option::Option::Some("SQL_OUT_OF_DISK_STATE_UNSPECIFIED")
12521                    }
12522                    Self::Normal => std::option::Option::Some("NORMAL"),
12523                    Self::SoftShutdown => std::option::Option::Some("SOFT_SHUTDOWN"),
12524                    Self::UnknownValue(u) => u.0.name(),
12525                }
12526            }
12527        }
12528
12529        impl std::default::Default for SqlOutOfDiskState {
12530            fn default() -> Self {
12531                use std::convert::From;
12532                Self::from(0)
12533            }
12534        }
12535
12536        impl std::fmt::Display for SqlOutOfDiskState {
12537            fn fmt(
12538                &self,
12539                f: &mut std::fmt::Formatter<'_>,
12540            ) -> std::result::Result<(), std::fmt::Error> {
12541                wkt::internal::display_enum(f, self.name(), self.value())
12542            }
12543        }
12544
12545        impl std::convert::From<i32> for SqlOutOfDiskState {
12546            fn from(value: i32) -> Self {
12547                match value {
12548                    0 => Self::Unspecified,
12549                    1 => Self::Normal,
12550                    2 => Self::SoftShutdown,
12551                    _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
12552                        wkt::internal::UnknownEnumValue::Integer(value),
12553                    )),
12554                }
12555            }
12556        }
12557
12558        impl std::convert::From<&str> for SqlOutOfDiskState {
12559            fn from(value: &str) -> Self {
12560                use std::string::ToString;
12561                match value {
12562                    "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" => Self::Unspecified,
12563                    "NORMAL" => Self::Normal,
12564                    "SOFT_SHUTDOWN" => Self::SoftShutdown,
12565                    _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
12566                        wkt::internal::UnknownEnumValue::String(value.to_string()),
12567                    )),
12568                }
12569            }
12570        }
12571
12572        impl serde::ser::Serialize for SqlOutOfDiskState {
12573            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12574            where
12575                S: serde::Serializer,
12576            {
12577                match self {
12578                    Self::Unspecified => serializer.serialize_i32(0),
12579                    Self::Normal => serializer.serialize_i32(1),
12580                    Self::SoftShutdown => serializer.serialize_i32(2),
12581                    Self::UnknownValue(u) => u.0.serialize(serializer),
12582                }
12583            }
12584        }
12585
12586        impl<'de> serde::de::Deserialize<'de> for SqlOutOfDiskState {
12587            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12588            where
12589                D: serde::Deserializer<'de>,
12590            {
12591                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOutOfDiskState>::new(
12592                    ".google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState",
12593                ))
12594            }
12595        }
12596    }
12597
12598    /// Details of a single read pool node of a read pool.
12599    #[derive(Clone, Default, PartialEq)]
12600    #[non_exhaustive]
12601    pub struct PoolNodeConfig {
12602        /// Output only. The name of the read pool node, to be used for retrieving
12603        /// metrics and logs.
12604        pub name: std::option::Option<std::string::String>,
12605
12606        /// Output only. The zone of the read pool node.
12607        pub gce_zone: std::option::Option<std::string::String>,
12608
12609        /// Output only. Mappings containing IP addresses that can be used to connect
12610        /// to the read pool node.
12611        pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
12612
12613        /// Output only. The DNS name of the read pool node.
12614        pub dns_name: std::option::Option<std::string::String>,
12615
12616        /// Output only. The current state of the read pool node.
12617        pub state: std::option::Option<crate::model::database_instance::SqlInstanceState>,
12618
12619        /// Output only. The list of DNS names used by this read pool node.
12620        pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
12621
12622        /// Output only. The Private Service Connect (PSC) service attachment of the
12623        /// read pool node.
12624        pub psc_service_attachment_link: std::option::Option<std::string::String>,
12625
12626        /// Output only. The list of settings for requested automatically-setup
12627        /// Private Service Connect (PSC) consumer endpoints that can be used to
12628        /// connect to this read pool node.
12629        pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
12630
12631        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12632    }
12633
12634    impl PoolNodeConfig {
12635        /// Creates a new default instance.
12636        pub fn new() -> Self {
12637            std::default::Default::default()
12638        }
12639
12640        /// Sets the value of [name][crate::model::database_instance::PoolNodeConfig::name].
12641        ///
12642        /// # Example
12643        /// ```ignore,no_run
12644        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12645        /// let x = PoolNodeConfig::new().set_name("example");
12646        /// ```
12647        pub fn set_name<T>(mut self, v: T) -> Self
12648        where
12649            T: std::convert::Into<std::string::String>,
12650        {
12651            self.name = std::option::Option::Some(v.into());
12652            self
12653        }
12654
12655        /// Sets or clears the value of [name][crate::model::database_instance::PoolNodeConfig::name].
12656        ///
12657        /// # Example
12658        /// ```ignore,no_run
12659        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12660        /// let x = PoolNodeConfig::new().set_or_clear_name(Some("example"));
12661        /// let x = PoolNodeConfig::new().set_or_clear_name(None::<String>);
12662        /// ```
12663        pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
12664        where
12665            T: std::convert::Into<std::string::String>,
12666        {
12667            self.name = v.map(|x| x.into());
12668            self
12669        }
12670
12671        /// Sets the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
12672        ///
12673        /// # Example
12674        /// ```ignore,no_run
12675        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12676        /// let x = PoolNodeConfig::new().set_gce_zone("example");
12677        /// ```
12678        pub fn set_gce_zone<T>(mut self, v: T) -> Self
12679        where
12680            T: std::convert::Into<std::string::String>,
12681        {
12682            self.gce_zone = std::option::Option::Some(v.into());
12683            self
12684        }
12685
12686        /// Sets or clears the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
12687        ///
12688        /// # Example
12689        /// ```ignore,no_run
12690        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12691        /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(Some("example"));
12692        /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(None::<String>);
12693        /// ```
12694        pub fn set_or_clear_gce_zone<T>(mut self, v: std::option::Option<T>) -> Self
12695        where
12696            T: std::convert::Into<std::string::String>,
12697        {
12698            self.gce_zone = v.map(|x| x.into());
12699            self
12700        }
12701
12702        /// Sets the value of [ip_addresses][crate::model::database_instance::PoolNodeConfig::ip_addresses].
12703        ///
12704        /// # Example
12705        /// ```ignore,no_run
12706        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12707        /// use google_cloud_sql_v1::model::IpMapping;
12708        /// let x = PoolNodeConfig::new()
12709        ///     .set_ip_addresses([
12710        ///         IpMapping::default()/* use setters */,
12711        ///         IpMapping::default()/* use (different) setters */,
12712        ///     ]);
12713        /// ```
12714        pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
12715        where
12716            T: std::iter::IntoIterator<Item = V>,
12717            V: std::convert::Into<crate::model::IpMapping>,
12718        {
12719            use std::iter::Iterator;
12720            self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
12721            self
12722        }
12723
12724        /// Sets the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
12725        ///
12726        /// # Example
12727        /// ```ignore,no_run
12728        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12729        /// let x = PoolNodeConfig::new().set_dns_name("example");
12730        /// ```
12731        pub fn set_dns_name<T>(mut self, v: T) -> Self
12732        where
12733            T: std::convert::Into<std::string::String>,
12734        {
12735            self.dns_name = std::option::Option::Some(v.into());
12736            self
12737        }
12738
12739        /// Sets or clears the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
12740        ///
12741        /// # Example
12742        /// ```ignore,no_run
12743        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12744        /// let x = PoolNodeConfig::new().set_or_clear_dns_name(Some("example"));
12745        /// let x = PoolNodeConfig::new().set_or_clear_dns_name(None::<String>);
12746        /// ```
12747        pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
12748        where
12749            T: std::convert::Into<std::string::String>,
12750        {
12751            self.dns_name = v.map(|x| x.into());
12752            self
12753        }
12754
12755        /// Sets the value of [state][crate::model::database_instance::PoolNodeConfig::state].
12756        ///
12757        /// # Example
12758        /// ```ignore,no_run
12759        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12760        /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
12761        /// let x0 = PoolNodeConfig::new().set_state(SqlInstanceState::Runnable);
12762        /// let x1 = PoolNodeConfig::new().set_state(SqlInstanceState::Suspended);
12763        /// let x2 = PoolNodeConfig::new().set_state(SqlInstanceState::PendingDelete);
12764        /// ```
12765        pub fn set_state<T>(mut self, v: T) -> Self
12766        where
12767            T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
12768        {
12769            self.state = std::option::Option::Some(v.into());
12770            self
12771        }
12772
12773        /// Sets or clears the value of [state][crate::model::database_instance::PoolNodeConfig::state].
12774        ///
12775        /// # Example
12776        /// ```ignore,no_run
12777        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12778        /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
12779        /// let x0 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Runnable));
12780        /// let x1 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Suspended));
12781        /// let x2 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::PendingDelete));
12782        /// let x_none = PoolNodeConfig::new().set_or_clear_state(None::<SqlInstanceState>);
12783        /// ```
12784        pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
12785        where
12786            T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
12787        {
12788            self.state = v.map(|x| x.into());
12789            self
12790        }
12791
12792        /// Sets the value of [dns_names][crate::model::database_instance::PoolNodeConfig::dns_names].
12793        ///
12794        /// # Example
12795        /// ```ignore,no_run
12796        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12797        /// use google_cloud_sql_v1::model::DnsNameMapping;
12798        /// let x = PoolNodeConfig::new()
12799        ///     .set_dns_names([
12800        ///         DnsNameMapping::default()/* use setters */,
12801        ///         DnsNameMapping::default()/* use (different) setters */,
12802        ///     ]);
12803        /// ```
12804        pub fn set_dns_names<T, V>(mut self, v: T) -> Self
12805        where
12806            T: std::iter::IntoIterator<Item = V>,
12807            V: std::convert::Into<crate::model::DnsNameMapping>,
12808        {
12809            use std::iter::Iterator;
12810            self.dns_names = v.into_iter().map(|i| i.into()).collect();
12811            self
12812        }
12813
12814        /// Sets the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
12815        ///
12816        /// # Example
12817        /// ```ignore,no_run
12818        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12819        /// let x = PoolNodeConfig::new().set_psc_service_attachment_link("example");
12820        /// ```
12821        pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
12822        where
12823            T: std::convert::Into<std::string::String>,
12824        {
12825            self.psc_service_attachment_link = std::option::Option::Some(v.into());
12826            self
12827        }
12828
12829        /// Sets or clears the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
12830        ///
12831        /// # Example
12832        /// ```ignore,no_run
12833        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12834        /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(Some("example"));
12835        /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(None::<String>);
12836        /// ```
12837        pub fn set_or_clear_psc_service_attachment_link<T>(
12838            mut self,
12839            v: std::option::Option<T>,
12840        ) -> Self
12841        where
12842            T: std::convert::Into<std::string::String>,
12843        {
12844            self.psc_service_attachment_link = v.map(|x| x.into());
12845            self
12846        }
12847
12848        /// Sets the value of [psc_auto_connections][crate::model::database_instance::PoolNodeConfig::psc_auto_connections].
12849        ///
12850        /// # Example
12851        /// ```ignore,no_run
12852        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12853        /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
12854        /// let x = PoolNodeConfig::new()
12855        ///     .set_psc_auto_connections([
12856        ///         PscAutoConnectionConfig::default()/* use setters */,
12857        ///         PscAutoConnectionConfig::default()/* use (different) setters */,
12858        ///     ]);
12859        /// ```
12860        pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
12861        where
12862            T: std::iter::IntoIterator<Item = V>,
12863            V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
12864        {
12865            use std::iter::Iterator;
12866            self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
12867            self
12868        }
12869    }
12870
12871    impl wkt::message::Message for PoolNodeConfig {
12872        fn typename() -> &'static str {
12873            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig"
12874        }
12875    }
12876
12877    /// The current serving state of the database instance.
12878    ///
12879    /// # Working with unknown values
12880    ///
12881    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12882    /// additional enum variants at any time. Adding new variants is not considered
12883    /// a breaking change. Applications should write their code in anticipation of:
12884    ///
12885    /// - New values appearing in future releases of the client library, **and**
12886    /// - New values received dynamically, without application changes.
12887    ///
12888    /// Please consult the [Working with enums] section in the user guide for some
12889    /// guidelines.
12890    ///
12891    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12892    #[derive(Clone, Debug, PartialEq)]
12893    #[non_exhaustive]
12894    pub enum SqlInstanceState {
12895        /// The state of the instance is unknown.
12896        Unspecified,
12897        /// The instance is running, or has been stopped by owner.
12898        Runnable,
12899        /// The instance is not available, for example due to problems with billing.
12900        Suspended,
12901        /// The instance is being deleted.
12902        PendingDelete,
12903        /// The instance is being created.
12904        PendingCreate,
12905        /// The instance is down for maintenance.
12906        Maintenance,
12907        /// The creation of the instance failed or a fatal error occurred during
12908        /// maintenance.
12909        Failed,
12910        /// Deprecated
12911        #[deprecated]
12912        OnlineMaintenance,
12913        /// (Applicable to read pool nodes only.) The read pool node needs to be
12914        /// repaired. The database might be unavailable.
12915        Repairing,
12916        /// If set, the enum was initialized with an unknown value.
12917        ///
12918        /// Applications can examine the value using [SqlInstanceState::value] or
12919        /// [SqlInstanceState::name].
12920        UnknownValue(sql_instance_state::UnknownValue),
12921    }
12922
12923    #[doc(hidden)]
12924    pub mod sql_instance_state {
12925        #[allow(unused_imports)]
12926        use super::*;
12927        #[derive(Clone, Debug, PartialEq)]
12928        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12929    }
12930
12931    impl SqlInstanceState {
12932        /// Gets the enum value.
12933        ///
12934        /// Returns `None` if the enum contains an unknown value deserialized from
12935        /// the string representation of enums.
12936        pub fn value(&self) -> std::option::Option<i32> {
12937            match self {
12938                Self::Unspecified => std::option::Option::Some(0),
12939                Self::Runnable => std::option::Option::Some(1),
12940                Self::Suspended => std::option::Option::Some(2),
12941                Self::PendingDelete => std::option::Option::Some(3),
12942                Self::PendingCreate => std::option::Option::Some(4),
12943                Self::Maintenance => std::option::Option::Some(5),
12944                Self::Failed => std::option::Option::Some(6),
12945                Self::OnlineMaintenance => std::option::Option::Some(7),
12946                Self::Repairing => std::option::Option::Some(8),
12947                Self::UnknownValue(u) => u.0.value(),
12948            }
12949        }
12950
12951        /// Gets the enum value as a string.
12952        ///
12953        /// Returns `None` if the enum contains an unknown value deserialized from
12954        /// the integer representation of enums.
12955        pub fn name(&self) -> std::option::Option<&str> {
12956            match self {
12957                Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_STATE_UNSPECIFIED"),
12958                Self::Runnable => std::option::Option::Some("RUNNABLE"),
12959                Self::Suspended => std::option::Option::Some("SUSPENDED"),
12960                Self::PendingDelete => std::option::Option::Some("PENDING_DELETE"),
12961                Self::PendingCreate => std::option::Option::Some("PENDING_CREATE"),
12962                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
12963                Self::Failed => std::option::Option::Some("FAILED"),
12964                Self::OnlineMaintenance => std::option::Option::Some("ONLINE_MAINTENANCE"),
12965                Self::Repairing => std::option::Option::Some("REPAIRING"),
12966                Self::UnknownValue(u) => u.0.name(),
12967            }
12968        }
12969    }
12970
12971    impl std::default::Default for SqlInstanceState {
12972        fn default() -> Self {
12973            use std::convert::From;
12974            Self::from(0)
12975        }
12976    }
12977
12978    impl std::fmt::Display for SqlInstanceState {
12979        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12980            wkt::internal::display_enum(f, self.name(), self.value())
12981        }
12982    }
12983
12984    impl std::convert::From<i32> for SqlInstanceState {
12985        fn from(value: i32) -> Self {
12986            match value {
12987                0 => Self::Unspecified,
12988                1 => Self::Runnable,
12989                2 => Self::Suspended,
12990                3 => Self::PendingDelete,
12991                4 => Self::PendingCreate,
12992                5 => Self::Maintenance,
12993                6 => Self::Failed,
12994                7 => Self::OnlineMaintenance,
12995                8 => Self::Repairing,
12996                _ => Self::UnknownValue(sql_instance_state::UnknownValue(
12997                    wkt::internal::UnknownEnumValue::Integer(value),
12998                )),
12999            }
13000        }
13001    }
13002
13003    impl std::convert::From<&str> for SqlInstanceState {
13004        fn from(value: &str) -> Self {
13005            use std::string::ToString;
13006            match value {
13007                "SQL_INSTANCE_STATE_UNSPECIFIED" => Self::Unspecified,
13008                "RUNNABLE" => Self::Runnable,
13009                "SUSPENDED" => Self::Suspended,
13010                "PENDING_DELETE" => Self::PendingDelete,
13011                "PENDING_CREATE" => Self::PendingCreate,
13012                "MAINTENANCE" => Self::Maintenance,
13013                "FAILED" => Self::Failed,
13014                "ONLINE_MAINTENANCE" => Self::OnlineMaintenance,
13015                "REPAIRING" => Self::Repairing,
13016                _ => Self::UnknownValue(sql_instance_state::UnknownValue(
13017                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13018                )),
13019            }
13020        }
13021    }
13022
13023    impl serde::ser::Serialize for SqlInstanceState {
13024        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13025        where
13026            S: serde::Serializer,
13027        {
13028            match self {
13029                Self::Unspecified => serializer.serialize_i32(0),
13030                Self::Runnable => serializer.serialize_i32(1),
13031                Self::Suspended => serializer.serialize_i32(2),
13032                Self::PendingDelete => serializer.serialize_i32(3),
13033                Self::PendingCreate => serializer.serialize_i32(4),
13034                Self::Maintenance => serializer.serialize_i32(5),
13035                Self::Failed => serializer.serialize_i32(6),
13036                Self::OnlineMaintenance => serializer.serialize_i32(7),
13037                Self::Repairing => serializer.serialize_i32(8),
13038                Self::UnknownValue(u) => u.0.serialize(serializer),
13039            }
13040        }
13041    }
13042
13043    impl<'de> serde::de::Deserialize<'de> for SqlInstanceState {
13044        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13045        where
13046            D: serde::Deserializer<'de>,
13047        {
13048            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceState>::new(
13049                ".google.cloud.sql.v1.DatabaseInstance.SqlInstanceState",
13050            ))
13051        }
13052    }
13053
13054    /// The SQL network architecture for the instance.
13055    ///
13056    /// # Working with unknown values
13057    ///
13058    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13059    /// additional enum variants at any time. Adding new variants is not considered
13060    /// a breaking change. Applications should write their code in anticipation of:
13061    ///
13062    /// - New values appearing in future releases of the client library, **and**
13063    /// - New values received dynamically, without application changes.
13064    ///
13065    /// Please consult the [Working with enums] section in the user guide for some
13066    /// guidelines.
13067    ///
13068    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13069    #[derive(Clone, Debug, PartialEq)]
13070    #[non_exhaustive]
13071    pub enum SqlNetworkArchitecture {
13072        #[allow(missing_docs)]
13073        Unspecified,
13074        /// The instance uses the new network architecture.
13075        NewNetworkArchitecture,
13076        /// The instance uses the old network architecture.
13077        OldNetworkArchitecture,
13078        /// If set, the enum was initialized with an unknown value.
13079        ///
13080        /// Applications can examine the value using [SqlNetworkArchitecture::value] or
13081        /// [SqlNetworkArchitecture::name].
13082        UnknownValue(sql_network_architecture::UnknownValue),
13083    }
13084
13085    #[doc(hidden)]
13086    pub mod sql_network_architecture {
13087        #[allow(unused_imports)]
13088        use super::*;
13089        #[derive(Clone, Debug, PartialEq)]
13090        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13091    }
13092
13093    impl SqlNetworkArchitecture {
13094        /// Gets the enum value.
13095        ///
13096        /// Returns `None` if the enum contains an unknown value deserialized from
13097        /// the string representation of enums.
13098        pub fn value(&self) -> std::option::Option<i32> {
13099            match self {
13100                Self::Unspecified => std::option::Option::Some(0),
13101                Self::NewNetworkArchitecture => std::option::Option::Some(1),
13102                Self::OldNetworkArchitecture => std::option::Option::Some(2),
13103                Self::UnknownValue(u) => u.0.value(),
13104            }
13105        }
13106
13107        /// Gets the enum value as a string.
13108        ///
13109        /// Returns `None` if the enum contains an unknown value deserialized from
13110        /// the integer representation of enums.
13111        pub fn name(&self) -> std::option::Option<&str> {
13112            match self {
13113                Self::Unspecified => {
13114                    std::option::Option::Some("SQL_NETWORK_ARCHITECTURE_UNSPECIFIED")
13115                }
13116                Self::NewNetworkArchitecture => {
13117                    std::option::Option::Some("NEW_NETWORK_ARCHITECTURE")
13118                }
13119                Self::OldNetworkArchitecture => {
13120                    std::option::Option::Some("OLD_NETWORK_ARCHITECTURE")
13121                }
13122                Self::UnknownValue(u) => u.0.name(),
13123            }
13124        }
13125    }
13126
13127    impl std::default::Default for SqlNetworkArchitecture {
13128        fn default() -> Self {
13129            use std::convert::From;
13130            Self::from(0)
13131        }
13132    }
13133
13134    impl std::fmt::Display for SqlNetworkArchitecture {
13135        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13136            wkt::internal::display_enum(f, self.name(), self.value())
13137        }
13138    }
13139
13140    impl std::convert::From<i32> for SqlNetworkArchitecture {
13141        fn from(value: i32) -> Self {
13142            match value {
13143                0 => Self::Unspecified,
13144                1 => Self::NewNetworkArchitecture,
13145                2 => Self::OldNetworkArchitecture,
13146                _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
13147                    wkt::internal::UnknownEnumValue::Integer(value),
13148                )),
13149            }
13150        }
13151    }
13152
13153    impl std::convert::From<&str> for SqlNetworkArchitecture {
13154        fn from(value: &str) -> Self {
13155            use std::string::ToString;
13156            match value {
13157                "SQL_NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
13158                "NEW_NETWORK_ARCHITECTURE" => Self::NewNetworkArchitecture,
13159                "OLD_NETWORK_ARCHITECTURE" => Self::OldNetworkArchitecture,
13160                _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
13161                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13162                )),
13163            }
13164        }
13165    }
13166
13167    impl serde::ser::Serialize for SqlNetworkArchitecture {
13168        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13169        where
13170            S: serde::Serializer,
13171        {
13172            match self {
13173                Self::Unspecified => serializer.serialize_i32(0),
13174                Self::NewNetworkArchitecture => serializer.serialize_i32(1),
13175                Self::OldNetworkArchitecture => serializer.serialize_i32(2),
13176                Self::UnknownValue(u) => u.0.serialize(serializer),
13177            }
13178        }
13179    }
13180
13181    impl<'de> serde::de::Deserialize<'de> for SqlNetworkArchitecture {
13182        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13183        where
13184            D: serde::Deserializer<'de>,
13185        {
13186            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlNetworkArchitecture>::new(
13187                ".google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture",
13188            ))
13189        }
13190    }
13191}
13192
13193/// Gemini instance configuration.
13194#[derive(Clone, Default, PartialEq)]
13195#[non_exhaustive]
13196pub struct GeminiInstanceConfig {
13197    /// Output only. Whether Gemini is enabled.
13198    pub entitled: std::option::Option<bool>,
13199
13200    /// Output only. Whether the vacuum management is enabled.
13201    pub google_vacuum_mgmt_enabled: std::option::Option<bool>,
13202
13203    /// Output only. Whether canceling the out-of-memory (OOM) session is enabled.
13204    pub oom_session_cancel_enabled: std::option::Option<bool>,
13205
13206    /// Output only. Whether the active query is enabled.
13207    pub active_query_enabled: std::option::Option<bool>,
13208
13209    /// Output only. Whether the index advisor is enabled.
13210    pub index_advisor_enabled: std::option::Option<bool>,
13211
13212    /// Output only. Whether the flag recommender is enabled.
13213    pub flag_recommender_enabled: std::option::Option<bool>,
13214
13215    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13216}
13217
13218impl GeminiInstanceConfig {
13219    /// Creates a new default instance.
13220    pub fn new() -> Self {
13221        std::default::Default::default()
13222    }
13223
13224    /// Sets the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
13225    ///
13226    /// # Example
13227    /// ```ignore,no_run
13228    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13229    /// let x = GeminiInstanceConfig::new().set_entitled(true);
13230    /// ```
13231    pub fn set_entitled<T>(mut self, v: T) -> Self
13232    where
13233        T: std::convert::Into<bool>,
13234    {
13235        self.entitled = std::option::Option::Some(v.into());
13236        self
13237    }
13238
13239    /// Sets or clears the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
13240    ///
13241    /// # Example
13242    /// ```ignore,no_run
13243    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13244    /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(Some(false));
13245    /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(None::<bool>);
13246    /// ```
13247    pub fn set_or_clear_entitled<T>(mut self, v: std::option::Option<T>) -> Self
13248    where
13249        T: std::convert::Into<bool>,
13250    {
13251        self.entitled = v.map(|x| x.into());
13252        self
13253    }
13254
13255    /// Sets the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
13256    ///
13257    /// # Example
13258    /// ```ignore,no_run
13259    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13260    /// let x = GeminiInstanceConfig::new().set_google_vacuum_mgmt_enabled(true);
13261    /// ```
13262    pub fn set_google_vacuum_mgmt_enabled<T>(mut self, v: T) -> Self
13263    where
13264        T: std::convert::Into<bool>,
13265    {
13266        self.google_vacuum_mgmt_enabled = std::option::Option::Some(v.into());
13267        self
13268    }
13269
13270    /// Sets or clears the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
13271    ///
13272    /// # Example
13273    /// ```ignore,no_run
13274    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13275    /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(Some(false));
13276    /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(None::<bool>);
13277    /// ```
13278    pub fn set_or_clear_google_vacuum_mgmt_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13279    where
13280        T: std::convert::Into<bool>,
13281    {
13282        self.google_vacuum_mgmt_enabled = v.map(|x| x.into());
13283        self
13284    }
13285
13286    /// Sets the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
13287    ///
13288    /// # Example
13289    /// ```ignore,no_run
13290    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13291    /// let x = GeminiInstanceConfig::new().set_oom_session_cancel_enabled(true);
13292    /// ```
13293    pub fn set_oom_session_cancel_enabled<T>(mut self, v: T) -> Self
13294    where
13295        T: std::convert::Into<bool>,
13296    {
13297        self.oom_session_cancel_enabled = std::option::Option::Some(v.into());
13298        self
13299    }
13300
13301    /// Sets or clears the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
13302    ///
13303    /// # Example
13304    /// ```ignore,no_run
13305    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13306    /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(Some(false));
13307    /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(None::<bool>);
13308    /// ```
13309    pub fn set_or_clear_oom_session_cancel_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13310    where
13311        T: std::convert::Into<bool>,
13312    {
13313        self.oom_session_cancel_enabled = v.map(|x| x.into());
13314        self
13315    }
13316
13317    /// Sets the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
13318    ///
13319    /// # Example
13320    /// ```ignore,no_run
13321    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13322    /// let x = GeminiInstanceConfig::new().set_active_query_enabled(true);
13323    /// ```
13324    pub fn set_active_query_enabled<T>(mut self, v: T) -> Self
13325    where
13326        T: std::convert::Into<bool>,
13327    {
13328        self.active_query_enabled = std::option::Option::Some(v.into());
13329        self
13330    }
13331
13332    /// Sets or clears the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
13333    ///
13334    /// # Example
13335    /// ```ignore,no_run
13336    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13337    /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(Some(false));
13338    /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(None::<bool>);
13339    /// ```
13340    pub fn set_or_clear_active_query_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13341    where
13342        T: std::convert::Into<bool>,
13343    {
13344        self.active_query_enabled = v.map(|x| x.into());
13345        self
13346    }
13347
13348    /// Sets the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
13349    ///
13350    /// # Example
13351    /// ```ignore,no_run
13352    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13353    /// let x = GeminiInstanceConfig::new().set_index_advisor_enabled(true);
13354    /// ```
13355    pub fn set_index_advisor_enabled<T>(mut self, v: T) -> Self
13356    where
13357        T: std::convert::Into<bool>,
13358    {
13359        self.index_advisor_enabled = std::option::Option::Some(v.into());
13360        self
13361    }
13362
13363    /// Sets or clears the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
13364    ///
13365    /// # Example
13366    /// ```ignore,no_run
13367    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13368    /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(Some(false));
13369    /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(None::<bool>);
13370    /// ```
13371    pub fn set_or_clear_index_advisor_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13372    where
13373        T: std::convert::Into<bool>,
13374    {
13375        self.index_advisor_enabled = v.map(|x| x.into());
13376        self
13377    }
13378
13379    /// Sets the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
13380    ///
13381    /// # Example
13382    /// ```ignore,no_run
13383    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13384    /// let x = GeminiInstanceConfig::new().set_flag_recommender_enabled(true);
13385    /// ```
13386    pub fn set_flag_recommender_enabled<T>(mut self, v: T) -> Self
13387    where
13388        T: std::convert::Into<bool>,
13389    {
13390        self.flag_recommender_enabled = std::option::Option::Some(v.into());
13391        self
13392    }
13393
13394    /// Sets or clears the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
13395    ///
13396    /// # Example
13397    /// ```ignore,no_run
13398    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13399    /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(Some(false));
13400    /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(None::<bool>);
13401    /// ```
13402    pub fn set_or_clear_flag_recommender_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13403    where
13404        T: std::convert::Into<bool>,
13405    {
13406        self.flag_recommender_enabled = v.map(|x| x.into());
13407        self
13408    }
13409}
13410
13411impl wkt::message::Message for GeminiInstanceConfig {
13412    fn typename() -> &'static str {
13413        "type.googleapis.com/google.cloud.sql.v1.GeminiInstanceConfig"
13414    }
13415}
13416
13417/// A primary instance and disaster recovery (DR) replica pair.
13418/// A DR replica is a cross-region replica that you designate for failover in
13419/// the event that the primary instance experiences regional failure.
13420/// Applicable to MySQL and PostgreSQL.
13421#[derive(Clone, Default, PartialEq)]
13422#[non_exhaustive]
13423pub struct ReplicationCluster {
13424    /// Output only. If set, this field indicates this instance has a private
13425    /// service access (PSA) DNS endpoint that is pointing to the primary instance
13426    /// of the cluster. If this instance is the primary, then the DNS endpoint
13427    /// points to this instance. After a switchover or replica failover operation,
13428    /// this DNS endpoint points to the promoted instance. This is a read-only
13429    /// field, returned to the user as information. This field can exist even if a
13430    /// standalone instance doesn't have a DR replica yet or the DR replica is
13431    /// deleted.
13432    pub psa_write_endpoint: std::string::String,
13433
13434    /// Optional. If the instance is a primary instance, then this field identifies
13435    /// the disaster recovery (DR) replica. A DR replica is an optional
13436    /// configuration for Enterprise Plus edition instances. If the instance is a
13437    /// read replica, then the field is not set. Set this field to a replica name
13438    /// to designate a DR replica for a primary instance. Remove the replica name
13439    /// to remove the DR replica designation.
13440    pub failover_dr_replica_name: std::string::String,
13441
13442    /// Output only. Read-only field that indicates whether the replica is a DR
13443    /// replica. This field is not set if the instance is a primary instance.
13444    pub dr_replica: bool,
13445
13446    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13447}
13448
13449impl ReplicationCluster {
13450    /// Creates a new default instance.
13451    pub fn new() -> Self {
13452        std::default::Default::default()
13453    }
13454
13455    /// Sets the value of [psa_write_endpoint][crate::model::ReplicationCluster::psa_write_endpoint].
13456    ///
13457    /// # Example
13458    /// ```ignore,no_run
13459    /// # use google_cloud_sql_v1::model::ReplicationCluster;
13460    /// let x = ReplicationCluster::new().set_psa_write_endpoint("example");
13461    /// ```
13462    pub fn set_psa_write_endpoint<T: std::convert::Into<std::string::String>>(
13463        mut self,
13464        v: T,
13465    ) -> Self {
13466        self.psa_write_endpoint = v.into();
13467        self
13468    }
13469
13470    /// Sets the value of [failover_dr_replica_name][crate::model::ReplicationCluster::failover_dr_replica_name].
13471    ///
13472    /// # Example
13473    /// ```ignore,no_run
13474    /// # use google_cloud_sql_v1::model::ReplicationCluster;
13475    /// let x = ReplicationCluster::new().set_failover_dr_replica_name("example");
13476    /// ```
13477    pub fn set_failover_dr_replica_name<T: std::convert::Into<std::string::String>>(
13478        mut self,
13479        v: T,
13480    ) -> Self {
13481        self.failover_dr_replica_name = v.into();
13482        self
13483    }
13484
13485    /// Sets the value of [dr_replica][crate::model::ReplicationCluster::dr_replica].
13486    ///
13487    /// # Example
13488    /// ```ignore,no_run
13489    /// # use google_cloud_sql_v1::model::ReplicationCluster;
13490    /// let x = ReplicationCluster::new().set_dr_replica(true);
13491    /// ```
13492    pub fn set_dr_replica<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13493        self.dr_replica = v.into();
13494        self
13495    }
13496}
13497
13498impl wkt::message::Message for ReplicationCluster {
13499    fn typename() -> &'static str {
13500        "type.googleapis.com/google.cloud.sql.v1.ReplicationCluster"
13501    }
13502}
13503
13504/// An available database version. It can be a major or a minor version.
13505#[derive(Clone, Default, PartialEq)]
13506#[non_exhaustive]
13507pub struct AvailableDatabaseVersion {
13508    /// The version's major version name.
13509    pub major_version: std::option::Option<std::string::String>,
13510
13511    /// The database version name. For MySQL 8.0, this string provides the database
13512    /// major and minor version.
13513    pub name: std::option::Option<std::string::String>,
13514
13515    /// The database version's display name.
13516    pub display_name: std::option::Option<std::string::String>,
13517
13518    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13519}
13520
13521impl AvailableDatabaseVersion {
13522    /// Creates a new default instance.
13523    pub fn new() -> Self {
13524        std::default::Default::default()
13525    }
13526
13527    /// Sets the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
13528    ///
13529    /// # Example
13530    /// ```ignore,no_run
13531    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13532    /// let x = AvailableDatabaseVersion::new().set_major_version("example");
13533    /// ```
13534    pub fn set_major_version<T>(mut self, v: T) -> Self
13535    where
13536        T: std::convert::Into<std::string::String>,
13537    {
13538        self.major_version = std::option::Option::Some(v.into());
13539        self
13540    }
13541
13542    /// Sets or clears the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
13543    ///
13544    /// # Example
13545    /// ```ignore,no_run
13546    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13547    /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(Some("example"));
13548    /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(None::<String>);
13549    /// ```
13550    pub fn set_or_clear_major_version<T>(mut self, v: std::option::Option<T>) -> Self
13551    where
13552        T: std::convert::Into<std::string::String>,
13553    {
13554        self.major_version = v.map(|x| x.into());
13555        self
13556    }
13557
13558    /// Sets the value of [name][crate::model::AvailableDatabaseVersion::name].
13559    ///
13560    /// # Example
13561    /// ```ignore,no_run
13562    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13563    /// let x = AvailableDatabaseVersion::new().set_name("example");
13564    /// ```
13565    pub fn set_name<T>(mut self, v: T) -> Self
13566    where
13567        T: std::convert::Into<std::string::String>,
13568    {
13569        self.name = std::option::Option::Some(v.into());
13570        self
13571    }
13572
13573    /// Sets or clears the value of [name][crate::model::AvailableDatabaseVersion::name].
13574    ///
13575    /// # Example
13576    /// ```ignore,no_run
13577    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13578    /// let x = AvailableDatabaseVersion::new().set_or_clear_name(Some("example"));
13579    /// let x = AvailableDatabaseVersion::new().set_or_clear_name(None::<String>);
13580    /// ```
13581    pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
13582    where
13583        T: std::convert::Into<std::string::String>,
13584    {
13585        self.name = v.map(|x| x.into());
13586        self
13587    }
13588
13589    /// Sets the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
13590    ///
13591    /// # Example
13592    /// ```ignore,no_run
13593    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13594    /// let x = AvailableDatabaseVersion::new().set_display_name("example");
13595    /// ```
13596    pub fn set_display_name<T>(mut self, v: T) -> Self
13597    where
13598        T: std::convert::Into<std::string::String>,
13599    {
13600        self.display_name = std::option::Option::Some(v.into());
13601        self
13602    }
13603
13604    /// Sets or clears the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
13605    ///
13606    /// # Example
13607    /// ```ignore,no_run
13608    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13609    /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(Some("example"));
13610    /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(None::<String>);
13611    /// ```
13612    pub fn set_or_clear_display_name<T>(mut self, v: std::option::Option<T>) -> Self
13613    where
13614        T: std::convert::Into<std::string::String>,
13615    {
13616        self.display_name = v.map(|x| x.into());
13617        self
13618    }
13619}
13620
13621impl wkt::message::Message for AvailableDatabaseVersion {
13622    fn typename() -> &'static str {
13623        "type.googleapis.com/google.cloud.sql.v1.AvailableDatabaseVersion"
13624    }
13625}
13626
13627/// Reschedule options for maintenance windows.
13628#[derive(Clone, Default, PartialEq)]
13629#[non_exhaustive]
13630pub struct SqlInstancesRescheduleMaintenanceRequestBody {
13631    /// Required. The type of the reschedule the user wants.
13632    pub reschedule: std::option::Option<
13633        crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13634    >,
13635
13636    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13637}
13638
13639impl SqlInstancesRescheduleMaintenanceRequestBody {
13640    /// Creates a new default instance.
13641    pub fn new() -> Self {
13642        std::default::Default::default()
13643    }
13644
13645    /// Sets the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
13646    ///
13647    /// # Example
13648    /// ```ignore,no_run
13649    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
13650    /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13651    /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_reschedule(Reschedule::default()/* use setters */);
13652    /// ```
13653    pub fn set_reschedule<T>(mut self, v: T) -> Self
13654    where
13655        T: std::convert::Into<
13656                crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13657            >,
13658    {
13659        self.reschedule = std::option::Option::Some(v.into());
13660        self
13661    }
13662
13663    /// Sets or clears the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
13664    ///
13665    /// # Example
13666    /// ```ignore,no_run
13667    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
13668    /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13669    /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(Some(Reschedule::default()/* use setters */));
13670    /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(None::<Reschedule>);
13671    /// ```
13672    pub fn set_or_clear_reschedule<T>(mut self, v: std::option::Option<T>) -> Self
13673    where
13674        T: std::convert::Into<
13675                crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13676            >,
13677    {
13678        self.reschedule = v.map(|x| x.into());
13679        self
13680    }
13681}
13682
13683impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequestBody {
13684    fn typename() -> &'static str {
13685        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody"
13686    }
13687}
13688
13689/// Defines additional types related to [SqlInstancesRescheduleMaintenanceRequestBody].
13690pub mod sql_instances_reschedule_maintenance_request_body {
13691    #[allow(unused_imports)]
13692    use super::*;
13693
13694    #[allow(missing_docs)]
13695    #[derive(Clone, Default, PartialEq)]
13696    #[non_exhaustive]
13697    pub struct Reschedule {
13698        /// Required. The type of the reschedule.
13699        pub reschedule_type:
13700            crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
13701
13702        /// Optional. Timestamp when the maintenance shall be rescheduled to if
13703        /// reschedule_type=SPECIFIC_TIME, in
13704        /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
13705        /// `2012-11-15T16:19:00.094Z`.
13706        pub schedule_time: std::option::Option<wkt::Timestamp>,
13707
13708        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13709    }
13710
13711    impl Reschedule {
13712        /// Creates a new default instance.
13713        pub fn new() -> Self {
13714            std::default::Default::default()
13715        }
13716
13717        /// Sets the value of [reschedule_type][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::reschedule_type].
13718        ///
13719        /// # Example
13720        /// ```ignore,no_run
13721        /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13722        /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::RescheduleType;
13723        /// let x0 = Reschedule::new().set_reschedule_type(RescheduleType::Immediate);
13724        /// let x1 = Reschedule::new().set_reschedule_type(RescheduleType::NextAvailableWindow);
13725        /// let x2 = Reschedule::new().set_reschedule_type(RescheduleType::SpecificTime);
13726        /// ```
13727        pub fn set_reschedule_type<
13728            T: std::convert::Into<
13729                    crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
13730                >,
13731        >(
13732            mut self,
13733            v: T,
13734        ) -> Self {
13735            self.reschedule_type = v.into();
13736            self
13737        }
13738
13739        /// Sets the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
13740        ///
13741        /// # Example
13742        /// ```ignore,no_run
13743        /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13744        /// use wkt::Timestamp;
13745        /// let x = Reschedule::new().set_schedule_time(Timestamp::default()/* use setters */);
13746        /// ```
13747        pub fn set_schedule_time<T>(mut self, v: T) -> Self
13748        where
13749            T: std::convert::Into<wkt::Timestamp>,
13750        {
13751            self.schedule_time = std::option::Option::Some(v.into());
13752            self
13753        }
13754
13755        /// Sets or clears the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
13756        ///
13757        /// # Example
13758        /// ```ignore,no_run
13759        /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13760        /// use wkt::Timestamp;
13761        /// let x = Reschedule::new().set_or_clear_schedule_time(Some(Timestamp::default()/* use setters */));
13762        /// let x = Reschedule::new().set_or_clear_schedule_time(None::<Timestamp>);
13763        /// ```
13764        pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
13765        where
13766            T: std::convert::Into<wkt::Timestamp>,
13767        {
13768            self.schedule_time = v.map(|x| x.into());
13769            self
13770        }
13771    }
13772
13773    impl wkt::message::Message for Reschedule {
13774        fn typename() -> &'static str {
13775            "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule"
13776        }
13777    }
13778
13779    /// Enum for [RescheduleType].
13780    ///
13781    /// # Working with unknown values
13782    ///
13783    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13784    /// additional enum variants at any time. Adding new variants is not considered
13785    /// a breaking change. Applications should write their code in anticipation of:
13786    ///
13787    /// - New values appearing in future releases of the client library, **and**
13788    /// - New values received dynamically, without application changes.
13789    ///
13790    /// Please consult the [Working with enums] section in the user guide for some
13791    /// guidelines.
13792    ///
13793    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13794    #[derive(Clone, Debug, PartialEq)]
13795    #[non_exhaustive]
13796    pub enum RescheduleType {
13797        #[allow(missing_docs)]
13798        Unspecified,
13799        /// Reschedules maintenance to happen now (within 5 minutes).
13800        Immediate,
13801        /// Reschedules maintenance to occur within one week from the originally
13802        /// scheduled day and time.
13803        NextAvailableWindow,
13804        /// Reschedules maintenance to a specific time and day.
13805        SpecificTime,
13806        /// If set, the enum was initialized with an unknown value.
13807        ///
13808        /// Applications can examine the value using [RescheduleType::value] or
13809        /// [RescheduleType::name].
13810        UnknownValue(reschedule_type::UnknownValue),
13811    }
13812
13813    #[doc(hidden)]
13814    pub mod reschedule_type {
13815        #[allow(unused_imports)]
13816        use super::*;
13817        #[derive(Clone, Debug, PartialEq)]
13818        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13819    }
13820
13821    impl RescheduleType {
13822        /// Gets the enum value.
13823        ///
13824        /// Returns `None` if the enum contains an unknown value deserialized from
13825        /// the string representation of enums.
13826        pub fn value(&self) -> std::option::Option<i32> {
13827            match self {
13828                Self::Unspecified => std::option::Option::Some(0),
13829                Self::Immediate => std::option::Option::Some(1),
13830                Self::NextAvailableWindow => std::option::Option::Some(2),
13831                Self::SpecificTime => std::option::Option::Some(3),
13832                Self::UnknownValue(u) => u.0.value(),
13833            }
13834        }
13835
13836        /// Gets the enum value as a string.
13837        ///
13838        /// Returns `None` if the enum contains an unknown value deserialized from
13839        /// the integer representation of enums.
13840        pub fn name(&self) -> std::option::Option<&str> {
13841            match self {
13842                Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
13843                Self::Immediate => std::option::Option::Some("IMMEDIATE"),
13844                Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
13845                Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
13846                Self::UnknownValue(u) => u.0.name(),
13847            }
13848        }
13849    }
13850
13851    impl std::default::Default for RescheduleType {
13852        fn default() -> Self {
13853            use std::convert::From;
13854            Self::from(0)
13855        }
13856    }
13857
13858    impl std::fmt::Display for RescheduleType {
13859        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13860            wkt::internal::display_enum(f, self.name(), self.value())
13861        }
13862    }
13863
13864    impl std::convert::From<i32> for RescheduleType {
13865        fn from(value: i32) -> Self {
13866            match value {
13867                0 => Self::Unspecified,
13868                1 => Self::Immediate,
13869                2 => Self::NextAvailableWindow,
13870                3 => Self::SpecificTime,
13871                _ => Self::UnknownValue(reschedule_type::UnknownValue(
13872                    wkt::internal::UnknownEnumValue::Integer(value),
13873                )),
13874            }
13875        }
13876    }
13877
13878    impl std::convert::From<&str> for RescheduleType {
13879        fn from(value: &str) -> Self {
13880            use std::string::ToString;
13881            match value {
13882                "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
13883                "IMMEDIATE" => Self::Immediate,
13884                "NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
13885                "SPECIFIC_TIME" => Self::SpecificTime,
13886                _ => Self::UnknownValue(reschedule_type::UnknownValue(
13887                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13888                )),
13889            }
13890        }
13891    }
13892
13893    impl serde::ser::Serialize for RescheduleType {
13894        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13895        where
13896            S: serde::Serializer,
13897        {
13898            match self {
13899                Self::Unspecified => serializer.serialize_i32(0),
13900                Self::Immediate => serializer.serialize_i32(1),
13901                Self::NextAvailableWindow => serializer.serialize_i32(2),
13902                Self::SpecificTime => serializer.serialize_i32(3),
13903                Self::UnknownValue(u) => u.0.serialize(serializer),
13904            }
13905        }
13906    }
13907
13908    impl<'de> serde::de::Deserialize<'de> for RescheduleType {
13909        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13910        where
13911            D: serde::Deserializer<'de>,
13912        {
13913            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
13914                ".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType",
13915            ))
13916        }
13917    }
13918}
13919
13920/// Database instance demote primary instance context.
13921#[derive(Clone, Default, PartialEq)]
13922#[non_exhaustive]
13923pub struct DemoteMasterContext {
13924    /// This is always `sql#demoteMasterContext`.
13925    pub kind: std::string::String,
13926
13927    /// Verify the GTID consistency for demote operation. Default value:
13928    /// `True`. Setting this flag to `false` enables you to bypass the GTID
13929    /// consistency check between on-premises primary instance and Cloud SQL
13930    /// instance during the demotion operation but also exposes you to the risk of
13931    /// future replication failures. Change the value only if you know the reason
13932    /// for the GTID divergence and are confident that doing so will not cause any
13933    /// replication issues.
13934    pub verify_gtid_consistency: std::option::Option<wkt::BoolValue>,
13935
13936    /// The name of the instance which will act as on-premises primary instance
13937    /// in the replication setup.
13938    pub master_instance_name: std::string::String,
13939
13940    /// Configuration specific to read-replicas replicating from the on-premises
13941    /// primary instance.
13942    pub replica_configuration: std::option::Option<crate::model::DemoteMasterConfiguration>,
13943
13944    /// Flag to skip replication setup on the instance.
13945    pub skip_replication_setup: bool,
13946
13947    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13948}
13949
13950impl DemoteMasterContext {
13951    /// Creates a new default instance.
13952    pub fn new() -> Self {
13953        std::default::Default::default()
13954    }
13955
13956    /// Sets the value of [kind][crate::model::DemoteMasterContext::kind].
13957    ///
13958    /// # Example
13959    /// ```ignore,no_run
13960    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13961    /// let x = DemoteMasterContext::new().set_kind("example");
13962    /// ```
13963    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13964        self.kind = v.into();
13965        self
13966    }
13967
13968    /// Sets the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
13969    ///
13970    /// # Example
13971    /// ```ignore,no_run
13972    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13973    /// use wkt::BoolValue;
13974    /// let x = DemoteMasterContext::new().set_verify_gtid_consistency(BoolValue::default()/* use setters */);
13975    /// ```
13976    pub fn set_verify_gtid_consistency<T>(mut self, v: T) -> Self
13977    where
13978        T: std::convert::Into<wkt::BoolValue>,
13979    {
13980        self.verify_gtid_consistency = std::option::Option::Some(v.into());
13981        self
13982    }
13983
13984    /// Sets or clears the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
13985    ///
13986    /// # Example
13987    /// ```ignore,no_run
13988    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13989    /// use wkt::BoolValue;
13990    /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(Some(BoolValue::default()/* use setters */));
13991    /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(None::<BoolValue>);
13992    /// ```
13993    pub fn set_or_clear_verify_gtid_consistency<T>(mut self, v: std::option::Option<T>) -> Self
13994    where
13995        T: std::convert::Into<wkt::BoolValue>,
13996    {
13997        self.verify_gtid_consistency = v.map(|x| x.into());
13998        self
13999    }
14000
14001    /// Sets the value of [master_instance_name][crate::model::DemoteMasterContext::master_instance_name].
14002    ///
14003    /// # Example
14004    /// ```ignore,no_run
14005    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14006    /// let x = DemoteMasterContext::new().set_master_instance_name("example");
14007    /// ```
14008    pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
14009        mut self,
14010        v: T,
14011    ) -> Self {
14012        self.master_instance_name = v.into();
14013        self
14014    }
14015
14016    /// Sets the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
14017    ///
14018    /// # Example
14019    /// ```ignore,no_run
14020    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14021    /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
14022    /// let x = DemoteMasterContext::new().set_replica_configuration(DemoteMasterConfiguration::default()/* use setters */);
14023    /// ```
14024    pub fn set_replica_configuration<T>(mut self, v: T) -> Self
14025    where
14026        T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
14027    {
14028        self.replica_configuration = std::option::Option::Some(v.into());
14029        self
14030    }
14031
14032    /// Sets or clears the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
14033    ///
14034    /// # Example
14035    /// ```ignore,no_run
14036    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14037    /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
14038    /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(Some(DemoteMasterConfiguration::default()/* use setters */));
14039    /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(None::<DemoteMasterConfiguration>);
14040    /// ```
14041    pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
14042    where
14043        T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
14044    {
14045        self.replica_configuration = v.map(|x| x.into());
14046        self
14047    }
14048
14049    /// Sets the value of [skip_replication_setup][crate::model::DemoteMasterContext::skip_replication_setup].
14050    ///
14051    /// # Example
14052    /// ```ignore,no_run
14053    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14054    /// let x = DemoteMasterContext::new().set_skip_replication_setup(true);
14055    /// ```
14056    pub fn set_skip_replication_setup<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14057        self.skip_replication_setup = v.into();
14058        self
14059    }
14060}
14061
14062impl wkt::message::Message for DemoteMasterContext {
14063    fn typename() -> &'static str {
14064        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterContext"
14065    }
14066}
14067
14068/// This context is used to demote an existing standalone instance to be
14069/// a Cloud SQL read replica for an external database server.
14070#[derive(Clone, Default, PartialEq)]
14071#[non_exhaustive]
14072pub struct DemoteContext {
14073    /// This is always `sql#demoteContext`.
14074    pub kind: std::string::String,
14075
14076    /// Required. The name of the instance which acts as the on-premises primary
14077    /// instance in the replication setup.
14078    pub source_representative_instance_name: std::string::String,
14079
14080    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14081}
14082
14083impl DemoteContext {
14084    /// Creates a new default instance.
14085    pub fn new() -> Self {
14086        std::default::Default::default()
14087    }
14088
14089    /// Sets the value of [kind][crate::model::DemoteContext::kind].
14090    ///
14091    /// # Example
14092    /// ```ignore,no_run
14093    /// # use google_cloud_sql_v1::model::DemoteContext;
14094    /// let x = DemoteContext::new().set_kind("example");
14095    /// ```
14096    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14097        self.kind = v.into();
14098        self
14099    }
14100
14101    /// Sets the value of [source_representative_instance_name][crate::model::DemoteContext::source_representative_instance_name].
14102    ///
14103    /// # Example
14104    /// ```ignore,no_run
14105    /// # use google_cloud_sql_v1::model::DemoteContext;
14106    /// let x = DemoteContext::new().set_source_representative_instance_name("example");
14107    /// ```
14108    pub fn set_source_representative_instance_name<T: std::convert::Into<std::string::String>>(
14109        mut self,
14110        v: T,
14111    ) -> Self {
14112        self.source_representative_instance_name = v.into();
14113        self
14114    }
14115}
14116
14117impl wkt::message::Message for DemoteContext {
14118    fn typename() -> &'static str {
14119        "type.googleapis.com/google.cloud.sql.v1.DemoteContext"
14120    }
14121}
14122
14123/// Database instance failover context.
14124#[derive(Clone, Default, PartialEq)]
14125#[non_exhaustive]
14126pub struct FailoverContext {
14127    /// The current settings version of this instance. Request will be rejected if
14128    /// this version doesn't match the current settings version.
14129    pub settings_version: i64,
14130
14131    /// This is always `sql#failoverContext`.
14132    pub kind: std::string::String,
14133
14134    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14135}
14136
14137impl FailoverContext {
14138    /// Creates a new default instance.
14139    pub fn new() -> Self {
14140        std::default::Default::default()
14141    }
14142
14143    /// Sets the value of [settings_version][crate::model::FailoverContext::settings_version].
14144    ///
14145    /// # Example
14146    /// ```ignore,no_run
14147    /// # use google_cloud_sql_v1::model::FailoverContext;
14148    /// let x = FailoverContext::new().set_settings_version(42);
14149    /// ```
14150    pub fn set_settings_version<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14151        self.settings_version = v.into();
14152        self
14153    }
14154
14155    /// Sets the value of [kind][crate::model::FailoverContext::kind].
14156    ///
14157    /// # Example
14158    /// ```ignore,no_run
14159    /// # use google_cloud_sql_v1::model::FailoverContext;
14160    /// let x = FailoverContext::new().set_kind("example");
14161    /// ```
14162    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14163        self.kind = v.into();
14164        self
14165    }
14166}
14167
14168impl wkt::message::Message for FailoverContext {
14169    fn typename() -> &'static str {
14170        "type.googleapis.com/google.cloud.sql.v1.FailoverContext"
14171    }
14172}
14173
14174/// Database instance restore from backup context.
14175/// Backup context contains source instance id and project id.
14176#[derive(Clone, Default, PartialEq)]
14177#[non_exhaustive]
14178pub struct RestoreBackupContext {
14179    /// This is always `sql#restoreBackupContext`.
14180    pub kind: std::string::String,
14181
14182    /// The ID of the backup run to restore from.
14183    pub backup_run_id: i64,
14184
14185    /// The ID of the instance that the backup was taken from.
14186    pub instance_id: std::string::String,
14187
14188    /// The full project ID of the source instance.
14189    pub project: std::string::String,
14190
14191    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14192}
14193
14194impl RestoreBackupContext {
14195    /// Creates a new default instance.
14196    pub fn new() -> Self {
14197        std::default::Default::default()
14198    }
14199
14200    /// Sets the value of [kind][crate::model::RestoreBackupContext::kind].
14201    ///
14202    /// # Example
14203    /// ```ignore,no_run
14204    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14205    /// let x = RestoreBackupContext::new().set_kind("example");
14206    /// ```
14207    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14208        self.kind = v.into();
14209        self
14210    }
14211
14212    /// Sets the value of [backup_run_id][crate::model::RestoreBackupContext::backup_run_id].
14213    ///
14214    /// # Example
14215    /// ```ignore,no_run
14216    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14217    /// let x = RestoreBackupContext::new().set_backup_run_id(42);
14218    /// ```
14219    pub fn set_backup_run_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14220        self.backup_run_id = v.into();
14221        self
14222    }
14223
14224    /// Sets the value of [instance_id][crate::model::RestoreBackupContext::instance_id].
14225    ///
14226    /// # Example
14227    /// ```ignore,no_run
14228    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14229    /// let x = RestoreBackupContext::new().set_instance_id("example");
14230    /// ```
14231    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14232        self.instance_id = v.into();
14233        self
14234    }
14235
14236    /// Sets the value of [project][crate::model::RestoreBackupContext::project].
14237    ///
14238    /// # Example
14239    /// ```ignore,no_run
14240    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14241    /// let x = RestoreBackupContext::new().set_project("example");
14242    /// ```
14243    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14244        self.project = v.into();
14245        self
14246    }
14247}
14248
14249impl wkt::message::Message for RestoreBackupContext {
14250    fn typename() -> &'static str {
14251        "type.googleapis.com/google.cloud.sql.v1.RestoreBackupContext"
14252    }
14253}
14254
14255/// Instance rotate server CA context.
14256#[derive(Clone, Default, PartialEq)]
14257#[non_exhaustive]
14258pub struct RotateServerCaContext {
14259    /// This is always `sql#rotateServerCaContext`.
14260    pub kind: std::string::String,
14261
14262    /// The fingerprint of the next version to be rotated to. If left unspecified,
14263    /// will be rotated to the most recently added server CA version.
14264    pub next_version: std::string::String,
14265
14266    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14267}
14268
14269impl RotateServerCaContext {
14270    /// Creates a new default instance.
14271    pub fn new() -> Self {
14272        std::default::Default::default()
14273    }
14274
14275    /// Sets the value of [kind][crate::model::RotateServerCaContext::kind].
14276    ///
14277    /// # Example
14278    /// ```ignore,no_run
14279    /// # use google_cloud_sql_v1::model::RotateServerCaContext;
14280    /// let x = RotateServerCaContext::new().set_kind("example");
14281    /// ```
14282    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14283        self.kind = v.into();
14284        self
14285    }
14286
14287    /// Sets the value of [next_version][crate::model::RotateServerCaContext::next_version].
14288    ///
14289    /// # Example
14290    /// ```ignore,no_run
14291    /// # use google_cloud_sql_v1::model::RotateServerCaContext;
14292    /// let x = RotateServerCaContext::new().set_next_version("example");
14293    /// ```
14294    pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14295        self.next_version = v.into();
14296        self
14297    }
14298}
14299
14300impl wkt::message::Message for RotateServerCaContext {
14301    fn typename() -> &'static str {
14302        "type.googleapis.com/google.cloud.sql.v1.RotateServerCaContext"
14303    }
14304}
14305
14306/// Instance rotate server certificate context.
14307#[derive(Clone, Default, PartialEq)]
14308#[non_exhaustive]
14309pub struct RotateServerCertificateContext {
14310    /// Optional. This is always `sql#rotateServerCertificateContext`.
14311    pub kind: std::string::String,
14312
14313    /// The fingerprint of the next version to be rotated to. If left unspecified,
14314    /// will be rotated to the most recently added server certificate version.
14315    pub next_version: std::string::String,
14316
14317    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14318}
14319
14320impl RotateServerCertificateContext {
14321    /// Creates a new default instance.
14322    pub fn new() -> Self {
14323        std::default::Default::default()
14324    }
14325
14326    /// Sets the value of [kind][crate::model::RotateServerCertificateContext::kind].
14327    ///
14328    /// # Example
14329    /// ```ignore,no_run
14330    /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
14331    /// let x = RotateServerCertificateContext::new().set_kind("example");
14332    /// ```
14333    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14334        self.kind = v.into();
14335        self
14336    }
14337
14338    /// Sets the value of [next_version][crate::model::RotateServerCertificateContext::next_version].
14339    ///
14340    /// # Example
14341    /// ```ignore,no_run
14342    /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
14343    /// let x = RotateServerCertificateContext::new().set_next_version("example");
14344    /// ```
14345    pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14346        self.next_version = v.into();
14347        self
14348    }
14349}
14350
14351impl wkt::message::Message for RotateServerCertificateContext {
14352    fn typename() -> &'static str {
14353        "type.googleapis.com/google.cloud.sql.v1.RotateServerCertificateContext"
14354    }
14355}
14356
14357/// Instance rotate Entra ID certificate context.
14358#[derive(Clone, Default, PartialEq)]
14359#[non_exhaustive]
14360pub struct RotateEntraIdCertificateContext {
14361    /// Optional. This is always `sql#rotateEntraIdCertificateContext`.
14362    pub kind: std::string::String,
14363
14364    /// Optional. The fingerprint of the next version to be rotated to. If left
14365    /// unspecified, will be rotated to the most recently added server certificate
14366    /// version.
14367    pub next_version: std::string::String,
14368
14369    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14370}
14371
14372impl RotateEntraIdCertificateContext {
14373    /// Creates a new default instance.
14374    pub fn new() -> Self {
14375        std::default::Default::default()
14376    }
14377
14378    /// Sets the value of [kind][crate::model::RotateEntraIdCertificateContext::kind].
14379    ///
14380    /// # Example
14381    /// ```ignore,no_run
14382    /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
14383    /// let x = RotateEntraIdCertificateContext::new().set_kind("example");
14384    /// ```
14385    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14386        self.kind = v.into();
14387        self
14388    }
14389
14390    /// Sets the value of [next_version][crate::model::RotateEntraIdCertificateContext::next_version].
14391    ///
14392    /// # Example
14393    /// ```ignore,no_run
14394    /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
14395    /// let x = RotateEntraIdCertificateContext::new().set_next_version("example");
14396    /// ```
14397    pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14398        self.next_version = v.into();
14399        self
14400    }
14401}
14402
14403impl wkt::message::Message for RotateEntraIdCertificateContext {
14404    fn typename() -> &'static str {
14405        "type.googleapis.com/google.cloud.sql.v1.RotateEntraIdCertificateContext"
14406    }
14407}
14408
14409/// Database Instance truncate log context.
14410#[derive(Clone, Default, PartialEq)]
14411#[non_exhaustive]
14412pub struct TruncateLogContext {
14413    /// This is always `sql#truncateLogContext`.
14414    pub kind: std::string::String,
14415
14416    /// The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
14417    /// `MYSQL_SLOW_TABLE`.
14418    pub log_type: std::string::String,
14419
14420    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14421}
14422
14423impl TruncateLogContext {
14424    /// Creates a new default instance.
14425    pub fn new() -> Self {
14426        std::default::Default::default()
14427    }
14428
14429    /// Sets the value of [kind][crate::model::TruncateLogContext::kind].
14430    ///
14431    /// # Example
14432    /// ```ignore,no_run
14433    /// # use google_cloud_sql_v1::model::TruncateLogContext;
14434    /// let x = TruncateLogContext::new().set_kind("example");
14435    /// ```
14436    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14437        self.kind = v.into();
14438        self
14439    }
14440
14441    /// Sets the value of [log_type][crate::model::TruncateLogContext::log_type].
14442    ///
14443    /// # Example
14444    /// ```ignore,no_run
14445    /// # use google_cloud_sql_v1::model::TruncateLogContext;
14446    /// let x = TruncateLogContext::new().set_log_type("example");
14447    /// ```
14448    pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14449        self.log_type = v.into();
14450        self
14451    }
14452}
14453
14454impl wkt::message::Message for TruncateLogContext {
14455    fn typename() -> &'static str {
14456        "type.googleapis.com/google.cloud.sql.v1.TruncateLogContext"
14457    }
14458}
14459
14460/// External primary instance migration setting error/warning.
14461#[derive(Clone, Default, PartialEq)]
14462#[non_exhaustive]
14463pub struct SqlExternalSyncSettingError {
14464    /// Can be `sql#externalSyncSettingError` or
14465    /// `sql#externalSyncSettingWarning`.
14466    pub kind: std::string::String,
14467
14468    /// Identifies the specific error that occurred.
14469    pub r#type: crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
14470
14471    /// Additional information about the error encountered.
14472    pub detail: std::string::String,
14473
14474    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14475}
14476
14477impl SqlExternalSyncSettingError {
14478    /// Creates a new default instance.
14479    pub fn new() -> Self {
14480        std::default::Default::default()
14481    }
14482
14483    /// Sets the value of [kind][crate::model::SqlExternalSyncSettingError::kind].
14484    ///
14485    /// # Example
14486    /// ```ignore,no_run
14487    /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14488    /// let x = SqlExternalSyncSettingError::new().set_kind("example");
14489    /// ```
14490    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14491        self.kind = v.into();
14492        self
14493    }
14494
14495    /// Sets the value of [r#type][crate::model::SqlExternalSyncSettingError::type].
14496    ///
14497    /// # Example
14498    /// ```ignore,no_run
14499    /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14500    /// use google_cloud_sql_v1::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType;
14501    /// let x0 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::ConnectionFailure);
14502    /// let x1 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::BinlogNotEnabled);
14503    /// let x2 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::IncompatibleDatabaseVersion);
14504    /// ```
14505    pub fn set_type<
14506        T: std::convert::Into<
14507                crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
14508            >,
14509    >(
14510        mut self,
14511        v: T,
14512    ) -> Self {
14513        self.r#type = v.into();
14514        self
14515    }
14516
14517    /// Sets the value of [detail][crate::model::SqlExternalSyncSettingError::detail].
14518    ///
14519    /// # Example
14520    /// ```ignore,no_run
14521    /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14522    /// let x = SqlExternalSyncSettingError::new().set_detail("example");
14523    /// ```
14524    pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14525        self.detail = v.into();
14526        self
14527    }
14528}
14529
14530impl wkt::message::Message for SqlExternalSyncSettingError {
14531    fn typename() -> &'static str {
14532        "type.googleapis.com/google.cloud.sql.v1.SqlExternalSyncSettingError"
14533    }
14534}
14535
14536/// Defines additional types related to [SqlExternalSyncSettingError].
14537pub mod sql_external_sync_setting_error {
14538    #[allow(unused_imports)]
14539    use super::*;
14540
14541    /// Enum for [SqlExternalSyncSettingErrorType].
14542    ///
14543    /// # Working with unknown values
14544    ///
14545    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14546    /// additional enum variants at any time. Adding new variants is not considered
14547    /// a breaking change. Applications should write their code in anticipation of:
14548    ///
14549    /// - New values appearing in future releases of the client library, **and**
14550    /// - New values received dynamically, without application changes.
14551    ///
14552    /// Please consult the [Working with enums] section in the user guide for some
14553    /// guidelines.
14554    ///
14555    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14556    #[derive(Clone, Debug, PartialEq)]
14557    #[non_exhaustive]
14558    pub enum SqlExternalSyncSettingErrorType {
14559        #[allow(missing_docs)]
14560        Unspecified,
14561        #[allow(missing_docs)]
14562        ConnectionFailure,
14563        #[allow(missing_docs)]
14564        BinlogNotEnabled,
14565        #[allow(missing_docs)]
14566        IncompatibleDatabaseVersion,
14567        #[allow(missing_docs)]
14568        ReplicaAlreadySetup,
14569        /// The replication user is missing privileges that are required.
14570        InsufficientPrivilege,
14571        /// Unsupported migration type.
14572        UnsupportedMigrationType,
14573        /// No pglogical extension installed on databases, applicable for postgres.
14574        NoPglogicalInstalled,
14575        /// pglogical node already exists on databases, applicable for postgres.
14576        PglogicalNodeAlreadyExists,
14577        /// The value of parameter wal_level is not set to logical.
14578        InvalidWalLevel,
14579        /// The value of parameter shared_preload_libraries does not include
14580        /// pglogical.
14581        InvalidSharedPreloadLibrary,
14582        /// The value of parameter max_replication_slots is not sufficient.
14583        InsufficientMaxReplicationSlots,
14584        /// The value of parameter max_wal_senders is not sufficient.
14585        InsufficientMaxWalSenders,
14586        /// The value of parameter max_worker_processes is not sufficient.
14587        InsufficientMaxWorkerProcesses,
14588        /// Extensions installed are either not supported or having unsupported
14589        /// versions.
14590        UnsupportedExtensions,
14591        /// The value of parameter rds.logical_replication is not set to 1.
14592        InvalidRdsLogicalReplication,
14593        /// The primary instance logging setup doesn't allow EM sync.
14594        InvalidLoggingSetup,
14595        /// The primary instance database parameter setup doesn't allow EM sync.
14596        InvalidDbParam,
14597        /// The gtid_mode is not supported, applicable for MySQL.
14598        UnsupportedGtidMode,
14599        /// SQL Server Agent is not running.
14600        SqlserverAgentNotRunning,
14601        /// The table definition is not support due to missing primary key or replica
14602        /// identity, applicable for postgres. Note that this is a warning and won't
14603        /// block the migration.
14604        UnsupportedTableDefinition,
14605        /// The customer has a definer that will break EM setup.
14606        UnsupportedDefiner,
14607        /// SQL Server @@SERVERNAME does not match actual host name.
14608        SqlserverServernameMismatch,
14609        /// The primary instance has been setup and will fail the setup.
14610        PrimaryAlreadySetup,
14611        /// The primary instance has unsupported binary log format.
14612        UnsupportedBinlogFormat,
14613        /// The primary instance's binary log retention setting.
14614        BinlogRetentionSetting,
14615        /// The primary instance has tables with unsupported storage engine.
14616        UnsupportedStorageEngine,
14617        /// Source has tables with limited support
14618        /// eg: PostgreSQL tables without primary keys.
14619        LimitedSupportTables,
14620        /// The replica instance contains existing data.
14621        ExistingDataInReplica,
14622        /// The replication user is missing privileges that are optional.
14623        MissingOptionalPrivileges,
14624        /// Additional BACKUP_ADMIN privilege is granted to the replication user
14625        /// which may lock source MySQL 8 instance for DDLs during initial sync.
14626        RiskyBackupAdminPrivilege,
14627        /// The Cloud Storage bucket is missing necessary permissions.
14628        InsufficientGcsPermissions,
14629        /// The Cloud Storage bucket has an error in the file or contains invalid
14630        /// file information.
14631        InvalidFileInfo,
14632        /// The source instance has unsupported database settings for migration.
14633        UnsupportedDatabaseSettings,
14634        /// The replication user is missing parallel import specific privileges.
14635        /// (e.g. LOCK TABLES) for MySQL.
14636        MysqlParallelImportInsufficientPrivilege,
14637        /// The global variable local_infile is off on external server replica.
14638        LocalInfileOff,
14639        /// This code instructs customers to turn on point-in-time recovery manually
14640        /// for the instance after promoting the Cloud SQL for PostgreSQL instance.
14641        TurnOnPitrAfterPromote,
14642        /// The minor version of replica database is incompatible with the source.
14643        IncompatibleDatabaseMinorVersion,
14644        /// This warning message indicates that Cloud SQL uses the maximum number of
14645        /// subscriptions to migrate data from the source to the destination.
14646        SourceMaxSubscriptions,
14647        /// Unable to verify definers on the source for MySQL.
14648        UnableToVerifyDefiners,
14649        /// If a time out occurs while the subscription counts are calculated, then
14650        /// this value is set to 1. Otherwise, this value is set to 2.
14651        SubscriptionCalculationStatus,
14652        /// Count of subscriptions needed to sync source data for PostgreSQL
14653        /// database.
14654        PgSubscriptionCount,
14655        /// Final parallel level that is used to do migration.
14656        PgSyncParallelLevel,
14657        /// The disk size of the replica instance is smaller than the data size of
14658        /// the source instance.
14659        InsufficientDiskSize,
14660        /// The data size of the source instance is greater than 1 TB, the number of
14661        /// cores of the replica instance is less than 8, and the memory of the
14662        /// replica is less than 32 GB.
14663        InsufficientMachineTier,
14664        /// The warning message indicates the unsupported extensions will not be
14665        /// migrated to the destination.
14666        UnsupportedExtensionsNotMigrated,
14667        /// The warning message indicates the pg_cron extension and settings will not
14668        /// be migrated to the destination.
14669        ExtensionsNotMigrated,
14670        /// The error message indicates that pg_cron flags are enabled on the
14671        /// destination which is not supported during the migration.
14672        PgCronFlagEnabledInReplica,
14673        /// This error message indicates that the specified extensions are not
14674        /// enabled on destination instance. For example, before you can migrate
14675        /// data to the destination instance, you must enable the PGAudit extension
14676        /// on the instance.
14677        ExtensionsNotEnabledInReplica,
14678        /// The source database has generated columns that can't be migrated. Please
14679        /// change them to regular columns before migration.
14680        UnsupportedColumns,
14681        /// The source database has users that aren't created in the replica.
14682        /// First, create all users, which are in the pg_user_mappings table
14683        /// of the source database, in the destination instance. Then, perform the
14684        /// migration.
14685        UsersNotCreatedInReplica,
14686        /// The selected objects include system objects that aren't supported for
14687        /// migration.
14688        UnsupportedSystemObjects,
14689        /// The source database has tables with the FULL or NOTHING replica identity.
14690        /// Before starting your migration, either remove the identity or change it
14691        /// to DEFAULT. Note that this is an error and will block the migration.
14692        UnsupportedTablesWithReplicaIdentity,
14693        /// The selected objects don't exist on the source instance.
14694        SelectedObjectsNotExistOnSource,
14695        /// PSC only destination instance does not have a network attachment URI.
14696        PscOnlyInstanceWithNoNetworkAttachmentUri,
14697        /// Selected objects reference unselected objects. Based on their object type
14698        /// (foreign key constraint or view), selected objects will fail during
14699        /// migration.
14700        SelectedObjectsReferenceUnselectedObjects,
14701        /// The migration will delete existing data in the replica; set
14702        /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
14703        /// in the request to acknowledge this. This is an error. MySQL only.
14704        ///
14705        /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
14706        PromptDeleteExisting,
14707        /// The migration will delete existing data in the replica;
14708        /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
14709        /// was set in the request acknowledging this. This is a warning rather than
14710        /// an error. MySQL only.
14711        ///
14712        /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
14713        WillDeleteExisting,
14714        /// The replication user is missing specific privileges to setup DDL
14715        /// replication. (e.g. CREATE EVENT TRIGGER, CREATE SCHEMA) for PostgreSQL.
14716        PgDdlReplicationInsufficientPrivilege,
14717        /// If set, the enum was initialized with an unknown value.
14718        ///
14719        /// Applications can examine the value using [SqlExternalSyncSettingErrorType::value] or
14720        /// [SqlExternalSyncSettingErrorType::name].
14721        UnknownValue(sql_external_sync_setting_error_type::UnknownValue),
14722    }
14723
14724    #[doc(hidden)]
14725    pub mod sql_external_sync_setting_error_type {
14726        #[allow(unused_imports)]
14727        use super::*;
14728        #[derive(Clone, Debug, PartialEq)]
14729        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14730    }
14731
14732    impl SqlExternalSyncSettingErrorType {
14733        /// Gets the enum value.
14734        ///
14735        /// Returns `None` if the enum contains an unknown value deserialized from
14736        /// the string representation of enums.
14737        pub fn value(&self) -> std::option::Option<i32> {
14738            match self {
14739                Self::Unspecified => std::option::Option::Some(0),
14740                Self::ConnectionFailure => std::option::Option::Some(1),
14741                Self::BinlogNotEnabled => std::option::Option::Some(2),
14742                Self::IncompatibleDatabaseVersion => std::option::Option::Some(3),
14743                Self::ReplicaAlreadySetup => std::option::Option::Some(4),
14744                Self::InsufficientPrivilege => std::option::Option::Some(5),
14745                Self::UnsupportedMigrationType => std::option::Option::Some(6),
14746                Self::NoPglogicalInstalled => std::option::Option::Some(7),
14747                Self::PglogicalNodeAlreadyExists => std::option::Option::Some(8),
14748                Self::InvalidWalLevel => std::option::Option::Some(9),
14749                Self::InvalidSharedPreloadLibrary => std::option::Option::Some(10),
14750                Self::InsufficientMaxReplicationSlots => std::option::Option::Some(11),
14751                Self::InsufficientMaxWalSenders => std::option::Option::Some(12),
14752                Self::InsufficientMaxWorkerProcesses => std::option::Option::Some(13),
14753                Self::UnsupportedExtensions => std::option::Option::Some(14),
14754                Self::InvalidRdsLogicalReplication => std::option::Option::Some(15),
14755                Self::InvalidLoggingSetup => std::option::Option::Some(16),
14756                Self::InvalidDbParam => std::option::Option::Some(17),
14757                Self::UnsupportedGtidMode => std::option::Option::Some(18),
14758                Self::SqlserverAgentNotRunning => std::option::Option::Some(19),
14759                Self::UnsupportedTableDefinition => std::option::Option::Some(20),
14760                Self::UnsupportedDefiner => std::option::Option::Some(21),
14761                Self::SqlserverServernameMismatch => std::option::Option::Some(22),
14762                Self::PrimaryAlreadySetup => std::option::Option::Some(23),
14763                Self::UnsupportedBinlogFormat => std::option::Option::Some(24),
14764                Self::BinlogRetentionSetting => std::option::Option::Some(25),
14765                Self::UnsupportedStorageEngine => std::option::Option::Some(26),
14766                Self::LimitedSupportTables => std::option::Option::Some(27),
14767                Self::ExistingDataInReplica => std::option::Option::Some(28),
14768                Self::MissingOptionalPrivileges => std::option::Option::Some(29),
14769                Self::RiskyBackupAdminPrivilege => std::option::Option::Some(30),
14770                Self::InsufficientGcsPermissions => std::option::Option::Some(31),
14771                Self::InvalidFileInfo => std::option::Option::Some(32),
14772                Self::UnsupportedDatabaseSettings => std::option::Option::Some(33),
14773                Self::MysqlParallelImportInsufficientPrivilege => std::option::Option::Some(34),
14774                Self::LocalInfileOff => std::option::Option::Some(35),
14775                Self::TurnOnPitrAfterPromote => std::option::Option::Some(36),
14776                Self::IncompatibleDatabaseMinorVersion => std::option::Option::Some(37),
14777                Self::SourceMaxSubscriptions => std::option::Option::Some(38),
14778                Self::UnableToVerifyDefiners => std::option::Option::Some(39),
14779                Self::SubscriptionCalculationStatus => std::option::Option::Some(40),
14780                Self::PgSubscriptionCount => std::option::Option::Some(41),
14781                Self::PgSyncParallelLevel => std::option::Option::Some(42),
14782                Self::InsufficientDiskSize => std::option::Option::Some(43),
14783                Self::InsufficientMachineTier => std::option::Option::Some(44),
14784                Self::UnsupportedExtensionsNotMigrated => std::option::Option::Some(45),
14785                Self::ExtensionsNotMigrated => std::option::Option::Some(46),
14786                Self::PgCronFlagEnabledInReplica => std::option::Option::Some(47),
14787                Self::ExtensionsNotEnabledInReplica => std::option::Option::Some(48),
14788                Self::UnsupportedColumns => std::option::Option::Some(49),
14789                Self::UsersNotCreatedInReplica => std::option::Option::Some(50),
14790                Self::UnsupportedSystemObjects => std::option::Option::Some(51),
14791                Self::UnsupportedTablesWithReplicaIdentity => std::option::Option::Some(52),
14792                Self::SelectedObjectsNotExistOnSource => std::option::Option::Some(53),
14793                Self::PscOnlyInstanceWithNoNetworkAttachmentUri => std::option::Option::Some(54),
14794                Self::SelectedObjectsReferenceUnselectedObjects => std::option::Option::Some(55),
14795                Self::PromptDeleteExisting => std::option::Option::Some(56),
14796                Self::WillDeleteExisting => std::option::Option::Some(57),
14797                Self::PgDdlReplicationInsufficientPrivilege => std::option::Option::Some(58),
14798                Self::UnknownValue(u) => u.0.value(),
14799            }
14800        }
14801
14802        /// Gets the enum value as a string.
14803        ///
14804        /// Returns `None` if the enum contains an unknown value deserialized from
14805        /// the integer representation of enums.
14806        pub fn name(&self) -> std::option::Option<&str> {
14807            match self {
14808                Self::Unspecified => {
14809                    std::option::Option::Some("SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED")
14810                }
14811                Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
14812                Self::BinlogNotEnabled => std::option::Option::Some("BINLOG_NOT_ENABLED"),
14813                Self::IncompatibleDatabaseVersion => {
14814                    std::option::Option::Some("INCOMPATIBLE_DATABASE_VERSION")
14815                }
14816                Self::ReplicaAlreadySetup => std::option::Option::Some("REPLICA_ALREADY_SETUP"),
14817                Self::InsufficientPrivilege => std::option::Option::Some("INSUFFICIENT_PRIVILEGE"),
14818                Self::UnsupportedMigrationType => {
14819                    std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
14820                }
14821                Self::NoPglogicalInstalled => std::option::Option::Some("NO_PGLOGICAL_INSTALLED"),
14822                Self::PglogicalNodeAlreadyExists => {
14823                    std::option::Option::Some("PGLOGICAL_NODE_ALREADY_EXISTS")
14824                }
14825                Self::InvalidWalLevel => std::option::Option::Some("INVALID_WAL_LEVEL"),
14826                Self::InvalidSharedPreloadLibrary => {
14827                    std::option::Option::Some("INVALID_SHARED_PRELOAD_LIBRARY")
14828                }
14829                Self::InsufficientMaxReplicationSlots => {
14830                    std::option::Option::Some("INSUFFICIENT_MAX_REPLICATION_SLOTS")
14831                }
14832                Self::InsufficientMaxWalSenders => {
14833                    std::option::Option::Some("INSUFFICIENT_MAX_WAL_SENDERS")
14834                }
14835                Self::InsufficientMaxWorkerProcesses => {
14836                    std::option::Option::Some("INSUFFICIENT_MAX_WORKER_PROCESSES")
14837                }
14838                Self::UnsupportedExtensions => std::option::Option::Some("UNSUPPORTED_EXTENSIONS"),
14839                Self::InvalidRdsLogicalReplication => {
14840                    std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
14841                }
14842                Self::InvalidLoggingSetup => std::option::Option::Some("INVALID_LOGGING_SETUP"),
14843                Self::InvalidDbParam => std::option::Option::Some("INVALID_DB_PARAM"),
14844                Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
14845                Self::SqlserverAgentNotRunning => {
14846                    std::option::Option::Some("SQLSERVER_AGENT_NOT_RUNNING")
14847                }
14848                Self::UnsupportedTableDefinition => {
14849                    std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
14850                }
14851                Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
14852                Self::SqlserverServernameMismatch => {
14853                    std::option::Option::Some("SQLSERVER_SERVERNAME_MISMATCH")
14854                }
14855                Self::PrimaryAlreadySetup => std::option::Option::Some("PRIMARY_ALREADY_SETUP"),
14856                Self::UnsupportedBinlogFormat => {
14857                    std::option::Option::Some("UNSUPPORTED_BINLOG_FORMAT")
14858                }
14859                Self::BinlogRetentionSetting => {
14860                    std::option::Option::Some("BINLOG_RETENTION_SETTING")
14861                }
14862                Self::UnsupportedStorageEngine => {
14863                    std::option::Option::Some("UNSUPPORTED_STORAGE_ENGINE")
14864                }
14865                Self::LimitedSupportTables => std::option::Option::Some("LIMITED_SUPPORT_TABLES"),
14866                Self::ExistingDataInReplica => {
14867                    std::option::Option::Some("EXISTING_DATA_IN_REPLICA")
14868                }
14869                Self::MissingOptionalPrivileges => {
14870                    std::option::Option::Some("MISSING_OPTIONAL_PRIVILEGES")
14871                }
14872                Self::RiskyBackupAdminPrivilege => {
14873                    std::option::Option::Some("RISKY_BACKUP_ADMIN_PRIVILEGE")
14874                }
14875                Self::InsufficientGcsPermissions => {
14876                    std::option::Option::Some("INSUFFICIENT_GCS_PERMISSIONS")
14877                }
14878                Self::InvalidFileInfo => std::option::Option::Some("INVALID_FILE_INFO"),
14879                Self::UnsupportedDatabaseSettings => {
14880                    std::option::Option::Some("UNSUPPORTED_DATABASE_SETTINGS")
14881                }
14882                Self::MysqlParallelImportInsufficientPrivilege => {
14883                    std::option::Option::Some("MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
14884                }
14885                Self::LocalInfileOff => std::option::Option::Some("LOCAL_INFILE_OFF"),
14886                Self::TurnOnPitrAfterPromote => {
14887                    std::option::Option::Some("TURN_ON_PITR_AFTER_PROMOTE")
14888                }
14889                Self::IncompatibleDatabaseMinorVersion => {
14890                    std::option::Option::Some("INCOMPATIBLE_DATABASE_MINOR_VERSION")
14891                }
14892                Self::SourceMaxSubscriptions => {
14893                    std::option::Option::Some("SOURCE_MAX_SUBSCRIPTIONS")
14894                }
14895                Self::UnableToVerifyDefiners => {
14896                    std::option::Option::Some("UNABLE_TO_VERIFY_DEFINERS")
14897                }
14898                Self::SubscriptionCalculationStatus => {
14899                    std::option::Option::Some("SUBSCRIPTION_CALCULATION_STATUS")
14900                }
14901                Self::PgSubscriptionCount => std::option::Option::Some("PG_SUBSCRIPTION_COUNT"),
14902                Self::PgSyncParallelLevel => std::option::Option::Some("PG_SYNC_PARALLEL_LEVEL"),
14903                Self::InsufficientDiskSize => std::option::Option::Some("INSUFFICIENT_DISK_SIZE"),
14904                Self::InsufficientMachineTier => {
14905                    std::option::Option::Some("INSUFFICIENT_MACHINE_TIER")
14906                }
14907                Self::UnsupportedExtensionsNotMigrated => {
14908                    std::option::Option::Some("UNSUPPORTED_EXTENSIONS_NOT_MIGRATED")
14909                }
14910                Self::ExtensionsNotMigrated => std::option::Option::Some("EXTENSIONS_NOT_MIGRATED"),
14911                Self::PgCronFlagEnabledInReplica => {
14912                    std::option::Option::Some("PG_CRON_FLAG_ENABLED_IN_REPLICA")
14913                }
14914                Self::ExtensionsNotEnabledInReplica => {
14915                    std::option::Option::Some("EXTENSIONS_NOT_ENABLED_IN_REPLICA")
14916                }
14917                Self::UnsupportedColumns => std::option::Option::Some("UNSUPPORTED_COLUMNS"),
14918                Self::UsersNotCreatedInReplica => {
14919                    std::option::Option::Some("USERS_NOT_CREATED_IN_REPLICA")
14920                }
14921                Self::UnsupportedSystemObjects => {
14922                    std::option::Option::Some("UNSUPPORTED_SYSTEM_OBJECTS")
14923                }
14924                Self::UnsupportedTablesWithReplicaIdentity => {
14925                    std::option::Option::Some("UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY")
14926                }
14927                Self::SelectedObjectsNotExistOnSource => {
14928                    std::option::Option::Some("SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE")
14929                }
14930                Self::PscOnlyInstanceWithNoNetworkAttachmentUri => {
14931                    std::option::Option::Some("PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI")
14932                }
14933                Self::SelectedObjectsReferenceUnselectedObjects => {
14934                    std::option::Option::Some("SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS")
14935                }
14936                Self::PromptDeleteExisting => std::option::Option::Some("PROMPT_DELETE_EXISTING"),
14937                Self::WillDeleteExisting => std::option::Option::Some("WILL_DELETE_EXISTING"),
14938                Self::PgDdlReplicationInsufficientPrivilege => {
14939                    std::option::Option::Some("PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE")
14940                }
14941                Self::UnknownValue(u) => u.0.name(),
14942            }
14943        }
14944    }
14945
14946    impl std::default::Default for SqlExternalSyncSettingErrorType {
14947        fn default() -> Self {
14948            use std::convert::From;
14949            Self::from(0)
14950        }
14951    }
14952
14953    impl std::fmt::Display for SqlExternalSyncSettingErrorType {
14954        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14955            wkt::internal::display_enum(f, self.name(), self.value())
14956        }
14957    }
14958
14959    impl std::convert::From<i32> for SqlExternalSyncSettingErrorType {
14960        fn from(value: i32) -> Self {
14961            match value {
14962                0 => Self::Unspecified,
14963                1 => Self::ConnectionFailure,
14964                2 => Self::BinlogNotEnabled,
14965                3 => Self::IncompatibleDatabaseVersion,
14966                4 => Self::ReplicaAlreadySetup,
14967                5 => Self::InsufficientPrivilege,
14968                6 => Self::UnsupportedMigrationType,
14969                7 => Self::NoPglogicalInstalled,
14970                8 => Self::PglogicalNodeAlreadyExists,
14971                9 => Self::InvalidWalLevel,
14972                10 => Self::InvalidSharedPreloadLibrary,
14973                11 => Self::InsufficientMaxReplicationSlots,
14974                12 => Self::InsufficientMaxWalSenders,
14975                13 => Self::InsufficientMaxWorkerProcesses,
14976                14 => Self::UnsupportedExtensions,
14977                15 => Self::InvalidRdsLogicalReplication,
14978                16 => Self::InvalidLoggingSetup,
14979                17 => Self::InvalidDbParam,
14980                18 => Self::UnsupportedGtidMode,
14981                19 => Self::SqlserverAgentNotRunning,
14982                20 => Self::UnsupportedTableDefinition,
14983                21 => Self::UnsupportedDefiner,
14984                22 => Self::SqlserverServernameMismatch,
14985                23 => Self::PrimaryAlreadySetup,
14986                24 => Self::UnsupportedBinlogFormat,
14987                25 => Self::BinlogRetentionSetting,
14988                26 => Self::UnsupportedStorageEngine,
14989                27 => Self::LimitedSupportTables,
14990                28 => Self::ExistingDataInReplica,
14991                29 => Self::MissingOptionalPrivileges,
14992                30 => Self::RiskyBackupAdminPrivilege,
14993                31 => Self::InsufficientGcsPermissions,
14994                32 => Self::InvalidFileInfo,
14995                33 => Self::UnsupportedDatabaseSettings,
14996                34 => Self::MysqlParallelImportInsufficientPrivilege,
14997                35 => Self::LocalInfileOff,
14998                36 => Self::TurnOnPitrAfterPromote,
14999                37 => Self::IncompatibleDatabaseMinorVersion,
15000                38 => Self::SourceMaxSubscriptions,
15001                39 => Self::UnableToVerifyDefiners,
15002                40 => Self::SubscriptionCalculationStatus,
15003                41 => Self::PgSubscriptionCount,
15004                42 => Self::PgSyncParallelLevel,
15005                43 => Self::InsufficientDiskSize,
15006                44 => Self::InsufficientMachineTier,
15007                45 => Self::UnsupportedExtensionsNotMigrated,
15008                46 => Self::ExtensionsNotMigrated,
15009                47 => Self::PgCronFlagEnabledInReplica,
15010                48 => Self::ExtensionsNotEnabledInReplica,
15011                49 => Self::UnsupportedColumns,
15012                50 => Self::UsersNotCreatedInReplica,
15013                51 => Self::UnsupportedSystemObjects,
15014                52 => Self::UnsupportedTablesWithReplicaIdentity,
15015                53 => Self::SelectedObjectsNotExistOnSource,
15016                54 => Self::PscOnlyInstanceWithNoNetworkAttachmentUri,
15017                55 => Self::SelectedObjectsReferenceUnselectedObjects,
15018                56 => Self::PromptDeleteExisting,
15019                57 => Self::WillDeleteExisting,
15020                58 => Self::PgDdlReplicationInsufficientPrivilege,
15021                _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
15022                    wkt::internal::UnknownEnumValue::Integer(value),
15023                )),
15024            }
15025        }
15026    }
15027
15028    impl std::convert::From<&str> for SqlExternalSyncSettingErrorType {
15029        fn from(value: &str) -> Self {
15030            use std::string::ToString;
15031            match value {
15032                "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
15033                "CONNECTION_FAILURE" => Self::ConnectionFailure,
15034                "BINLOG_NOT_ENABLED" => Self::BinlogNotEnabled,
15035                "INCOMPATIBLE_DATABASE_VERSION" => Self::IncompatibleDatabaseVersion,
15036                "REPLICA_ALREADY_SETUP" => Self::ReplicaAlreadySetup,
15037                "INSUFFICIENT_PRIVILEGE" => Self::InsufficientPrivilege,
15038                "UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
15039                "NO_PGLOGICAL_INSTALLED" => Self::NoPglogicalInstalled,
15040                "PGLOGICAL_NODE_ALREADY_EXISTS" => Self::PglogicalNodeAlreadyExists,
15041                "INVALID_WAL_LEVEL" => Self::InvalidWalLevel,
15042                "INVALID_SHARED_PRELOAD_LIBRARY" => Self::InvalidSharedPreloadLibrary,
15043                "INSUFFICIENT_MAX_REPLICATION_SLOTS" => Self::InsufficientMaxReplicationSlots,
15044                "INSUFFICIENT_MAX_WAL_SENDERS" => Self::InsufficientMaxWalSenders,
15045                "INSUFFICIENT_MAX_WORKER_PROCESSES" => Self::InsufficientMaxWorkerProcesses,
15046                "UNSUPPORTED_EXTENSIONS" => Self::UnsupportedExtensions,
15047                "INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
15048                "INVALID_LOGGING_SETUP" => Self::InvalidLoggingSetup,
15049                "INVALID_DB_PARAM" => Self::InvalidDbParam,
15050                "UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
15051                "SQLSERVER_AGENT_NOT_RUNNING" => Self::SqlserverAgentNotRunning,
15052                "UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
15053                "UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
15054                "SQLSERVER_SERVERNAME_MISMATCH" => Self::SqlserverServernameMismatch,
15055                "PRIMARY_ALREADY_SETUP" => Self::PrimaryAlreadySetup,
15056                "UNSUPPORTED_BINLOG_FORMAT" => Self::UnsupportedBinlogFormat,
15057                "BINLOG_RETENTION_SETTING" => Self::BinlogRetentionSetting,
15058                "UNSUPPORTED_STORAGE_ENGINE" => Self::UnsupportedStorageEngine,
15059                "LIMITED_SUPPORT_TABLES" => Self::LimitedSupportTables,
15060                "EXISTING_DATA_IN_REPLICA" => Self::ExistingDataInReplica,
15061                "MISSING_OPTIONAL_PRIVILEGES" => Self::MissingOptionalPrivileges,
15062                "RISKY_BACKUP_ADMIN_PRIVILEGE" => Self::RiskyBackupAdminPrivilege,
15063                "INSUFFICIENT_GCS_PERMISSIONS" => Self::InsufficientGcsPermissions,
15064                "INVALID_FILE_INFO" => Self::InvalidFileInfo,
15065                "UNSUPPORTED_DATABASE_SETTINGS" => Self::UnsupportedDatabaseSettings,
15066                "MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
15067                    Self::MysqlParallelImportInsufficientPrivilege
15068                }
15069                "LOCAL_INFILE_OFF" => Self::LocalInfileOff,
15070                "TURN_ON_PITR_AFTER_PROMOTE" => Self::TurnOnPitrAfterPromote,
15071                "INCOMPATIBLE_DATABASE_MINOR_VERSION" => Self::IncompatibleDatabaseMinorVersion,
15072                "SOURCE_MAX_SUBSCRIPTIONS" => Self::SourceMaxSubscriptions,
15073                "UNABLE_TO_VERIFY_DEFINERS" => Self::UnableToVerifyDefiners,
15074                "SUBSCRIPTION_CALCULATION_STATUS" => Self::SubscriptionCalculationStatus,
15075                "PG_SUBSCRIPTION_COUNT" => Self::PgSubscriptionCount,
15076                "PG_SYNC_PARALLEL_LEVEL" => Self::PgSyncParallelLevel,
15077                "INSUFFICIENT_DISK_SIZE" => Self::InsufficientDiskSize,
15078                "INSUFFICIENT_MACHINE_TIER" => Self::InsufficientMachineTier,
15079                "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED" => Self::UnsupportedExtensionsNotMigrated,
15080                "EXTENSIONS_NOT_MIGRATED" => Self::ExtensionsNotMigrated,
15081                "PG_CRON_FLAG_ENABLED_IN_REPLICA" => Self::PgCronFlagEnabledInReplica,
15082                "EXTENSIONS_NOT_ENABLED_IN_REPLICA" => Self::ExtensionsNotEnabledInReplica,
15083                "UNSUPPORTED_COLUMNS" => Self::UnsupportedColumns,
15084                "USERS_NOT_CREATED_IN_REPLICA" => Self::UsersNotCreatedInReplica,
15085                "UNSUPPORTED_SYSTEM_OBJECTS" => Self::UnsupportedSystemObjects,
15086                "UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY" => {
15087                    Self::UnsupportedTablesWithReplicaIdentity
15088                }
15089                "SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE" => Self::SelectedObjectsNotExistOnSource,
15090                "PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI" => {
15091                    Self::PscOnlyInstanceWithNoNetworkAttachmentUri
15092                }
15093                "SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS" => {
15094                    Self::SelectedObjectsReferenceUnselectedObjects
15095                }
15096                "PROMPT_DELETE_EXISTING" => Self::PromptDeleteExisting,
15097                "WILL_DELETE_EXISTING" => Self::WillDeleteExisting,
15098                "PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE" => {
15099                    Self::PgDdlReplicationInsufficientPrivilege
15100                }
15101                _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
15102                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15103                )),
15104            }
15105        }
15106    }
15107
15108    impl serde::ser::Serialize for SqlExternalSyncSettingErrorType {
15109        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15110        where
15111            S: serde::Serializer,
15112        {
15113            match self {
15114                Self::Unspecified => serializer.serialize_i32(0),
15115                Self::ConnectionFailure => serializer.serialize_i32(1),
15116                Self::BinlogNotEnabled => serializer.serialize_i32(2),
15117                Self::IncompatibleDatabaseVersion => serializer.serialize_i32(3),
15118                Self::ReplicaAlreadySetup => serializer.serialize_i32(4),
15119                Self::InsufficientPrivilege => serializer.serialize_i32(5),
15120                Self::UnsupportedMigrationType => serializer.serialize_i32(6),
15121                Self::NoPglogicalInstalled => serializer.serialize_i32(7),
15122                Self::PglogicalNodeAlreadyExists => serializer.serialize_i32(8),
15123                Self::InvalidWalLevel => serializer.serialize_i32(9),
15124                Self::InvalidSharedPreloadLibrary => serializer.serialize_i32(10),
15125                Self::InsufficientMaxReplicationSlots => serializer.serialize_i32(11),
15126                Self::InsufficientMaxWalSenders => serializer.serialize_i32(12),
15127                Self::InsufficientMaxWorkerProcesses => serializer.serialize_i32(13),
15128                Self::UnsupportedExtensions => serializer.serialize_i32(14),
15129                Self::InvalidRdsLogicalReplication => serializer.serialize_i32(15),
15130                Self::InvalidLoggingSetup => serializer.serialize_i32(16),
15131                Self::InvalidDbParam => serializer.serialize_i32(17),
15132                Self::UnsupportedGtidMode => serializer.serialize_i32(18),
15133                Self::SqlserverAgentNotRunning => serializer.serialize_i32(19),
15134                Self::UnsupportedTableDefinition => serializer.serialize_i32(20),
15135                Self::UnsupportedDefiner => serializer.serialize_i32(21),
15136                Self::SqlserverServernameMismatch => serializer.serialize_i32(22),
15137                Self::PrimaryAlreadySetup => serializer.serialize_i32(23),
15138                Self::UnsupportedBinlogFormat => serializer.serialize_i32(24),
15139                Self::BinlogRetentionSetting => serializer.serialize_i32(25),
15140                Self::UnsupportedStorageEngine => serializer.serialize_i32(26),
15141                Self::LimitedSupportTables => serializer.serialize_i32(27),
15142                Self::ExistingDataInReplica => serializer.serialize_i32(28),
15143                Self::MissingOptionalPrivileges => serializer.serialize_i32(29),
15144                Self::RiskyBackupAdminPrivilege => serializer.serialize_i32(30),
15145                Self::InsufficientGcsPermissions => serializer.serialize_i32(31),
15146                Self::InvalidFileInfo => serializer.serialize_i32(32),
15147                Self::UnsupportedDatabaseSettings => serializer.serialize_i32(33),
15148                Self::MysqlParallelImportInsufficientPrivilege => serializer.serialize_i32(34),
15149                Self::LocalInfileOff => serializer.serialize_i32(35),
15150                Self::TurnOnPitrAfterPromote => serializer.serialize_i32(36),
15151                Self::IncompatibleDatabaseMinorVersion => serializer.serialize_i32(37),
15152                Self::SourceMaxSubscriptions => serializer.serialize_i32(38),
15153                Self::UnableToVerifyDefiners => serializer.serialize_i32(39),
15154                Self::SubscriptionCalculationStatus => serializer.serialize_i32(40),
15155                Self::PgSubscriptionCount => serializer.serialize_i32(41),
15156                Self::PgSyncParallelLevel => serializer.serialize_i32(42),
15157                Self::InsufficientDiskSize => serializer.serialize_i32(43),
15158                Self::InsufficientMachineTier => serializer.serialize_i32(44),
15159                Self::UnsupportedExtensionsNotMigrated => serializer.serialize_i32(45),
15160                Self::ExtensionsNotMigrated => serializer.serialize_i32(46),
15161                Self::PgCronFlagEnabledInReplica => serializer.serialize_i32(47),
15162                Self::ExtensionsNotEnabledInReplica => serializer.serialize_i32(48),
15163                Self::UnsupportedColumns => serializer.serialize_i32(49),
15164                Self::UsersNotCreatedInReplica => serializer.serialize_i32(50),
15165                Self::UnsupportedSystemObjects => serializer.serialize_i32(51),
15166                Self::UnsupportedTablesWithReplicaIdentity => serializer.serialize_i32(52),
15167                Self::SelectedObjectsNotExistOnSource => serializer.serialize_i32(53),
15168                Self::PscOnlyInstanceWithNoNetworkAttachmentUri => serializer.serialize_i32(54),
15169                Self::SelectedObjectsReferenceUnselectedObjects => serializer.serialize_i32(55),
15170                Self::PromptDeleteExisting => serializer.serialize_i32(56),
15171                Self::WillDeleteExisting => serializer.serialize_i32(57),
15172                Self::PgDdlReplicationInsufficientPrivilege => serializer.serialize_i32(58),
15173                Self::UnknownValue(u) => u.0.serialize(serializer),
15174            }
15175        }
15176    }
15177
15178    impl<'de> serde::de::Deserialize<'de> for SqlExternalSyncSettingErrorType {
15179        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15180        where
15181            D: serde::Deserializer<'de>,
15182        {
15183            deserializer.deserialize_any(wkt::internal::EnumVisitor::<
15184                SqlExternalSyncSettingErrorType,
15185            >::new(
15186                ".google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType",
15187            ))
15188        }
15189    }
15190}
15191
15192/// A list of objects that the user selects for replication from an external
15193/// source instance.
15194#[derive(Clone, Default, PartialEq)]
15195#[non_exhaustive]
15196pub struct SelectedObjects {
15197    /// Required. The name of the database to migrate.
15198    pub database: std::string::String,
15199
15200    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15201}
15202
15203impl SelectedObjects {
15204    /// Creates a new default instance.
15205    pub fn new() -> Self {
15206        std::default::Default::default()
15207    }
15208
15209    /// Sets the value of [database][crate::model::SelectedObjects::database].
15210    ///
15211    /// # Example
15212    /// ```ignore,no_run
15213    /// # use google_cloud_sql_v1::model::SelectedObjects;
15214    /// let x = SelectedObjects::new().set_database("example");
15215    /// ```
15216    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15217        self.database = v.into();
15218        self
15219    }
15220}
15221
15222impl wkt::message::Message for SelectedObjects {
15223    fn typename() -> &'static str {
15224        "type.googleapis.com/google.cloud.sql.v1.SelectedObjects"
15225    }
15226}
15227
15228/// On-premises instance configuration.
15229#[derive(Clone, Default, PartialEq)]
15230#[non_exhaustive]
15231pub struct OnPremisesConfiguration {
15232    /// The host and port of the on-premises instance in host:port format
15233    pub host_port: std::string::String,
15234
15235    /// This is always `sql#onPremisesConfiguration`.
15236    pub kind: std::string::String,
15237
15238    /// The username for connecting to on-premises instance.
15239    pub username: std::string::String,
15240
15241    /// The password for connecting to on-premises instance.
15242    pub password: std::string::String,
15243
15244    /// PEM representation of the trusted CA's x509 certificate.
15245    pub ca_certificate: std::string::String,
15246
15247    /// PEM representation of the replica's x509 certificate.
15248    pub client_certificate: std::string::String,
15249
15250    /// PEM representation of the replica's private key. The corresponding public
15251    /// key is encoded in the client's certificate.
15252    pub client_key: std::string::String,
15253
15254    /// The dump file to create the Cloud SQL replica.
15255    pub dump_file_path: std::string::String,
15256
15257    /// The reference to Cloud SQL instance if the source is Cloud SQL.
15258    pub source_instance: std::option::Option<crate::model::InstanceReference>,
15259
15260    /// Optional. A list of objects that the user selects for replication from an
15261    /// external source instance.
15262    pub selected_objects: std::vec::Vec<crate::model::SelectedObjects>,
15263
15264    /// Optional. SSL option for replica connection to the on-premises source.
15265    pub ssl_option: crate::model::on_premises_configuration::SslOption,
15266
15267    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15268}
15269
15270impl OnPremisesConfiguration {
15271    /// Creates a new default instance.
15272    pub fn new() -> Self {
15273        std::default::Default::default()
15274    }
15275
15276    /// Sets the value of [host_port][crate::model::OnPremisesConfiguration::host_port].
15277    ///
15278    /// # Example
15279    /// ```ignore,no_run
15280    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15281    /// let x = OnPremisesConfiguration::new().set_host_port("example");
15282    /// ```
15283    pub fn set_host_port<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15284        self.host_port = v.into();
15285        self
15286    }
15287
15288    /// Sets the value of [kind][crate::model::OnPremisesConfiguration::kind].
15289    ///
15290    /// # Example
15291    /// ```ignore,no_run
15292    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15293    /// let x = OnPremisesConfiguration::new().set_kind("example");
15294    /// ```
15295    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15296        self.kind = v.into();
15297        self
15298    }
15299
15300    /// Sets the value of [username][crate::model::OnPremisesConfiguration::username].
15301    ///
15302    /// # Example
15303    /// ```ignore,no_run
15304    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15305    /// let x = OnPremisesConfiguration::new().set_username("example");
15306    /// ```
15307    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15308        self.username = v.into();
15309        self
15310    }
15311
15312    /// Sets the value of [password][crate::model::OnPremisesConfiguration::password].
15313    ///
15314    /// # Example
15315    /// ```ignore,no_run
15316    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15317    /// let x = OnPremisesConfiguration::new().set_password("example");
15318    /// ```
15319    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15320        self.password = v.into();
15321        self
15322    }
15323
15324    /// Sets the value of [ca_certificate][crate::model::OnPremisesConfiguration::ca_certificate].
15325    ///
15326    /// # Example
15327    /// ```ignore,no_run
15328    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15329    /// let x = OnPremisesConfiguration::new().set_ca_certificate("example");
15330    /// ```
15331    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15332        self.ca_certificate = v.into();
15333        self
15334    }
15335
15336    /// Sets the value of [client_certificate][crate::model::OnPremisesConfiguration::client_certificate].
15337    ///
15338    /// # Example
15339    /// ```ignore,no_run
15340    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15341    /// let x = OnPremisesConfiguration::new().set_client_certificate("example");
15342    /// ```
15343    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
15344        mut self,
15345        v: T,
15346    ) -> Self {
15347        self.client_certificate = v.into();
15348        self
15349    }
15350
15351    /// Sets the value of [client_key][crate::model::OnPremisesConfiguration::client_key].
15352    ///
15353    /// # Example
15354    /// ```ignore,no_run
15355    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15356    /// let x = OnPremisesConfiguration::new().set_client_key("example");
15357    /// ```
15358    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15359        self.client_key = v.into();
15360        self
15361    }
15362
15363    /// Sets the value of [dump_file_path][crate::model::OnPremisesConfiguration::dump_file_path].
15364    ///
15365    /// # Example
15366    /// ```ignore,no_run
15367    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15368    /// let x = OnPremisesConfiguration::new().set_dump_file_path("example");
15369    /// ```
15370    pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15371        self.dump_file_path = v.into();
15372        self
15373    }
15374
15375    /// Sets the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
15376    ///
15377    /// # Example
15378    /// ```ignore,no_run
15379    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15380    /// use google_cloud_sql_v1::model::InstanceReference;
15381    /// let x = OnPremisesConfiguration::new().set_source_instance(InstanceReference::default()/* use setters */);
15382    /// ```
15383    pub fn set_source_instance<T>(mut self, v: T) -> Self
15384    where
15385        T: std::convert::Into<crate::model::InstanceReference>,
15386    {
15387        self.source_instance = std::option::Option::Some(v.into());
15388        self
15389    }
15390
15391    /// Sets or clears the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
15392    ///
15393    /// # Example
15394    /// ```ignore,no_run
15395    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15396    /// use google_cloud_sql_v1::model::InstanceReference;
15397    /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(Some(InstanceReference::default()/* use setters */));
15398    /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(None::<InstanceReference>);
15399    /// ```
15400    pub fn set_or_clear_source_instance<T>(mut self, v: std::option::Option<T>) -> Self
15401    where
15402        T: std::convert::Into<crate::model::InstanceReference>,
15403    {
15404        self.source_instance = v.map(|x| x.into());
15405        self
15406    }
15407
15408    /// Sets the value of [selected_objects][crate::model::OnPremisesConfiguration::selected_objects].
15409    ///
15410    /// # Example
15411    /// ```ignore,no_run
15412    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15413    /// use google_cloud_sql_v1::model::SelectedObjects;
15414    /// let x = OnPremisesConfiguration::new()
15415    ///     .set_selected_objects([
15416    ///         SelectedObjects::default()/* use setters */,
15417    ///         SelectedObjects::default()/* use (different) setters */,
15418    ///     ]);
15419    /// ```
15420    pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
15421    where
15422        T: std::iter::IntoIterator<Item = V>,
15423        V: std::convert::Into<crate::model::SelectedObjects>,
15424    {
15425        use std::iter::Iterator;
15426        self.selected_objects = v.into_iter().map(|i| i.into()).collect();
15427        self
15428    }
15429
15430    /// Sets the value of [ssl_option][crate::model::OnPremisesConfiguration::ssl_option].
15431    ///
15432    /// # Example
15433    /// ```ignore,no_run
15434    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15435    /// use google_cloud_sql_v1::model::on_premises_configuration::SslOption;
15436    /// let x0 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Disable);
15437    /// let x1 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Require);
15438    /// let x2 = OnPremisesConfiguration::new().set_ssl_option(SslOption::VerifyCa);
15439    /// ```
15440    pub fn set_ssl_option<
15441        T: std::convert::Into<crate::model::on_premises_configuration::SslOption>,
15442    >(
15443        mut self,
15444        v: T,
15445    ) -> Self {
15446        self.ssl_option = v.into();
15447        self
15448    }
15449}
15450
15451impl wkt::message::Message for OnPremisesConfiguration {
15452    fn typename() -> &'static str {
15453        "type.googleapis.com/google.cloud.sql.v1.OnPremisesConfiguration"
15454    }
15455}
15456
15457/// Defines additional types related to [OnPremisesConfiguration].
15458pub mod on_premises_configuration {
15459    #[allow(unused_imports)]
15460    use super::*;
15461
15462    /// SslOption defines the SSL mode to be used for replica connection to the
15463    /// on-premises source.
15464    ///
15465    /// # Working with unknown values
15466    ///
15467    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15468    /// additional enum variants at any time. Adding new variants is not considered
15469    /// a breaking change. Applications should write their code in anticipation of:
15470    ///
15471    /// - New values appearing in future releases of the client library, **and**
15472    /// - New values received dynamically, without application changes.
15473    ///
15474    /// Please consult the [Working with enums] section in the user guide for some
15475    /// guidelines.
15476    ///
15477    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15478    #[derive(Clone, Debug, PartialEq)]
15479    #[non_exhaustive]
15480    pub enum SslOption {
15481        /// Unknown SSL option i.e. SSL option not specified by user.
15482        Unspecified,
15483        /// SSL is not used for replica connection to the on-premises source.
15484        Disable,
15485        /// SSL is required for replica connection to the on-premises source.
15486        Require,
15487        /// Verify CA is required for replica connection to the on-premises source.
15488        VerifyCa,
15489        /// If set, the enum was initialized with an unknown value.
15490        ///
15491        /// Applications can examine the value using [SslOption::value] or
15492        /// [SslOption::name].
15493        UnknownValue(ssl_option::UnknownValue),
15494    }
15495
15496    #[doc(hidden)]
15497    pub mod ssl_option {
15498        #[allow(unused_imports)]
15499        use super::*;
15500        #[derive(Clone, Debug, PartialEq)]
15501        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15502    }
15503
15504    impl SslOption {
15505        /// Gets the enum value.
15506        ///
15507        /// Returns `None` if the enum contains an unknown value deserialized from
15508        /// the string representation of enums.
15509        pub fn value(&self) -> std::option::Option<i32> {
15510            match self {
15511                Self::Unspecified => std::option::Option::Some(0),
15512                Self::Disable => std::option::Option::Some(1),
15513                Self::Require => std::option::Option::Some(2),
15514                Self::VerifyCa => std::option::Option::Some(3),
15515                Self::UnknownValue(u) => u.0.value(),
15516            }
15517        }
15518
15519        /// Gets the enum value as a string.
15520        ///
15521        /// Returns `None` if the enum contains an unknown value deserialized from
15522        /// the integer representation of enums.
15523        pub fn name(&self) -> std::option::Option<&str> {
15524            match self {
15525                Self::Unspecified => std::option::Option::Some("SSL_OPTION_UNSPECIFIED"),
15526                Self::Disable => std::option::Option::Some("DISABLE"),
15527                Self::Require => std::option::Option::Some("REQUIRE"),
15528                Self::VerifyCa => std::option::Option::Some("VERIFY_CA"),
15529                Self::UnknownValue(u) => u.0.name(),
15530            }
15531        }
15532    }
15533
15534    impl std::default::Default for SslOption {
15535        fn default() -> Self {
15536            use std::convert::From;
15537            Self::from(0)
15538        }
15539    }
15540
15541    impl std::fmt::Display for SslOption {
15542        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15543            wkt::internal::display_enum(f, self.name(), self.value())
15544        }
15545    }
15546
15547    impl std::convert::From<i32> for SslOption {
15548        fn from(value: i32) -> Self {
15549            match value {
15550                0 => Self::Unspecified,
15551                1 => Self::Disable,
15552                2 => Self::Require,
15553                3 => Self::VerifyCa,
15554                _ => Self::UnknownValue(ssl_option::UnknownValue(
15555                    wkt::internal::UnknownEnumValue::Integer(value),
15556                )),
15557            }
15558        }
15559    }
15560
15561    impl std::convert::From<&str> for SslOption {
15562        fn from(value: &str) -> Self {
15563            use std::string::ToString;
15564            match value {
15565                "SSL_OPTION_UNSPECIFIED" => Self::Unspecified,
15566                "DISABLE" => Self::Disable,
15567                "REQUIRE" => Self::Require,
15568                "VERIFY_CA" => Self::VerifyCa,
15569                _ => Self::UnknownValue(ssl_option::UnknownValue(
15570                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15571                )),
15572            }
15573        }
15574    }
15575
15576    impl serde::ser::Serialize for SslOption {
15577        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15578        where
15579            S: serde::Serializer,
15580        {
15581            match self {
15582                Self::Unspecified => serializer.serialize_i32(0),
15583                Self::Disable => serializer.serialize_i32(1),
15584                Self::Require => serializer.serialize_i32(2),
15585                Self::VerifyCa => serializer.serialize_i32(3),
15586                Self::UnknownValue(u) => u.0.serialize(serializer),
15587            }
15588        }
15589    }
15590
15591    impl<'de> serde::de::Deserialize<'de> for SslOption {
15592        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15593        where
15594            D: serde::Deserializer<'de>,
15595        {
15596            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslOption>::new(
15597                ".google.cloud.sql.v1.OnPremisesConfiguration.SslOption",
15598            ))
15599        }
15600    }
15601}
15602
15603/// Read-replica configuration for connecting to the primary instance.
15604#[derive(Clone, Default, PartialEq)]
15605#[non_exhaustive]
15606pub struct ReplicaConfiguration {
15607    /// This is always `sql#replicaConfiguration`.
15608    pub kind: std::string::String,
15609
15610    /// MySQL specific configuration when replicating from a MySQL on-premises
15611    /// primary instance. Replication configuration information such as the
15612    /// username, password, certificates, and keys are not stored in the instance
15613    /// metadata. The configuration information is used only to set up the
15614    /// replication connection and is stored by MySQL in a file named
15615    /// `master.info` in the data directory.
15616    pub mysql_replica_configuration: std::option::Option<crate::model::MySqlReplicaConfiguration>,
15617
15618    /// Specifies if the replica is the failover target. If the field is set to
15619    /// `true`, the replica will be designated as a failover replica. In case the
15620    /// primary instance fails, the replica instance will be promoted as the new
15621    /// primary instance. Only one replica can be specified as failover target, and
15622    /// the replica has to be in different zone with the primary instance.
15623    pub failover_target: std::option::Option<wkt::BoolValue>,
15624
15625    /// Optional. Specifies if a SQL Server replica is a cascadable replica. A
15626    /// cascadable replica is a SQL Server cross region replica that supports
15627    /// replica(s) under it.
15628    pub cascadable_replica: std::option::Option<wkt::BoolValue>,
15629
15630    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15631}
15632
15633impl ReplicaConfiguration {
15634    /// Creates a new default instance.
15635    pub fn new() -> Self {
15636        std::default::Default::default()
15637    }
15638
15639    /// Sets the value of [kind][crate::model::ReplicaConfiguration::kind].
15640    ///
15641    /// # Example
15642    /// ```ignore,no_run
15643    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15644    /// let x = ReplicaConfiguration::new().set_kind("example");
15645    /// ```
15646    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15647        self.kind = v.into();
15648        self
15649    }
15650
15651    /// Sets the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
15652    ///
15653    /// # Example
15654    /// ```ignore,no_run
15655    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15656    /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
15657    /// let x = ReplicaConfiguration::new().set_mysql_replica_configuration(MySqlReplicaConfiguration::default()/* use setters */);
15658    /// ```
15659    pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
15660    where
15661        T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
15662    {
15663        self.mysql_replica_configuration = std::option::Option::Some(v.into());
15664        self
15665    }
15666
15667    /// Sets or clears the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
15668    ///
15669    /// # Example
15670    /// ```ignore,no_run
15671    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15672    /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
15673    /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(Some(MySqlReplicaConfiguration::default()/* use setters */));
15674    /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(None::<MySqlReplicaConfiguration>);
15675    /// ```
15676    pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
15677    where
15678        T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
15679    {
15680        self.mysql_replica_configuration = v.map(|x| x.into());
15681        self
15682    }
15683
15684    /// Sets the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
15685    ///
15686    /// # Example
15687    /// ```ignore,no_run
15688    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15689    /// use wkt::BoolValue;
15690    /// let x = ReplicaConfiguration::new().set_failover_target(BoolValue::default()/* use setters */);
15691    /// ```
15692    pub fn set_failover_target<T>(mut self, v: T) -> Self
15693    where
15694        T: std::convert::Into<wkt::BoolValue>,
15695    {
15696        self.failover_target = std::option::Option::Some(v.into());
15697        self
15698    }
15699
15700    /// Sets or clears the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
15701    ///
15702    /// # Example
15703    /// ```ignore,no_run
15704    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15705    /// use wkt::BoolValue;
15706    /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(Some(BoolValue::default()/* use setters */));
15707    /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(None::<BoolValue>);
15708    /// ```
15709    pub fn set_or_clear_failover_target<T>(mut self, v: std::option::Option<T>) -> Self
15710    where
15711        T: std::convert::Into<wkt::BoolValue>,
15712    {
15713        self.failover_target = v.map(|x| x.into());
15714        self
15715    }
15716
15717    /// Sets the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
15718    ///
15719    /// # Example
15720    /// ```ignore,no_run
15721    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15722    /// use wkt::BoolValue;
15723    /// let x = ReplicaConfiguration::new().set_cascadable_replica(BoolValue::default()/* use setters */);
15724    /// ```
15725    pub fn set_cascadable_replica<T>(mut self, v: T) -> Self
15726    where
15727        T: std::convert::Into<wkt::BoolValue>,
15728    {
15729        self.cascadable_replica = std::option::Option::Some(v.into());
15730        self
15731    }
15732
15733    /// Sets or clears the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
15734    ///
15735    /// # Example
15736    /// ```ignore,no_run
15737    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15738    /// use wkt::BoolValue;
15739    /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(Some(BoolValue::default()/* use setters */));
15740    /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(None::<BoolValue>);
15741    /// ```
15742    pub fn set_or_clear_cascadable_replica<T>(mut self, v: std::option::Option<T>) -> Self
15743    where
15744        T: std::convert::Into<wkt::BoolValue>,
15745    {
15746        self.cascadable_replica = v.map(|x| x.into());
15747        self
15748    }
15749}
15750
15751impl wkt::message::Message for ReplicaConfiguration {
15752    fn typename() -> &'static str {
15753        "type.googleapis.com/google.cloud.sql.v1.ReplicaConfiguration"
15754    }
15755}
15756
15757/// Execute SQL statements request.
15758#[derive(Clone, Default, PartialEq)]
15759#[non_exhaustive]
15760pub struct SqlInstancesExecuteSqlRequest {
15761    /// Required. Database instance ID. This does not include the project ID.
15762    pub instance: std::string::String,
15763
15764    /// Required. Project ID of the project that contains the instance.
15765    pub project: std::string::String,
15766
15767    /// The request body.
15768    pub body: std::option::Option<crate::model::ExecuteSqlPayload>,
15769
15770    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15771}
15772
15773impl SqlInstancesExecuteSqlRequest {
15774    /// Creates a new default instance.
15775    pub fn new() -> Self {
15776        std::default::Default::default()
15777    }
15778
15779    /// Sets the value of [instance][crate::model::SqlInstancesExecuteSqlRequest::instance].
15780    ///
15781    /// # Example
15782    /// ```ignore,no_run
15783    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15784    /// let x = SqlInstancesExecuteSqlRequest::new().set_instance("example");
15785    /// ```
15786    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15787        self.instance = v.into();
15788        self
15789    }
15790
15791    /// Sets the value of [project][crate::model::SqlInstancesExecuteSqlRequest::project].
15792    ///
15793    /// # Example
15794    /// ```ignore,no_run
15795    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15796    /// let x = SqlInstancesExecuteSqlRequest::new().set_project("example");
15797    /// ```
15798    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15799        self.project = v.into();
15800        self
15801    }
15802
15803    /// Sets the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
15804    ///
15805    /// # Example
15806    /// ```ignore,no_run
15807    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15808    /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
15809    /// let x = SqlInstancesExecuteSqlRequest::new().set_body(ExecuteSqlPayload::default()/* use setters */);
15810    /// ```
15811    pub fn set_body<T>(mut self, v: T) -> Self
15812    where
15813        T: std::convert::Into<crate::model::ExecuteSqlPayload>,
15814    {
15815        self.body = std::option::Option::Some(v.into());
15816        self
15817    }
15818
15819    /// Sets or clears the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
15820    ///
15821    /// # Example
15822    /// ```ignore,no_run
15823    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15824    /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
15825    /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(Some(ExecuteSqlPayload::default()/* use setters */));
15826    /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(None::<ExecuteSqlPayload>);
15827    /// ```
15828    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15829    where
15830        T: std::convert::Into<crate::model::ExecuteSqlPayload>,
15831    {
15832        self.body = v.map(|x| x.into());
15833        self
15834    }
15835}
15836
15837impl wkt::message::Message for SqlInstancesExecuteSqlRequest {
15838    fn typename() -> &'static str {
15839        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlRequest"
15840    }
15841}
15842
15843/// The request payload used to execute SQL statements.
15844#[derive(Clone, Default, PartialEq)]
15845#[non_exhaustive]
15846pub struct ExecuteSqlPayload {
15847    /// Optional. The name of an existing database user to connect to the database.
15848    /// When `auto_iam_authn` is set to true, this field is ignored and the API
15849    /// caller's IAM user is used.
15850    pub user: std::string::String,
15851
15852    /// Required. SQL statements to run on the database. It can be a single
15853    /// statement or a sequence of statements separated by semicolons.
15854    pub sql_statement: std::string::String,
15855
15856    /// Optional. Name of the database on which the statement will be executed.
15857    pub database: std::string::String,
15858
15859    /// Optional. The maximum number of rows returned per SQL statement.
15860    pub row_limit: i64,
15861
15862    /// Optional. Controls how the API should respond when the SQL execution result
15863    /// is incomplete due to the size limit or another error. The default mode is
15864    /// to throw an error.
15865    pub partial_result_mode: crate::model::execute_sql_payload::PartialResultMode,
15866
15867    /// Optional. Specifies the name of the application that is making the request.
15868    /// This field is used for telemetry. Only alphanumeric characters, dashes, and
15869    /// underscores are allowed. The maximum length is 32 characters.
15870    pub application: std::string::String,
15871
15872    /// Credentials for the database connection.
15873    pub user_password: std::option::Option<crate::model::execute_sql_payload::UserPassword>,
15874
15875    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15876}
15877
15878impl ExecuteSqlPayload {
15879    /// Creates a new default instance.
15880    pub fn new() -> Self {
15881        std::default::Default::default()
15882    }
15883
15884    /// Sets the value of [user][crate::model::ExecuteSqlPayload::user].
15885    ///
15886    /// # Example
15887    /// ```ignore,no_run
15888    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15889    /// let x = ExecuteSqlPayload::new().set_user("example");
15890    /// ```
15891    pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15892        self.user = v.into();
15893        self
15894    }
15895
15896    /// Sets the value of [sql_statement][crate::model::ExecuteSqlPayload::sql_statement].
15897    ///
15898    /// # Example
15899    /// ```ignore,no_run
15900    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15901    /// let x = ExecuteSqlPayload::new().set_sql_statement("example");
15902    /// ```
15903    pub fn set_sql_statement<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15904        self.sql_statement = v.into();
15905        self
15906    }
15907
15908    /// Sets the value of [database][crate::model::ExecuteSqlPayload::database].
15909    ///
15910    /// # Example
15911    /// ```ignore,no_run
15912    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15913    /// let x = ExecuteSqlPayload::new().set_database("example");
15914    /// ```
15915    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15916        self.database = v.into();
15917        self
15918    }
15919
15920    /// Sets the value of [row_limit][crate::model::ExecuteSqlPayload::row_limit].
15921    ///
15922    /// # Example
15923    /// ```ignore,no_run
15924    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15925    /// let x = ExecuteSqlPayload::new().set_row_limit(42);
15926    /// ```
15927    pub fn set_row_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15928        self.row_limit = v.into();
15929        self
15930    }
15931
15932    /// Sets the value of [partial_result_mode][crate::model::ExecuteSqlPayload::partial_result_mode].
15933    ///
15934    /// # Example
15935    /// ```ignore,no_run
15936    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15937    /// use google_cloud_sql_v1::model::execute_sql_payload::PartialResultMode;
15938    /// let x0 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::FailPartialResult);
15939    /// let x1 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::AllowPartialResult);
15940    /// ```
15941    pub fn set_partial_result_mode<
15942        T: std::convert::Into<crate::model::execute_sql_payload::PartialResultMode>,
15943    >(
15944        mut self,
15945        v: T,
15946    ) -> Self {
15947        self.partial_result_mode = v.into();
15948        self
15949    }
15950
15951    /// Sets the value of [application][crate::model::ExecuteSqlPayload::application].
15952    ///
15953    /// # Example
15954    /// ```ignore,no_run
15955    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15956    /// let x = ExecuteSqlPayload::new().set_application("example");
15957    /// ```
15958    pub fn set_application<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15959        self.application = v.into();
15960        self
15961    }
15962
15963    /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password].
15964    ///
15965    /// Note that all the setters affecting `user_password` are mutually
15966    /// exclusive.
15967    ///
15968    /// # Example
15969    /// ```ignore,no_run
15970    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15971    /// use google_cloud_sql_v1::model::execute_sql_payload::UserPassword;
15972    /// let x = ExecuteSqlPayload::new().set_user_password(Some(UserPassword::AutoIamAuthn(true)));
15973    /// ```
15974    pub fn set_user_password<
15975        T: std::convert::Into<std::option::Option<crate::model::execute_sql_payload::UserPassword>>,
15976    >(
15977        mut self,
15978        v: T,
15979    ) -> Self {
15980        self.user_password = v.into();
15981        self
15982    }
15983
15984    /// The value of [user_password][crate::model::ExecuteSqlPayload::user_password]
15985    /// if it holds a `AutoIamAuthn`, `None` if the field is not set or
15986    /// holds a different branch.
15987    pub fn auto_iam_authn(&self) -> std::option::Option<&bool> {
15988        #[allow(unreachable_patterns)]
15989        self.user_password.as_ref().and_then(|v| match v {
15990            crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v) => {
15991                std::option::Option::Some(v)
15992            }
15993            _ => std::option::Option::None,
15994        })
15995    }
15996
15997    /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password]
15998    /// to hold a `AutoIamAuthn`.
15999    ///
16000    /// Note that all the setters affecting `user_password` are
16001    /// mutually exclusive.
16002    ///
16003    /// # Example
16004    /// ```ignore,no_run
16005    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16006    /// let x = ExecuteSqlPayload::new().set_auto_iam_authn(true);
16007    /// assert!(x.auto_iam_authn().is_some());
16008    /// ```
16009    pub fn set_auto_iam_authn<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16010        self.user_password = std::option::Option::Some(
16011            crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v.into()),
16012        );
16013        self
16014    }
16015}
16016
16017impl wkt::message::Message for ExecuteSqlPayload {
16018    fn typename() -> &'static str {
16019        "type.googleapis.com/google.cloud.sql.v1.ExecuteSqlPayload"
16020    }
16021}
16022
16023/// Defines additional types related to [ExecuteSqlPayload].
16024pub mod execute_sql_payload {
16025    #[allow(unused_imports)]
16026    use super::*;
16027
16028    /// Controls how the API should respond when the SQL execution result exceeds
16029    /// 10 MB.
16030    ///
16031    /// # Working with unknown values
16032    ///
16033    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16034    /// additional enum variants at any time. Adding new variants is not considered
16035    /// a breaking change. Applications should write their code in anticipation of:
16036    ///
16037    /// - New values appearing in future releases of the client library, **and**
16038    /// - New values received dynamically, without application changes.
16039    ///
16040    /// Please consult the [Working with enums] section in the user guide for some
16041    /// guidelines.
16042    ///
16043    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16044    #[derive(Clone, Debug, PartialEq)]
16045    #[non_exhaustive]
16046    pub enum PartialResultMode {
16047        /// Unspecified mode, effectively the same as `FAIL_PARTIAL_RESULT`.
16048        Unspecified,
16049        /// Throw an error if the result exceeds 10 MB or if only a partial result
16050        /// can be retrieved. Don't return the result.
16051        FailPartialResult,
16052        /// Return a truncated result and set `partial_result` to true if the result
16053        /// exceeds 10 MB or if only a partial result can be retrieved due to error.
16054        /// Don't throw an error.
16055        AllowPartialResult,
16056        /// If set, the enum was initialized with an unknown value.
16057        ///
16058        /// Applications can examine the value using [PartialResultMode::value] or
16059        /// [PartialResultMode::name].
16060        UnknownValue(partial_result_mode::UnknownValue),
16061    }
16062
16063    #[doc(hidden)]
16064    pub mod partial_result_mode {
16065        #[allow(unused_imports)]
16066        use super::*;
16067        #[derive(Clone, Debug, PartialEq)]
16068        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16069    }
16070
16071    impl PartialResultMode {
16072        /// Gets the enum value.
16073        ///
16074        /// Returns `None` if the enum contains an unknown value deserialized from
16075        /// the string representation of enums.
16076        pub fn value(&self) -> std::option::Option<i32> {
16077            match self {
16078                Self::Unspecified => std::option::Option::Some(0),
16079                Self::FailPartialResult => std::option::Option::Some(1),
16080                Self::AllowPartialResult => std::option::Option::Some(2),
16081                Self::UnknownValue(u) => u.0.value(),
16082            }
16083        }
16084
16085        /// Gets the enum value as a string.
16086        ///
16087        /// Returns `None` if the enum contains an unknown value deserialized from
16088        /// the integer representation of enums.
16089        pub fn name(&self) -> std::option::Option<&str> {
16090            match self {
16091                Self::Unspecified => std::option::Option::Some("PARTIAL_RESULT_MODE_UNSPECIFIED"),
16092                Self::FailPartialResult => std::option::Option::Some("FAIL_PARTIAL_RESULT"),
16093                Self::AllowPartialResult => std::option::Option::Some("ALLOW_PARTIAL_RESULT"),
16094                Self::UnknownValue(u) => u.0.name(),
16095            }
16096        }
16097    }
16098
16099    impl std::default::Default for PartialResultMode {
16100        fn default() -> Self {
16101            use std::convert::From;
16102            Self::from(0)
16103        }
16104    }
16105
16106    impl std::fmt::Display for PartialResultMode {
16107        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16108            wkt::internal::display_enum(f, self.name(), self.value())
16109        }
16110    }
16111
16112    impl std::convert::From<i32> for PartialResultMode {
16113        fn from(value: i32) -> Self {
16114            match value {
16115                0 => Self::Unspecified,
16116                1 => Self::FailPartialResult,
16117                2 => Self::AllowPartialResult,
16118                _ => Self::UnknownValue(partial_result_mode::UnknownValue(
16119                    wkt::internal::UnknownEnumValue::Integer(value),
16120                )),
16121            }
16122        }
16123    }
16124
16125    impl std::convert::From<&str> for PartialResultMode {
16126        fn from(value: &str) -> Self {
16127            use std::string::ToString;
16128            match value {
16129                "PARTIAL_RESULT_MODE_UNSPECIFIED" => Self::Unspecified,
16130                "FAIL_PARTIAL_RESULT" => Self::FailPartialResult,
16131                "ALLOW_PARTIAL_RESULT" => Self::AllowPartialResult,
16132                _ => Self::UnknownValue(partial_result_mode::UnknownValue(
16133                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16134                )),
16135            }
16136        }
16137    }
16138
16139    impl serde::ser::Serialize for PartialResultMode {
16140        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16141        where
16142            S: serde::Serializer,
16143        {
16144            match self {
16145                Self::Unspecified => serializer.serialize_i32(0),
16146                Self::FailPartialResult => serializer.serialize_i32(1),
16147                Self::AllowPartialResult => serializer.serialize_i32(2),
16148                Self::UnknownValue(u) => u.0.serialize(serializer),
16149            }
16150        }
16151    }
16152
16153    impl<'de> serde::de::Deserialize<'de> for PartialResultMode {
16154        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16155        where
16156            D: serde::Deserializer<'de>,
16157        {
16158            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PartialResultMode>::new(
16159                ".google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode",
16160            ))
16161        }
16162    }
16163
16164    /// Credentials for the database connection.
16165    #[derive(Clone, Debug, PartialEq)]
16166    #[non_exhaustive]
16167    pub enum UserPassword {
16168        /// Optional. When set to true, the API caller identity associated with the
16169        /// request is used for database authentication. The API caller must be an
16170        /// IAM user in the database.
16171        AutoIamAuthn(bool),
16172    }
16173}
16174
16175/// Execute SQL statements response.
16176#[derive(Clone, Default, PartialEq)]
16177#[non_exhaustive]
16178pub struct SqlInstancesExecuteSqlResponse {
16179    /// A list of notices and warnings generated during query execution.
16180    /// For PostgreSQL, this includes all notices and warnings.
16181    /// For MySQL, this includes warnings generated by the last executed statement.
16182    /// To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
16183    /// be executed after each statement.
16184    pub messages: std::vec::Vec<crate::model::sql_instances_execute_sql_response::Message>,
16185
16186    /// The additional metadata information regarding the execution of the SQL
16187    /// statements.
16188    pub metadata: std::option::Option<crate::model::Metadata>,
16189
16190    /// The list of results after executing all the SQL statements.
16191    pub results: std::vec::Vec<crate::model::QueryResult>,
16192
16193    /// Contains the error from the database if the SQL execution failed.
16194    pub status: std::option::Option<google_cloud_rpc::model::Status>,
16195
16196    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16197}
16198
16199impl SqlInstancesExecuteSqlResponse {
16200    /// Creates a new default instance.
16201    pub fn new() -> Self {
16202        std::default::Default::default()
16203    }
16204
16205    /// Sets the value of [messages][crate::model::SqlInstancesExecuteSqlResponse::messages].
16206    ///
16207    /// # Example
16208    /// ```ignore,no_run
16209    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16210    /// use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16211    /// let x = SqlInstancesExecuteSqlResponse::new()
16212    ///     .set_messages([
16213    ///         Message::default()/* use setters */,
16214    ///         Message::default()/* use (different) setters */,
16215    ///     ]);
16216    /// ```
16217    pub fn set_messages<T, V>(mut self, v: T) -> Self
16218    where
16219        T: std::iter::IntoIterator<Item = V>,
16220        V: std::convert::Into<crate::model::sql_instances_execute_sql_response::Message>,
16221    {
16222        use std::iter::Iterator;
16223        self.messages = v.into_iter().map(|i| i.into()).collect();
16224        self
16225    }
16226
16227    /// Sets the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
16228    ///
16229    /// # Example
16230    /// ```ignore,no_run
16231    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16232    /// use google_cloud_sql_v1::model::Metadata;
16233    /// let x = SqlInstancesExecuteSqlResponse::new().set_metadata(Metadata::default()/* use setters */);
16234    /// ```
16235    pub fn set_metadata<T>(mut self, v: T) -> Self
16236    where
16237        T: std::convert::Into<crate::model::Metadata>,
16238    {
16239        self.metadata = std::option::Option::Some(v.into());
16240        self
16241    }
16242
16243    /// Sets or clears the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
16244    ///
16245    /// # Example
16246    /// ```ignore,no_run
16247    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16248    /// use google_cloud_sql_v1::model::Metadata;
16249    /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
16250    /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(None::<Metadata>);
16251    /// ```
16252    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16253    where
16254        T: std::convert::Into<crate::model::Metadata>,
16255    {
16256        self.metadata = v.map(|x| x.into());
16257        self
16258    }
16259
16260    /// Sets the value of [results][crate::model::SqlInstancesExecuteSqlResponse::results].
16261    ///
16262    /// # Example
16263    /// ```ignore,no_run
16264    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16265    /// use google_cloud_sql_v1::model::QueryResult;
16266    /// let x = SqlInstancesExecuteSqlResponse::new()
16267    ///     .set_results([
16268    ///         QueryResult::default()/* use setters */,
16269    ///         QueryResult::default()/* use (different) setters */,
16270    ///     ]);
16271    /// ```
16272    pub fn set_results<T, V>(mut self, v: T) -> Self
16273    where
16274        T: std::iter::IntoIterator<Item = V>,
16275        V: std::convert::Into<crate::model::QueryResult>,
16276    {
16277        use std::iter::Iterator;
16278        self.results = v.into_iter().map(|i| i.into()).collect();
16279        self
16280    }
16281
16282    /// Sets the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
16283    ///
16284    /// # Example
16285    /// ```ignore,no_run
16286    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16287    /// use google_cloud_rpc::model::Status;
16288    /// let x = SqlInstancesExecuteSqlResponse::new().set_status(Status::default()/* use setters */);
16289    /// ```
16290    pub fn set_status<T>(mut self, v: T) -> Self
16291    where
16292        T: std::convert::Into<google_cloud_rpc::model::Status>,
16293    {
16294        self.status = std::option::Option::Some(v.into());
16295        self
16296    }
16297
16298    /// Sets or clears the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
16299    ///
16300    /// # Example
16301    /// ```ignore,no_run
16302    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16303    /// use google_cloud_rpc::model::Status;
16304    /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(Some(Status::default()/* use setters */));
16305    /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(None::<Status>);
16306    /// ```
16307    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
16308    where
16309        T: std::convert::Into<google_cloud_rpc::model::Status>,
16310    {
16311        self.status = v.map(|x| x.into());
16312        self
16313    }
16314}
16315
16316impl wkt::message::Message for SqlInstancesExecuteSqlResponse {
16317    fn typename() -> &'static str {
16318        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse"
16319    }
16320}
16321
16322/// Defines additional types related to [SqlInstancesExecuteSqlResponse].
16323pub mod sql_instances_execute_sql_response {
16324    #[allow(unused_imports)]
16325    use super::*;
16326
16327    /// Represents a notice or warning message from the database.
16328    #[derive(Clone, Default, PartialEq)]
16329    #[non_exhaustive]
16330    pub struct Message {
16331        /// The full message string.
16332        /// For PostgreSQL, this is a formatted string that may include severity,
16333        /// code, and the notice/warning message.
16334        /// For MySQL, this contains the warning message.
16335        pub message: std::option::Option<std::string::String>,
16336
16337        /// The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
16338        /// MySQL).
16339        pub severity: std::option::Option<std::string::String>,
16340
16341        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16342    }
16343
16344    impl Message {
16345        /// Creates a new default instance.
16346        pub fn new() -> Self {
16347            std::default::Default::default()
16348        }
16349
16350        /// Sets the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
16351        ///
16352        /// # Example
16353        /// ```ignore,no_run
16354        /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16355        /// let x = Message::new().set_message("example");
16356        /// ```
16357        pub fn set_message<T>(mut self, v: T) -> Self
16358        where
16359            T: std::convert::Into<std::string::String>,
16360        {
16361            self.message = std::option::Option::Some(v.into());
16362            self
16363        }
16364
16365        /// Sets or clears the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
16366        ///
16367        /// # Example
16368        /// ```ignore,no_run
16369        /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16370        /// let x = Message::new().set_or_clear_message(Some("example"));
16371        /// let x = Message::new().set_or_clear_message(None::<String>);
16372        /// ```
16373        pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
16374        where
16375            T: std::convert::Into<std::string::String>,
16376        {
16377            self.message = v.map(|x| x.into());
16378            self
16379        }
16380
16381        /// Sets the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
16382        ///
16383        /// # Example
16384        /// ```ignore,no_run
16385        /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16386        /// let x = Message::new().set_severity("example");
16387        /// ```
16388        pub fn set_severity<T>(mut self, v: T) -> Self
16389        where
16390            T: std::convert::Into<std::string::String>,
16391        {
16392            self.severity = std::option::Option::Some(v.into());
16393            self
16394        }
16395
16396        /// Sets or clears the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
16397        ///
16398        /// # Example
16399        /// ```ignore,no_run
16400        /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16401        /// let x = Message::new().set_or_clear_severity(Some("example"));
16402        /// let x = Message::new().set_or_clear_severity(None::<String>);
16403        /// ```
16404        pub fn set_or_clear_severity<T>(mut self, v: std::option::Option<T>) -> Self
16405        where
16406            T: std::convert::Into<std::string::String>,
16407        {
16408            self.severity = v.map(|x| x.into());
16409            self
16410        }
16411    }
16412
16413    impl wkt::message::Message for Message {
16414        fn typename() -> &'static str {
16415            "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message"
16416        }
16417    }
16418}
16419
16420/// QueryResult contains the result of executing a single SQL statement.
16421#[derive(Clone, Default, PartialEq)]
16422#[non_exhaustive]
16423pub struct QueryResult {
16424    /// List of columns included in the result. This also includes the data type
16425    /// of the column.
16426    pub columns: std::vec::Vec<crate::model::Column>,
16427
16428    /// Rows returned by the SQL statement.
16429    pub rows: std::vec::Vec<crate::model::Row>,
16430
16431    /// Message related to the SQL execution result.
16432    pub message: std::string::String,
16433
16434    /// Set to true if the SQL execution's result is truncated due to size limits
16435    /// or an error retrieving results.
16436    pub partial_result: bool,
16437
16438    /// If results were truncated due to an error, details of that error.
16439    pub status: std::option::Option<google_cloud_rpc::model::Status>,
16440
16441    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16442}
16443
16444impl QueryResult {
16445    /// Creates a new default instance.
16446    pub fn new() -> Self {
16447        std::default::Default::default()
16448    }
16449
16450    /// Sets the value of [columns][crate::model::QueryResult::columns].
16451    ///
16452    /// # Example
16453    /// ```ignore,no_run
16454    /// # use google_cloud_sql_v1::model::QueryResult;
16455    /// use google_cloud_sql_v1::model::Column;
16456    /// let x = QueryResult::new()
16457    ///     .set_columns([
16458    ///         Column::default()/* use setters */,
16459    ///         Column::default()/* use (different) setters */,
16460    ///     ]);
16461    /// ```
16462    pub fn set_columns<T, V>(mut self, v: T) -> Self
16463    where
16464        T: std::iter::IntoIterator<Item = V>,
16465        V: std::convert::Into<crate::model::Column>,
16466    {
16467        use std::iter::Iterator;
16468        self.columns = v.into_iter().map(|i| i.into()).collect();
16469        self
16470    }
16471
16472    /// Sets the value of [rows][crate::model::QueryResult::rows].
16473    ///
16474    /// # Example
16475    /// ```ignore,no_run
16476    /// # use google_cloud_sql_v1::model::QueryResult;
16477    /// use google_cloud_sql_v1::model::Row;
16478    /// let x = QueryResult::new()
16479    ///     .set_rows([
16480    ///         Row::default()/* use setters */,
16481    ///         Row::default()/* use (different) setters */,
16482    ///     ]);
16483    /// ```
16484    pub fn set_rows<T, V>(mut self, v: T) -> Self
16485    where
16486        T: std::iter::IntoIterator<Item = V>,
16487        V: std::convert::Into<crate::model::Row>,
16488    {
16489        use std::iter::Iterator;
16490        self.rows = v.into_iter().map(|i| i.into()).collect();
16491        self
16492    }
16493
16494    /// Sets the value of [message][crate::model::QueryResult::message].
16495    ///
16496    /// # Example
16497    /// ```ignore,no_run
16498    /// # use google_cloud_sql_v1::model::QueryResult;
16499    /// let x = QueryResult::new().set_message("example");
16500    /// ```
16501    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16502        self.message = v.into();
16503        self
16504    }
16505
16506    /// Sets the value of [partial_result][crate::model::QueryResult::partial_result].
16507    ///
16508    /// # Example
16509    /// ```ignore,no_run
16510    /// # use google_cloud_sql_v1::model::QueryResult;
16511    /// let x = QueryResult::new().set_partial_result(true);
16512    /// ```
16513    pub fn set_partial_result<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16514        self.partial_result = v.into();
16515        self
16516    }
16517
16518    /// Sets the value of [status][crate::model::QueryResult::status].
16519    ///
16520    /// # Example
16521    /// ```ignore,no_run
16522    /// # use google_cloud_sql_v1::model::QueryResult;
16523    /// use google_cloud_rpc::model::Status;
16524    /// let x = QueryResult::new().set_status(Status::default()/* use setters */);
16525    /// ```
16526    pub fn set_status<T>(mut self, v: T) -> Self
16527    where
16528        T: std::convert::Into<google_cloud_rpc::model::Status>,
16529    {
16530        self.status = std::option::Option::Some(v.into());
16531        self
16532    }
16533
16534    /// Sets or clears the value of [status][crate::model::QueryResult::status].
16535    ///
16536    /// # Example
16537    /// ```ignore,no_run
16538    /// # use google_cloud_sql_v1::model::QueryResult;
16539    /// use google_cloud_rpc::model::Status;
16540    /// let x = QueryResult::new().set_or_clear_status(Some(Status::default()/* use setters */));
16541    /// let x = QueryResult::new().set_or_clear_status(None::<Status>);
16542    /// ```
16543    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
16544    where
16545        T: std::convert::Into<google_cloud_rpc::model::Status>,
16546    {
16547        self.status = v.map(|x| x.into());
16548        self
16549    }
16550}
16551
16552impl wkt::message::Message for QueryResult {
16553    fn typename() -> &'static str {
16554        "type.googleapis.com/google.cloud.sql.v1.QueryResult"
16555    }
16556}
16557
16558/// Contains the name and datatype of a column.
16559#[derive(Clone, Default, PartialEq)]
16560#[non_exhaustive]
16561pub struct Column {
16562    /// Name of the column.
16563    pub name: std::string::String,
16564
16565    /// Datatype of the column.
16566    pub r#type: std::string::String,
16567
16568    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16569}
16570
16571impl Column {
16572    /// Creates a new default instance.
16573    pub fn new() -> Self {
16574        std::default::Default::default()
16575    }
16576
16577    /// Sets the value of [name][crate::model::Column::name].
16578    ///
16579    /// # Example
16580    /// ```ignore,no_run
16581    /// # use google_cloud_sql_v1::model::Column;
16582    /// let x = Column::new().set_name("example");
16583    /// ```
16584    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16585        self.name = v.into();
16586        self
16587    }
16588
16589    /// Sets the value of [r#type][crate::model::Column::type].
16590    ///
16591    /// # Example
16592    /// ```ignore,no_run
16593    /// # use google_cloud_sql_v1::model::Column;
16594    /// let x = Column::new().set_type("example");
16595    /// ```
16596    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16597        self.r#type = v.into();
16598        self
16599    }
16600}
16601
16602impl wkt::message::Message for Column {
16603    fn typename() -> &'static str {
16604        "type.googleapis.com/google.cloud.sql.v1.Column"
16605    }
16606}
16607
16608/// Contains the values for a row.
16609#[derive(Clone, Default, PartialEq)]
16610#[non_exhaustive]
16611pub struct Row {
16612    /// The values for the row.
16613    pub values: std::vec::Vec<crate::model::Value>,
16614
16615    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16616}
16617
16618impl Row {
16619    /// Creates a new default instance.
16620    pub fn new() -> Self {
16621        std::default::Default::default()
16622    }
16623
16624    /// Sets the value of [values][crate::model::Row::values].
16625    ///
16626    /// # Example
16627    /// ```ignore,no_run
16628    /// # use google_cloud_sql_v1::model::Row;
16629    /// use google_cloud_sql_v1::model::Value;
16630    /// let x = Row::new()
16631    ///     .set_values([
16632    ///         Value::default()/* use setters */,
16633    ///         Value::default()/* use (different) setters */,
16634    ///     ]);
16635    /// ```
16636    pub fn set_values<T, V>(mut self, v: T) -> Self
16637    where
16638        T: std::iter::IntoIterator<Item = V>,
16639        V: std::convert::Into<crate::model::Value>,
16640    {
16641        use std::iter::Iterator;
16642        self.values = v.into_iter().map(|i| i.into()).collect();
16643        self
16644    }
16645}
16646
16647impl wkt::message::Message for Row {
16648    fn typename() -> &'static str {
16649        "type.googleapis.com/google.cloud.sql.v1.Row"
16650    }
16651}
16652
16653/// The cell value of the table.
16654#[derive(Clone, Default, PartialEq)]
16655#[non_exhaustive]
16656pub struct Value {
16657    /// The cell value in string format.
16658    pub value: std::string::String,
16659
16660    /// If cell value is null, then this flag will be set to true.
16661    pub null_value: bool,
16662
16663    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16664}
16665
16666impl Value {
16667    /// Creates a new default instance.
16668    pub fn new() -> Self {
16669        std::default::Default::default()
16670    }
16671
16672    /// Sets the value of [value][crate::model::Value::value].
16673    ///
16674    /// # Example
16675    /// ```ignore,no_run
16676    /// # use google_cloud_sql_v1::model::Value;
16677    /// let x = Value::new().set_value("example");
16678    /// ```
16679    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16680        self.value = v.into();
16681        self
16682    }
16683
16684    /// Sets the value of [null_value][crate::model::Value::null_value].
16685    ///
16686    /// # Example
16687    /// ```ignore,no_run
16688    /// # use google_cloud_sql_v1::model::Value;
16689    /// let x = Value::new().set_null_value(true);
16690    /// ```
16691    pub fn set_null_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16692        self.null_value = v.into();
16693        self
16694    }
16695}
16696
16697impl wkt::message::Message for Value {
16698    fn typename() -> &'static str {
16699        "type.googleapis.com/google.cloud.sql.v1.Value"
16700    }
16701}
16702
16703/// The additional metadata information regarding the execution of the SQL
16704/// statements.
16705#[derive(Clone, Default, PartialEq)]
16706#[non_exhaustive]
16707pub struct Metadata {
16708    /// The time taken to execute the SQL statements.
16709    pub sql_statement_execution_time: std::option::Option<wkt::Duration>,
16710
16711    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16712}
16713
16714impl Metadata {
16715    /// Creates a new default instance.
16716    pub fn new() -> Self {
16717        std::default::Default::default()
16718    }
16719
16720    /// Sets the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
16721    ///
16722    /// # Example
16723    /// ```ignore,no_run
16724    /// # use google_cloud_sql_v1::model::Metadata;
16725    /// use wkt::Duration;
16726    /// let x = Metadata::new().set_sql_statement_execution_time(Duration::default()/* use setters */);
16727    /// ```
16728    pub fn set_sql_statement_execution_time<T>(mut self, v: T) -> Self
16729    where
16730        T: std::convert::Into<wkt::Duration>,
16731    {
16732        self.sql_statement_execution_time = std::option::Option::Some(v.into());
16733        self
16734    }
16735
16736    /// Sets or clears the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
16737    ///
16738    /// # Example
16739    /// ```ignore,no_run
16740    /// # use google_cloud_sql_v1::model::Metadata;
16741    /// use wkt::Duration;
16742    /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(Some(Duration::default()/* use setters */));
16743    /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(None::<Duration>);
16744    /// ```
16745    pub fn set_or_clear_sql_statement_execution_time<T>(mut self, v: std::option::Option<T>) -> Self
16746    where
16747        T: std::convert::Into<wkt::Duration>,
16748    {
16749        self.sql_statement_execution_time = v.map(|x| x.into());
16750        self
16751    }
16752}
16753
16754impl wkt::message::Message for Metadata {
16755    fn typename() -> &'static str {
16756        "type.googleapis.com/google.cloud.sql.v1.Metadata"
16757    }
16758}
16759
16760/// Request to acquire a lease for SSRS.
16761#[derive(Clone, Default, PartialEq)]
16762#[non_exhaustive]
16763pub struct SqlInstancesAcquireSsrsLeaseRequest {
16764    /// Required. Cloud SQL instance ID. This doesn't include the project ID. It's
16765    /// composed of lowercase letters, numbers, and hyphens, and it must start with
16766    /// a letter. The total length must be 98 characters or less (Example:
16767    /// instance-id).
16768    pub instance: std::string::String,
16769
16770    /// Required. Project ID of the project that contains the instance (Example:
16771    /// project-id).
16772    pub project: std::string::String,
16773
16774    /// Required. The request body.
16775    pub body: std::option::Option<crate::model::InstancesAcquireSsrsLeaseRequest>,
16776
16777    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16778}
16779
16780impl SqlInstancesAcquireSsrsLeaseRequest {
16781    /// Creates a new default instance.
16782    pub fn new() -> Self {
16783        std::default::Default::default()
16784    }
16785
16786    /// Sets the value of [instance][crate::model::SqlInstancesAcquireSsrsLeaseRequest::instance].
16787    ///
16788    /// # Example
16789    /// ```ignore,no_run
16790    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16791    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_instance("example");
16792    /// ```
16793    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16794        self.instance = v.into();
16795        self
16796    }
16797
16798    /// Sets the value of [project][crate::model::SqlInstancesAcquireSsrsLeaseRequest::project].
16799    ///
16800    /// # Example
16801    /// ```ignore,no_run
16802    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16803    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_project("example");
16804    /// ```
16805    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16806        self.project = v.into();
16807        self
16808    }
16809
16810    /// Sets the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
16811    ///
16812    /// # Example
16813    /// ```ignore,no_run
16814    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16815    /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
16816    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_body(InstancesAcquireSsrsLeaseRequest::default()/* use setters */);
16817    /// ```
16818    pub fn set_body<T>(mut self, v: T) -> Self
16819    where
16820        T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
16821    {
16822        self.body = std::option::Option::Some(v.into());
16823        self
16824    }
16825
16826    /// Sets or clears the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
16827    ///
16828    /// # Example
16829    /// ```ignore,no_run
16830    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16831    /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
16832    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(Some(InstancesAcquireSsrsLeaseRequest::default()/* use setters */));
16833    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(None::<InstancesAcquireSsrsLeaseRequest>);
16834    /// ```
16835    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16836    where
16837        T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
16838    {
16839        self.body = v.map(|x| x.into());
16840        self
16841    }
16842}
16843
16844impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseRequest {
16845    fn typename() -> &'static str {
16846        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest"
16847    }
16848}
16849
16850/// Response for the acquire SSRS lease request.
16851#[derive(Clone, Default, PartialEq)]
16852#[non_exhaustive]
16853pub struct SqlInstancesAcquireSsrsLeaseResponse {
16854    /// The unique identifier for this operation.
16855    pub operation_id: std::string::String,
16856
16857    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16858}
16859
16860impl SqlInstancesAcquireSsrsLeaseResponse {
16861    /// Creates a new default instance.
16862    pub fn new() -> Self {
16863        std::default::Default::default()
16864    }
16865
16866    /// Sets the value of [operation_id][crate::model::SqlInstancesAcquireSsrsLeaseResponse::operation_id].
16867    ///
16868    /// # Example
16869    /// ```ignore,no_run
16870    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseResponse;
16871    /// let x = SqlInstancesAcquireSsrsLeaseResponse::new().set_operation_id("example");
16872    /// ```
16873    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16874        self.operation_id = v.into();
16875        self
16876    }
16877}
16878
16879impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseResponse {
16880    fn typename() -> &'static str {
16881        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse"
16882    }
16883}
16884
16885/// Request to release a lease for SSRS.
16886#[derive(Clone, Default, PartialEq)]
16887#[non_exhaustive]
16888pub struct SqlInstancesReleaseSsrsLeaseRequest {
16889    /// Required. The Cloud SQL instance ID. This doesn't include the project ID.
16890    /// The instance ID contains lowercase letters, numbers, and hyphens, and it
16891    /// must start with a letter. This ID can have a maximum length of 98
16892    /// characters.
16893    pub instance: std::string::String,
16894
16895    /// Required. The project ID that contains the instance.
16896    pub project: std::string::String,
16897
16898    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16899}
16900
16901impl SqlInstancesReleaseSsrsLeaseRequest {
16902    /// Creates a new default instance.
16903    pub fn new() -> Self {
16904        std::default::Default::default()
16905    }
16906
16907    /// Sets the value of [instance][crate::model::SqlInstancesReleaseSsrsLeaseRequest::instance].
16908    ///
16909    /// # Example
16910    /// ```ignore,no_run
16911    /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
16912    /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_instance("example");
16913    /// ```
16914    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16915        self.instance = v.into();
16916        self
16917    }
16918
16919    /// Sets the value of [project][crate::model::SqlInstancesReleaseSsrsLeaseRequest::project].
16920    ///
16921    /// # Example
16922    /// ```ignore,no_run
16923    /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
16924    /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_project("example");
16925    /// ```
16926    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16927        self.project = v.into();
16928        self
16929    }
16930}
16931
16932impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseRequest {
16933    fn typename() -> &'static str {
16934        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest"
16935    }
16936}
16937
16938/// Response for the release SSRS lease request.
16939#[derive(Clone, Default, PartialEq)]
16940#[non_exhaustive]
16941pub struct SqlInstancesReleaseSsrsLeaseResponse {
16942    /// The unique identifier for this operation.
16943    pub operation_id: std::string::String,
16944
16945    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16946}
16947
16948impl SqlInstancesReleaseSsrsLeaseResponse {
16949    /// Creates a new default instance.
16950    pub fn new() -> Self {
16951        std::default::Default::default()
16952    }
16953
16954    /// Sets the value of [operation_id][crate::model::SqlInstancesReleaseSsrsLeaseResponse::operation_id].
16955    ///
16956    /// # Example
16957    /// ```ignore,no_run
16958    /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseResponse;
16959    /// let x = SqlInstancesReleaseSsrsLeaseResponse::new().set_operation_id("example");
16960    /// ```
16961    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16962        self.operation_id = v.into();
16963        self
16964    }
16965}
16966
16967impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseResponse {
16968    fn typename() -> &'static str {
16969        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse"
16970    }
16971}
16972
16973/// Request to perform a point in time restore on a Google Cloud Backup and
16974/// Disaster Recovery managed instance.
16975#[derive(Clone, Default, PartialEq)]
16976#[non_exhaustive]
16977pub struct SqlInstancesPointInTimeRestoreRequest {
16978    /// Required. The parent resource where you created this instance.
16979    /// Format: projects/{project}
16980    pub parent: std::string::String,
16981
16982    /// Required. The context for request to perform a PITR on a Google Cloud
16983    /// Backup and Disaster Recovery managed instance.
16984    pub context: std::option::Option<crate::model::PointInTimeRestoreContext>,
16985
16986    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16987}
16988
16989impl SqlInstancesPointInTimeRestoreRequest {
16990    /// Creates a new default instance.
16991    pub fn new() -> Self {
16992        std::default::Default::default()
16993    }
16994
16995    /// Sets the value of [parent][crate::model::SqlInstancesPointInTimeRestoreRequest::parent].
16996    ///
16997    /// # Example
16998    /// ```ignore,no_run
16999    /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
17000    /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_parent("example");
17001    /// ```
17002    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17003        self.parent = v.into();
17004        self
17005    }
17006
17007    /// Sets the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
17008    ///
17009    /// # Example
17010    /// ```ignore,no_run
17011    /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
17012    /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
17013    /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_context(PointInTimeRestoreContext::default()/* use setters */);
17014    /// ```
17015    pub fn set_context<T>(mut self, v: T) -> Self
17016    where
17017        T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
17018    {
17019        self.context = std::option::Option::Some(v.into());
17020        self
17021    }
17022
17023    /// Sets or clears the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
17024    ///
17025    /// # Example
17026    /// ```ignore,no_run
17027    /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
17028    /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
17029    /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(Some(PointInTimeRestoreContext::default()/* use setters */));
17030    /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(None::<PointInTimeRestoreContext>);
17031    /// ```
17032    pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
17033    where
17034        T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
17035    {
17036        self.context = v.map(|x| x.into());
17037        self
17038    }
17039}
17040
17041impl wkt::message::Message for SqlInstancesPointInTimeRestoreRequest {
17042    fn typename() -> &'static str {
17043        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest"
17044    }
17045}
17046
17047/// Operations get request.
17048#[derive(Clone, Default, PartialEq)]
17049#[non_exhaustive]
17050pub struct SqlOperationsGetRequest {
17051    /// Required. Instance operation ID.
17052    pub operation: std::string::String,
17053
17054    /// Required. Project ID of the project that contains the instance.
17055    pub project: std::string::String,
17056
17057    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17058}
17059
17060impl SqlOperationsGetRequest {
17061    /// Creates a new default instance.
17062    pub fn new() -> Self {
17063        std::default::Default::default()
17064    }
17065
17066    /// Sets the value of [operation][crate::model::SqlOperationsGetRequest::operation].
17067    ///
17068    /// # Example
17069    /// ```ignore,no_run
17070    /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
17071    /// let x = SqlOperationsGetRequest::new().set_operation("example");
17072    /// ```
17073    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17074        self.operation = v.into();
17075        self
17076    }
17077
17078    /// Sets the value of [project][crate::model::SqlOperationsGetRequest::project].
17079    ///
17080    /// # Example
17081    /// ```ignore,no_run
17082    /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
17083    /// let x = SqlOperationsGetRequest::new().set_project("example");
17084    /// ```
17085    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17086        self.project = v.into();
17087        self
17088    }
17089}
17090
17091impl wkt::message::Message for SqlOperationsGetRequest {
17092    fn typename() -> &'static str {
17093        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsGetRequest"
17094    }
17095}
17096
17097/// Operations list request.
17098#[derive(Clone, Default, PartialEq)]
17099#[non_exhaustive]
17100pub struct SqlOperationsListRequest {
17101    /// Cloud SQL instance ID. This does not include the project ID.
17102    pub instance: std::string::String,
17103
17104    /// Maximum number of operations per response.
17105    pub max_results: u32,
17106
17107    /// A previously-returned page token representing part of the larger set of
17108    /// results to view.
17109    pub page_token: std::string::String,
17110
17111    /// Project ID of the project that contains the instance.
17112    pub project: std::string::String,
17113
17114    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17115}
17116
17117impl SqlOperationsListRequest {
17118    /// Creates a new default instance.
17119    pub fn new() -> Self {
17120        std::default::Default::default()
17121    }
17122
17123    /// Sets the value of [instance][crate::model::SqlOperationsListRequest::instance].
17124    ///
17125    /// # Example
17126    /// ```ignore,no_run
17127    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17128    /// let x = SqlOperationsListRequest::new().set_instance("example");
17129    /// ```
17130    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17131        self.instance = v.into();
17132        self
17133    }
17134
17135    /// Sets the value of [max_results][crate::model::SqlOperationsListRequest::max_results].
17136    ///
17137    /// # Example
17138    /// ```ignore,no_run
17139    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17140    /// let x = SqlOperationsListRequest::new().set_max_results(42_u32);
17141    /// ```
17142    pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
17143        self.max_results = v.into();
17144        self
17145    }
17146
17147    /// Sets the value of [page_token][crate::model::SqlOperationsListRequest::page_token].
17148    ///
17149    /// # Example
17150    /// ```ignore,no_run
17151    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17152    /// let x = SqlOperationsListRequest::new().set_page_token("example");
17153    /// ```
17154    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17155        self.page_token = v.into();
17156        self
17157    }
17158
17159    /// Sets the value of [project][crate::model::SqlOperationsListRequest::project].
17160    ///
17161    /// # Example
17162    /// ```ignore,no_run
17163    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17164    /// let x = SqlOperationsListRequest::new().set_project("example");
17165    /// ```
17166    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17167        self.project = v.into();
17168        self
17169    }
17170}
17171
17172impl wkt::message::Message for SqlOperationsListRequest {
17173    fn typename() -> &'static str {
17174        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsListRequest"
17175    }
17176}
17177
17178/// Operations list response.
17179#[derive(Clone, Default, PartialEq)]
17180#[non_exhaustive]
17181pub struct OperationsListResponse {
17182    /// This is always `sql#operationsList`.
17183    pub kind: std::string::String,
17184
17185    /// List of operation resources.
17186    pub items: std::vec::Vec<crate::model::Operation>,
17187
17188    /// The continuation token, used to page through large result sets. Provide
17189    /// this value in a subsequent request to return the next page of results.
17190    pub next_page_token: std::string::String,
17191
17192    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17193}
17194
17195impl OperationsListResponse {
17196    /// Creates a new default instance.
17197    pub fn new() -> Self {
17198        std::default::Default::default()
17199    }
17200
17201    /// Sets the value of [kind][crate::model::OperationsListResponse::kind].
17202    ///
17203    /// # Example
17204    /// ```ignore,no_run
17205    /// # use google_cloud_sql_v1::model::OperationsListResponse;
17206    /// let x = OperationsListResponse::new().set_kind("example");
17207    /// ```
17208    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17209        self.kind = v.into();
17210        self
17211    }
17212
17213    /// Sets the value of [items][crate::model::OperationsListResponse::items].
17214    ///
17215    /// # Example
17216    /// ```ignore,no_run
17217    /// # use google_cloud_sql_v1::model::OperationsListResponse;
17218    /// use google_cloud_sql_v1::model::Operation;
17219    /// let x = OperationsListResponse::new()
17220    ///     .set_items([
17221    ///         Operation::default()/* use setters */,
17222    ///         Operation::default()/* use (different) setters */,
17223    ///     ]);
17224    /// ```
17225    pub fn set_items<T, V>(mut self, v: T) -> Self
17226    where
17227        T: std::iter::IntoIterator<Item = V>,
17228        V: std::convert::Into<crate::model::Operation>,
17229    {
17230        use std::iter::Iterator;
17231        self.items = v.into_iter().map(|i| i.into()).collect();
17232        self
17233    }
17234
17235    /// Sets the value of [next_page_token][crate::model::OperationsListResponse::next_page_token].
17236    ///
17237    /// # Example
17238    /// ```ignore,no_run
17239    /// # use google_cloud_sql_v1::model::OperationsListResponse;
17240    /// let x = OperationsListResponse::new().set_next_page_token("example");
17241    /// ```
17242    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17243        self.next_page_token = v.into();
17244        self
17245    }
17246}
17247
17248impl wkt::message::Message for OperationsListResponse {
17249    fn typename() -> &'static str {
17250        "type.googleapis.com/google.cloud.sql.v1.OperationsListResponse"
17251    }
17252}
17253
17254#[doc(hidden)]
17255impl google_cloud_gax::paginator::internal::PageableResponse for OperationsListResponse {
17256    type PageItem = crate::model::Operation;
17257
17258    fn items(self) -> std::vec::Vec<Self::PageItem> {
17259        self.items
17260    }
17261
17262    fn next_page_token(&self) -> std::string::String {
17263        use std::clone::Clone;
17264        self.next_page_token.clone()
17265    }
17266}
17267
17268/// Operations cancel request.
17269#[derive(Clone, Default, PartialEq)]
17270#[non_exhaustive]
17271pub struct SqlOperationsCancelRequest {
17272    /// Instance operation ID.
17273    pub operation: std::string::String,
17274
17275    /// Project ID of the project that contains the instance.
17276    pub project: std::string::String,
17277
17278    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17279}
17280
17281impl SqlOperationsCancelRequest {
17282    /// Creates a new default instance.
17283    pub fn new() -> Self {
17284        std::default::Default::default()
17285    }
17286
17287    /// Sets the value of [operation][crate::model::SqlOperationsCancelRequest::operation].
17288    ///
17289    /// # Example
17290    /// ```ignore,no_run
17291    /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
17292    /// let x = SqlOperationsCancelRequest::new().set_operation("example");
17293    /// ```
17294    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17295        self.operation = v.into();
17296        self
17297    }
17298
17299    /// Sets the value of [project][crate::model::SqlOperationsCancelRequest::project].
17300    ///
17301    /// # Example
17302    /// ```ignore,no_run
17303    /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
17304    /// let x = SqlOperationsCancelRequest::new().set_project("example");
17305    /// ```
17306    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17307        self.project = v.into();
17308        self
17309    }
17310}
17311
17312impl wkt::message::Message for SqlOperationsCancelRequest {
17313    fn typename() -> &'static str {
17314        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsCancelRequest"
17315    }
17316}
17317
17318/// An entry for an Access Control list.
17319#[derive(Clone, Default, PartialEq)]
17320#[non_exhaustive]
17321pub struct AclEntry {
17322    /// The allowlisted value for the access control list.
17323    pub value: std::string::String,
17324
17325    /// The time when this access control entry expires in
17326    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
17327    /// `2012-11-15T16:19:00.094Z`.
17328    pub expiration_time: std::option::Option<wkt::Timestamp>,
17329
17330    /// Optional. A label to identify this entry.
17331    pub name: std::string::String,
17332
17333    /// This is always `sql#aclEntry`.
17334    pub kind: std::string::String,
17335
17336    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17337}
17338
17339impl AclEntry {
17340    /// Creates a new default instance.
17341    pub fn new() -> Self {
17342        std::default::Default::default()
17343    }
17344
17345    /// Sets the value of [value][crate::model::AclEntry::value].
17346    ///
17347    /// # Example
17348    /// ```ignore,no_run
17349    /// # use google_cloud_sql_v1::model::AclEntry;
17350    /// let x = AclEntry::new().set_value("example");
17351    /// ```
17352    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17353        self.value = v.into();
17354        self
17355    }
17356
17357    /// Sets the value of [expiration_time][crate::model::AclEntry::expiration_time].
17358    ///
17359    /// # Example
17360    /// ```ignore,no_run
17361    /// # use google_cloud_sql_v1::model::AclEntry;
17362    /// use wkt::Timestamp;
17363    /// let x = AclEntry::new().set_expiration_time(Timestamp::default()/* use setters */);
17364    /// ```
17365    pub fn set_expiration_time<T>(mut self, v: T) -> Self
17366    where
17367        T: std::convert::Into<wkt::Timestamp>,
17368    {
17369        self.expiration_time = std::option::Option::Some(v.into());
17370        self
17371    }
17372
17373    /// Sets or clears the value of [expiration_time][crate::model::AclEntry::expiration_time].
17374    ///
17375    /// # Example
17376    /// ```ignore,no_run
17377    /// # use google_cloud_sql_v1::model::AclEntry;
17378    /// use wkt::Timestamp;
17379    /// let x = AclEntry::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
17380    /// let x = AclEntry::new().set_or_clear_expiration_time(None::<Timestamp>);
17381    /// ```
17382    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
17383    where
17384        T: std::convert::Into<wkt::Timestamp>,
17385    {
17386        self.expiration_time = v.map(|x| x.into());
17387        self
17388    }
17389
17390    /// Sets the value of [name][crate::model::AclEntry::name].
17391    ///
17392    /// # Example
17393    /// ```ignore,no_run
17394    /// # use google_cloud_sql_v1::model::AclEntry;
17395    /// let x = AclEntry::new().set_name("example");
17396    /// ```
17397    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17398        self.name = v.into();
17399        self
17400    }
17401
17402    /// Sets the value of [kind][crate::model::AclEntry::kind].
17403    ///
17404    /// # Example
17405    /// ```ignore,no_run
17406    /// # use google_cloud_sql_v1::model::AclEntry;
17407    /// let x = AclEntry::new().set_kind("example");
17408    /// ```
17409    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17410        self.kind = v.into();
17411        self
17412    }
17413}
17414
17415impl wkt::message::Message for AclEntry {
17416    fn typename() -> &'static str {
17417        "type.googleapis.com/google.cloud.sql.v1.AclEntry"
17418    }
17419}
17420
17421/// An Admin API warning message.
17422#[derive(Clone, Default, PartialEq)]
17423#[non_exhaustive]
17424pub struct ApiWarning {
17425    /// Code to uniquely identify the warning type.
17426    pub code: crate::model::api_warning::SqlApiWarningCode,
17427
17428    /// The warning message.
17429    pub message: std::string::String,
17430
17431    /// The region name for REGION_UNREACHABLE warning.
17432    pub region: std::string::String,
17433
17434    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17435}
17436
17437impl ApiWarning {
17438    /// Creates a new default instance.
17439    pub fn new() -> Self {
17440        std::default::Default::default()
17441    }
17442
17443    /// Sets the value of [code][crate::model::ApiWarning::code].
17444    ///
17445    /// # Example
17446    /// ```ignore,no_run
17447    /// # use google_cloud_sql_v1::model::ApiWarning;
17448    /// use google_cloud_sql_v1::model::api_warning::SqlApiWarningCode;
17449    /// let x0 = ApiWarning::new().set_code(SqlApiWarningCode::RegionUnreachable);
17450    /// let x1 = ApiWarning::new().set_code(SqlApiWarningCode::MaxResultsExceedsLimit);
17451    /// let x2 = ApiWarning::new().set_code(SqlApiWarningCode::CompromisedCredentials);
17452    /// ```
17453    pub fn set_code<T: std::convert::Into<crate::model::api_warning::SqlApiWarningCode>>(
17454        mut self,
17455        v: T,
17456    ) -> Self {
17457        self.code = v.into();
17458        self
17459    }
17460
17461    /// Sets the value of [message][crate::model::ApiWarning::message].
17462    ///
17463    /// # Example
17464    /// ```ignore,no_run
17465    /// # use google_cloud_sql_v1::model::ApiWarning;
17466    /// let x = ApiWarning::new().set_message("example");
17467    /// ```
17468    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17469        self.message = v.into();
17470        self
17471    }
17472
17473    /// Sets the value of [region][crate::model::ApiWarning::region].
17474    ///
17475    /// # Example
17476    /// ```ignore,no_run
17477    /// # use google_cloud_sql_v1::model::ApiWarning;
17478    /// let x = ApiWarning::new().set_region("example");
17479    /// ```
17480    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17481        self.region = v.into();
17482        self
17483    }
17484}
17485
17486impl wkt::message::Message for ApiWarning {
17487    fn typename() -> &'static str {
17488        "type.googleapis.com/google.cloud.sql.v1.ApiWarning"
17489    }
17490}
17491
17492/// Defines additional types related to [ApiWarning].
17493pub mod api_warning {
17494    #[allow(unused_imports)]
17495    use super::*;
17496
17497    /// Enum for [SqlApiWarningCode].
17498    ///
17499    /// # Working with unknown values
17500    ///
17501    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17502    /// additional enum variants at any time. Adding new variants is not considered
17503    /// a breaking change. Applications should write their code in anticipation of:
17504    ///
17505    /// - New values appearing in future releases of the client library, **and**
17506    /// - New values received dynamically, without application changes.
17507    ///
17508    /// Please consult the [Working with enums] section in the user guide for some
17509    /// guidelines.
17510    ///
17511    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17512    #[derive(Clone, Debug, PartialEq)]
17513    #[non_exhaustive]
17514    pub enum SqlApiWarningCode {
17515        /// An unknown or unset warning type from Cloud SQL API.
17516        Unspecified,
17517        /// Warning when one or more regions are not reachable.  The returned result
17518        /// set may be incomplete.
17519        RegionUnreachable,
17520        /// Warning when user provided maxResults parameter exceeds the limit.  The
17521        /// returned result set may be incomplete.
17522        MaxResultsExceedsLimit,
17523        /// Warning when user tries to create/update a user with credentials that
17524        /// have previously been compromised by a public data breach.
17525        CompromisedCredentials,
17526        /// Warning when the operation succeeds but some non-critical workflow state
17527        /// failed.
17528        InternalStateFailure,
17529        /// If set, the enum was initialized with an unknown value.
17530        ///
17531        /// Applications can examine the value using [SqlApiWarningCode::value] or
17532        /// [SqlApiWarningCode::name].
17533        UnknownValue(sql_api_warning_code::UnknownValue),
17534    }
17535
17536    #[doc(hidden)]
17537    pub mod sql_api_warning_code {
17538        #[allow(unused_imports)]
17539        use super::*;
17540        #[derive(Clone, Debug, PartialEq)]
17541        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17542    }
17543
17544    impl SqlApiWarningCode {
17545        /// Gets the enum value.
17546        ///
17547        /// Returns `None` if the enum contains an unknown value deserialized from
17548        /// the string representation of enums.
17549        pub fn value(&self) -> std::option::Option<i32> {
17550            match self {
17551                Self::Unspecified => std::option::Option::Some(0),
17552                Self::RegionUnreachable => std::option::Option::Some(1),
17553                Self::MaxResultsExceedsLimit => std::option::Option::Some(2),
17554                Self::CompromisedCredentials => std::option::Option::Some(3),
17555                Self::InternalStateFailure => std::option::Option::Some(4),
17556                Self::UnknownValue(u) => u.0.value(),
17557            }
17558        }
17559
17560        /// Gets the enum value as a string.
17561        ///
17562        /// Returns `None` if the enum contains an unknown value deserialized from
17563        /// the integer representation of enums.
17564        pub fn name(&self) -> std::option::Option<&str> {
17565            match self {
17566                Self::Unspecified => std::option::Option::Some("SQL_API_WARNING_CODE_UNSPECIFIED"),
17567                Self::RegionUnreachable => std::option::Option::Some("REGION_UNREACHABLE"),
17568                Self::MaxResultsExceedsLimit => {
17569                    std::option::Option::Some("MAX_RESULTS_EXCEEDS_LIMIT")
17570                }
17571                Self::CompromisedCredentials => {
17572                    std::option::Option::Some("COMPROMISED_CREDENTIALS")
17573                }
17574                Self::InternalStateFailure => std::option::Option::Some("INTERNAL_STATE_FAILURE"),
17575                Self::UnknownValue(u) => u.0.name(),
17576            }
17577        }
17578    }
17579
17580    impl std::default::Default for SqlApiWarningCode {
17581        fn default() -> Self {
17582            use std::convert::From;
17583            Self::from(0)
17584        }
17585    }
17586
17587    impl std::fmt::Display for SqlApiWarningCode {
17588        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17589            wkt::internal::display_enum(f, self.name(), self.value())
17590        }
17591    }
17592
17593    impl std::convert::From<i32> for SqlApiWarningCode {
17594        fn from(value: i32) -> Self {
17595            match value {
17596                0 => Self::Unspecified,
17597                1 => Self::RegionUnreachable,
17598                2 => Self::MaxResultsExceedsLimit,
17599                3 => Self::CompromisedCredentials,
17600                4 => Self::InternalStateFailure,
17601                _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
17602                    wkt::internal::UnknownEnumValue::Integer(value),
17603                )),
17604            }
17605        }
17606    }
17607
17608    impl std::convert::From<&str> for SqlApiWarningCode {
17609        fn from(value: &str) -> Self {
17610            use std::string::ToString;
17611            match value {
17612                "SQL_API_WARNING_CODE_UNSPECIFIED" => Self::Unspecified,
17613                "REGION_UNREACHABLE" => Self::RegionUnreachable,
17614                "MAX_RESULTS_EXCEEDS_LIMIT" => Self::MaxResultsExceedsLimit,
17615                "COMPROMISED_CREDENTIALS" => Self::CompromisedCredentials,
17616                "INTERNAL_STATE_FAILURE" => Self::InternalStateFailure,
17617                _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
17618                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17619                )),
17620            }
17621        }
17622    }
17623
17624    impl serde::ser::Serialize for SqlApiWarningCode {
17625        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17626        where
17627            S: serde::Serializer,
17628        {
17629            match self {
17630                Self::Unspecified => serializer.serialize_i32(0),
17631                Self::RegionUnreachable => serializer.serialize_i32(1),
17632                Self::MaxResultsExceedsLimit => serializer.serialize_i32(2),
17633                Self::CompromisedCredentials => serializer.serialize_i32(3),
17634                Self::InternalStateFailure => serializer.serialize_i32(4),
17635                Self::UnknownValue(u) => u.0.serialize(serializer),
17636            }
17637        }
17638    }
17639
17640    impl<'de> serde::de::Deserialize<'de> for SqlApiWarningCode {
17641        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17642        where
17643            D: serde::Deserializer<'de>,
17644        {
17645            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlApiWarningCode>::new(
17646                ".google.cloud.sql.v1.ApiWarning.SqlApiWarningCode",
17647            ))
17648        }
17649    }
17650}
17651
17652/// We currently only support backup retention by specifying the number
17653/// of backups we will retain.
17654#[derive(Clone, Default, PartialEq)]
17655#[non_exhaustive]
17656pub struct BackupRetentionSettings {
17657    /// The unit that 'retained_backups' represents.
17658    pub retention_unit: crate::model::backup_retention_settings::RetentionUnit,
17659
17660    /// Depending on the value of retention_unit, this is used to determine
17661    /// if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
17662    /// retain this many backups.
17663    pub retained_backups: std::option::Option<wkt::Int32Value>,
17664
17665    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17666}
17667
17668impl BackupRetentionSettings {
17669    /// Creates a new default instance.
17670    pub fn new() -> Self {
17671        std::default::Default::default()
17672    }
17673
17674    /// Sets the value of [retention_unit][crate::model::BackupRetentionSettings::retention_unit].
17675    ///
17676    /// # Example
17677    /// ```ignore,no_run
17678    /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17679    /// use google_cloud_sql_v1::model::backup_retention_settings::RetentionUnit;
17680    /// let x0 = BackupRetentionSettings::new().set_retention_unit(RetentionUnit::Count);
17681    /// ```
17682    pub fn set_retention_unit<
17683        T: std::convert::Into<crate::model::backup_retention_settings::RetentionUnit>,
17684    >(
17685        mut self,
17686        v: T,
17687    ) -> Self {
17688        self.retention_unit = v.into();
17689        self
17690    }
17691
17692    /// Sets the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
17693    ///
17694    /// # Example
17695    /// ```ignore,no_run
17696    /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17697    /// use wkt::Int32Value;
17698    /// let x = BackupRetentionSettings::new().set_retained_backups(Int32Value::default()/* use setters */);
17699    /// ```
17700    pub fn set_retained_backups<T>(mut self, v: T) -> Self
17701    where
17702        T: std::convert::Into<wkt::Int32Value>,
17703    {
17704        self.retained_backups = std::option::Option::Some(v.into());
17705        self
17706    }
17707
17708    /// Sets or clears the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
17709    ///
17710    /// # Example
17711    /// ```ignore,no_run
17712    /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17713    /// use wkt::Int32Value;
17714    /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(Some(Int32Value::default()/* use setters */));
17715    /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(None::<Int32Value>);
17716    /// ```
17717    pub fn set_or_clear_retained_backups<T>(mut self, v: std::option::Option<T>) -> Self
17718    where
17719        T: std::convert::Into<wkt::Int32Value>,
17720    {
17721        self.retained_backups = v.map(|x| x.into());
17722        self
17723    }
17724}
17725
17726impl wkt::message::Message for BackupRetentionSettings {
17727    fn typename() -> &'static str {
17728        "type.googleapis.com/google.cloud.sql.v1.BackupRetentionSettings"
17729    }
17730}
17731
17732/// Defines additional types related to [BackupRetentionSettings].
17733pub mod backup_retention_settings {
17734    #[allow(unused_imports)]
17735    use super::*;
17736
17737    /// The units that retained_backups specifies, we only support COUNT.
17738    ///
17739    /// # Working with unknown values
17740    ///
17741    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17742    /// additional enum variants at any time. Adding new variants is not considered
17743    /// a breaking change. Applications should write their code in anticipation of:
17744    ///
17745    /// - New values appearing in future releases of the client library, **and**
17746    /// - New values received dynamically, without application changes.
17747    ///
17748    /// Please consult the [Working with enums] section in the user guide for some
17749    /// guidelines.
17750    ///
17751    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17752    #[derive(Clone, Debug, PartialEq)]
17753    #[non_exhaustive]
17754    pub enum RetentionUnit {
17755        /// Backup retention unit is unspecified, will be treated as COUNT.
17756        Unspecified,
17757        /// Retention will be by count, eg. "retain the most recent 7 backups".
17758        Count,
17759        /// If set, the enum was initialized with an unknown value.
17760        ///
17761        /// Applications can examine the value using [RetentionUnit::value] or
17762        /// [RetentionUnit::name].
17763        UnknownValue(retention_unit::UnknownValue),
17764    }
17765
17766    #[doc(hidden)]
17767    pub mod retention_unit {
17768        #[allow(unused_imports)]
17769        use super::*;
17770        #[derive(Clone, Debug, PartialEq)]
17771        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17772    }
17773
17774    impl RetentionUnit {
17775        /// Gets the enum value.
17776        ///
17777        /// Returns `None` if the enum contains an unknown value deserialized from
17778        /// the string representation of enums.
17779        pub fn value(&self) -> std::option::Option<i32> {
17780            match self {
17781                Self::Unspecified => std::option::Option::Some(0),
17782                Self::Count => std::option::Option::Some(1),
17783                Self::UnknownValue(u) => u.0.value(),
17784            }
17785        }
17786
17787        /// Gets the enum value as a string.
17788        ///
17789        /// Returns `None` if the enum contains an unknown value deserialized from
17790        /// the integer representation of enums.
17791        pub fn name(&self) -> std::option::Option<&str> {
17792            match self {
17793                Self::Unspecified => std::option::Option::Some("RETENTION_UNIT_UNSPECIFIED"),
17794                Self::Count => std::option::Option::Some("COUNT"),
17795                Self::UnknownValue(u) => u.0.name(),
17796            }
17797        }
17798    }
17799
17800    impl std::default::Default for RetentionUnit {
17801        fn default() -> Self {
17802            use std::convert::From;
17803            Self::from(0)
17804        }
17805    }
17806
17807    impl std::fmt::Display for RetentionUnit {
17808        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17809            wkt::internal::display_enum(f, self.name(), self.value())
17810        }
17811    }
17812
17813    impl std::convert::From<i32> for RetentionUnit {
17814        fn from(value: i32) -> Self {
17815            match value {
17816                0 => Self::Unspecified,
17817                1 => Self::Count,
17818                _ => Self::UnknownValue(retention_unit::UnknownValue(
17819                    wkt::internal::UnknownEnumValue::Integer(value),
17820                )),
17821            }
17822        }
17823    }
17824
17825    impl std::convert::From<&str> for RetentionUnit {
17826        fn from(value: &str) -> Self {
17827            use std::string::ToString;
17828            match value {
17829                "RETENTION_UNIT_UNSPECIFIED" => Self::Unspecified,
17830                "COUNT" => Self::Count,
17831                _ => Self::UnknownValue(retention_unit::UnknownValue(
17832                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17833                )),
17834            }
17835        }
17836    }
17837
17838    impl serde::ser::Serialize for RetentionUnit {
17839        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17840        where
17841            S: serde::Serializer,
17842        {
17843            match self {
17844                Self::Unspecified => serializer.serialize_i32(0),
17845                Self::Count => serializer.serialize_i32(1),
17846                Self::UnknownValue(u) => u.0.serialize(serializer),
17847            }
17848        }
17849    }
17850
17851    impl<'de> serde::de::Deserialize<'de> for RetentionUnit {
17852        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17853        where
17854            D: serde::Deserializer<'de>,
17855        {
17856            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RetentionUnit>::new(
17857                ".google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit",
17858            ))
17859        }
17860    }
17861}
17862
17863/// Database instance backup configuration.
17864#[derive(Clone, Default, PartialEq)]
17865#[non_exhaustive]
17866pub struct BackupConfiguration {
17867    /// Start time for the daily backup configuration in UTC timezone in the 24
17868    /// hour format - `HH:MM`.
17869    pub start_time: std::string::String,
17870
17871    /// Whether this configuration is enabled.
17872    pub enabled: std::option::Option<wkt::BoolValue>,
17873
17874    /// This is always `sql#backupConfiguration`.
17875    pub kind: std::string::String,
17876
17877    /// (MySQL only) Whether binary log is enabled. If backup configuration is
17878    /// disabled, binarylog must be disabled as well.
17879    pub binary_log_enabled: std::option::Option<wkt::BoolValue>,
17880
17881    /// Reserved for future use.
17882    pub replication_log_archiving_enabled: std::option::Option<wkt::BoolValue>,
17883
17884    /// Location of the backup
17885    pub location: std::string::String,
17886
17887    /// Whether point in time recovery is enabled.
17888    pub point_in_time_recovery_enabled: std::option::Option<wkt::BoolValue>,
17889
17890    /// Backup retention settings.
17891    pub backup_retention_settings: std::option::Option<crate::model::BackupRetentionSettings>,
17892
17893    /// The number of days of transaction logs we retain for point in time
17894    /// restore, from 1-7.
17895    pub transaction_log_retention_days: std::option::Option<wkt::Int32Value>,
17896
17897    /// Output only. This value contains the storage location of transactional logs
17898    /// used to perform point-in-time recovery (PITR) for the database.
17899    pub transactional_log_storage_state:
17900        std::option::Option<crate::model::backup_configuration::TransactionalLogStorageState>,
17901
17902    /// Output only. Backup tier that manages the backups for the instance.
17903    pub backup_tier: std::option::Option<crate::model::backup_configuration::BackupTier>,
17904
17905    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17906}
17907
17908impl BackupConfiguration {
17909    /// Creates a new default instance.
17910    pub fn new() -> Self {
17911        std::default::Default::default()
17912    }
17913
17914    /// Sets the value of [start_time][crate::model::BackupConfiguration::start_time].
17915    ///
17916    /// # Example
17917    /// ```ignore,no_run
17918    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17919    /// let x = BackupConfiguration::new().set_start_time("example");
17920    /// ```
17921    pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17922        self.start_time = v.into();
17923        self
17924    }
17925
17926    /// Sets the value of [enabled][crate::model::BackupConfiguration::enabled].
17927    ///
17928    /// # Example
17929    /// ```ignore,no_run
17930    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17931    /// use wkt::BoolValue;
17932    /// let x = BackupConfiguration::new().set_enabled(BoolValue::default()/* use setters */);
17933    /// ```
17934    pub fn set_enabled<T>(mut self, v: T) -> Self
17935    where
17936        T: std::convert::Into<wkt::BoolValue>,
17937    {
17938        self.enabled = std::option::Option::Some(v.into());
17939        self
17940    }
17941
17942    /// Sets or clears the value of [enabled][crate::model::BackupConfiguration::enabled].
17943    ///
17944    /// # Example
17945    /// ```ignore,no_run
17946    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17947    /// use wkt::BoolValue;
17948    /// let x = BackupConfiguration::new().set_or_clear_enabled(Some(BoolValue::default()/* use setters */));
17949    /// let x = BackupConfiguration::new().set_or_clear_enabled(None::<BoolValue>);
17950    /// ```
17951    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17952    where
17953        T: std::convert::Into<wkt::BoolValue>,
17954    {
17955        self.enabled = v.map(|x| x.into());
17956        self
17957    }
17958
17959    /// Sets the value of [kind][crate::model::BackupConfiguration::kind].
17960    ///
17961    /// # Example
17962    /// ```ignore,no_run
17963    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17964    /// let x = BackupConfiguration::new().set_kind("example");
17965    /// ```
17966    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17967        self.kind = v.into();
17968        self
17969    }
17970
17971    /// Sets the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
17972    ///
17973    /// # Example
17974    /// ```ignore,no_run
17975    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17976    /// use wkt::BoolValue;
17977    /// let x = BackupConfiguration::new().set_binary_log_enabled(BoolValue::default()/* use setters */);
17978    /// ```
17979    pub fn set_binary_log_enabled<T>(mut self, v: T) -> Self
17980    where
17981        T: std::convert::Into<wkt::BoolValue>,
17982    {
17983        self.binary_log_enabled = std::option::Option::Some(v.into());
17984        self
17985    }
17986
17987    /// Sets or clears the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
17988    ///
17989    /// # Example
17990    /// ```ignore,no_run
17991    /// # use google_cloud_sql_v1::model::BackupConfiguration;
17992    /// use wkt::BoolValue;
17993    /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(Some(BoolValue::default()/* use setters */));
17994    /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(None::<BoolValue>);
17995    /// ```
17996    pub fn set_or_clear_binary_log_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17997    where
17998        T: std::convert::Into<wkt::BoolValue>,
17999    {
18000        self.binary_log_enabled = v.map(|x| x.into());
18001        self
18002    }
18003
18004    /// Sets the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
18005    ///
18006    /// # Example
18007    /// ```ignore,no_run
18008    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18009    /// use wkt::BoolValue;
18010    /// let x = BackupConfiguration::new().set_replication_log_archiving_enabled(BoolValue::default()/* use setters */);
18011    /// ```
18012    pub fn set_replication_log_archiving_enabled<T>(mut self, v: T) -> Self
18013    where
18014        T: std::convert::Into<wkt::BoolValue>,
18015    {
18016        self.replication_log_archiving_enabled = std::option::Option::Some(v.into());
18017        self
18018    }
18019
18020    /// Sets or clears the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
18021    ///
18022    /// # Example
18023    /// ```ignore,no_run
18024    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18025    /// use wkt::BoolValue;
18026    /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(Some(BoolValue::default()/* use setters */));
18027    /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(None::<BoolValue>);
18028    /// ```
18029    pub fn set_or_clear_replication_log_archiving_enabled<T>(
18030        mut self,
18031        v: std::option::Option<T>,
18032    ) -> Self
18033    where
18034        T: std::convert::Into<wkt::BoolValue>,
18035    {
18036        self.replication_log_archiving_enabled = v.map(|x| x.into());
18037        self
18038    }
18039
18040    /// Sets the value of [location][crate::model::BackupConfiguration::location].
18041    ///
18042    /// # Example
18043    /// ```ignore,no_run
18044    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18045    /// let x = BackupConfiguration::new().set_location("example");
18046    /// ```
18047    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18048        self.location = v.into();
18049        self
18050    }
18051
18052    /// Sets the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
18053    ///
18054    /// # Example
18055    /// ```ignore,no_run
18056    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18057    /// use wkt::BoolValue;
18058    /// let x = BackupConfiguration::new().set_point_in_time_recovery_enabled(BoolValue::default()/* use setters */);
18059    /// ```
18060    pub fn set_point_in_time_recovery_enabled<T>(mut self, v: T) -> Self
18061    where
18062        T: std::convert::Into<wkt::BoolValue>,
18063    {
18064        self.point_in_time_recovery_enabled = std::option::Option::Some(v.into());
18065        self
18066    }
18067
18068    /// Sets or clears the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
18069    ///
18070    /// # Example
18071    /// ```ignore,no_run
18072    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18073    /// use wkt::BoolValue;
18074    /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(Some(BoolValue::default()/* use setters */));
18075    /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(None::<BoolValue>);
18076    /// ```
18077    pub fn set_or_clear_point_in_time_recovery_enabled<T>(
18078        mut self,
18079        v: std::option::Option<T>,
18080    ) -> Self
18081    where
18082        T: std::convert::Into<wkt::BoolValue>,
18083    {
18084        self.point_in_time_recovery_enabled = v.map(|x| x.into());
18085        self
18086    }
18087
18088    /// Sets the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
18089    ///
18090    /// # Example
18091    /// ```ignore,no_run
18092    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18093    /// use google_cloud_sql_v1::model::BackupRetentionSettings;
18094    /// let x = BackupConfiguration::new().set_backup_retention_settings(BackupRetentionSettings::default()/* use setters */);
18095    /// ```
18096    pub fn set_backup_retention_settings<T>(mut self, v: T) -> Self
18097    where
18098        T: std::convert::Into<crate::model::BackupRetentionSettings>,
18099    {
18100        self.backup_retention_settings = std::option::Option::Some(v.into());
18101        self
18102    }
18103
18104    /// Sets or clears the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
18105    ///
18106    /// # Example
18107    /// ```ignore,no_run
18108    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18109    /// use google_cloud_sql_v1::model::BackupRetentionSettings;
18110    /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(Some(BackupRetentionSettings::default()/* use setters */));
18111    /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(None::<BackupRetentionSettings>);
18112    /// ```
18113    pub fn set_or_clear_backup_retention_settings<T>(mut self, v: std::option::Option<T>) -> Self
18114    where
18115        T: std::convert::Into<crate::model::BackupRetentionSettings>,
18116    {
18117        self.backup_retention_settings = v.map(|x| x.into());
18118        self
18119    }
18120
18121    /// Sets the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
18122    ///
18123    /// # Example
18124    /// ```ignore,no_run
18125    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18126    /// use wkt::Int32Value;
18127    /// let x = BackupConfiguration::new().set_transaction_log_retention_days(Int32Value::default()/* use setters */);
18128    /// ```
18129    pub fn set_transaction_log_retention_days<T>(mut self, v: T) -> Self
18130    where
18131        T: std::convert::Into<wkt::Int32Value>,
18132    {
18133        self.transaction_log_retention_days = std::option::Option::Some(v.into());
18134        self
18135    }
18136
18137    /// Sets or clears the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
18138    ///
18139    /// # Example
18140    /// ```ignore,no_run
18141    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18142    /// use wkt::Int32Value;
18143    /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(Some(Int32Value::default()/* use setters */));
18144    /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(None::<Int32Value>);
18145    /// ```
18146    pub fn set_or_clear_transaction_log_retention_days<T>(
18147        mut self,
18148        v: std::option::Option<T>,
18149    ) -> Self
18150    where
18151        T: std::convert::Into<wkt::Int32Value>,
18152    {
18153        self.transaction_log_retention_days = v.map(|x| x.into());
18154        self
18155    }
18156
18157    /// Sets the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
18158    ///
18159    /// # Example
18160    /// ```ignore,no_run
18161    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18162    /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
18163    /// let x0 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::Disk);
18164    /// let x1 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchingToCloudStorage);
18165    /// let x2 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchedToCloudStorage);
18166    /// ```
18167    pub fn set_transactional_log_storage_state<T>(mut self, v: T) -> Self
18168    where
18169        T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
18170    {
18171        self.transactional_log_storage_state = std::option::Option::Some(v.into());
18172        self
18173    }
18174
18175    /// Sets or clears the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
18176    ///
18177    /// # Example
18178    /// ```ignore,no_run
18179    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18180    /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
18181    /// let x0 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::Disk));
18182    /// let x1 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchingToCloudStorage));
18183    /// let x2 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchedToCloudStorage));
18184    /// let x_none = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(None::<TransactionalLogStorageState>);
18185    /// ```
18186    pub fn set_or_clear_transactional_log_storage_state<T>(
18187        mut self,
18188        v: std::option::Option<T>,
18189    ) -> Self
18190    where
18191        T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
18192    {
18193        self.transactional_log_storage_state = v.map(|x| x.into());
18194        self
18195    }
18196
18197    /// Sets the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
18198    ///
18199    /// # Example
18200    /// ```ignore,no_run
18201    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18202    /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
18203    /// let x0 = BackupConfiguration::new().set_backup_tier(BackupTier::Standard);
18204    /// let x1 = BackupConfiguration::new().set_backup_tier(BackupTier::Enhanced);
18205    /// ```
18206    pub fn set_backup_tier<T>(mut self, v: T) -> Self
18207    where
18208        T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
18209    {
18210        self.backup_tier = std::option::Option::Some(v.into());
18211        self
18212    }
18213
18214    /// Sets or clears the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
18215    ///
18216    /// # Example
18217    /// ```ignore,no_run
18218    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18219    /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
18220    /// let x0 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Standard));
18221    /// let x1 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Enhanced));
18222    /// let x_none = BackupConfiguration::new().set_or_clear_backup_tier(None::<BackupTier>);
18223    /// ```
18224    pub fn set_or_clear_backup_tier<T>(mut self, v: std::option::Option<T>) -> Self
18225    where
18226        T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
18227    {
18228        self.backup_tier = v.map(|x| x.into());
18229        self
18230    }
18231}
18232
18233impl wkt::message::Message for BackupConfiguration {
18234    fn typename() -> &'static str {
18235        "type.googleapis.com/google.cloud.sql.v1.BackupConfiguration"
18236    }
18237}
18238
18239/// Defines additional types related to [BackupConfiguration].
18240pub mod backup_configuration {
18241    #[allow(unused_imports)]
18242    use super::*;
18243
18244    /// This value contains the storage location of the transactional logs
18245    /// used to perform point-in-time recovery (PITR) for the database.
18246    ///
18247    /// # Working with unknown values
18248    ///
18249    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18250    /// additional enum variants at any time. Adding new variants is not considered
18251    /// a breaking change. Applications should write their code in anticipation of:
18252    ///
18253    /// - New values appearing in future releases of the client library, **and**
18254    /// - New values received dynamically, without application changes.
18255    ///
18256    /// Please consult the [Working with enums] section in the user guide for some
18257    /// guidelines.
18258    ///
18259    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18260    #[derive(Clone, Debug, PartialEq)]
18261    #[non_exhaustive]
18262    pub enum TransactionalLogStorageState {
18263        /// Unspecified.
18264        Unspecified,
18265        /// The transaction logs used for PITR for the instance are stored
18266        /// on a data disk.
18267        Disk,
18268        /// The transaction logs used for PITR for the instance are switching from
18269        /// being stored on a data disk to being stored in Cloud Storage.
18270        /// Only applicable to MySQL.
18271        SwitchingToCloudStorage,
18272        /// The transaction logs used for PITR for the instance are now stored
18273        /// in Cloud Storage. Previously, they were stored on a data disk.
18274        /// Only applicable to MySQL.
18275        SwitchedToCloudStorage,
18276        /// The transaction logs used for PITR for the instance are stored in
18277        /// Cloud Storage. Only applicable to MySQL and PostgreSQL.
18278        CloudStorage,
18279        /// If set, the enum was initialized with an unknown value.
18280        ///
18281        /// Applications can examine the value using [TransactionalLogStorageState::value] or
18282        /// [TransactionalLogStorageState::name].
18283        UnknownValue(transactional_log_storage_state::UnknownValue),
18284    }
18285
18286    #[doc(hidden)]
18287    pub mod transactional_log_storage_state {
18288        #[allow(unused_imports)]
18289        use super::*;
18290        #[derive(Clone, Debug, PartialEq)]
18291        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18292    }
18293
18294    impl TransactionalLogStorageState {
18295        /// Gets the enum value.
18296        ///
18297        /// Returns `None` if the enum contains an unknown value deserialized from
18298        /// the string representation of enums.
18299        pub fn value(&self) -> std::option::Option<i32> {
18300            match self {
18301                Self::Unspecified => std::option::Option::Some(0),
18302                Self::Disk => std::option::Option::Some(1),
18303                Self::SwitchingToCloudStorage => std::option::Option::Some(2),
18304                Self::SwitchedToCloudStorage => std::option::Option::Some(3),
18305                Self::CloudStorage => std::option::Option::Some(4),
18306                Self::UnknownValue(u) => u.0.value(),
18307            }
18308        }
18309
18310        /// Gets the enum value as a string.
18311        ///
18312        /// Returns `None` if the enum contains an unknown value deserialized from
18313        /// the integer representation of enums.
18314        pub fn name(&self) -> std::option::Option<&str> {
18315            match self {
18316                Self::Unspecified => {
18317                    std::option::Option::Some("TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED")
18318                }
18319                Self::Disk => std::option::Option::Some("DISK"),
18320                Self::SwitchingToCloudStorage => {
18321                    std::option::Option::Some("SWITCHING_TO_CLOUD_STORAGE")
18322                }
18323                Self::SwitchedToCloudStorage => {
18324                    std::option::Option::Some("SWITCHED_TO_CLOUD_STORAGE")
18325                }
18326                Self::CloudStorage => std::option::Option::Some("CLOUD_STORAGE"),
18327                Self::UnknownValue(u) => u.0.name(),
18328            }
18329        }
18330    }
18331
18332    impl std::default::Default for TransactionalLogStorageState {
18333        fn default() -> Self {
18334            use std::convert::From;
18335            Self::from(0)
18336        }
18337    }
18338
18339    impl std::fmt::Display for TransactionalLogStorageState {
18340        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18341            wkt::internal::display_enum(f, self.name(), self.value())
18342        }
18343    }
18344
18345    impl std::convert::From<i32> for TransactionalLogStorageState {
18346        fn from(value: i32) -> Self {
18347            match value {
18348                0 => Self::Unspecified,
18349                1 => Self::Disk,
18350                2 => Self::SwitchingToCloudStorage,
18351                3 => Self::SwitchedToCloudStorage,
18352                4 => Self::CloudStorage,
18353                _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
18354                    wkt::internal::UnknownEnumValue::Integer(value),
18355                )),
18356            }
18357        }
18358    }
18359
18360    impl std::convert::From<&str> for TransactionalLogStorageState {
18361        fn from(value: &str) -> Self {
18362            use std::string::ToString;
18363            match value {
18364                "TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED" => Self::Unspecified,
18365                "DISK" => Self::Disk,
18366                "SWITCHING_TO_CLOUD_STORAGE" => Self::SwitchingToCloudStorage,
18367                "SWITCHED_TO_CLOUD_STORAGE" => Self::SwitchedToCloudStorage,
18368                "CLOUD_STORAGE" => Self::CloudStorage,
18369                _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
18370                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18371                )),
18372            }
18373        }
18374    }
18375
18376    impl serde::ser::Serialize for TransactionalLogStorageState {
18377        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18378        where
18379            S: serde::Serializer,
18380        {
18381            match self {
18382                Self::Unspecified => serializer.serialize_i32(0),
18383                Self::Disk => serializer.serialize_i32(1),
18384                Self::SwitchingToCloudStorage => serializer.serialize_i32(2),
18385                Self::SwitchedToCloudStorage => serializer.serialize_i32(3),
18386                Self::CloudStorage => serializer.serialize_i32(4),
18387                Self::UnknownValue(u) => u.0.serialize(serializer),
18388            }
18389        }
18390    }
18391
18392    impl<'de> serde::de::Deserialize<'de> for TransactionalLogStorageState {
18393        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18394        where
18395            D: serde::Deserializer<'de>,
18396        {
18397            deserializer.deserialize_any(
18398                wkt::internal::EnumVisitor::<TransactionalLogStorageState>::new(
18399                    ".google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState",
18400                ),
18401            )
18402        }
18403    }
18404
18405    /// Backup tier that manages the backups for the instance.
18406    ///
18407    /// # Working with unknown values
18408    ///
18409    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18410    /// additional enum variants at any time. Adding new variants is not considered
18411    /// a breaking change. Applications should write their code in anticipation of:
18412    ///
18413    /// - New values appearing in future releases of the client library, **and**
18414    /// - New values received dynamically, without application changes.
18415    ///
18416    /// Please consult the [Working with enums] section in the user guide for some
18417    /// guidelines.
18418    ///
18419    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18420    #[derive(Clone, Debug, PartialEq)]
18421    #[non_exhaustive]
18422    pub enum BackupTier {
18423        /// Unspecified.
18424        Unspecified,
18425        /// Instance is managed by Cloud SQL.
18426        Standard,
18427        /// Deprecated: ADVANCED is deprecated. Please use ENHANCED instead.
18428        #[deprecated]
18429        Advanced,
18430        /// Instance is managed by Google Cloud Backup and DR Service.
18431        Enhanced,
18432        /// If set, the enum was initialized with an unknown value.
18433        ///
18434        /// Applications can examine the value using [BackupTier::value] or
18435        /// [BackupTier::name].
18436        UnknownValue(backup_tier::UnknownValue),
18437    }
18438
18439    #[doc(hidden)]
18440    pub mod backup_tier {
18441        #[allow(unused_imports)]
18442        use super::*;
18443        #[derive(Clone, Debug, PartialEq)]
18444        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18445    }
18446
18447    impl BackupTier {
18448        /// Gets the enum value.
18449        ///
18450        /// Returns `None` if the enum contains an unknown value deserialized from
18451        /// the string representation of enums.
18452        pub fn value(&self) -> std::option::Option<i32> {
18453            match self {
18454                Self::Unspecified => std::option::Option::Some(0),
18455                Self::Standard => std::option::Option::Some(1),
18456                Self::Advanced => std::option::Option::Some(2),
18457                Self::Enhanced => std::option::Option::Some(3),
18458                Self::UnknownValue(u) => u.0.value(),
18459            }
18460        }
18461
18462        /// Gets the enum value as a string.
18463        ///
18464        /// Returns `None` if the enum contains an unknown value deserialized from
18465        /// the integer representation of enums.
18466        pub fn name(&self) -> std::option::Option<&str> {
18467            match self {
18468                Self::Unspecified => std::option::Option::Some("BACKUP_TIER_UNSPECIFIED"),
18469                Self::Standard => std::option::Option::Some("STANDARD"),
18470                Self::Advanced => std::option::Option::Some("ADVANCED"),
18471                Self::Enhanced => std::option::Option::Some("ENHANCED"),
18472                Self::UnknownValue(u) => u.0.name(),
18473            }
18474        }
18475    }
18476
18477    impl std::default::Default for BackupTier {
18478        fn default() -> Self {
18479            use std::convert::From;
18480            Self::from(0)
18481        }
18482    }
18483
18484    impl std::fmt::Display for BackupTier {
18485        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18486            wkt::internal::display_enum(f, self.name(), self.value())
18487        }
18488    }
18489
18490    impl std::convert::From<i32> for BackupTier {
18491        fn from(value: i32) -> Self {
18492            match value {
18493                0 => Self::Unspecified,
18494                1 => Self::Standard,
18495                2 => Self::Advanced,
18496                3 => Self::Enhanced,
18497                _ => Self::UnknownValue(backup_tier::UnknownValue(
18498                    wkt::internal::UnknownEnumValue::Integer(value),
18499                )),
18500            }
18501        }
18502    }
18503
18504    impl std::convert::From<&str> for BackupTier {
18505        fn from(value: &str) -> Self {
18506            use std::string::ToString;
18507            match value {
18508                "BACKUP_TIER_UNSPECIFIED" => Self::Unspecified,
18509                "STANDARD" => Self::Standard,
18510                "ADVANCED" => Self::Advanced,
18511                "ENHANCED" => Self::Enhanced,
18512                _ => Self::UnknownValue(backup_tier::UnknownValue(
18513                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18514                )),
18515            }
18516        }
18517    }
18518
18519    impl serde::ser::Serialize for BackupTier {
18520        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18521        where
18522            S: serde::Serializer,
18523        {
18524            match self {
18525                Self::Unspecified => serializer.serialize_i32(0),
18526                Self::Standard => serializer.serialize_i32(1),
18527                Self::Advanced => serializer.serialize_i32(2),
18528                Self::Enhanced => serializer.serialize_i32(3),
18529                Self::UnknownValue(u) => u.0.serialize(serializer),
18530            }
18531        }
18532    }
18533
18534    impl<'de> serde::de::Deserialize<'de> for BackupTier {
18535        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18536        where
18537            D: serde::Deserializer<'de>,
18538        {
18539            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupTier>::new(
18540                ".google.cloud.sql.v1.BackupConfiguration.BackupTier",
18541            ))
18542        }
18543    }
18544}
18545
18546/// Perform disk shrink context.
18547#[derive(Clone, Default, PartialEq)]
18548#[non_exhaustive]
18549pub struct PerformDiskShrinkContext {
18550    /// The target disk shrink size in GigaBytes.
18551    pub target_size_gb: i64,
18552
18553    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18554}
18555
18556impl PerformDiskShrinkContext {
18557    /// Creates a new default instance.
18558    pub fn new() -> Self {
18559        std::default::Default::default()
18560    }
18561
18562    /// Sets the value of [target_size_gb][crate::model::PerformDiskShrinkContext::target_size_gb].
18563    ///
18564    /// # Example
18565    /// ```ignore,no_run
18566    /// # use google_cloud_sql_v1::model::PerformDiskShrinkContext;
18567    /// let x = PerformDiskShrinkContext::new().set_target_size_gb(42);
18568    /// ```
18569    pub fn set_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18570        self.target_size_gb = v.into();
18571        self
18572    }
18573}
18574
18575impl wkt::message::Message for PerformDiskShrinkContext {
18576    fn typename() -> &'static str {
18577        "type.googleapis.com/google.cloud.sql.v1.PerformDiskShrinkContext"
18578    }
18579}
18580
18581/// Structured PreCheckResponse containing message, type, and required
18582/// actions.
18583#[derive(Clone, Default, PartialEq)]
18584#[non_exhaustive]
18585pub struct PreCheckResponse {
18586    /// The message to be displayed to the user.
18587    pub message: std::option::Option<std::string::String>,
18588
18589    /// The type of message whether it is an info, warning, or error.
18590    pub message_type: std::option::Option<crate::model::pre_check_response::MessageType>,
18591
18592    /// The actions that the user needs to take. Use repeated for multiple
18593    /// actions.
18594    pub actions_required: std::vec::Vec<std::string::String>,
18595
18596    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18597}
18598
18599impl PreCheckResponse {
18600    /// Creates a new default instance.
18601    pub fn new() -> Self {
18602        std::default::Default::default()
18603    }
18604
18605    /// Sets the value of [message][crate::model::PreCheckResponse::message].
18606    ///
18607    /// # Example
18608    /// ```ignore,no_run
18609    /// # use google_cloud_sql_v1::model::PreCheckResponse;
18610    /// let x = PreCheckResponse::new().set_message("example");
18611    /// ```
18612    pub fn set_message<T>(mut self, v: T) -> Self
18613    where
18614        T: std::convert::Into<std::string::String>,
18615    {
18616        self.message = std::option::Option::Some(v.into());
18617        self
18618    }
18619
18620    /// Sets or clears the value of [message][crate::model::PreCheckResponse::message].
18621    ///
18622    /// # Example
18623    /// ```ignore,no_run
18624    /// # use google_cloud_sql_v1::model::PreCheckResponse;
18625    /// let x = PreCheckResponse::new().set_or_clear_message(Some("example"));
18626    /// let x = PreCheckResponse::new().set_or_clear_message(None::<String>);
18627    /// ```
18628    pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
18629    where
18630        T: std::convert::Into<std::string::String>,
18631    {
18632        self.message = v.map(|x| x.into());
18633        self
18634    }
18635
18636    /// Sets the value of [message_type][crate::model::PreCheckResponse::message_type].
18637    ///
18638    /// # Example
18639    /// ```ignore,no_run
18640    /// # use google_cloud_sql_v1::model::PreCheckResponse;
18641    /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
18642    /// let x0 = PreCheckResponse::new().set_message_type(MessageType::Info);
18643    /// let x1 = PreCheckResponse::new().set_message_type(MessageType::Warning);
18644    /// let x2 = PreCheckResponse::new().set_message_type(MessageType::Error);
18645    /// ```
18646    pub fn set_message_type<T>(mut self, v: T) -> Self
18647    where
18648        T: std::convert::Into<crate::model::pre_check_response::MessageType>,
18649    {
18650        self.message_type = std::option::Option::Some(v.into());
18651        self
18652    }
18653
18654    /// Sets or clears the value of [message_type][crate::model::PreCheckResponse::message_type].
18655    ///
18656    /// # Example
18657    /// ```ignore,no_run
18658    /// # use google_cloud_sql_v1::model::PreCheckResponse;
18659    /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
18660    /// let x0 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Info));
18661    /// let x1 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Warning));
18662    /// let x2 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Error));
18663    /// let x_none = PreCheckResponse::new().set_or_clear_message_type(None::<MessageType>);
18664    /// ```
18665    pub fn set_or_clear_message_type<T>(mut self, v: std::option::Option<T>) -> Self
18666    where
18667        T: std::convert::Into<crate::model::pre_check_response::MessageType>,
18668    {
18669        self.message_type = v.map(|x| x.into());
18670        self
18671    }
18672
18673    /// Sets the value of [actions_required][crate::model::PreCheckResponse::actions_required].
18674    ///
18675    /// # Example
18676    /// ```ignore,no_run
18677    /// # use google_cloud_sql_v1::model::PreCheckResponse;
18678    /// let x = PreCheckResponse::new().set_actions_required(["a", "b", "c"]);
18679    /// ```
18680    pub fn set_actions_required<T, V>(mut self, v: T) -> Self
18681    where
18682        T: std::iter::IntoIterator<Item = V>,
18683        V: std::convert::Into<std::string::String>,
18684    {
18685        use std::iter::Iterator;
18686        self.actions_required = v.into_iter().map(|i| i.into()).collect();
18687        self
18688    }
18689}
18690
18691impl wkt::message::Message for PreCheckResponse {
18692    fn typename() -> &'static str {
18693        "type.googleapis.com/google.cloud.sql.v1.PreCheckResponse"
18694    }
18695}
18696
18697/// Defines additional types related to [PreCheckResponse].
18698pub mod pre_check_response {
18699    #[allow(unused_imports)]
18700    use super::*;
18701
18702    /// The type of message which can be an info, a warning, or an error that
18703    /// requires user intervention.
18704    ///
18705    /// # Working with unknown values
18706    ///
18707    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18708    /// additional enum variants at any time. Adding new variants is not considered
18709    /// a breaking change. Applications should write their code in anticipation of:
18710    ///
18711    /// - New values appearing in future releases of the client library, **and**
18712    /// - New values received dynamically, without application changes.
18713    ///
18714    /// Please consult the [Working with enums] section in the user guide for some
18715    /// guidelines.
18716    ///
18717    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18718    #[derive(Clone, Debug, PartialEq)]
18719    #[non_exhaustive]
18720    pub enum MessageType {
18721        /// Default unspecified value to prevent unintended behavior changes.
18722        Unspecified,
18723        /// General informational messages that don't require action.
18724        Info,
18725        /// Warnings that might impact the upgrade but don't block it.
18726        Warning,
18727        /// Errors that a user must resolve before proceeding with the upgrade.
18728        Error,
18729        /// If set, the enum was initialized with an unknown value.
18730        ///
18731        /// Applications can examine the value using [MessageType::value] or
18732        /// [MessageType::name].
18733        UnknownValue(message_type::UnknownValue),
18734    }
18735
18736    #[doc(hidden)]
18737    pub mod message_type {
18738        #[allow(unused_imports)]
18739        use super::*;
18740        #[derive(Clone, Debug, PartialEq)]
18741        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18742    }
18743
18744    impl MessageType {
18745        /// Gets the enum value.
18746        ///
18747        /// Returns `None` if the enum contains an unknown value deserialized from
18748        /// the string representation of enums.
18749        pub fn value(&self) -> std::option::Option<i32> {
18750            match self {
18751                Self::Unspecified => std::option::Option::Some(0),
18752                Self::Info => std::option::Option::Some(1),
18753                Self::Warning => std::option::Option::Some(2),
18754                Self::Error => std::option::Option::Some(3),
18755                Self::UnknownValue(u) => u.0.value(),
18756            }
18757        }
18758
18759        /// Gets the enum value as a string.
18760        ///
18761        /// Returns `None` if the enum contains an unknown value deserialized from
18762        /// the integer representation of enums.
18763        pub fn name(&self) -> std::option::Option<&str> {
18764            match self {
18765                Self::Unspecified => std::option::Option::Some("MESSAGE_TYPE_UNSPECIFIED"),
18766                Self::Info => std::option::Option::Some("INFO"),
18767                Self::Warning => std::option::Option::Some("WARNING"),
18768                Self::Error => std::option::Option::Some("ERROR"),
18769                Self::UnknownValue(u) => u.0.name(),
18770            }
18771        }
18772    }
18773
18774    impl std::default::Default for MessageType {
18775        fn default() -> Self {
18776            use std::convert::From;
18777            Self::from(0)
18778        }
18779    }
18780
18781    impl std::fmt::Display for MessageType {
18782        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18783            wkt::internal::display_enum(f, self.name(), self.value())
18784        }
18785    }
18786
18787    impl std::convert::From<i32> for MessageType {
18788        fn from(value: i32) -> Self {
18789            match value {
18790                0 => Self::Unspecified,
18791                1 => Self::Info,
18792                2 => Self::Warning,
18793                3 => Self::Error,
18794                _ => Self::UnknownValue(message_type::UnknownValue(
18795                    wkt::internal::UnknownEnumValue::Integer(value),
18796                )),
18797            }
18798        }
18799    }
18800
18801    impl std::convert::From<&str> for MessageType {
18802        fn from(value: &str) -> Self {
18803            use std::string::ToString;
18804            match value {
18805                "MESSAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
18806                "INFO" => Self::Info,
18807                "WARNING" => Self::Warning,
18808                "ERROR" => Self::Error,
18809                _ => Self::UnknownValue(message_type::UnknownValue(
18810                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18811                )),
18812            }
18813        }
18814    }
18815
18816    impl serde::ser::Serialize for MessageType {
18817        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18818        where
18819            S: serde::Serializer,
18820        {
18821            match self {
18822                Self::Unspecified => serializer.serialize_i32(0),
18823                Self::Info => serializer.serialize_i32(1),
18824                Self::Warning => serializer.serialize_i32(2),
18825                Self::Error => serializer.serialize_i32(3),
18826                Self::UnknownValue(u) => u.0.serialize(serializer),
18827            }
18828        }
18829    }
18830
18831    impl<'de> serde::de::Deserialize<'de> for MessageType {
18832        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18833        where
18834            D: serde::Deserializer<'de>,
18835        {
18836            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MessageType>::new(
18837                ".google.cloud.sql.v1.PreCheckResponse.MessageType",
18838            ))
18839        }
18840    }
18841}
18842
18843/// Pre-check major version upgrade context.
18844#[derive(Clone, Default, PartialEq)]
18845#[non_exhaustive]
18846pub struct PreCheckMajorVersionUpgradeContext {
18847    /// Required. The target database version to upgrade to.
18848    pub target_database_version: crate::model::SqlDatabaseVersion,
18849
18850    /// Output only. The responses from the precheck operation.
18851    pub pre_check_response: std::vec::Vec<crate::model::PreCheckResponse>,
18852
18853    /// Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
18854    pub kind: std::string::String,
18855
18856    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18857}
18858
18859impl PreCheckMajorVersionUpgradeContext {
18860    /// Creates a new default instance.
18861    pub fn new() -> Self {
18862        std::default::Default::default()
18863    }
18864
18865    /// Sets the value of [target_database_version][crate::model::PreCheckMajorVersionUpgradeContext::target_database_version].
18866    ///
18867    /// # Example
18868    /// ```ignore,no_run
18869    /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
18870    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
18871    /// let x0 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql56);
18872    /// let x1 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql57);
18873    /// let x2 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql80);
18874    /// ```
18875    pub fn set_target_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
18876        mut self,
18877        v: T,
18878    ) -> Self {
18879        self.target_database_version = v.into();
18880        self
18881    }
18882
18883    /// Sets the value of [pre_check_response][crate::model::PreCheckMajorVersionUpgradeContext::pre_check_response].
18884    ///
18885    /// # Example
18886    /// ```ignore,no_run
18887    /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
18888    /// use google_cloud_sql_v1::model::PreCheckResponse;
18889    /// let x = PreCheckMajorVersionUpgradeContext::new()
18890    ///     .set_pre_check_response([
18891    ///         PreCheckResponse::default()/* use setters */,
18892    ///         PreCheckResponse::default()/* use (different) setters */,
18893    ///     ]);
18894    /// ```
18895    pub fn set_pre_check_response<T, V>(mut self, v: T) -> Self
18896    where
18897        T: std::iter::IntoIterator<Item = V>,
18898        V: std::convert::Into<crate::model::PreCheckResponse>,
18899    {
18900        use std::iter::Iterator;
18901        self.pre_check_response = v.into_iter().map(|i| i.into()).collect();
18902        self
18903    }
18904
18905    /// Sets the value of [kind][crate::model::PreCheckMajorVersionUpgradeContext::kind].
18906    ///
18907    /// # Example
18908    /// ```ignore,no_run
18909    /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
18910    /// let x = PreCheckMajorVersionUpgradeContext::new().set_kind("example");
18911    /// ```
18912    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18913        self.kind = v.into();
18914        self
18915    }
18916}
18917
18918impl wkt::message::Message for PreCheckMajorVersionUpgradeContext {
18919    fn typename() -> &'static str {
18920        "type.googleapis.com/google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext"
18921    }
18922}
18923
18924/// Backup context.
18925#[derive(Clone, Default, PartialEq)]
18926#[non_exhaustive]
18927pub struct BackupContext {
18928    /// The identifier of the backup.
18929    pub backup_id: i64,
18930
18931    /// This is always `sql#backupContext`.
18932    pub kind: std::string::String,
18933
18934    /// The name of the backup.
18935    /// Format: projects/{project}/backups/{backup}
18936    pub name: std::string::String,
18937
18938    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18939}
18940
18941impl BackupContext {
18942    /// Creates a new default instance.
18943    pub fn new() -> Self {
18944        std::default::Default::default()
18945    }
18946
18947    /// Sets the value of [backup_id][crate::model::BackupContext::backup_id].
18948    ///
18949    /// # Example
18950    /// ```ignore,no_run
18951    /// # use google_cloud_sql_v1::model::BackupContext;
18952    /// let x = BackupContext::new().set_backup_id(42);
18953    /// ```
18954    pub fn set_backup_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18955        self.backup_id = v.into();
18956        self
18957    }
18958
18959    /// Sets the value of [kind][crate::model::BackupContext::kind].
18960    ///
18961    /// # Example
18962    /// ```ignore,no_run
18963    /// # use google_cloud_sql_v1::model::BackupContext;
18964    /// let x = BackupContext::new().set_kind("example");
18965    /// ```
18966    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18967        self.kind = v.into();
18968        self
18969    }
18970
18971    /// Sets the value of [name][crate::model::BackupContext::name].
18972    ///
18973    /// # Example
18974    /// ```ignore,no_run
18975    /// # use google_cloud_sql_v1::model::BackupContext;
18976    /// let x = BackupContext::new().set_name("example");
18977    /// ```
18978    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18979        self.name = v.into();
18980        self
18981    }
18982}
18983
18984impl wkt::message::Message for BackupContext {
18985    fn typename() -> &'static str {
18986        "type.googleapis.com/google.cloud.sql.v1.BackupContext"
18987    }
18988}
18989
18990/// Represents a SQL database on the Cloud SQL instance.
18991#[derive(Clone, Default, PartialEq)]
18992#[non_exhaustive]
18993pub struct Database {
18994    /// This is always `sql#database`.
18995    pub kind: std::string::String,
18996
18997    /// The Cloud SQL charset value.
18998    pub charset: std::string::String,
18999
19000    /// The Cloud SQL collation value.
19001    pub collation: std::string::String,
19002
19003    /// This field is deprecated and will be removed from a future version of the
19004    /// API.
19005    pub etag: std::string::String,
19006
19007    /// The name of the database in the Cloud SQL instance. This does not include
19008    /// the project ID or instance name.
19009    pub name: std::string::String,
19010
19011    /// The name of the Cloud SQL instance. This does not include the project ID.
19012    pub instance: std::string::String,
19013
19014    /// The URI of this resource.
19015    pub self_link: std::string::String,
19016
19017    /// The project ID of the project containing the Cloud SQL database. The Google
19018    /// apps domain is prefixed if applicable.
19019    pub project: std::string::String,
19020
19021    #[allow(missing_docs)]
19022    pub database_details: std::option::Option<crate::model::database::DatabaseDetails>,
19023
19024    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19025}
19026
19027impl Database {
19028    /// Creates a new default instance.
19029    pub fn new() -> Self {
19030        std::default::Default::default()
19031    }
19032
19033    /// Sets the value of [kind][crate::model::Database::kind].
19034    ///
19035    /// # Example
19036    /// ```ignore,no_run
19037    /// # use google_cloud_sql_v1::model::Database;
19038    /// let x = Database::new().set_kind("example");
19039    /// ```
19040    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19041        self.kind = v.into();
19042        self
19043    }
19044
19045    /// Sets the value of [charset][crate::model::Database::charset].
19046    ///
19047    /// # Example
19048    /// ```ignore,no_run
19049    /// # use google_cloud_sql_v1::model::Database;
19050    /// let x = Database::new().set_charset("example");
19051    /// ```
19052    pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19053        self.charset = v.into();
19054        self
19055    }
19056
19057    /// Sets the value of [collation][crate::model::Database::collation].
19058    ///
19059    /// # Example
19060    /// ```ignore,no_run
19061    /// # use google_cloud_sql_v1::model::Database;
19062    /// let x = Database::new().set_collation("example");
19063    /// ```
19064    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19065        self.collation = v.into();
19066        self
19067    }
19068
19069    /// Sets the value of [etag][crate::model::Database::etag].
19070    ///
19071    /// # Example
19072    /// ```ignore,no_run
19073    /// # use google_cloud_sql_v1::model::Database;
19074    /// let x = Database::new().set_etag("example");
19075    /// ```
19076    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19077        self.etag = v.into();
19078        self
19079    }
19080
19081    /// Sets the value of [name][crate::model::Database::name].
19082    ///
19083    /// # Example
19084    /// ```ignore,no_run
19085    /// # use google_cloud_sql_v1::model::Database;
19086    /// let x = Database::new().set_name("example");
19087    /// ```
19088    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19089        self.name = v.into();
19090        self
19091    }
19092
19093    /// Sets the value of [instance][crate::model::Database::instance].
19094    ///
19095    /// # Example
19096    /// ```ignore,no_run
19097    /// # use google_cloud_sql_v1::model::Database;
19098    /// let x = Database::new().set_instance("example");
19099    /// ```
19100    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19101        self.instance = v.into();
19102        self
19103    }
19104
19105    /// Sets the value of [self_link][crate::model::Database::self_link].
19106    ///
19107    /// # Example
19108    /// ```ignore,no_run
19109    /// # use google_cloud_sql_v1::model::Database;
19110    /// let x = Database::new().set_self_link("example");
19111    /// ```
19112    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19113        self.self_link = v.into();
19114        self
19115    }
19116
19117    /// Sets the value of [project][crate::model::Database::project].
19118    ///
19119    /// # Example
19120    /// ```ignore,no_run
19121    /// # use google_cloud_sql_v1::model::Database;
19122    /// let x = Database::new().set_project("example");
19123    /// ```
19124    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19125        self.project = v.into();
19126        self
19127    }
19128
19129    /// Sets the value of [database_details][crate::model::Database::database_details].
19130    ///
19131    /// Note that all the setters affecting `database_details` are mutually
19132    /// exclusive.
19133    ///
19134    /// # Example
19135    /// ```ignore,no_run
19136    /// # use google_cloud_sql_v1::model::Database;
19137    /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19138    /// let x = Database::new().set_database_details(Some(
19139    ///     google_cloud_sql_v1::model::database::DatabaseDetails::SqlserverDatabaseDetails(SqlServerDatabaseDetails::default().into())));
19140    /// ```
19141    pub fn set_database_details<
19142        T: std::convert::Into<std::option::Option<crate::model::database::DatabaseDetails>>,
19143    >(
19144        mut self,
19145        v: T,
19146    ) -> Self {
19147        self.database_details = v.into();
19148        self
19149    }
19150
19151    /// The value of [database_details][crate::model::Database::database_details]
19152    /// if it holds a `SqlserverDatabaseDetails`, `None` if the field is not set or
19153    /// holds a different branch.
19154    pub fn sqlserver_database_details(
19155        &self,
19156    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerDatabaseDetails>> {
19157        #[allow(unreachable_patterns)]
19158        self.database_details.as_ref().and_then(|v| match v {
19159            crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v) => {
19160                std::option::Option::Some(v)
19161            }
19162            _ => std::option::Option::None,
19163        })
19164    }
19165
19166    /// Sets the value of [database_details][crate::model::Database::database_details]
19167    /// to hold a `SqlserverDatabaseDetails`.
19168    ///
19169    /// Note that all the setters affecting `database_details` are
19170    /// mutually exclusive.
19171    ///
19172    /// # Example
19173    /// ```ignore,no_run
19174    /// # use google_cloud_sql_v1::model::Database;
19175    /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19176    /// let x = Database::new().set_sqlserver_database_details(SqlServerDatabaseDetails::default()/* use setters */);
19177    /// assert!(x.sqlserver_database_details().is_some());
19178    /// ```
19179    pub fn set_sqlserver_database_details<
19180        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerDatabaseDetails>>,
19181    >(
19182        mut self,
19183        v: T,
19184    ) -> Self {
19185        self.database_details = std::option::Option::Some(
19186            crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v.into()),
19187        );
19188        self
19189    }
19190}
19191
19192impl wkt::message::Message for Database {
19193    fn typename() -> &'static str {
19194        "type.googleapis.com/google.cloud.sql.v1.Database"
19195    }
19196}
19197
19198/// Defines additional types related to [Database].
19199pub mod database {
19200    #[allow(unused_imports)]
19201    use super::*;
19202
19203    #[allow(missing_docs)]
19204    #[derive(Clone, Debug, PartialEq)]
19205    #[non_exhaustive]
19206    pub enum DatabaseDetails {
19207        #[allow(missing_docs)]
19208        SqlserverDatabaseDetails(std::boxed::Box<crate::model::SqlServerDatabaseDetails>),
19209    }
19210}
19211
19212/// Represents a Sql Server database on the Cloud SQL instance.
19213#[derive(Clone, Default, PartialEq)]
19214#[non_exhaustive]
19215pub struct SqlServerDatabaseDetails {
19216    /// The version of SQL Server with which the database is to be made compatible
19217    pub compatibility_level: i32,
19218
19219    /// The recovery model of a SQL Server database
19220    pub recovery_model: std::string::String,
19221
19222    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19223}
19224
19225impl SqlServerDatabaseDetails {
19226    /// Creates a new default instance.
19227    pub fn new() -> Self {
19228        std::default::Default::default()
19229    }
19230
19231    /// Sets the value of [compatibility_level][crate::model::SqlServerDatabaseDetails::compatibility_level].
19232    ///
19233    /// # Example
19234    /// ```ignore,no_run
19235    /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19236    /// let x = SqlServerDatabaseDetails::new().set_compatibility_level(42);
19237    /// ```
19238    pub fn set_compatibility_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19239        self.compatibility_level = v.into();
19240        self
19241    }
19242
19243    /// Sets the value of [recovery_model][crate::model::SqlServerDatabaseDetails::recovery_model].
19244    ///
19245    /// # Example
19246    /// ```ignore,no_run
19247    /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19248    /// let x = SqlServerDatabaseDetails::new().set_recovery_model("example");
19249    /// ```
19250    pub fn set_recovery_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19251        self.recovery_model = v.into();
19252        self
19253    }
19254}
19255
19256impl wkt::message::Message for SqlServerDatabaseDetails {
19257    fn typename() -> &'static str {
19258        "type.googleapis.com/google.cloud.sql.v1.SqlServerDatabaseDetails"
19259    }
19260}
19261
19262/// Database flags for Cloud SQL instances.
19263#[derive(Clone, Default, PartialEq)]
19264#[non_exhaustive]
19265pub struct DatabaseFlags {
19266    /// The name of the flag. These flags are passed at instance startup, so
19267    /// include both server options and system variables. Flags are
19268    /// specified with underscores, not hyphens. For more information, see
19269    /// [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
19270    /// in the Cloud SQL documentation.
19271    pub name: std::string::String,
19272
19273    /// The value of the flag. Boolean flags are set to `on` for true
19274    /// and `off` for false. This field must be omitted if the flag
19275    /// doesn't take a value.
19276    pub value: std::string::String,
19277
19278    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19279}
19280
19281impl DatabaseFlags {
19282    /// Creates a new default instance.
19283    pub fn new() -> Self {
19284        std::default::Default::default()
19285    }
19286
19287    /// Sets the value of [name][crate::model::DatabaseFlags::name].
19288    ///
19289    /// # Example
19290    /// ```ignore,no_run
19291    /// # use google_cloud_sql_v1::model::DatabaseFlags;
19292    /// let x = DatabaseFlags::new().set_name("example");
19293    /// ```
19294    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19295        self.name = v.into();
19296        self
19297    }
19298
19299    /// Sets the value of [value][crate::model::DatabaseFlags::value].
19300    ///
19301    /// # Example
19302    /// ```ignore,no_run
19303    /// # use google_cloud_sql_v1::model::DatabaseFlags;
19304    /// let x = DatabaseFlags::new().set_value("example");
19305    /// ```
19306    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19307        self.value = v.into();
19308        self
19309    }
19310}
19311
19312impl wkt::message::Message for DatabaseFlags {
19313    fn typename() -> &'static str {
19314        "type.googleapis.com/google.cloud.sql.v1.DatabaseFlags"
19315    }
19316}
19317
19318/// MySQL-specific external server sync settings.
19319#[derive(Clone, Default, PartialEq)]
19320#[non_exhaustive]
19321pub struct MySqlSyncConfig {
19322    /// Flags to use for the initial dump.
19323    pub initial_sync_flags: std::vec::Vec<crate::model::SyncFlags>,
19324
19325    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19326}
19327
19328impl MySqlSyncConfig {
19329    /// Creates a new default instance.
19330    pub fn new() -> Self {
19331        std::default::Default::default()
19332    }
19333
19334    /// Sets the value of [initial_sync_flags][crate::model::MySqlSyncConfig::initial_sync_flags].
19335    ///
19336    /// # Example
19337    /// ```ignore,no_run
19338    /// # use google_cloud_sql_v1::model::MySqlSyncConfig;
19339    /// use google_cloud_sql_v1::model::SyncFlags;
19340    /// let x = MySqlSyncConfig::new()
19341    ///     .set_initial_sync_flags([
19342    ///         SyncFlags::default()/* use setters */,
19343    ///         SyncFlags::default()/* use (different) setters */,
19344    ///     ]);
19345    /// ```
19346    pub fn set_initial_sync_flags<T, V>(mut self, v: T) -> Self
19347    where
19348        T: std::iter::IntoIterator<Item = V>,
19349        V: std::convert::Into<crate::model::SyncFlags>,
19350    {
19351        use std::iter::Iterator;
19352        self.initial_sync_flags = v.into_iter().map(|i| i.into()).collect();
19353        self
19354    }
19355}
19356
19357impl wkt::message::Message for MySqlSyncConfig {
19358    fn typename() -> &'static str {
19359        "type.googleapis.com/google.cloud.sql.v1.MySqlSyncConfig"
19360    }
19361}
19362
19363/// Initial sync flags for certain Cloud SQL APIs.
19364/// Currently used for the MySQL external server initial dump.
19365#[derive(Clone, Default, PartialEq)]
19366#[non_exhaustive]
19367pub struct SyncFlags {
19368    /// The name of the flag.
19369    pub name: std::string::String,
19370
19371    /// The value of the flag. This field must be omitted if the flag
19372    /// doesn't take a value.
19373    pub value: std::string::String,
19374
19375    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19376}
19377
19378impl SyncFlags {
19379    /// Creates a new default instance.
19380    pub fn new() -> Self {
19381        std::default::Default::default()
19382    }
19383
19384    /// Sets the value of [name][crate::model::SyncFlags::name].
19385    ///
19386    /// # Example
19387    /// ```ignore,no_run
19388    /// # use google_cloud_sql_v1::model::SyncFlags;
19389    /// let x = SyncFlags::new().set_name("example");
19390    /// ```
19391    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19392        self.name = v.into();
19393        self
19394    }
19395
19396    /// Sets the value of [value][crate::model::SyncFlags::value].
19397    ///
19398    /// # Example
19399    /// ```ignore,no_run
19400    /// # use google_cloud_sql_v1::model::SyncFlags;
19401    /// let x = SyncFlags::new().set_value("example");
19402    /// ```
19403    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19404        self.value = v.into();
19405        self
19406    }
19407}
19408
19409impl wkt::message::Message for SyncFlags {
19410    fn typename() -> &'static str {
19411        "type.googleapis.com/google.cloud.sql.v1.SyncFlags"
19412    }
19413}
19414
19415/// Reference to another Cloud SQL instance.
19416#[derive(Clone, Default, PartialEq)]
19417#[non_exhaustive]
19418pub struct InstanceReference {
19419    /// The name of the Cloud SQL instance being referenced.
19420    /// This does not include the project ID.
19421    pub name: std::string::String,
19422
19423    /// The region of the Cloud SQL instance being referenced.
19424    pub region: std::string::String,
19425
19426    /// The project ID of the Cloud SQL instance being referenced.
19427    /// The default is the same project ID as the instance references it.
19428    pub project: std::string::String,
19429
19430    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19431}
19432
19433impl InstanceReference {
19434    /// Creates a new default instance.
19435    pub fn new() -> Self {
19436        std::default::Default::default()
19437    }
19438
19439    /// Sets the value of [name][crate::model::InstanceReference::name].
19440    ///
19441    /// # Example
19442    /// ```ignore,no_run
19443    /// # use google_cloud_sql_v1::model::InstanceReference;
19444    /// let x = InstanceReference::new().set_name("example");
19445    /// ```
19446    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19447        self.name = v.into();
19448        self
19449    }
19450
19451    /// Sets the value of [region][crate::model::InstanceReference::region].
19452    ///
19453    /// # Example
19454    /// ```ignore,no_run
19455    /// # use google_cloud_sql_v1::model::InstanceReference;
19456    /// let x = InstanceReference::new().set_region("example");
19457    /// ```
19458    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19459        self.region = v.into();
19460        self
19461    }
19462
19463    /// Sets the value of [project][crate::model::InstanceReference::project].
19464    ///
19465    /// # Example
19466    /// ```ignore,no_run
19467    /// # use google_cloud_sql_v1::model::InstanceReference;
19468    /// let x = InstanceReference::new().set_project("example");
19469    /// ```
19470    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19471        self.project = v.into();
19472        self
19473    }
19474}
19475
19476impl wkt::message::Message for InstanceReference {
19477    fn typename() -> &'static str {
19478        "type.googleapis.com/google.cloud.sql.v1.InstanceReference"
19479    }
19480}
19481
19482/// Read-replica configuration for connecting to the on-premises primary
19483/// instance.
19484#[derive(Clone, Default, PartialEq)]
19485#[non_exhaustive]
19486pub struct DemoteMasterConfiguration {
19487    /// This is always `sql#demoteMasterConfiguration`.
19488    pub kind: std::string::String,
19489
19490    /// MySQL specific configuration when replicating from a MySQL on-premises
19491    /// primary instance. Replication configuration information such as the
19492    /// username, password, certificates, and keys are not stored in the instance
19493    /// metadata. The configuration information is used only to set up the
19494    /// replication connection and is stored by MySQL in a file named
19495    /// `master.info` in the data directory.
19496    pub mysql_replica_configuration:
19497        std::option::Option<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19498
19499    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19500}
19501
19502impl DemoteMasterConfiguration {
19503    /// Creates a new default instance.
19504    pub fn new() -> Self {
19505        std::default::Default::default()
19506    }
19507
19508    /// Sets the value of [kind][crate::model::DemoteMasterConfiguration::kind].
19509    ///
19510    /// # Example
19511    /// ```ignore,no_run
19512    /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19513    /// let x = DemoteMasterConfiguration::new().set_kind("example");
19514    /// ```
19515    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19516        self.kind = v.into();
19517        self
19518    }
19519
19520    /// Sets the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
19521    ///
19522    /// # Example
19523    /// ```ignore,no_run
19524    /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19525    /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19526    /// let x = DemoteMasterConfiguration::new().set_mysql_replica_configuration(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */);
19527    /// ```
19528    pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
19529    where
19530        T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19531    {
19532        self.mysql_replica_configuration = std::option::Option::Some(v.into());
19533        self
19534    }
19535
19536    /// Sets or clears the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
19537    ///
19538    /// # Example
19539    /// ```ignore,no_run
19540    /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19541    /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19542    /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(Some(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */));
19543    /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(None::<DemoteMasterMySqlReplicaConfiguration>);
19544    /// ```
19545    pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
19546    where
19547        T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19548    {
19549        self.mysql_replica_configuration = v.map(|x| x.into());
19550        self
19551    }
19552}
19553
19554impl wkt::message::Message for DemoteMasterConfiguration {
19555    fn typename() -> &'static str {
19556        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterConfiguration"
19557    }
19558}
19559
19560/// Read-replica configuration specific to MySQL databases.
19561#[derive(Clone, Default, PartialEq)]
19562#[non_exhaustive]
19563pub struct DemoteMasterMySqlReplicaConfiguration {
19564    /// This is always `sql#demoteMasterMysqlReplicaConfiguration`.
19565    pub kind: std::string::String,
19566
19567    /// The username for the replication connection.
19568    pub username: std::string::String,
19569
19570    /// The password for the replication connection.
19571    pub password: std::string::String,
19572
19573    /// PEM representation of the replica's private key. The corresponding public
19574    /// key is encoded in the client's certificate. The format of the replica's
19575    /// private key can be either PKCS #1 or PKCS #8.
19576    pub client_key: std::string::String,
19577
19578    /// PEM representation of the replica's x509 certificate.
19579    pub client_certificate: std::string::String,
19580
19581    /// PEM representation of the trusted CA's x509 certificate.
19582    pub ca_certificate: std::string::String,
19583
19584    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19585}
19586
19587impl DemoteMasterMySqlReplicaConfiguration {
19588    /// Creates a new default instance.
19589    pub fn new() -> Self {
19590        std::default::Default::default()
19591    }
19592
19593    /// Sets the value of [kind][crate::model::DemoteMasterMySqlReplicaConfiguration::kind].
19594    ///
19595    /// # Example
19596    /// ```ignore,no_run
19597    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19598    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_kind("example");
19599    /// ```
19600    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19601        self.kind = v.into();
19602        self
19603    }
19604
19605    /// Sets the value of [username][crate::model::DemoteMasterMySqlReplicaConfiguration::username].
19606    ///
19607    /// # Example
19608    /// ```ignore,no_run
19609    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19610    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_username("example");
19611    /// ```
19612    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19613        self.username = v.into();
19614        self
19615    }
19616
19617    /// Sets the value of [password][crate::model::DemoteMasterMySqlReplicaConfiguration::password].
19618    ///
19619    /// # Example
19620    /// ```ignore,no_run
19621    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19622    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_password("example");
19623    /// ```
19624    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19625        self.password = v.into();
19626        self
19627    }
19628
19629    /// Sets the value of [client_key][crate::model::DemoteMasterMySqlReplicaConfiguration::client_key].
19630    ///
19631    /// # Example
19632    /// ```ignore,no_run
19633    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19634    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_key("example");
19635    /// ```
19636    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19637        self.client_key = v.into();
19638        self
19639    }
19640
19641    /// Sets the value of [client_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::client_certificate].
19642    ///
19643    /// # Example
19644    /// ```ignore,no_run
19645    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19646    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_certificate("example");
19647    /// ```
19648    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
19649        mut self,
19650        v: T,
19651    ) -> Self {
19652        self.client_certificate = v.into();
19653        self
19654    }
19655
19656    /// Sets the value of [ca_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::ca_certificate].
19657    ///
19658    /// # Example
19659    /// ```ignore,no_run
19660    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19661    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_ca_certificate("example");
19662    /// ```
19663    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19664        self.ca_certificate = v.into();
19665        self
19666    }
19667}
19668
19669impl wkt::message::Message for DemoteMasterMySqlReplicaConfiguration {
19670    fn typename() -> &'static str {
19671        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration"
19672    }
19673}
19674
19675/// Database instance export context.
19676#[derive(Clone, Default, PartialEq)]
19677#[non_exhaustive]
19678pub struct ExportContext {
19679    /// The path to the file in Google Cloud Storage where the export will be
19680    /// stored. The URI is in the form `gs://bucketName/fileName`. If the file
19681    /// already exists, the request succeeds, but the operation fails. If
19682    /// `fileType` is `SQL` and the filename ends with .gz,
19683    /// the contents are compressed.
19684    pub uri: std::string::String,
19685
19686    /// Databases to be exported. <br /> `MySQL instances:` If
19687    /// `fileType` is `SQL` and no database is specified, all
19688    /// databases are exported, except for the `mysql` system database.
19689    /// If `fileType` is `CSV`, you can specify one database,
19690    /// either by using this property or by using the
19691    /// `csvExportOptions.selectQuery` property, which takes precedence
19692    /// over this property. <br /> `PostgreSQL instances:` If you don't specify a
19693    /// database by name, all user databases in the instance are exported.
19694    /// This excludes system databases and Cloud SQL databases used to manage
19695    /// internal operations. Exporting all user databases is only available for
19696    /// directory-formatted parallel export. If `fileType` is `CSV`,
19697    /// this database must match the one specified in the
19698    /// `csvExportOptions.selectQuery` property. <br /> `SQL Server
19699    /// instances:` You must specify one database to be exported, and the
19700    /// `fileType` must be `BAK`.
19701    pub databases: std::vec::Vec<std::string::String>,
19702
19703    /// This is always `sql#exportContext`.
19704    pub kind: std::string::String,
19705
19706    /// Options for exporting data as SQL statements.
19707    pub sql_export_options: std::option::Option<crate::model::export_context::SqlExportOptions>,
19708
19709    /// Options for exporting data as CSV. `MySQL` and `PostgreSQL`
19710    /// instances only.
19711    pub csv_export_options: std::option::Option<crate::model::export_context::SqlCsvExportOptions>,
19712
19713    /// The file type for the specified uri.
19714    pub file_type: crate::model::SqlFileType,
19715
19716    /// Whether to perform a serverless export.
19717    pub offload: std::option::Option<wkt::BoolValue>,
19718
19719    /// Options for exporting data as BAK files.
19720    pub bak_export_options: std::option::Option<crate::model::export_context::SqlBakExportOptions>,
19721
19722    /// Optional. Export parameters specific to SQL Server TDE certificates
19723    pub tde_export_options: std::option::Option<crate::model::export_context::SqlTdeExportOptions>,
19724
19725    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19726}
19727
19728impl ExportContext {
19729    /// Creates a new default instance.
19730    pub fn new() -> Self {
19731        std::default::Default::default()
19732    }
19733
19734    /// Sets the value of [uri][crate::model::ExportContext::uri].
19735    ///
19736    /// # Example
19737    /// ```ignore,no_run
19738    /// # use google_cloud_sql_v1::model::ExportContext;
19739    /// let x = ExportContext::new().set_uri("example");
19740    /// ```
19741    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19742        self.uri = v.into();
19743        self
19744    }
19745
19746    /// Sets the value of [databases][crate::model::ExportContext::databases].
19747    ///
19748    /// # Example
19749    /// ```ignore,no_run
19750    /// # use google_cloud_sql_v1::model::ExportContext;
19751    /// let x = ExportContext::new().set_databases(["a", "b", "c"]);
19752    /// ```
19753    pub fn set_databases<T, V>(mut self, v: T) -> Self
19754    where
19755        T: std::iter::IntoIterator<Item = V>,
19756        V: std::convert::Into<std::string::String>,
19757    {
19758        use std::iter::Iterator;
19759        self.databases = v.into_iter().map(|i| i.into()).collect();
19760        self
19761    }
19762
19763    /// Sets the value of [kind][crate::model::ExportContext::kind].
19764    ///
19765    /// # Example
19766    /// ```ignore,no_run
19767    /// # use google_cloud_sql_v1::model::ExportContext;
19768    /// let x = ExportContext::new().set_kind("example");
19769    /// ```
19770    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19771        self.kind = v.into();
19772        self
19773    }
19774
19775    /// Sets the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
19776    ///
19777    /// # Example
19778    /// ```ignore,no_run
19779    /// # use google_cloud_sql_v1::model::ExportContext;
19780    /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19781    /// let x = ExportContext::new().set_sql_export_options(SqlExportOptions::default()/* use setters */);
19782    /// ```
19783    pub fn set_sql_export_options<T>(mut self, v: T) -> Self
19784    where
19785        T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
19786    {
19787        self.sql_export_options = std::option::Option::Some(v.into());
19788        self
19789    }
19790
19791    /// Sets or clears the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
19792    ///
19793    /// # Example
19794    /// ```ignore,no_run
19795    /// # use google_cloud_sql_v1::model::ExportContext;
19796    /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19797    /// let x = ExportContext::new().set_or_clear_sql_export_options(Some(SqlExportOptions::default()/* use setters */));
19798    /// let x = ExportContext::new().set_or_clear_sql_export_options(None::<SqlExportOptions>);
19799    /// ```
19800    pub fn set_or_clear_sql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19801    where
19802        T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
19803    {
19804        self.sql_export_options = v.map(|x| x.into());
19805        self
19806    }
19807
19808    /// Sets the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
19809    ///
19810    /// # Example
19811    /// ```ignore,no_run
19812    /// # use google_cloud_sql_v1::model::ExportContext;
19813    /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19814    /// let x = ExportContext::new().set_csv_export_options(SqlCsvExportOptions::default()/* use setters */);
19815    /// ```
19816    pub fn set_csv_export_options<T>(mut self, v: T) -> Self
19817    where
19818        T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
19819    {
19820        self.csv_export_options = std::option::Option::Some(v.into());
19821        self
19822    }
19823
19824    /// Sets or clears the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
19825    ///
19826    /// # Example
19827    /// ```ignore,no_run
19828    /// # use google_cloud_sql_v1::model::ExportContext;
19829    /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19830    /// let x = ExportContext::new().set_or_clear_csv_export_options(Some(SqlCsvExportOptions::default()/* use setters */));
19831    /// let x = ExportContext::new().set_or_clear_csv_export_options(None::<SqlCsvExportOptions>);
19832    /// ```
19833    pub fn set_or_clear_csv_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19834    where
19835        T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
19836    {
19837        self.csv_export_options = v.map(|x| x.into());
19838        self
19839    }
19840
19841    /// Sets the value of [file_type][crate::model::ExportContext::file_type].
19842    ///
19843    /// # Example
19844    /// ```ignore,no_run
19845    /// # use google_cloud_sql_v1::model::ExportContext;
19846    /// use google_cloud_sql_v1::model::SqlFileType;
19847    /// let x0 = ExportContext::new().set_file_type(SqlFileType::Sql);
19848    /// let x1 = ExportContext::new().set_file_type(SqlFileType::Csv);
19849    /// let x2 = ExportContext::new().set_file_type(SqlFileType::Bak);
19850    /// ```
19851    pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
19852        self.file_type = v.into();
19853        self
19854    }
19855
19856    /// Sets the value of [offload][crate::model::ExportContext::offload].
19857    ///
19858    /// # Example
19859    /// ```ignore,no_run
19860    /// # use google_cloud_sql_v1::model::ExportContext;
19861    /// use wkt::BoolValue;
19862    /// let x = ExportContext::new().set_offload(BoolValue::default()/* use setters */);
19863    /// ```
19864    pub fn set_offload<T>(mut self, v: T) -> Self
19865    where
19866        T: std::convert::Into<wkt::BoolValue>,
19867    {
19868        self.offload = std::option::Option::Some(v.into());
19869        self
19870    }
19871
19872    /// Sets or clears the value of [offload][crate::model::ExportContext::offload].
19873    ///
19874    /// # Example
19875    /// ```ignore,no_run
19876    /// # use google_cloud_sql_v1::model::ExportContext;
19877    /// use wkt::BoolValue;
19878    /// let x = ExportContext::new().set_or_clear_offload(Some(BoolValue::default()/* use setters */));
19879    /// let x = ExportContext::new().set_or_clear_offload(None::<BoolValue>);
19880    /// ```
19881    pub fn set_or_clear_offload<T>(mut self, v: std::option::Option<T>) -> Self
19882    where
19883        T: std::convert::Into<wkt::BoolValue>,
19884    {
19885        self.offload = v.map(|x| x.into());
19886        self
19887    }
19888
19889    /// Sets the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
19890    ///
19891    /// # Example
19892    /// ```ignore,no_run
19893    /// # use google_cloud_sql_v1::model::ExportContext;
19894    /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
19895    /// let x = ExportContext::new().set_bak_export_options(SqlBakExportOptions::default()/* use setters */);
19896    /// ```
19897    pub fn set_bak_export_options<T>(mut self, v: T) -> Self
19898    where
19899        T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
19900    {
19901        self.bak_export_options = std::option::Option::Some(v.into());
19902        self
19903    }
19904
19905    /// Sets or clears the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
19906    ///
19907    /// # Example
19908    /// ```ignore,no_run
19909    /// # use google_cloud_sql_v1::model::ExportContext;
19910    /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
19911    /// let x = ExportContext::new().set_or_clear_bak_export_options(Some(SqlBakExportOptions::default()/* use setters */));
19912    /// let x = ExportContext::new().set_or_clear_bak_export_options(None::<SqlBakExportOptions>);
19913    /// ```
19914    pub fn set_or_clear_bak_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19915    where
19916        T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
19917    {
19918        self.bak_export_options = v.map(|x| x.into());
19919        self
19920    }
19921
19922    /// Sets the value of [tde_export_options][crate::model::ExportContext::tde_export_options].
19923    ///
19924    /// # Example
19925    /// ```ignore,no_run
19926    /// # use google_cloud_sql_v1::model::ExportContext;
19927    /// use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
19928    /// let x = ExportContext::new().set_tde_export_options(SqlTdeExportOptions::default()/* use setters */);
19929    /// ```
19930    pub fn set_tde_export_options<T>(mut self, v: T) -> Self
19931    where
19932        T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
19933    {
19934        self.tde_export_options = std::option::Option::Some(v.into());
19935        self
19936    }
19937
19938    /// Sets or clears the value of [tde_export_options][crate::model::ExportContext::tde_export_options].
19939    ///
19940    /// # Example
19941    /// ```ignore,no_run
19942    /// # use google_cloud_sql_v1::model::ExportContext;
19943    /// use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
19944    /// let x = ExportContext::new().set_or_clear_tde_export_options(Some(SqlTdeExportOptions::default()/* use setters */));
19945    /// let x = ExportContext::new().set_or_clear_tde_export_options(None::<SqlTdeExportOptions>);
19946    /// ```
19947    pub fn set_or_clear_tde_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19948    where
19949        T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
19950    {
19951        self.tde_export_options = v.map(|x| x.into());
19952        self
19953    }
19954}
19955
19956impl wkt::message::Message for ExportContext {
19957    fn typename() -> &'static str {
19958        "type.googleapis.com/google.cloud.sql.v1.ExportContext"
19959    }
19960}
19961
19962/// Defines additional types related to [ExportContext].
19963pub mod export_context {
19964    #[allow(unused_imports)]
19965    use super::*;
19966
19967    #[allow(missing_docs)]
19968    #[derive(Clone, Default, PartialEq)]
19969    #[non_exhaustive]
19970    pub struct SqlCsvExportOptions {
19971        /// The select query used to extract the data.
19972        pub select_query: std::string::String,
19973
19974        /// Specifies the character that should appear before a data character that
19975        /// needs to be escaped.
19976        pub escape_character: std::string::String,
19977
19978        /// Specifies the quoting character to be used when a data value is quoted.
19979        pub quote_character: std::string::String,
19980
19981        /// Specifies the character that separates columns within each row (line) of
19982        /// the file.
19983        pub fields_terminated_by: std::string::String,
19984
19985        /// This is used to separate lines. If a line does not contain all fields,
19986        /// the rest of the columns are set to their default values.
19987        pub lines_terminated_by: std::string::String,
19988
19989        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19990    }
19991
19992    impl SqlCsvExportOptions {
19993        /// Creates a new default instance.
19994        pub fn new() -> Self {
19995            std::default::Default::default()
19996        }
19997
19998        /// Sets the value of [select_query][crate::model::export_context::SqlCsvExportOptions::select_query].
19999        ///
20000        /// # Example
20001        /// ```ignore,no_run
20002        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20003        /// let x = SqlCsvExportOptions::new().set_select_query("example");
20004        /// ```
20005        pub fn set_select_query<T: std::convert::Into<std::string::String>>(
20006            mut self,
20007            v: T,
20008        ) -> Self {
20009            self.select_query = v.into();
20010            self
20011        }
20012
20013        /// Sets the value of [escape_character][crate::model::export_context::SqlCsvExportOptions::escape_character].
20014        ///
20015        /// # Example
20016        /// ```ignore,no_run
20017        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20018        /// let x = SqlCsvExportOptions::new().set_escape_character("example");
20019        /// ```
20020        pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
20021            mut self,
20022            v: T,
20023        ) -> Self {
20024            self.escape_character = v.into();
20025            self
20026        }
20027
20028        /// Sets the value of [quote_character][crate::model::export_context::SqlCsvExportOptions::quote_character].
20029        ///
20030        /// # Example
20031        /// ```ignore,no_run
20032        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20033        /// let x = SqlCsvExportOptions::new().set_quote_character("example");
20034        /// ```
20035        pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
20036            mut self,
20037            v: T,
20038        ) -> Self {
20039            self.quote_character = v.into();
20040            self
20041        }
20042
20043        /// Sets the value of [fields_terminated_by][crate::model::export_context::SqlCsvExportOptions::fields_terminated_by].
20044        ///
20045        /// # Example
20046        /// ```ignore,no_run
20047        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20048        /// let x = SqlCsvExportOptions::new().set_fields_terminated_by("example");
20049        /// ```
20050        pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
20051            mut self,
20052            v: T,
20053        ) -> Self {
20054            self.fields_terminated_by = v.into();
20055            self
20056        }
20057
20058        /// Sets the value of [lines_terminated_by][crate::model::export_context::SqlCsvExportOptions::lines_terminated_by].
20059        ///
20060        /// # Example
20061        /// ```ignore,no_run
20062        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20063        /// let x = SqlCsvExportOptions::new().set_lines_terminated_by("example");
20064        /// ```
20065        pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
20066            mut self,
20067            v: T,
20068        ) -> Self {
20069            self.lines_terminated_by = v.into();
20070            self
20071        }
20072    }
20073
20074    impl wkt::message::Message for SqlCsvExportOptions {
20075        fn typename() -> &'static str {
20076            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlCsvExportOptions"
20077        }
20078    }
20079
20080    #[allow(missing_docs)]
20081    #[derive(Clone, Default, PartialEq)]
20082    #[non_exhaustive]
20083    pub struct SqlExportOptions {
20084        /// Tables to export, or that were exported, from the specified database. If
20085        /// you specify tables, specify one and only one database. For PostgreSQL
20086        /// instances, you can specify only one table.
20087        pub tables: std::vec::Vec<std::string::String>,
20088
20089        /// Export only schemas.
20090        pub schema_only: std::option::Option<wkt::BoolValue>,
20091
20092        #[allow(missing_docs)]
20093        pub mysql_export_options: std::option::Option<
20094            crate::model::export_context::sql_export_options::MysqlExportOptions,
20095        >,
20096
20097        /// Optional. The number of threads to use for parallel export.
20098        pub threads: std::option::Option<wkt::Int32Value>,
20099
20100        /// Optional. Whether or not the export should be parallel.
20101        pub parallel: std::option::Option<wkt::BoolValue>,
20102
20103        /// Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
20104        pub postgres_export_options: std::option::Option<
20105            crate::model::export_context::sql_export_options::PostgresExportOptions,
20106        >,
20107
20108        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20109    }
20110
20111    impl SqlExportOptions {
20112        /// Creates a new default instance.
20113        pub fn new() -> Self {
20114            std::default::Default::default()
20115        }
20116
20117        /// Sets the value of [tables][crate::model::export_context::SqlExportOptions::tables].
20118        ///
20119        /// # Example
20120        /// ```ignore,no_run
20121        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20122        /// let x = SqlExportOptions::new().set_tables(["a", "b", "c"]);
20123        /// ```
20124        pub fn set_tables<T, V>(mut self, v: T) -> Self
20125        where
20126            T: std::iter::IntoIterator<Item = V>,
20127            V: std::convert::Into<std::string::String>,
20128        {
20129            use std::iter::Iterator;
20130            self.tables = v.into_iter().map(|i| i.into()).collect();
20131            self
20132        }
20133
20134        /// Sets the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
20135        ///
20136        /// # Example
20137        /// ```ignore,no_run
20138        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20139        /// use wkt::BoolValue;
20140        /// let x = SqlExportOptions::new().set_schema_only(BoolValue::default()/* use setters */);
20141        /// ```
20142        pub fn set_schema_only<T>(mut self, v: T) -> Self
20143        where
20144            T: std::convert::Into<wkt::BoolValue>,
20145        {
20146            self.schema_only = std::option::Option::Some(v.into());
20147            self
20148        }
20149
20150        /// Sets or clears the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
20151        ///
20152        /// # Example
20153        /// ```ignore,no_run
20154        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20155        /// use wkt::BoolValue;
20156        /// let x = SqlExportOptions::new().set_or_clear_schema_only(Some(BoolValue::default()/* use setters */));
20157        /// let x = SqlExportOptions::new().set_or_clear_schema_only(None::<BoolValue>);
20158        /// ```
20159        pub fn set_or_clear_schema_only<T>(mut self, v: std::option::Option<T>) -> Self
20160        where
20161            T: std::convert::Into<wkt::BoolValue>,
20162        {
20163            self.schema_only = v.map(|x| x.into());
20164            self
20165        }
20166
20167        /// Sets the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
20168        ///
20169        /// # Example
20170        /// ```ignore,no_run
20171        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20172        /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20173        /// let x = SqlExportOptions::new().set_mysql_export_options(MysqlExportOptions::default()/* use setters */);
20174        /// ```
20175        pub fn set_mysql_export_options<T>(mut self, v: T) -> Self
20176        where
20177            T: std::convert::Into<
20178                    crate::model::export_context::sql_export_options::MysqlExportOptions,
20179                >,
20180        {
20181            self.mysql_export_options = std::option::Option::Some(v.into());
20182            self
20183        }
20184
20185        /// Sets or clears the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
20186        ///
20187        /// # Example
20188        /// ```ignore,no_run
20189        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20190        /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20191        /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(Some(MysqlExportOptions::default()/* use setters */));
20192        /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(None::<MysqlExportOptions>);
20193        /// ```
20194        pub fn set_or_clear_mysql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20195        where
20196            T: std::convert::Into<
20197                    crate::model::export_context::sql_export_options::MysqlExportOptions,
20198                >,
20199        {
20200            self.mysql_export_options = v.map(|x| x.into());
20201            self
20202        }
20203
20204        /// Sets the value of [threads][crate::model::export_context::SqlExportOptions::threads].
20205        ///
20206        /// # Example
20207        /// ```ignore,no_run
20208        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20209        /// use wkt::Int32Value;
20210        /// let x = SqlExportOptions::new().set_threads(Int32Value::default()/* use setters */);
20211        /// ```
20212        pub fn set_threads<T>(mut self, v: T) -> Self
20213        where
20214            T: std::convert::Into<wkt::Int32Value>,
20215        {
20216            self.threads = std::option::Option::Some(v.into());
20217            self
20218        }
20219
20220        /// Sets or clears the value of [threads][crate::model::export_context::SqlExportOptions::threads].
20221        ///
20222        /// # Example
20223        /// ```ignore,no_run
20224        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20225        /// use wkt::Int32Value;
20226        /// let x = SqlExportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
20227        /// let x = SqlExportOptions::new().set_or_clear_threads(None::<Int32Value>);
20228        /// ```
20229        pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
20230        where
20231            T: std::convert::Into<wkt::Int32Value>,
20232        {
20233            self.threads = v.map(|x| x.into());
20234            self
20235        }
20236
20237        /// Sets the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
20238        ///
20239        /// # Example
20240        /// ```ignore,no_run
20241        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20242        /// use wkt::BoolValue;
20243        /// let x = SqlExportOptions::new().set_parallel(BoolValue::default()/* use setters */);
20244        /// ```
20245        pub fn set_parallel<T>(mut self, v: T) -> Self
20246        where
20247            T: std::convert::Into<wkt::BoolValue>,
20248        {
20249            self.parallel = std::option::Option::Some(v.into());
20250            self
20251        }
20252
20253        /// Sets or clears the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
20254        ///
20255        /// # Example
20256        /// ```ignore,no_run
20257        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20258        /// use wkt::BoolValue;
20259        /// let x = SqlExportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
20260        /// let x = SqlExportOptions::new().set_or_clear_parallel(None::<BoolValue>);
20261        /// ```
20262        pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
20263        where
20264            T: std::convert::Into<wkt::BoolValue>,
20265        {
20266            self.parallel = v.map(|x| x.into());
20267            self
20268        }
20269
20270        /// Sets the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
20271        ///
20272        /// # Example
20273        /// ```ignore,no_run
20274        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20275        /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20276        /// let x = SqlExportOptions::new().set_postgres_export_options(PostgresExportOptions::default()/* use setters */);
20277        /// ```
20278        pub fn set_postgres_export_options<T>(mut self, v: T) -> Self
20279        where
20280            T: std::convert::Into<
20281                    crate::model::export_context::sql_export_options::PostgresExportOptions,
20282                >,
20283        {
20284            self.postgres_export_options = std::option::Option::Some(v.into());
20285            self
20286        }
20287
20288        /// Sets or clears the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
20289        ///
20290        /// # Example
20291        /// ```ignore,no_run
20292        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20293        /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20294        /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(Some(PostgresExportOptions::default()/* use setters */));
20295        /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(None::<PostgresExportOptions>);
20296        /// ```
20297        pub fn set_or_clear_postgres_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20298        where
20299            T: std::convert::Into<
20300                    crate::model::export_context::sql_export_options::PostgresExportOptions,
20301                >,
20302        {
20303            self.postgres_export_options = v.map(|x| x.into());
20304            self
20305        }
20306    }
20307
20308    impl wkt::message::Message for SqlExportOptions {
20309        fn typename() -> &'static str {
20310            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions"
20311        }
20312    }
20313
20314    /// Defines additional types related to [SqlExportOptions].
20315    pub mod sql_export_options {
20316        #[allow(unused_imports)]
20317        use super::*;
20318
20319        /// Options for exporting from MySQL.
20320        #[derive(Clone, Default, PartialEq)]
20321        #[non_exhaustive]
20322        pub struct MysqlExportOptions {
20323            /// Option to include SQL statement required to set up replication. If set
20324            /// to `1`, the dump file includes a CHANGE MASTER TO statement with the
20325            /// binary log coordinates, and --set-gtid-purged is set to ON. If set to
20326            /// `2`, the CHANGE MASTER TO statement is written as a SQL comment and
20327            /// has no effect. If set to any value other than `1`, --set-gtid-purged
20328            /// is set to OFF.
20329            pub master_data: std::option::Option<wkt::Int32Value>,
20330
20331            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20332        }
20333
20334        impl MysqlExportOptions {
20335            /// Creates a new default instance.
20336            pub fn new() -> Self {
20337                std::default::Default::default()
20338            }
20339
20340            /// Sets the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
20341            ///
20342            /// # Example
20343            /// ```ignore,no_run
20344            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20345            /// use wkt::Int32Value;
20346            /// let x = MysqlExportOptions::new().set_master_data(Int32Value::default()/* use setters */);
20347            /// ```
20348            pub fn set_master_data<T>(mut self, v: T) -> Self
20349            where
20350                T: std::convert::Into<wkt::Int32Value>,
20351            {
20352                self.master_data = std::option::Option::Some(v.into());
20353                self
20354            }
20355
20356            /// Sets or clears the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
20357            ///
20358            /// # Example
20359            /// ```ignore,no_run
20360            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20361            /// use wkt::Int32Value;
20362            /// let x = MysqlExportOptions::new().set_or_clear_master_data(Some(Int32Value::default()/* use setters */));
20363            /// let x = MysqlExportOptions::new().set_or_clear_master_data(None::<Int32Value>);
20364            /// ```
20365            pub fn set_or_clear_master_data<T>(mut self, v: std::option::Option<T>) -> Self
20366            where
20367                T: std::convert::Into<wkt::Int32Value>,
20368            {
20369                self.master_data = v.map(|x| x.into());
20370                self
20371            }
20372        }
20373
20374        impl wkt::message::Message for MysqlExportOptions {
20375            fn typename() -> &'static str {
20376                "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions"
20377            }
20378        }
20379
20380        /// Options for exporting from a Cloud SQL for PostgreSQL instance.
20381        #[derive(Clone, Default, PartialEq)]
20382        #[non_exhaustive]
20383        pub struct PostgresExportOptions {
20384            /// Optional. Use this option to include DROP \<code\>&lt;object&gt;\</code\>
20385            /// SQL statements. Use these statements to delete database objects before
20386            /// running the import operation.
20387            pub clean: std::option::Option<wkt::BoolValue>,
20388
20389            /// Optional. Option to include an IF EXISTS SQL statement with each DROP
20390            /// statement produced by clean.
20391            pub if_exists: std::option::Option<wkt::BoolValue>,
20392
20393            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20394        }
20395
20396        impl PostgresExportOptions {
20397            /// Creates a new default instance.
20398            pub fn new() -> Self {
20399                std::default::Default::default()
20400            }
20401
20402            /// Sets the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
20403            ///
20404            /// # Example
20405            /// ```ignore,no_run
20406            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20407            /// use wkt::BoolValue;
20408            /// let x = PostgresExportOptions::new().set_clean(BoolValue::default()/* use setters */);
20409            /// ```
20410            pub fn set_clean<T>(mut self, v: T) -> Self
20411            where
20412                T: std::convert::Into<wkt::BoolValue>,
20413            {
20414                self.clean = std::option::Option::Some(v.into());
20415                self
20416            }
20417
20418            /// Sets or clears the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
20419            ///
20420            /// # Example
20421            /// ```ignore,no_run
20422            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20423            /// use wkt::BoolValue;
20424            /// let x = PostgresExportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
20425            /// let x = PostgresExportOptions::new().set_or_clear_clean(None::<BoolValue>);
20426            /// ```
20427            pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
20428            where
20429                T: std::convert::Into<wkt::BoolValue>,
20430            {
20431                self.clean = v.map(|x| x.into());
20432                self
20433            }
20434
20435            /// Sets the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
20436            ///
20437            /// # Example
20438            /// ```ignore,no_run
20439            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20440            /// use wkt::BoolValue;
20441            /// let x = PostgresExportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
20442            /// ```
20443            pub fn set_if_exists<T>(mut self, v: T) -> Self
20444            where
20445                T: std::convert::Into<wkt::BoolValue>,
20446            {
20447                self.if_exists = std::option::Option::Some(v.into());
20448                self
20449            }
20450
20451            /// Sets or clears the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
20452            ///
20453            /// # Example
20454            /// ```ignore,no_run
20455            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20456            /// use wkt::BoolValue;
20457            /// let x = PostgresExportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
20458            /// let x = PostgresExportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
20459            /// ```
20460            pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
20461            where
20462                T: std::convert::Into<wkt::BoolValue>,
20463            {
20464                self.if_exists = v.map(|x| x.into());
20465                self
20466            }
20467        }
20468
20469        impl wkt::message::Message for PostgresExportOptions {
20470            fn typename() -> &'static str {
20471                "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions"
20472            }
20473        }
20474    }
20475
20476    /// Options for exporting BAK files (SQL Server-only)
20477    #[derive(Clone, Default, PartialEq)]
20478    #[non_exhaustive]
20479    pub struct SqlBakExportOptions {
20480        /// Whether or not the export should be striped.
20481        pub striped: std::option::Option<wkt::BoolValue>,
20482
20483        /// Option for specifying how many stripes to use for the export.
20484        /// If blank, and the value of the striped field is true,
20485        /// the number of stripes is automatically chosen.
20486        pub stripe_count: std::option::Option<wkt::Int32Value>,
20487
20488        /// Type of this bak file will be export, FULL or DIFF, SQL Server only
20489        pub bak_type: crate::model::BakType,
20490
20491        /// Deprecated: copy_only is deprecated. Use differential_base instead
20492        #[deprecated]
20493        pub copy_only: std::option::Option<wkt::BoolValue>,
20494
20495        /// Whether or not the backup can be used as a differential base
20496        /// copy_only backup can not be served as differential base
20497        pub differential_base: std::option::Option<wkt::BoolValue>,
20498
20499        /// Optional. The begin timestamp when transaction log will be included in
20500        /// the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
20501        /// format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
20502        /// available logs from the beginning of retention period will be included.
20503        /// Only applied to Cloud SQL for SQL Server.
20504        pub export_log_start_time: std::option::Option<wkt::Timestamp>,
20505
20506        /// Optional. The end timestamp when transaction log will be included in the
20507        /// export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
20508        /// (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
20509        /// available logs until current time will be included. Only applied to Cloud
20510        /// SQL for SQL Server.
20511        pub export_log_end_time: std::option::Option<wkt::Timestamp>,
20512
20513        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20514    }
20515
20516    impl SqlBakExportOptions {
20517        /// Creates a new default instance.
20518        pub fn new() -> Self {
20519            std::default::Default::default()
20520        }
20521
20522        /// Sets the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
20523        ///
20524        /// # Example
20525        /// ```ignore,no_run
20526        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20527        /// use wkt::BoolValue;
20528        /// let x = SqlBakExportOptions::new().set_striped(BoolValue::default()/* use setters */);
20529        /// ```
20530        pub fn set_striped<T>(mut self, v: T) -> Self
20531        where
20532            T: std::convert::Into<wkt::BoolValue>,
20533        {
20534            self.striped = std::option::Option::Some(v.into());
20535            self
20536        }
20537
20538        /// Sets or clears the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
20539        ///
20540        /// # Example
20541        /// ```ignore,no_run
20542        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20543        /// use wkt::BoolValue;
20544        /// let x = SqlBakExportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
20545        /// let x = SqlBakExportOptions::new().set_or_clear_striped(None::<BoolValue>);
20546        /// ```
20547        pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
20548        where
20549            T: std::convert::Into<wkt::BoolValue>,
20550        {
20551            self.striped = v.map(|x| x.into());
20552            self
20553        }
20554
20555        /// Sets the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
20556        ///
20557        /// # Example
20558        /// ```ignore,no_run
20559        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20560        /// use wkt::Int32Value;
20561        /// let x = SqlBakExportOptions::new().set_stripe_count(Int32Value::default()/* use setters */);
20562        /// ```
20563        pub fn set_stripe_count<T>(mut self, v: T) -> Self
20564        where
20565            T: std::convert::Into<wkt::Int32Value>,
20566        {
20567            self.stripe_count = std::option::Option::Some(v.into());
20568            self
20569        }
20570
20571        /// Sets or clears the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
20572        ///
20573        /// # Example
20574        /// ```ignore,no_run
20575        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20576        /// use wkt::Int32Value;
20577        /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(Some(Int32Value::default()/* use setters */));
20578        /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(None::<Int32Value>);
20579        /// ```
20580        pub fn set_or_clear_stripe_count<T>(mut self, v: std::option::Option<T>) -> Self
20581        where
20582            T: std::convert::Into<wkt::Int32Value>,
20583        {
20584            self.stripe_count = v.map(|x| x.into());
20585            self
20586        }
20587
20588        /// Sets the value of [bak_type][crate::model::export_context::SqlBakExportOptions::bak_type].
20589        ///
20590        /// # Example
20591        /// ```ignore,no_run
20592        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20593        /// use google_cloud_sql_v1::model::BakType;
20594        /// let x0 = SqlBakExportOptions::new().set_bak_type(BakType::Full);
20595        /// let x1 = SqlBakExportOptions::new().set_bak_type(BakType::Diff);
20596        /// let x2 = SqlBakExportOptions::new().set_bak_type(BakType::Tlog);
20597        /// ```
20598        pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
20599            self.bak_type = v.into();
20600            self
20601        }
20602
20603        /// Sets the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
20604        ///
20605        /// # Example
20606        /// ```ignore,no_run
20607        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20608        /// use wkt::BoolValue;
20609        /// let x = SqlBakExportOptions::new().set_copy_only(BoolValue::default()/* use setters */);
20610        /// ```
20611        #[deprecated]
20612        pub fn set_copy_only<T>(mut self, v: T) -> Self
20613        where
20614            T: std::convert::Into<wkt::BoolValue>,
20615        {
20616            self.copy_only = std::option::Option::Some(v.into());
20617            self
20618        }
20619
20620        /// Sets or clears the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
20621        ///
20622        /// # Example
20623        /// ```ignore,no_run
20624        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20625        /// use wkt::BoolValue;
20626        /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(Some(BoolValue::default()/* use setters */));
20627        /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(None::<BoolValue>);
20628        /// ```
20629        #[deprecated]
20630        pub fn set_or_clear_copy_only<T>(mut self, v: std::option::Option<T>) -> Self
20631        where
20632            T: std::convert::Into<wkt::BoolValue>,
20633        {
20634            self.copy_only = v.map(|x| x.into());
20635            self
20636        }
20637
20638        /// Sets the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
20639        ///
20640        /// # Example
20641        /// ```ignore,no_run
20642        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20643        /// use wkt::BoolValue;
20644        /// let x = SqlBakExportOptions::new().set_differential_base(BoolValue::default()/* use setters */);
20645        /// ```
20646        pub fn set_differential_base<T>(mut self, v: T) -> Self
20647        where
20648            T: std::convert::Into<wkt::BoolValue>,
20649        {
20650            self.differential_base = std::option::Option::Some(v.into());
20651            self
20652        }
20653
20654        /// Sets or clears the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
20655        ///
20656        /// # Example
20657        /// ```ignore,no_run
20658        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20659        /// use wkt::BoolValue;
20660        /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(Some(BoolValue::default()/* use setters */));
20661        /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(None::<BoolValue>);
20662        /// ```
20663        pub fn set_or_clear_differential_base<T>(mut self, v: std::option::Option<T>) -> Self
20664        where
20665            T: std::convert::Into<wkt::BoolValue>,
20666        {
20667            self.differential_base = v.map(|x| x.into());
20668            self
20669        }
20670
20671        /// Sets the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
20672        ///
20673        /// # Example
20674        /// ```ignore,no_run
20675        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20676        /// use wkt::Timestamp;
20677        /// let x = SqlBakExportOptions::new().set_export_log_start_time(Timestamp::default()/* use setters */);
20678        /// ```
20679        pub fn set_export_log_start_time<T>(mut self, v: T) -> Self
20680        where
20681            T: std::convert::Into<wkt::Timestamp>,
20682        {
20683            self.export_log_start_time = std::option::Option::Some(v.into());
20684            self
20685        }
20686
20687        /// Sets or clears the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
20688        ///
20689        /// # Example
20690        /// ```ignore,no_run
20691        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20692        /// use wkt::Timestamp;
20693        /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(Some(Timestamp::default()/* use setters */));
20694        /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(None::<Timestamp>);
20695        /// ```
20696        pub fn set_or_clear_export_log_start_time<T>(mut self, v: std::option::Option<T>) -> Self
20697        where
20698            T: std::convert::Into<wkt::Timestamp>,
20699        {
20700            self.export_log_start_time = v.map(|x| x.into());
20701            self
20702        }
20703
20704        /// Sets the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
20705        ///
20706        /// # Example
20707        /// ```ignore,no_run
20708        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20709        /// use wkt::Timestamp;
20710        /// let x = SqlBakExportOptions::new().set_export_log_end_time(Timestamp::default()/* use setters */);
20711        /// ```
20712        pub fn set_export_log_end_time<T>(mut self, v: T) -> Self
20713        where
20714            T: std::convert::Into<wkt::Timestamp>,
20715        {
20716            self.export_log_end_time = std::option::Option::Some(v.into());
20717            self
20718        }
20719
20720        /// Sets or clears the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
20721        ///
20722        /// # Example
20723        /// ```ignore,no_run
20724        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20725        /// use wkt::Timestamp;
20726        /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(Some(Timestamp::default()/* use setters */));
20727        /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(None::<Timestamp>);
20728        /// ```
20729        pub fn set_or_clear_export_log_end_time<T>(mut self, v: std::option::Option<T>) -> Self
20730        where
20731            T: std::convert::Into<wkt::Timestamp>,
20732        {
20733            self.export_log_end_time = v.map(|x| x.into());
20734            self
20735        }
20736    }
20737
20738    impl wkt::message::Message for SqlBakExportOptions {
20739        fn typename() -> &'static str {
20740            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlBakExportOptions"
20741        }
20742    }
20743
20744    #[allow(missing_docs)]
20745    #[derive(Clone, Default, PartialEq)]
20746    #[non_exhaustive]
20747    pub struct SqlTdeExportOptions {
20748        /// Required. Path to the TDE certificate public key
20749        /// in the form gs://bucketName/fileName.
20750        /// The instance must have write access to the bucket.
20751        /// Applicable only for SQL Server instances.
20752        pub certificate_path: std::string::String,
20753
20754        /// Required. Path to the TDE certificate private key
20755        /// in the form gs://bucketName/fileName.
20756        /// The instance must have write access to the location.
20757        /// Applicable only for SQL Server instances.
20758        pub private_key_path: std::string::String,
20759
20760        /// Required. Password that encrypts the private key.
20761        pub private_key_password: std::string::String,
20762
20763        /// Required. Certificate name.
20764        /// Applicable only for SQL Server instances.
20765        pub name: std::string::String,
20766
20767        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20768    }
20769
20770    impl SqlTdeExportOptions {
20771        /// Creates a new default instance.
20772        pub fn new() -> Self {
20773            std::default::Default::default()
20774        }
20775
20776        /// Sets the value of [certificate_path][crate::model::export_context::SqlTdeExportOptions::certificate_path].
20777        ///
20778        /// # Example
20779        /// ```ignore,no_run
20780        /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20781        /// let x = SqlTdeExportOptions::new().set_certificate_path("example");
20782        /// ```
20783        pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
20784            mut self,
20785            v: T,
20786        ) -> Self {
20787            self.certificate_path = v.into();
20788            self
20789        }
20790
20791        /// Sets the value of [private_key_path][crate::model::export_context::SqlTdeExportOptions::private_key_path].
20792        ///
20793        /// # Example
20794        /// ```ignore,no_run
20795        /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20796        /// let x = SqlTdeExportOptions::new().set_private_key_path("example");
20797        /// ```
20798        pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
20799            mut self,
20800            v: T,
20801        ) -> Self {
20802            self.private_key_path = v.into();
20803            self
20804        }
20805
20806        /// Sets the value of [private_key_password][crate::model::export_context::SqlTdeExportOptions::private_key_password].
20807        ///
20808        /// # Example
20809        /// ```ignore,no_run
20810        /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20811        /// let x = SqlTdeExportOptions::new().set_private_key_password("example");
20812        /// ```
20813        pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
20814            mut self,
20815            v: T,
20816        ) -> Self {
20817            self.private_key_password = v.into();
20818            self
20819        }
20820
20821        /// Sets the value of [name][crate::model::export_context::SqlTdeExportOptions::name].
20822        ///
20823        /// # Example
20824        /// ```ignore,no_run
20825        /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20826        /// let x = SqlTdeExportOptions::new().set_name("example");
20827        /// ```
20828        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20829            self.name = v.into();
20830            self
20831        }
20832    }
20833
20834    impl wkt::message::Message for SqlTdeExportOptions {
20835        fn typename() -> &'static str {
20836            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlTdeExportOptions"
20837        }
20838    }
20839}
20840
20841/// Database instance import context.
20842#[derive(Clone, Default, PartialEq)]
20843#[non_exhaustive]
20844pub struct ImportContext {
20845    /// Path to the import file in Cloud Storage, in the form
20846    /// `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
20847    /// when `fileType` is `SQL`. The instance must have
20848    /// write permissions to the bucket and read access to the file.
20849    pub uri: std::string::String,
20850
20851    /// The target database for the import. If `fileType` is `SQL`, this field
20852    /// is required only if the import file does not specify a database, and is
20853    /// overridden by any database specification in the import file. For entire
20854    /// instance parallel import operations, the database is overridden by the
20855    /// database name stored in subdirectory name. If
20856    /// `fileType` is `CSV`, one database must be specified.
20857    pub database: std::string::String,
20858
20859    /// This is always `sql#importContext`.
20860    pub kind: std::string::String,
20861
20862    /// The file type for the specified uri.\`SQL`: The file
20863    /// contains SQL statements. \`CSV`: The file contains CSV data.
20864    pub file_type: crate::model::SqlFileType,
20865
20866    /// Options for importing data as CSV.
20867    pub csv_import_options: std::option::Option<crate::model::import_context::SqlCsvImportOptions>,
20868
20869    /// The PostgreSQL user for this import operation. PostgreSQL instances only.
20870    pub import_user: std::string::String,
20871
20872    /// Import parameters specific to SQL Server .BAK files
20873    pub bak_import_options: std::option::Option<crate::model::import_context::SqlBakImportOptions>,
20874
20875    /// Optional. Options for importing data from SQL statements.
20876    pub sql_import_options: std::option::Option<crate::model::import_context::SqlImportOptions>,
20877
20878    /// Optional. Import parameters specific to SQL Server TDE certificates
20879    pub tde_import_options: std::option::Option<crate::model::import_context::SqlTdeImportOptions>,
20880
20881    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20882}
20883
20884impl ImportContext {
20885    /// Creates a new default instance.
20886    pub fn new() -> Self {
20887        std::default::Default::default()
20888    }
20889
20890    /// Sets the value of [uri][crate::model::ImportContext::uri].
20891    ///
20892    /// # Example
20893    /// ```ignore,no_run
20894    /// # use google_cloud_sql_v1::model::ImportContext;
20895    /// let x = ImportContext::new().set_uri("example");
20896    /// ```
20897    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20898        self.uri = v.into();
20899        self
20900    }
20901
20902    /// Sets the value of [database][crate::model::ImportContext::database].
20903    ///
20904    /// # Example
20905    /// ```ignore,no_run
20906    /// # use google_cloud_sql_v1::model::ImportContext;
20907    /// let x = ImportContext::new().set_database("example");
20908    /// ```
20909    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20910        self.database = v.into();
20911        self
20912    }
20913
20914    /// Sets the value of [kind][crate::model::ImportContext::kind].
20915    ///
20916    /// # Example
20917    /// ```ignore,no_run
20918    /// # use google_cloud_sql_v1::model::ImportContext;
20919    /// let x = ImportContext::new().set_kind("example");
20920    /// ```
20921    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20922        self.kind = v.into();
20923        self
20924    }
20925
20926    /// Sets the value of [file_type][crate::model::ImportContext::file_type].
20927    ///
20928    /// # Example
20929    /// ```ignore,no_run
20930    /// # use google_cloud_sql_v1::model::ImportContext;
20931    /// use google_cloud_sql_v1::model::SqlFileType;
20932    /// let x0 = ImportContext::new().set_file_type(SqlFileType::Sql);
20933    /// let x1 = ImportContext::new().set_file_type(SqlFileType::Csv);
20934    /// let x2 = ImportContext::new().set_file_type(SqlFileType::Bak);
20935    /// ```
20936    pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
20937        self.file_type = v.into();
20938        self
20939    }
20940
20941    /// Sets the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
20942    ///
20943    /// # Example
20944    /// ```ignore,no_run
20945    /// # use google_cloud_sql_v1::model::ImportContext;
20946    /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
20947    /// let x = ImportContext::new().set_csv_import_options(SqlCsvImportOptions::default()/* use setters */);
20948    /// ```
20949    pub fn set_csv_import_options<T>(mut self, v: T) -> Self
20950    where
20951        T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
20952    {
20953        self.csv_import_options = std::option::Option::Some(v.into());
20954        self
20955    }
20956
20957    /// Sets or clears the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
20958    ///
20959    /// # Example
20960    /// ```ignore,no_run
20961    /// # use google_cloud_sql_v1::model::ImportContext;
20962    /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
20963    /// let x = ImportContext::new().set_or_clear_csv_import_options(Some(SqlCsvImportOptions::default()/* use setters */));
20964    /// let x = ImportContext::new().set_or_clear_csv_import_options(None::<SqlCsvImportOptions>);
20965    /// ```
20966    pub fn set_or_clear_csv_import_options<T>(mut self, v: std::option::Option<T>) -> Self
20967    where
20968        T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
20969    {
20970        self.csv_import_options = v.map(|x| x.into());
20971        self
20972    }
20973
20974    /// Sets the value of [import_user][crate::model::ImportContext::import_user].
20975    ///
20976    /// # Example
20977    /// ```ignore,no_run
20978    /// # use google_cloud_sql_v1::model::ImportContext;
20979    /// let x = ImportContext::new().set_import_user("example");
20980    /// ```
20981    pub fn set_import_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20982        self.import_user = v.into();
20983        self
20984    }
20985
20986    /// Sets the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
20987    ///
20988    /// # Example
20989    /// ```ignore,no_run
20990    /// # use google_cloud_sql_v1::model::ImportContext;
20991    /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
20992    /// let x = ImportContext::new().set_bak_import_options(SqlBakImportOptions::default()/* use setters */);
20993    /// ```
20994    pub fn set_bak_import_options<T>(mut self, v: T) -> Self
20995    where
20996        T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
20997    {
20998        self.bak_import_options = std::option::Option::Some(v.into());
20999        self
21000    }
21001
21002    /// Sets or clears the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
21003    ///
21004    /// # Example
21005    /// ```ignore,no_run
21006    /// # use google_cloud_sql_v1::model::ImportContext;
21007    /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21008    /// let x = ImportContext::new().set_or_clear_bak_import_options(Some(SqlBakImportOptions::default()/* use setters */));
21009    /// let x = ImportContext::new().set_or_clear_bak_import_options(None::<SqlBakImportOptions>);
21010    /// ```
21011    pub fn set_or_clear_bak_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21012    where
21013        T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
21014    {
21015        self.bak_import_options = v.map(|x| x.into());
21016        self
21017    }
21018
21019    /// Sets the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
21020    ///
21021    /// # Example
21022    /// ```ignore,no_run
21023    /// # use google_cloud_sql_v1::model::ImportContext;
21024    /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21025    /// let x = ImportContext::new().set_sql_import_options(SqlImportOptions::default()/* use setters */);
21026    /// ```
21027    pub fn set_sql_import_options<T>(mut self, v: T) -> Self
21028    where
21029        T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
21030    {
21031        self.sql_import_options = std::option::Option::Some(v.into());
21032        self
21033    }
21034
21035    /// Sets or clears the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
21036    ///
21037    /// # Example
21038    /// ```ignore,no_run
21039    /// # use google_cloud_sql_v1::model::ImportContext;
21040    /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21041    /// let x = ImportContext::new().set_or_clear_sql_import_options(Some(SqlImportOptions::default()/* use setters */));
21042    /// let x = ImportContext::new().set_or_clear_sql_import_options(None::<SqlImportOptions>);
21043    /// ```
21044    pub fn set_or_clear_sql_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21045    where
21046        T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
21047    {
21048        self.sql_import_options = v.map(|x| x.into());
21049        self
21050    }
21051
21052    /// Sets the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
21053    ///
21054    /// # Example
21055    /// ```ignore,no_run
21056    /// # use google_cloud_sql_v1::model::ImportContext;
21057    /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21058    /// let x = ImportContext::new().set_tde_import_options(SqlTdeImportOptions::default()/* use setters */);
21059    /// ```
21060    pub fn set_tde_import_options<T>(mut self, v: T) -> Self
21061    where
21062        T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
21063    {
21064        self.tde_import_options = std::option::Option::Some(v.into());
21065        self
21066    }
21067
21068    /// Sets or clears the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
21069    ///
21070    /// # Example
21071    /// ```ignore,no_run
21072    /// # use google_cloud_sql_v1::model::ImportContext;
21073    /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21074    /// let x = ImportContext::new().set_or_clear_tde_import_options(Some(SqlTdeImportOptions::default()/* use setters */));
21075    /// let x = ImportContext::new().set_or_clear_tde_import_options(None::<SqlTdeImportOptions>);
21076    /// ```
21077    pub fn set_or_clear_tde_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21078    where
21079        T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
21080    {
21081        self.tde_import_options = v.map(|x| x.into());
21082        self
21083    }
21084}
21085
21086impl wkt::message::Message for ImportContext {
21087    fn typename() -> &'static str {
21088        "type.googleapis.com/google.cloud.sql.v1.ImportContext"
21089    }
21090}
21091
21092/// Defines additional types related to [ImportContext].
21093pub mod import_context {
21094    #[allow(unused_imports)]
21095    use super::*;
21096
21097    #[allow(missing_docs)]
21098    #[derive(Clone, Default, PartialEq)]
21099    #[non_exhaustive]
21100    pub struct SqlImportOptions {
21101        /// Optional. The number of threads to use for parallel import.
21102        pub threads: std::option::Option<wkt::Int32Value>,
21103
21104        /// Optional. Whether or not the import should be parallel.
21105        pub parallel: std::option::Option<wkt::BoolValue>,
21106
21107        /// Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
21108        pub postgres_import_options: std::option::Option<
21109            crate::model::import_context::sql_import_options::PostgresImportOptions,
21110        >,
21111
21112        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21113    }
21114
21115    impl SqlImportOptions {
21116        /// Creates a new default instance.
21117        pub fn new() -> Self {
21118            std::default::Default::default()
21119        }
21120
21121        /// Sets the value of [threads][crate::model::import_context::SqlImportOptions::threads].
21122        ///
21123        /// # Example
21124        /// ```ignore,no_run
21125        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21126        /// use wkt::Int32Value;
21127        /// let x = SqlImportOptions::new().set_threads(Int32Value::default()/* use setters */);
21128        /// ```
21129        pub fn set_threads<T>(mut self, v: T) -> Self
21130        where
21131            T: std::convert::Into<wkt::Int32Value>,
21132        {
21133            self.threads = std::option::Option::Some(v.into());
21134            self
21135        }
21136
21137        /// Sets or clears the value of [threads][crate::model::import_context::SqlImportOptions::threads].
21138        ///
21139        /// # Example
21140        /// ```ignore,no_run
21141        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21142        /// use wkt::Int32Value;
21143        /// let x = SqlImportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
21144        /// let x = SqlImportOptions::new().set_or_clear_threads(None::<Int32Value>);
21145        /// ```
21146        pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
21147        where
21148            T: std::convert::Into<wkt::Int32Value>,
21149        {
21150            self.threads = v.map(|x| x.into());
21151            self
21152        }
21153
21154        /// Sets the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
21155        ///
21156        /// # Example
21157        /// ```ignore,no_run
21158        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21159        /// use wkt::BoolValue;
21160        /// let x = SqlImportOptions::new().set_parallel(BoolValue::default()/* use setters */);
21161        /// ```
21162        pub fn set_parallel<T>(mut self, v: T) -> Self
21163        where
21164            T: std::convert::Into<wkt::BoolValue>,
21165        {
21166            self.parallel = std::option::Option::Some(v.into());
21167            self
21168        }
21169
21170        /// Sets or clears the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
21171        ///
21172        /// # Example
21173        /// ```ignore,no_run
21174        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21175        /// use wkt::BoolValue;
21176        /// let x = SqlImportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
21177        /// let x = SqlImportOptions::new().set_or_clear_parallel(None::<BoolValue>);
21178        /// ```
21179        pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
21180        where
21181            T: std::convert::Into<wkt::BoolValue>,
21182        {
21183            self.parallel = v.map(|x| x.into());
21184            self
21185        }
21186
21187        /// Sets the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
21188        ///
21189        /// # Example
21190        /// ```ignore,no_run
21191        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21192        /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21193        /// let x = SqlImportOptions::new().set_postgres_import_options(PostgresImportOptions::default()/* use setters */);
21194        /// ```
21195        pub fn set_postgres_import_options<T>(mut self, v: T) -> Self
21196        where
21197            T: std::convert::Into<
21198                    crate::model::import_context::sql_import_options::PostgresImportOptions,
21199                >,
21200        {
21201            self.postgres_import_options = std::option::Option::Some(v.into());
21202            self
21203        }
21204
21205        /// Sets or clears the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
21206        ///
21207        /// # Example
21208        /// ```ignore,no_run
21209        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21210        /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21211        /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(Some(PostgresImportOptions::default()/* use setters */));
21212        /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(None::<PostgresImportOptions>);
21213        /// ```
21214        pub fn set_or_clear_postgres_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21215        where
21216            T: std::convert::Into<
21217                    crate::model::import_context::sql_import_options::PostgresImportOptions,
21218                >,
21219        {
21220            self.postgres_import_options = v.map(|x| x.into());
21221            self
21222        }
21223    }
21224
21225    impl wkt::message::Message for SqlImportOptions {
21226        fn typename() -> &'static str {
21227            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions"
21228        }
21229    }
21230
21231    /// Defines additional types related to [SqlImportOptions].
21232    pub mod sql_import_options {
21233        #[allow(unused_imports)]
21234        use super::*;
21235
21236        #[allow(missing_docs)]
21237        #[derive(Clone, Default, PartialEq)]
21238        #[non_exhaustive]
21239        pub struct PostgresImportOptions {
21240            /// Optional. The --clean flag for the pg_restore utility. This flag
21241            /// applies only if you enabled Cloud SQL to import files in parallel.
21242            pub clean: std::option::Option<wkt::BoolValue>,
21243
21244            /// Optional. The --if-exists flag for the pg_restore utility. This flag
21245            /// applies only if you enabled Cloud SQL to import files in parallel.
21246            pub if_exists: std::option::Option<wkt::BoolValue>,
21247
21248            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21249        }
21250
21251        impl PostgresImportOptions {
21252            /// Creates a new default instance.
21253            pub fn new() -> Self {
21254                std::default::Default::default()
21255            }
21256
21257            /// Sets the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
21258            ///
21259            /// # Example
21260            /// ```ignore,no_run
21261            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21262            /// use wkt::BoolValue;
21263            /// let x = PostgresImportOptions::new().set_clean(BoolValue::default()/* use setters */);
21264            /// ```
21265            pub fn set_clean<T>(mut self, v: T) -> Self
21266            where
21267                T: std::convert::Into<wkt::BoolValue>,
21268            {
21269                self.clean = std::option::Option::Some(v.into());
21270                self
21271            }
21272
21273            /// Sets or clears the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
21274            ///
21275            /// # Example
21276            /// ```ignore,no_run
21277            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21278            /// use wkt::BoolValue;
21279            /// let x = PostgresImportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
21280            /// let x = PostgresImportOptions::new().set_or_clear_clean(None::<BoolValue>);
21281            /// ```
21282            pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
21283            where
21284                T: std::convert::Into<wkt::BoolValue>,
21285            {
21286                self.clean = v.map(|x| x.into());
21287                self
21288            }
21289
21290            /// Sets the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
21291            ///
21292            /// # Example
21293            /// ```ignore,no_run
21294            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21295            /// use wkt::BoolValue;
21296            /// let x = PostgresImportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
21297            /// ```
21298            pub fn set_if_exists<T>(mut self, v: T) -> Self
21299            where
21300                T: std::convert::Into<wkt::BoolValue>,
21301            {
21302                self.if_exists = std::option::Option::Some(v.into());
21303                self
21304            }
21305
21306            /// Sets or clears the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
21307            ///
21308            /// # Example
21309            /// ```ignore,no_run
21310            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21311            /// use wkt::BoolValue;
21312            /// let x = PostgresImportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
21313            /// let x = PostgresImportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
21314            /// ```
21315            pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
21316            where
21317                T: std::convert::Into<wkt::BoolValue>,
21318            {
21319                self.if_exists = v.map(|x| x.into());
21320                self
21321            }
21322        }
21323
21324        impl wkt::message::Message for PostgresImportOptions {
21325            fn typename() -> &'static str {
21326                "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions"
21327            }
21328        }
21329    }
21330
21331    #[allow(missing_docs)]
21332    #[derive(Clone, Default, PartialEq)]
21333    #[non_exhaustive]
21334    pub struct SqlCsvImportOptions {
21335        /// The table to which CSV data is imported.
21336        pub table: std::string::String,
21337
21338        /// The columns to which CSV data is imported. If not specified, all columns
21339        /// of the database table are loaded with CSV data.
21340        pub columns: std::vec::Vec<std::string::String>,
21341
21342        /// Specifies the character that should appear before a data character that
21343        /// needs to be escaped.
21344        pub escape_character: std::string::String,
21345
21346        /// Specifies the quoting character to be used when a data value is quoted.
21347        pub quote_character: std::string::String,
21348
21349        /// Specifies the character that separates columns within each row (line) of
21350        /// the file.
21351        pub fields_terminated_by: std::string::String,
21352
21353        /// This is used to separate lines. If a line does not contain all fields,
21354        /// the rest of the columns are set to their default values.
21355        pub lines_terminated_by: std::string::String,
21356
21357        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21358    }
21359
21360    impl SqlCsvImportOptions {
21361        /// Creates a new default instance.
21362        pub fn new() -> Self {
21363            std::default::Default::default()
21364        }
21365
21366        /// Sets the value of [table][crate::model::import_context::SqlCsvImportOptions::table].
21367        ///
21368        /// # Example
21369        /// ```ignore,no_run
21370        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21371        /// let x = SqlCsvImportOptions::new().set_table("example");
21372        /// ```
21373        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21374            self.table = v.into();
21375            self
21376        }
21377
21378        /// Sets the value of [columns][crate::model::import_context::SqlCsvImportOptions::columns].
21379        ///
21380        /// # Example
21381        /// ```ignore,no_run
21382        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21383        /// let x = SqlCsvImportOptions::new().set_columns(["a", "b", "c"]);
21384        /// ```
21385        pub fn set_columns<T, V>(mut self, v: T) -> Self
21386        where
21387            T: std::iter::IntoIterator<Item = V>,
21388            V: std::convert::Into<std::string::String>,
21389        {
21390            use std::iter::Iterator;
21391            self.columns = v.into_iter().map(|i| i.into()).collect();
21392            self
21393        }
21394
21395        /// Sets the value of [escape_character][crate::model::import_context::SqlCsvImportOptions::escape_character].
21396        ///
21397        /// # Example
21398        /// ```ignore,no_run
21399        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21400        /// let x = SqlCsvImportOptions::new().set_escape_character("example");
21401        /// ```
21402        pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
21403            mut self,
21404            v: T,
21405        ) -> Self {
21406            self.escape_character = v.into();
21407            self
21408        }
21409
21410        /// Sets the value of [quote_character][crate::model::import_context::SqlCsvImportOptions::quote_character].
21411        ///
21412        /// # Example
21413        /// ```ignore,no_run
21414        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21415        /// let x = SqlCsvImportOptions::new().set_quote_character("example");
21416        /// ```
21417        pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
21418            mut self,
21419            v: T,
21420        ) -> Self {
21421            self.quote_character = v.into();
21422            self
21423        }
21424
21425        /// Sets the value of [fields_terminated_by][crate::model::import_context::SqlCsvImportOptions::fields_terminated_by].
21426        ///
21427        /// # Example
21428        /// ```ignore,no_run
21429        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21430        /// let x = SqlCsvImportOptions::new().set_fields_terminated_by("example");
21431        /// ```
21432        pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
21433            mut self,
21434            v: T,
21435        ) -> Self {
21436            self.fields_terminated_by = v.into();
21437            self
21438        }
21439
21440        /// Sets the value of [lines_terminated_by][crate::model::import_context::SqlCsvImportOptions::lines_terminated_by].
21441        ///
21442        /// # Example
21443        /// ```ignore,no_run
21444        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21445        /// let x = SqlCsvImportOptions::new().set_lines_terminated_by("example");
21446        /// ```
21447        pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
21448            mut self,
21449            v: T,
21450        ) -> Self {
21451            self.lines_terminated_by = v.into();
21452            self
21453        }
21454    }
21455
21456    impl wkt::message::Message for SqlCsvImportOptions {
21457        fn typename() -> &'static str {
21458            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlCsvImportOptions"
21459        }
21460    }
21461
21462    #[allow(missing_docs)]
21463    #[derive(Clone, Default, PartialEq)]
21464    #[non_exhaustive]
21465    pub struct SqlBakImportOptions {
21466        #[allow(missing_docs)]
21467        pub encryption_options: std::option::Option<
21468            crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21469        >,
21470
21471        /// Whether or not the backup set being restored is striped.
21472        /// Applies only to Cloud SQL for SQL Server.
21473        pub striped: std::option::Option<wkt::BoolValue>,
21474
21475        /// Whether or not the backup importing will restore database
21476        /// with NORECOVERY option.
21477        /// Applies only to Cloud SQL for SQL Server.
21478        pub no_recovery: std::option::Option<wkt::BoolValue>,
21479
21480        /// Whether or not the backup importing request will just bring database
21481        /// online without downloading Bak content only one of "no_recovery" and
21482        /// "recovery_only" can be true otherwise error will return. Applies only to
21483        /// Cloud SQL for SQL Server.
21484        pub recovery_only: std::option::Option<wkt::BoolValue>,
21485
21486        /// Type of the bak content, FULL or DIFF
21487        pub bak_type: crate::model::BakType,
21488
21489        /// Optional. The timestamp when the import should stop. This timestamp is in
21490        /// the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
21491        /// `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
21492        /// keyword and applies to Cloud SQL for SQL Server only.
21493        pub stop_at: std::option::Option<wkt::Timestamp>,
21494
21495        /// Optional. The marked transaction where the import should stop. This field
21496        /// is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
21497        /// Server only.
21498        pub stop_at_mark: std::string::String,
21499
21500        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21501    }
21502
21503    impl SqlBakImportOptions {
21504        /// Creates a new default instance.
21505        pub fn new() -> Self {
21506            std::default::Default::default()
21507        }
21508
21509        /// Sets the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
21510        ///
21511        /// # Example
21512        /// ```ignore,no_run
21513        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21514        /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21515        /// let x = SqlBakImportOptions::new().set_encryption_options(EncryptionOptions::default()/* use setters */);
21516        /// ```
21517        pub fn set_encryption_options<T>(mut self, v: T) -> Self
21518        where
21519            T: std::convert::Into<
21520                    crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21521                >,
21522        {
21523            self.encryption_options = std::option::Option::Some(v.into());
21524            self
21525        }
21526
21527        /// Sets or clears the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
21528        ///
21529        /// # Example
21530        /// ```ignore,no_run
21531        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21532        /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21533        /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(Some(EncryptionOptions::default()/* use setters */));
21534        /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(None::<EncryptionOptions>);
21535        /// ```
21536        pub fn set_or_clear_encryption_options<T>(mut self, v: std::option::Option<T>) -> Self
21537        where
21538            T: std::convert::Into<
21539                    crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21540                >,
21541        {
21542            self.encryption_options = v.map(|x| x.into());
21543            self
21544        }
21545
21546        /// Sets the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
21547        ///
21548        /// # Example
21549        /// ```ignore,no_run
21550        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21551        /// use wkt::BoolValue;
21552        /// let x = SqlBakImportOptions::new().set_striped(BoolValue::default()/* use setters */);
21553        /// ```
21554        pub fn set_striped<T>(mut self, v: T) -> Self
21555        where
21556            T: std::convert::Into<wkt::BoolValue>,
21557        {
21558            self.striped = std::option::Option::Some(v.into());
21559            self
21560        }
21561
21562        /// Sets or clears the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
21563        ///
21564        /// # Example
21565        /// ```ignore,no_run
21566        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21567        /// use wkt::BoolValue;
21568        /// let x = SqlBakImportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
21569        /// let x = SqlBakImportOptions::new().set_or_clear_striped(None::<BoolValue>);
21570        /// ```
21571        pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
21572        where
21573            T: std::convert::Into<wkt::BoolValue>,
21574        {
21575            self.striped = v.map(|x| x.into());
21576            self
21577        }
21578
21579        /// Sets the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
21580        ///
21581        /// # Example
21582        /// ```ignore,no_run
21583        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21584        /// use wkt::BoolValue;
21585        /// let x = SqlBakImportOptions::new().set_no_recovery(BoolValue::default()/* use setters */);
21586        /// ```
21587        pub fn set_no_recovery<T>(mut self, v: T) -> Self
21588        where
21589            T: std::convert::Into<wkt::BoolValue>,
21590        {
21591            self.no_recovery = std::option::Option::Some(v.into());
21592            self
21593        }
21594
21595        /// Sets or clears the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
21596        ///
21597        /// # Example
21598        /// ```ignore,no_run
21599        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21600        /// use wkt::BoolValue;
21601        /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(Some(BoolValue::default()/* use setters */));
21602        /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(None::<BoolValue>);
21603        /// ```
21604        pub fn set_or_clear_no_recovery<T>(mut self, v: std::option::Option<T>) -> Self
21605        where
21606            T: std::convert::Into<wkt::BoolValue>,
21607        {
21608            self.no_recovery = v.map(|x| x.into());
21609            self
21610        }
21611
21612        /// Sets the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
21613        ///
21614        /// # Example
21615        /// ```ignore,no_run
21616        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21617        /// use wkt::BoolValue;
21618        /// let x = SqlBakImportOptions::new().set_recovery_only(BoolValue::default()/* use setters */);
21619        /// ```
21620        pub fn set_recovery_only<T>(mut self, v: T) -> Self
21621        where
21622            T: std::convert::Into<wkt::BoolValue>,
21623        {
21624            self.recovery_only = std::option::Option::Some(v.into());
21625            self
21626        }
21627
21628        /// Sets or clears the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
21629        ///
21630        /// # Example
21631        /// ```ignore,no_run
21632        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21633        /// use wkt::BoolValue;
21634        /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(Some(BoolValue::default()/* use setters */));
21635        /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(None::<BoolValue>);
21636        /// ```
21637        pub fn set_or_clear_recovery_only<T>(mut self, v: std::option::Option<T>) -> Self
21638        where
21639            T: std::convert::Into<wkt::BoolValue>,
21640        {
21641            self.recovery_only = v.map(|x| x.into());
21642            self
21643        }
21644
21645        /// Sets the value of [bak_type][crate::model::import_context::SqlBakImportOptions::bak_type].
21646        ///
21647        /// # Example
21648        /// ```ignore,no_run
21649        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21650        /// use google_cloud_sql_v1::model::BakType;
21651        /// let x0 = SqlBakImportOptions::new().set_bak_type(BakType::Full);
21652        /// let x1 = SqlBakImportOptions::new().set_bak_type(BakType::Diff);
21653        /// let x2 = SqlBakImportOptions::new().set_bak_type(BakType::Tlog);
21654        /// ```
21655        pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
21656            self.bak_type = v.into();
21657            self
21658        }
21659
21660        /// Sets the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
21661        ///
21662        /// # Example
21663        /// ```ignore,no_run
21664        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21665        /// use wkt::Timestamp;
21666        /// let x = SqlBakImportOptions::new().set_stop_at(Timestamp::default()/* use setters */);
21667        /// ```
21668        pub fn set_stop_at<T>(mut self, v: T) -> Self
21669        where
21670            T: std::convert::Into<wkt::Timestamp>,
21671        {
21672            self.stop_at = std::option::Option::Some(v.into());
21673            self
21674        }
21675
21676        /// Sets or clears the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
21677        ///
21678        /// # Example
21679        /// ```ignore,no_run
21680        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21681        /// use wkt::Timestamp;
21682        /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(Some(Timestamp::default()/* use setters */));
21683        /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(None::<Timestamp>);
21684        /// ```
21685        pub fn set_or_clear_stop_at<T>(mut self, v: std::option::Option<T>) -> Self
21686        where
21687            T: std::convert::Into<wkt::Timestamp>,
21688        {
21689            self.stop_at = v.map(|x| x.into());
21690            self
21691        }
21692
21693        /// Sets the value of [stop_at_mark][crate::model::import_context::SqlBakImportOptions::stop_at_mark].
21694        ///
21695        /// # Example
21696        /// ```ignore,no_run
21697        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21698        /// let x = SqlBakImportOptions::new().set_stop_at_mark("example");
21699        /// ```
21700        pub fn set_stop_at_mark<T: std::convert::Into<std::string::String>>(
21701            mut self,
21702            v: T,
21703        ) -> Self {
21704            self.stop_at_mark = v.into();
21705            self
21706        }
21707    }
21708
21709    impl wkt::message::Message for SqlBakImportOptions {
21710        fn typename() -> &'static str {
21711            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions"
21712        }
21713    }
21714
21715    /// Defines additional types related to [SqlBakImportOptions].
21716    pub mod sql_bak_import_options {
21717        #[allow(unused_imports)]
21718        use super::*;
21719
21720        #[allow(missing_docs)]
21721        #[derive(Clone, Default, PartialEq)]
21722        #[non_exhaustive]
21723        pub struct EncryptionOptions {
21724            /// Path to the Certificate (.cer) in Cloud Storage, in the form
21725            /// `gs://bucketName/fileName`. The instance must have
21726            /// write permissions to the bucket and read access to the file.
21727            pub cert_path: std::string::String,
21728
21729            /// Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
21730            /// form `gs://bucketName/fileName`. The instance must have
21731            /// write permissions to the bucket and read access to the file.
21732            pub pvk_path: std::string::String,
21733
21734            /// Password that encrypts the private key
21735            pub pvk_password: std::string::String,
21736
21737            /// Optional. Whether the imported file remains encrypted.
21738            pub keep_encrypted: std::option::Option<wkt::BoolValue>,
21739
21740            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21741        }
21742
21743        impl EncryptionOptions {
21744            /// Creates a new default instance.
21745            pub fn new() -> Self {
21746                std::default::Default::default()
21747            }
21748
21749            /// Sets the value of [cert_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::cert_path].
21750            ///
21751            /// # Example
21752            /// ```ignore,no_run
21753            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21754            /// let x = EncryptionOptions::new().set_cert_path("example");
21755            /// ```
21756            pub fn set_cert_path<T: std::convert::Into<std::string::String>>(
21757                mut self,
21758                v: T,
21759            ) -> Self {
21760                self.cert_path = v.into();
21761                self
21762            }
21763
21764            /// Sets the value of [pvk_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_path].
21765            ///
21766            /// # Example
21767            /// ```ignore,no_run
21768            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21769            /// let x = EncryptionOptions::new().set_pvk_path("example");
21770            /// ```
21771            pub fn set_pvk_path<T: std::convert::Into<std::string::String>>(
21772                mut self,
21773                v: T,
21774            ) -> Self {
21775                self.pvk_path = v.into();
21776                self
21777            }
21778
21779            /// Sets the value of [pvk_password][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_password].
21780            ///
21781            /// # Example
21782            /// ```ignore,no_run
21783            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21784            /// let x = EncryptionOptions::new().set_pvk_password("example");
21785            /// ```
21786            pub fn set_pvk_password<T: std::convert::Into<std::string::String>>(
21787                mut self,
21788                v: T,
21789            ) -> Self {
21790                self.pvk_password = v.into();
21791                self
21792            }
21793
21794            /// Sets the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
21795            ///
21796            /// # Example
21797            /// ```ignore,no_run
21798            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21799            /// use wkt::BoolValue;
21800            /// let x = EncryptionOptions::new().set_keep_encrypted(BoolValue::default()/* use setters */);
21801            /// ```
21802            pub fn set_keep_encrypted<T>(mut self, v: T) -> Self
21803            where
21804                T: std::convert::Into<wkt::BoolValue>,
21805            {
21806                self.keep_encrypted = std::option::Option::Some(v.into());
21807                self
21808            }
21809
21810            /// Sets or clears the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
21811            ///
21812            /// # Example
21813            /// ```ignore,no_run
21814            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21815            /// use wkt::BoolValue;
21816            /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(Some(BoolValue::default()/* use setters */));
21817            /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(None::<BoolValue>);
21818            /// ```
21819            pub fn set_or_clear_keep_encrypted<T>(mut self, v: std::option::Option<T>) -> Self
21820            where
21821                T: std::convert::Into<wkt::BoolValue>,
21822            {
21823                self.keep_encrypted = v.map(|x| x.into());
21824                self
21825            }
21826        }
21827
21828        impl wkt::message::Message for EncryptionOptions {
21829            fn typename() -> &'static str {
21830                "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions"
21831            }
21832        }
21833    }
21834
21835    #[allow(missing_docs)]
21836    #[derive(Clone, Default, PartialEq)]
21837    #[non_exhaustive]
21838    pub struct SqlTdeImportOptions {
21839        /// Required. Path to the TDE certificate public key
21840        /// in the form gs://bucketName/fileName.
21841        /// The instance must have read access to the file.
21842        /// Applicable only for SQL Server instances.
21843        pub certificate_path: std::string::String,
21844
21845        /// Required. Path to the TDE certificate private key
21846        /// in the form gs://bucketName/fileName.
21847        /// The instance must have read access to the file.
21848        /// Applicable only for SQL Server instances.
21849        pub private_key_path: std::string::String,
21850
21851        /// Required. Password that encrypts the private key.
21852        pub private_key_password: std::string::String,
21853
21854        /// Required. Certificate name.
21855        /// Applicable only for SQL Server instances.
21856        pub name: std::string::String,
21857
21858        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21859    }
21860
21861    impl SqlTdeImportOptions {
21862        /// Creates a new default instance.
21863        pub fn new() -> Self {
21864            std::default::Default::default()
21865        }
21866
21867        /// Sets the value of [certificate_path][crate::model::import_context::SqlTdeImportOptions::certificate_path].
21868        ///
21869        /// # Example
21870        /// ```ignore,no_run
21871        /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21872        /// let x = SqlTdeImportOptions::new().set_certificate_path("example");
21873        /// ```
21874        pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
21875            mut self,
21876            v: T,
21877        ) -> Self {
21878            self.certificate_path = v.into();
21879            self
21880        }
21881
21882        /// Sets the value of [private_key_path][crate::model::import_context::SqlTdeImportOptions::private_key_path].
21883        ///
21884        /// # Example
21885        /// ```ignore,no_run
21886        /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21887        /// let x = SqlTdeImportOptions::new().set_private_key_path("example");
21888        /// ```
21889        pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
21890            mut self,
21891            v: T,
21892        ) -> Self {
21893            self.private_key_path = v.into();
21894            self
21895        }
21896
21897        /// Sets the value of [private_key_password][crate::model::import_context::SqlTdeImportOptions::private_key_password].
21898        ///
21899        /// # Example
21900        /// ```ignore,no_run
21901        /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21902        /// let x = SqlTdeImportOptions::new().set_private_key_password("example");
21903        /// ```
21904        pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
21905            mut self,
21906            v: T,
21907        ) -> Self {
21908            self.private_key_password = v.into();
21909            self
21910        }
21911
21912        /// Sets the value of [name][crate::model::import_context::SqlTdeImportOptions::name].
21913        ///
21914        /// # Example
21915        /// ```ignore,no_run
21916        /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21917        /// let x = SqlTdeImportOptions::new().set_name("example");
21918        /// ```
21919        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21920            self.name = v.into();
21921            self
21922        }
21923    }
21924
21925    impl wkt::message::Message for SqlTdeImportOptions {
21926        fn typename() -> &'static str {
21927            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlTdeImportOptions"
21928        }
21929    }
21930}
21931
21932/// IP Management configuration.
21933#[derive(Clone, Default, PartialEq)]
21934#[non_exhaustive]
21935pub struct IpConfiguration {
21936    /// Whether the instance is assigned a public IP address or not.
21937    pub ipv4_enabled: std::option::Option<wkt::BoolValue>,
21938
21939    /// The resource link for the VPC network from which the Cloud SQL instance is
21940    /// accessible for private IP. For example,
21941    /// `/projects/myProject/global/networks/default`. This setting can
21942    /// be updated, but it cannot be removed after it is set.
21943    pub private_network: std::string::String,
21944
21945    /// Use `ssl_mode` instead.
21946    ///
21947    /// Whether SSL/TLS connections over IP are enforced.
21948    /// If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
21949    /// For SSL/TLS connections, the client certificate won't be verified. If
21950    /// set to true, then only allow connections encrypted with SSL/TLS and with
21951    /// valid client certificates. If you want to enforce SSL/TLS without enforcing
21952    /// the requirement for valid client certificates, then use the `ssl_mode` flag
21953    /// instead of the `require_ssl` flag.
21954    pub require_ssl: std::option::Option<wkt::BoolValue>,
21955
21956    /// The list of external networks that are allowed to connect to the instance
21957    /// using the IP. In 'CIDR' notation, also known as 'slash' notation (for
21958    /// example: `157.197.200.0/24`).
21959    pub authorized_networks: std::vec::Vec<crate::model::AclEntry>,
21960
21961    /// The name of the allocated ip range for the private ip Cloud SQL instance.
21962    /// For example: "google-managed-services-default". If set, the instance ip
21963    /// will be created in the allocated range. The range name must comply with
21964    /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
21965    /// must be 1-63 characters long and match the regular expression
21966    /// `[a-z]([-a-z0-9]*[a-z0-9])?.`
21967    pub allocated_ip_range: std::string::String,
21968
21969    /// Controls connectivity to private IP instances from Google services,
21970    /// such as BigQuery.
21971    pub enable_private_path_for_google_cloud_services: std::option::Option<wkt::BoolValue>,
21972
21973    /// Specify how SSL/TLS is enforced in database connections. If you must use
21974    /// the `require_ssl` flag for backward compatibility, then only the following
21975    /// value pairs are valid:
21976    ///
21977    /// For PostgreSQL and MySQL:
21978    ///
21979    /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
21980    /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
21981    /// * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
21982    ///
21983    /// For SQL Server:
21984    ///
21985    /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
21986    /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
21987    ///
21988    /// The value of `ssl_mode` has priority over the value of `require_ssl`.
21989    ///
21990    /// For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
21991    /// `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
21992    /// connections, while `require_ssl=false` means accept both non-SSL
21993    /// and SSL connections. In this case, MySQL and PostgreSQL databases respect
21994    /// `ssl_mode` and accepts only SSL connections.
21995    pub ssl_mode: crate::model::ip_configuration::SslMode,
21996
21997    /// PSC settings for this instance.
21998    pub psc_config: std::option::Option<crate::model::PscConfig>,
21999
22000    /// Specify what type of CA is used for the server certificate.
22001    pub server_ca_mode: std::option::Option<crate::model::ip_configuration::CaMode>,
22002
22003    /// Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
22004    pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
22005
22006    /// Optional. The resource name of the server CA pool for an instance with
22007    /// `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
22008    /// Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
22009    pub server_ca_pool: std::option::Option<std::string::String>,
22010
22011    /// Optional. Controls the automatic server certificate rotation feature. This
22012    /// feature is disabled by default. When enabled, the server certificate will
22013    /// be automatically rotated during Cloud SQL scheduled maintenance or
22014    /// self-service maintenance updates up to six months before it expires. This
22015    /// setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
22016    /// or CUSTOMER_MANAGED_CAS_CA.
22017    pub server_certificate_rotation_mode:
22018        std::option::Option<crate::model::ip_configuration::ServerCertificateRotationMode>,
22019
22020    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22021}
22022
22023impl IpConfiguration {
22024    /// Creates a new default instance.
22025    pub fn new() -> Self {
22026        std::default::Default::default()
22027    }
22028
22029    /// Sets the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
22030    ///
22031    /// # Example
22032    /// ```ignore,no_run
22033    /// # use google_cloud_sql_v1::model::IpConfiguration;
22034    /// use wkt::BoolValue;
22035    /// let x = IpConfiguration::new().set_ipv4_enabled(BoolValue::default()/* use setters */);
22036    /// ```
22037    pub fn set_ipv4_enabled<T>(mut self, v: T) -> Self
22038    where
22039        T: std::convert::Into<wkt::BoolValue>,
22040    {
22041        self.ipv4_enabled = std::option::Option::Some(v.into());
22042        self
22043    }
22044
22045    /// Sets or clears the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
22046    ///
22047    /// # Example
22048    /// ```ignore,no_run
22049    /// # use google_cloud_sql_v1::model::IpConfiguration;
22050    /// use wkt::BoolValue;
22051    /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(Some(BoolValue::default()/* use setters */));
22052    /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(None::<BoolValue>);
22053    /// ```
22054    pub fn set_or_clear_ipv4_enabled<T>(mut self, v: std::option::Option<T>) -> Self
22055    where
22056        T: std::convert::Into<wkt::BoolValue>,
22057    {
22058        self.ipv4_enabled = v.map(|x| x.into());
22059        self
22060    }
22061
22062    /// Sets the value of [private_network][crate::model::IpConfiguration::private_network].
22063    ///
22064    /// # Example
22065    /// ```ignore,no_run
22066    /// # use google_cloud_sql_v1::model::IpConfiguration;
22067    /// let x = IpConfiguration::new().set_private_network("example");
22068    /// ```
22069    pub fn set_private_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22070        self.private_network = v.into();
22071        self
22072    }
22073
22074    /// Sets the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
22075    ///
22076    /// # Example
22077    /// ```ignore,no_run
22078    /// # use google_cloud_sql_v1::model::IpConfiguration;
22079    /// use wkt::BoolValue;
22080    /// let x = IpConfiguration::new().set_require_ssl(BoolValue::default()/* use setters */);
22081    /// ```
22082    pub fn set_require_ssl<T>(mut self, v: T) -> Self
22083    where
22084        T: std::convert::Into<wkt::BoolValue>,
22085    {
22086        self.require_ssl = std::option::Option::Some(v.into());
22087        self
22088    }
22089
22090    /// Sets or clears the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
22091    ///
22092    /// # Example
22093    /// ```ignore,no_run
22094    /// # use google_cloud_sql_v1::model::IpConfiguration;
22095    /// use wkt::BoolValue;
22096    /// let x = IpConfiguration::new().set_or_clear_require_ssl(Some(BoolValue::default()/* use setters */));
22097    /// let x = IpConfiguration::new().set_or_clear_require_ssl(None::<BoolValue>);
22098    /// ```
22099    pub fn set_or_clear_require_ssl<T>(mut self, v: std::option::Option<T>) -> Self
22100    where
22101        T: std::convert::Into<wkt::BoolValue>,
22102    {
22103        self.require_ssl = v.map(|x| x.into());
22104        self
22105    }
22106
22107    /// Sets the value of [authorized_networks][crate::model::IpConfiguration::authorized_networks].
22108    ///
22109    /// # Example
22110    /// ```ignore,no_run
22111    /// # use google_cloud_sql_v1::model::IpConfiguration;
22112    /// use google_cloud_sql_v1::model::AclEntry;
22113    /// let x = IpConfiguration::new()
22114    ///     .set_authorized_networks([
22115    ///         AclEntry::default()/* use setters */,
22116    ///         AclEntry::default()/* use (different) setters */,
22117    ///     ]);
22118    /// ```
22119    pub fn set_authorized_networks<T, V>(mut self, v: T) -> Self
22120    where
22121        T: std::iter::IntoIterator<Item = V>,
22122        V: std::convert::Into<crate::model::AclEntry>,
22123    {
22124        use std::iter::Iterator;
22125        self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
22126        self
22127    }
22128
22129    /// Sets the value of [allocated_ip_range][crate::model::IpConfiguration::allocated_ip_range].
22130    ///
22131    /// # Example
22132    /// ```ignore,no_run
22133    /// # use google_cloud_sql_v1::model::IpConfiguration;
22134    /// let x = IpConfiguration::new().set_allocated_ip_range("example");
22135    /// ```
22136    pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
22137        mut self,
22138        v: T,
22139    ) -> Self {
22140        self.allocated_ip_range = v.into();
22141        self
22142    }
22143
22144    /// Sets the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
22145    ///
22146    /// # Example
22147    /// ```ignore,no_run
22148    /// # use google_cloud_sql_v1::model::IpConfiguration;
22149    /// use wkt::BoolValue;
22150    /// let x = IpConfiguration::new().set_enable_private_path_for_google_cloud_services(BoolValue::default()/* use setters */);
22151    /// ```
22152    pub fn set_enable_private_path_for_google_cloud_services<T>(mut self, v: T) -> Self
22153    where
22154        T: std::convert::Into<wkt::BoolValue>,
22155    {
22156        self.enable_private_path_for_google_cloud_services = std::option::Option::Some(v.into());
22157        self
22158    }
22159
22160    /// Sets or clears the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
22161    ///
22162    /// # Example
22163    /// ```ignore,no_run
22164    /// # use google_cloud_sql_v1::model::IpConfiguration;
22165    /// use wkt::BoolValue;
22166    /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(Some(BoolValue::default()/* use setters */));
22167    /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(None::<BoolValue>);
22168    /// ```
22169    pub fn set_or_clear_enable_private_path_for_google_cloud_services<T>(
22170        mut self,
22171        v: std::option::Option<T>,
22172    ) -> Self
22173    where
22174        T: std::convert::Into<wkt::BoolValue>,
22175    {
22176        self.enable_private_path_for_google_cloud_services = v.map(|x| x.into());
22177        self
22178    }
22179
22180    /// Sets the value of [ssl_mode][crate::model::IpConfiguration::ssl_mode].
22181    ///
22182    /// # Example
22183    /// ```ignore,no_run
22184    /// # use google_cloud_sql_v1::model::IpConfiguration;
22185    /// use google_cloud_sql_v1::model::ip_configuration::SslMode;
22186    /// let x0 = IpConfiguration::new().set_ssl_mode(SslMode::AllowUnencryptedAndEncrypted);
22187    /// let x1 = IpConfiguration::new().set_ssl_mode(SslMode::EncryptedOnly);
22188    /// let x2 = IpConfiguration::new().set_ssl_mode(SslMode::TrustedClientCertificateRequired);
22189    /// ```
22190    pub fn set_ssl_mode<T: std::convert::Into<crate::model::ip_configuration::SslMode>>(
22191        mut self,
22192        v: T,
22193    ) -> Self {
22194        self.ssl_mode = v.into();
22195        self
22196    }
22197
22198    /// Sets the value of [psc_config][crate::model::IpConfiguration::psc_config].
22199    ///
22200    /// # Example
22201    /// ```ignore,no_run
22202    /// # use google_cloud_sql_v1::model::IpConfiguration;
22203    /// use google_cloud_sql_v1::model::PscConfig;
22204    /// let x = IpConfiguration::new().set_psc_config(PscConfig::default()/* use setters */);
22205    /// ```
22206    pub fn set_psc_config<T>(mut self, v: T) -> Self
22207    where
22208        T: std::convert::Into<crate::model::PscConfig>,
22209    {
22210        self.psc_config = std::option::Option::Some(v.into());
22211        self
22212    }
22213
22214    /// Sets or clears the value of [psc_config][crate::model::IpConfiguration::psc_config].
22215    ///
22216    /// # Example
22217    /// ```ignore,no_run
22218    /// # use google_cloud_sql_v1::model::IpConfiguration;
22219    /// use google_cloud_sql_v1::model::PscConfig;
22220    /// let x = IpConfiguration::new().set_or_clear_psc_config(Some(PscConfig::default()/* use setters */));
22221    /// let x = IpConfiguration::new().set_or_clear_psc_config(None::<PscConfig>);
22222    /// ```
22223    pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
22224    where
22225        T: std::convert::Into<crate::model::PscConfig>,
22226    {
22227        self.psc_config = v.map(|x| x.into());
22228        self
22229    }
22230
22231    /// Sets the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
22232    ///
22233    /// # Example
22234    /// ```ignore,no_run
22235    /// # use google_cloud_sql_v1::model::IpConfiguration;
22236    /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
22237    /// let x0 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
22238    /// let x1 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
22239    /// let x2 = IpConfiguration::new().set_server_ca_mode(CaMode::CustomerManagedCasCa);
22240    /// ```
22241    pub fn set_server_ca_mode<T>(mut self, v: T) -> Self
22242    where
22243        T: std::convert::Into<crate::model::ip_configuration::CaMode>,
22244    {
22245        self.server_ca_mode = std::option::Option::Some(v.into());
22246        self
22247    }
22248
22249    /// Sets or clears the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
22250    ///
22251    /// # Example
22252    /// ```ignore,no_run
22253    /// # use google_cloud_sql_v1::model::IpConfiguration;
22254    /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
22255    /// let x0 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedInternalCa));
22256    /// let x1 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedCasCa));
22257    /// let x2 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::CustomerManagedCasCa));
22258    /// let x_none = IpConfiguration::new().set_or_clear_server_ca_mode(None::<CaMode>);
22259    /// ```
22260    pub fn set_or_clear_server_ca_mode<T>(mut self, v: std::option::Option<T>) -> Self
22261    where
22262        T: std::convert::Into<crate::model::ip_configuration::CaMode>,
22263    {
22264        self.server_ca_mode = v.map(|x| x.into());
22265        self
22266    }
22267
22268    /// Sets the value of [custom_subject_alternative_names][crate::model::IpConfiguration::custom_subject_alternative_names].
22269    ///
22270    /// # Example
22271    /// ```ignore,no_run
22272    /// # use google_cloud_sql_v1::model::IpConfiguration;
22273    /// let x = IpConfiguration::new().set_custom_subject_alternative_names(["a", "b", "c"]);
22274    /// ```
22275    pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
22276    where
22277        T: std::iter::IntoIterator<Item = V>,
22278        V: std::convert::Into<std::string::String>,
22279    {
22280        use std::iter::Iterator;
22281        self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
22282        self
22283    }
22284
22285    /// Sets the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
22286    ///
22287    /// # Example
22288    /// ```ignore,no_run
22289    /// # use google_cloud_sql_v1::model::IpConfiguration;
22290    /// let x = IpConfiguration::new().set_server_ca_pool("example");
22291    /// ```
22292    pub fn set_server_ca_pool<T>(mut self, v: T) -> Self
22293    where
22294        T: std::convert::Into<std::string::String>,
22295    {
22296        self.server_ca_pool = std::option::Option::Some(v.into());
22297        self
22298    }
22299
22300    /// Sets or clears the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
22301    ///
22302    /// # Example
22303    /// ```ignore,no_run
22304    /// # use google_cloud_sql_v1::model::IpConfiguration;
22305    /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(Some("example"));
22306    /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(None::<String>);
22307    /// ```
22308    pub fn set_or_clear_server_ca_pool<T>(mut self, v: std::option::Option<T>) -> Self
22309    where
22310        T: std::convert::Into<std::string::String>,
22311    {
22312        self.server_ca_pool = v.map(|x| x.into());
22313        self
22314    }
22315
22316    /// Sets the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
22317    ///
22318    /// # Example
22319    /// ```ignore,no_run
22320    /// # use google_cloud_sql_v1::model::IpConfiguration;
22321    /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
22322    /// let x0 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::NoAutomaticRotation);
22323    /// let x1 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance);
22324    /// ```
22325    pub fn set_server_certificate_rotation_mode<T>(mut self, v: T) -> Self
22326    where
22327        T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
22328    {
22329        self.server_certificate_rotation_mode = std::option::Option::Some(v.into());
22330        self
22331    }
22332
22333    /// Sets or clears the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
22334    ///
22335    /// # Example
22336    /// ```ignore,no_run
22337    /// # use google_cloud_sql_v1::model::IpConfiguration;
22338    /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
22339    /// let x0 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::NoAutomaticRotation));
22340    /// let x1 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance));
22341    /// let x_none = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(None::<ServerCertificateRotationMode>);
22342    /// ```
22343    pub fn set_or_clear_server_certificate_rotation_mode<T>(
22344        mut self,
22345        v: std::option::Option<T>,
22346    ) -> Self
22347    where
22348        T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
22349    {
22350        self.server_certificate_rotation_mode = v.map(|x| x.into());
22351        self
22352    }
22353}
22354
22355impl wkt::message::Message for IpConfiguration {
22356    fn typename() -> &'static str {
22357        "type.googleapis.com/google.cloud.sql.v1.IpConfiguration"
22358    }
22359}
22360
22361/// Defines additional types related to [IpConfiguration].
22362pub mod ip_configuration {
22363    #[allow(unused_imports)]
22364    use super::*;
22365
22366    /// The SSL options for database connections.
22367    ///
22368    /// # Working with unknown values
22369    ///
22370    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22371    /// additional enum variants at any time. Adding new variants is not considered
22372    /// a breaking change. Applications should write their code in anticipation of:
22373    ///
22374    /// - New values appearing in future releases of the client library, **and**
22375    /// - New values received dynamically, without application changes.
22376    ///
22377    /// Please consult the [Working with enums] section in the user guide for some
22378    /// guidelines.
22379    ///
22380    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22381    #[derive(Clone, Debug, PartialEq)]
22382    #[non_exhaustive]
22383    pub enum SslMode {
22384        /// The SSL mode is unknown.
22385        Unspecified,
22386        /// Allow non-SSL/non-TLS and SSL/TLS connections.
22387        /// For SSL connections to MySQL and PostgreSQL, the client certificate
22388        /// isn't verified.
22389        ///
22390        /// When this value is used, the legacy `require_ssl` flag must be false or
22391        /// cleared to avoid a conflict between the values of the two flags.
22392        AllowUnencryptedAndEncrypted,
22393        /// Only allow connections encrypted with SSL/TLS.
22394        /// For SSL connections to MySQL and PostgreSQL, the client certificate
22395        /// isn't verified.
22396        ///
22397        /// When this value is used, the legacy `require_ssl` flag must be false or
22398        /// cleared to avoid a conflict between the values of the two flags.
22399        EncryptedOnly,
22400        /// Only allow connections encrypted with SSL/TLS and with valid
22401        /// client certificates.
22402        ///
22403        /// When this value is used, the legacy `require_ssl` flag must be true or
22404        /// cleared to avoid the conflict between values of two flags.
22405        /// PostgreSQL clients or users that connect using IAM database
22406        /// authentication must use either the
22407        /// [Cloud SQL Auth
22408        /// Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
22409        /// [Cloud SQL
22410        /// Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
22411        /// to enforce client identity verification.
22412        ///
22413        /// Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
22414        TrustedClientCertificateRequired,
22415        /// If set, the enum was initialized with an unknown value.
22416        ///
22417        /// Applications can examine the value using [SslMode::value] or
22418        /// [SslMode::name].
22419        UnknownValue(ssl_mode::UnknownValue),
22420    }
22421
22422    #[doc(hidden)]
22423    pub mod ssl_mode {
22424        #[allow(unused_imports)]
22425        use super::*;
22426        #[derive(Clone, Debug, PartialEq)]
22427        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22428    }
22429
22430    impl SslMode {
22431        /// Gets the enum value.
22432        ///
22433        /// Returns `None` if the enum contains an unknown value deserialized from
22434        /// the string representation of enums.
22435        pub fn value(&self) -> std::option::Option<i32> {
22436            match self {
22437                Self::Unspecified => std::option::Option::Some(0),
22438                Self::AllowUnencryptedAndEncrypted => std::option::Option::Some(1),
22439                Self::EncryptedOnly => std::option::Option::Some(2),
22440                Self::TrustedClientCertificateRequired => std::option::Option::Some(3),
22441                Self::UnknownValue(u) => u.0.value(),
22442            }
22443        }
22444
22445        /// Gets the enum value as a string.
22446        ///
22447        /// Returns `None` if the enum contains an unknown value deserialized from
22448        /// the integer representation of enums.
22449        pub fn name(&self) -> std::option::Option<&str> {
22450            match self {
22451                Self::Unspecified => std::option::Option::Some("SSL_MODE_UNSPECIFIED"),
22452                Self::AllowUnencryptedAndEncrypted => {
22453                    std::option::Option::Some("ALLOW_UNENCRYPTED_AND_ENCRYPTED")
22454                }
22455                Self::EncryptedOnly => std::option::Option::Some("ENCRYPTED_ONLY"),
22456                Self::TrustedClientCertificateRequired => {
22457                    std::option::Option::Some("TRUSTED_CLIENT_CERTIFICATE_REQUIRED")
22458                }
22459                Self::UnknownValue(u) => u.0.name(),
22460            }
22461        }
22462    }
22463
22464    impl std::default::Default for SslMode {
22465        fn default() -> Self {
22466            use std::convert::From;
22467            Self::from(0)
22468        }
22469    }
22470
22471    impl std::fmt::Display for SslMode {
22472        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22473            wkt::internal::display_enum(f, self.name(), self.value())
22474        }
22475    }
22476
22477    impl std::convert::From<i32> for SslMode {
22478        fn from(value: i32) -> Self {
22479            match value {
22480                0 => Self::Unspecified,
22481                1 => Self::AllowUnencryptedAndEncrypted,
22482                2 => Self::EncryptedOnly,
22483                3 => Self::TrustedClientCertificateRequired,
22484                _ => Self::UnknownValue(ssl_mode::UnknownValue(
22485                    wkt::internal::UnknownEnumValue::Integer(value),
22486                )),
22487            }
22488        }
22489    }
22490
22491    impl std::convert::From<&str> for SslMode {
22492        fn from(value: &str) -> Self {
22493            use std::string::ToString;
22494            match value {
22495                "SSL_MODE_UNSPECIFIED" => Self::Unspecified,
22496                "ALLOW_UNENCRYPTED_AND_ENCRYPTED" => Self::AllowUnencryptedAndEncrypted,
22497                "ENCRYPTED_ONLY" => Self::EncryptedOnly,
22498                "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" => Self::TrustedClientCertificateRequired,
22499                _ => Self::UnknownValue(ssl_mode::UnknownValue(
22500                    wkt::internal::UnknownEnumValue::String(value.to_string()),
22501                )),
22502            }
22503        }
22504    }
22505
22506    impl serde::ser::Serialize for SslMode {
22507        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22508        where
22509            S: serde::Serializer,
22510        {
22511            match self {
22512                Self::Unspecified => serializer.serialize_i32(0),
22513                Self::AllowUnencryptedAndEncrypted => serializer.serialize_i32(1),
22514                Self::EncryptedOnly => serializer.serialize_i32(2),
22515                Self::TrustedClientCertificateRequired => serializer.serialize_i32(3),
22516                Self::UnknownValue(u) => u.0.serialize(serializer),
22517            }
22518        }
22519    }
22520
22521    impl<'de> serde::de::Deserialize<'de> for SslMode {
22522        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22523        where
22524            D: serde::Deserializer<'de>,
22525        {
22526            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslMode>::new(
22527                ".google.cloud.sql.v1.IpConfiguration.SslMode",
22528            ))
22529        }
22530    }
22531
22532    /// Various Certificate Authority (CA) modes for certificate signing.
22533    ///
22534    /// # Working with unknown values
22535    ///
22536    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22537    /// additional enum variants at any time. Adding new variants is not considered
22538    /// a breaking change. Applications should write their code in anticipation of:
22539    ///
22540    /// - New values appearing in future releases of the client library, **and**
22541    /// - New values received dynamically, without application changes.
22542    ///
22543    /// Please consult the [Working with enums] section in the user guide for some
22544    /// guidelines.
22545    ///
22546    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22547    #[derive(Clone, Debug, PartialEq)]
22548    #[non_exhaustive]
22549    pub enum CaMode {
22550        /// CA mode is unspecified. It is effectively the same as
22551        /// `GOOGLE_MANAGED_INTERNAL_CA`.
22552        Unspecified,
22553        /// Google-managed self-signed internal CA.
22554        GoogleManagedInternalCa,
22555        /// Google-managed regional CA part of root CA hierarchy hosted on Google
22556        /// Cloud's Certificate Authority Service (CAS).
22557        GoogleManagedCasCa,
22558        /// Customer-managed CA hosted on Google Cloud's Certificate Authority
22559        /// Service (CAS).
22560        CustomerManagedCasCa,
22561        /// If set, the enum was initialized with an unknown value.
22562        ///
22563        /// Applications can examine the value using [CaMode::value] or
22564        /// [CaMode::name].
22565        UnknownValue(ca_mode::UnknownValue),
22566    }
22567
22568    #[doc(hidden)]
22569    pub mod ca_mode {
22570        #[allow(unused_imports)]
22571        use super::*;
22572        #[derive(Clone, Debug, PartialEq)]
22573        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22574    }
22575
22576    impl CaMode {
22577        /// Gets the enum value.
22578        ///
22579        /// Returns `None` if the enum contains an unknown value deserialized from
22580        /// the string representation of enums.
22581        pub fn value(&self) -> std::option::Option<i32> {
22582            match self {
22583                Self::Unspecified => std::option::Option::Some(0),
22584                Self::GoogleManagedInternalCa => std::option::Option::Some(1),
22585                Self::GoogleManagedCasCa => std::option::Option::Some(2),
22586                Self::CustomerManagedCasCa => std::option::Option::Some(3),
22587                Self::UnknownValue(u) => u.0.value(),
22588            }
22589        }
22590
22591        /// Gets the enum value as a string.
22592        ///
22593        /// Returns `None` if the enum contains an unknown value deserialized from
22594        /// the integer representation of enums.
22595        pub fn name(&self) -> std::option::Option<&str> {
22596            match self {
22597                Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
22598                Self::GoogleManagedInternalCa => {
22599                    std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
22600                }
22601                Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
22602                Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
22603                Self::UnknownValue(u) => u.0.name(),
22604            }
22605        }
22606    }
22607
22608    impl std::default::Default for CaMode {
22609        fn default() -> Self {
22610            use std::convert::From;
22611            Self::from(0)
22612        }
22613    }
22614
22615    impl std::fmt::Display for CaMode {
22616        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22617            wkt::internal::display_enum(f, self.name(), self.value())
22618        }
22619    }
22620
22621    impl std::convert::From<i32> for CaMode {
22622        fn from(value: i32) -> Self {
22623            match value {
22624                0 => Self::Unspecified,
22625                1 => Self::GoogleManagedInternalCa,
22626                2 => Self::GoogleManagedCasCa,
22627                3 => Self::CustomerManagedCasCa,
22628                _ => Self::UnknownValue(ca_mode::UnknownValue(
22629                    wkt::internal::UnknownEnumValue::Integer(value),
22630                )),
22631            }
22632        }
22633    }
22634
22635    impl std::convert::From<&str> for CaMode {
22636        fn from(value: &str) -> Self {
22637            use std::string::ToString;
22638            match value {
22639                "CA_MODE_UNSPECIFIED" => Self::Unspecified,
22640                "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
22641                "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
22642                "CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
22643                _ => Self::UnknownValue(ca_mode::UnknownValue(
22644                    wkt::internal::UnknownEnumValue::String(value.to_string()),
22645                )),
22646            }
22647        }
22648    }
22649
22650    impl serde::ser::Serialize for CaMode {
22651        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22652        where
22653            S: serde::Serializer,
22654        {
22655            match self {
22656                Self::Unspecified => serializer.serialize_i32(0),
22657                Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
22658                Self::GoogleManagedCasCa => serializer.serialize_i32(2),
22659                Self::CustomerManagedCasCa => serializer.serialize_i32(3),
22660                Self::UnknownValue(u) => u.0.serialize(serializer),
22661            }
22662        }
22663    }
22664
22665    impl<'de> serde::de::Deserialize<'de> for CaMode {
22666        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22667        where
22668            D: serde::Deserializer<'de>,
22669        {
22670            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
22671                ".google.cloud.sql.v1.IpConfiguration.CaMode",
22672            ))
22673        }
22674    }
22675
22676    /// Settings for automatic server certificate rotation.
22677    ///
22678    /// # Working with unknown values
22679    ///
22680    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22681    /// additional enum variants at any time. Adding new variants is not considered
22682    /// a breaking change. Applications should write their code in anticipation of:
22683    ///
22684    /// - New values appearing in future releases of the client library, **and**
22685    /// - New values received dynamically, without application changes.
22686    ///
22687    /// Please consult the [Working with enums] section in the user guide for some
22688    /// guidelines.
22689    ///
22690    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22691    #[derive(Clone, Debug, PartialEq)]
22692    #[non_exhaustive]
22693    pub enum ServerCertificateRotationMode {
22694        /// Unspecified: no automatic server certificate rotation.
22695        Unspecified,
22696        /// No automatic server certificate rotation. The user must [manage server
22697        /// certificate
22698        /// rotation](/sql/docs/mysql/manage-ssl-instance#rotate-server-certificate-cas)
22699        /// on their side.
22700        NoAutomaticRotation,
22701        /// Automatic server certificate rotation during Cloud SQL scheduled
22702        /// maintenance or self-service maintenance updates. Requires
22703        /// `server_ca_mode` to be `GOOGLE_MANAGED_CAS_CA` or
22704        /// `CUSTOMER_MANAGED_CAS_CA`.
22705        AutomaticRotationDuringMaintenance,
22706        /// If set, the enum was initialized with an unknown value.
22707        ///
22708        /// Applications can examine the value using [ServerCertificateRotationMode::value] or
22709        /// [ServerCertificateRotationMode::name].
22710        UnknownValue(server_certificate_rotation_mode::UnknownValue),
22711    }
22712
22713    #[doc(hidden)]
22714    pub mod server_certificate_rotation_mode {
22715        #[allow(unused_imports)]
22716        use super::*;
22717        #[derive(Clone, Debug, PartialEq)]
22718        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22719    }
22720
22721    impl ServerCertificateRotationMode {
22722        /// Gets the enum value.
22723        ///
22724        /// Returns `None` if the enum contains an unknown value deserialized from
22725        /// the string representation of enums.
22726        pub fn value(&self) -> std::option::Option<i32> {
22727            match self {
22728                Self::Unspecified => std::option::Option::Some(0),
22729                Self::NoAutomaticRotation => std::option::Option::Some(1),
22730                Self::AutomaticRotationDuringMaintenance => std::option::Option::Some(2),
22731                Self::UnknownValue(u) => u.0.value(),
22732            }
22733        }
22734
22735        /// Gets the enum value as a string.
22736        ///
22737        /// Returns `None` if the enum contains an unknown value deserialized from
22738        /// the integer representation of enums.
22739        pub fn name(&self) -> std::option::Option<&str> {
22740            match self {
22741                Self::Unspecified => {
22742                    std::option::Option::Some("SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED")
22743                }
22744                Self::NoAutomaticRotation => std::option::Option::Some("NO_AUTOMATIC_ROTATION"),
22745                Self::AutomaticRotationDuringMaintenance => {
22746                    std::option::Option::Some("AUTOMATIC_ROTATION_DURING_MAINTENANCE")
22747                }
22748                Self::UnknownValue(u) => u.0.name(),
22749            }
22750        }
22751    }
22752
22753    impl std::default::Default for ServerCertificateRotationMode {
22754        fn default() -> Self {
22755            use std::convert::From;
22756            Self::from(0)
22757        }
22758    }
22759
22760    impl std::fmt::Display for ServerCertificateRotationMode {
22761        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22762            wkt::internal::display_enum(f, self.name(), self.value())
22763        }
22764    }
22765
22766    impl std::convert::From<i32> for ServerCertificateRotationMode {
22767        fn from(value: i32) -> Self {
22768            match value {
22769                0 => Self::Unspecified,
22770                1 => Self::NoAutomaticRotation,
22771                2 => Self::AutomaticRotationDuringMaintenance,
22772                _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
22773                    wkt::internal::UnknownEnumValue::Integer(value),
22774                )),
22775            }
22776        }
22777    }
22778
22779    impl std::convert::From<&str> for ServerCertificateRotationMode {
22780        fn from(value: &str) -> Self {
22781            use std::string::ToString;
22782            match value {
22783                "SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED" => Self::Unspecified,
22784                "NO_AUTOMATIC_ROTATION" => Self::NoAutomaticRotation,
22785                "AUTOMATIC_ROTATION_DURING_MAINTENANCE" => Self::AutomaticRotationDuringMaintenance,
22786                _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
22787                    wkt::internal::UnknownEnumValue::String(value.to_string()),
22788                )),
22789            }
22790        }
22791    }
22792
22793    impl serde::ser::Serialize for ServerCertificateRotationMode {
22794        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22795        where
22796            S: serde::Serializer,
22797        {
22798            match self {
22799                Self::Unspecified => serializer.serialize_i32(0),
22800                Self::NoAutomaticRotation => serializer.serialize_i32(1),
22801                Self::AutomaticRotationDuringMaintenance => serializer.serialize_i32(2),
22802                Self::UnknownValue(u) => u.0.serialize(serializer),
22803            }
22804        }
22805    }
22806
22807    impl<'de> serde::de::Deserialize<'de> for ServerCertificateRotationMode {
22808        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22809        where
22810            D: serde::Deserializer<'de>,
22811        {
22812            deserializer.deserialize_any(
22813                wkt::internal::EnumVisitor::<ServerCertificateRotationMode>::new(
22814                    ".google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode",
22815                ),
22816            )
22817        }
22818    }
22819}
22820
22821/// PSC settings for a Cloud SQL instance.
22822#[derive(Clone, Default, PartialEq)]
22823#[non_exhaustive]
22824pub struct PscConfig {
22825    /// Whether PSC connectivity is enabled for this instance.
22826    pub psc_enabled: std::option::Option<bool>,
22827
22828    /// Optional. The list of consumer projects that are allow-listed for PSC
22829    /// connections to this instance. This instance can be connected to with PSC
22830    /// from any network in these projects.
22831    ///
22832    /// Each consumer project in this list may be represented by a project number
22833    /// (numeric) or by a project id (alphanumeric).
22834    pub allowed_consumer_projects: std::vec::Vec<std::string::String>,
22835
22836    /// Optional. The list of settings for requested Private Service Connect
22837    /// consumer endpoints that can be used to connect to this Cloud SQL instance.
22838    pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
22839
22840    /// Optional. The network attachment of the consumer network that the
22841    /// Private Service Connect enabled Cloud SQL instance is
22842    /// authorized to connect via PSC interface.
22843    /// format: projects/PROJECT/regions/REGION/networkAttachments/ID
22844    pub network_attachment_uri: std::string::String,
22845
22846    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22847}
22848
22849impl PscConfig {
22850    /// Creates a new default instance.
22851    pub fn new() -> Self {
22852        std::default::Default::default()
22853    }
22854
22855    /// Sets the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
22856    ///
22857    /// # Example
22858    /// ```ignore,no_run
22859    /// # use google_cloud_sql_v1::model::PscConfig;
22860    /// let x = PscConfig::new().set_psc_enabled(true);
22861    /// ```
22862    pub fn set_psc_enabled<T>(mut self, v: T) -> Self
22863    where
22864        T: std::convert::Into<bool>,
22865    {
22866        self.psc_enabled = std::option::Option::Some(v.into());
22867        self
22868    }
22869
22870    /// Sets or clears the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
22871    ///
22872    /// # Example
22873    /// ```ignore,no_run
22874    /// # use google_cloud_sql_v1::model::PscConfig;
22875    /// let x = PscConfig::new().set_or_clear_psc_enabled(Some(false));
22876    /// let x = PscConfig::new().set_or_clear_psc_enabled(None::<bool>);
22877    /// ```
22878    pub fn set_or_clear_psc_enabled<T>(mut self, v: std::option::Option<T>) -> Self
22879    where
22880        T: std::convert::Into<bool>,
22881    {
22882        self.psc_enabled = v.map(|x| x.into());
22883        self
22884    }
22885
22886    /// Sets the value of [allowed_consumer_projects][crate::model::PscConfig::allowed_consumer_projects].
22887    ///
22888    /// # Example
22889    /// ```ignore,no_run
22890    /// # use google_cloud_sql_v1::model::PscConfig;
22891    /// let x = PscConfig::new().set_allowed_consumer_projects(["a", "b", "c"]);
22892    /// ```
22893    pub fn set_allowed_consumer_projects<T, V>(mut self, v: T) -> Self
22894    where
22895        T: std::iter::IntoIterator<Item = V>,
22896        V: std::convert::Into<std::string::String>,
22897    {
22898        use std::iter::Iterator;
22899        self.allowed_consumer_projects = v.into_iter().map(|i| i.into()).collect();
22900        self
22901    }
22902
22903    /// Sets the value of [psc_auto_connections][crate::model::PscConfig::psc_auto_connections].
22904    ///
22905    /// # Example
22906    /// ```ignore,no_run
22907    /// # use google_cloud_sql_v1::model::PscConfig;
22908    /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22909    /// let x = PscConfig::new()
22910    ///     .set_psc_auto_connections([
22911    ///         PscAutoConnectionConfig::default()/* use setters */,
22912    ///         PscAutoConnectionConfig::default()/* use (different) setters */,
22913    ///     ]);
22914    /// ```
22915    pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
22916    where
22917        T: std::iter::IntoIterator<Item = V>,
22918        V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
22919    {
22920        use std::iter::Iterator;
22921        self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
22922        self
22923    }
22924
22925    /// Sets the value of [network_attachment_uri][crate::model::PscConfig::network_attachment_uri].
22926    ///
22927    /// # Example
22928    /// ```ignore,no_run
22929    /// # use google_cloud_sql_v1::model::PscConfig;
22930    /// let x = PscConfig::new().set_network_attachment_uri("example");
22931    /// ```
22932    pub fn set_network_attachment_uri<T: std::convert::Into<std::string::String>>(
22933        mut self,
22934        v: T,
22935    ) -> Self {
22936        self.network_attachment_uri = v.into();
22937        self
22938    }
22939}
22940
22941impl wkt::message::Message for PscConfig {
22942    fn typename() -> &'static str {
22943        "type.googleapis.com/google.cloud.sql.v1.PscConfig"
22944    }
22945}
22946
22947/// Settings for an automatically-setup Private Service Connect consumer endpoint
22948/// that is used to connect to a Cloud SQL instance.
22949#[derive(Clone, Default, PartialEq)]
22950#[non_exhaustive]
22951pub struct PscAutoConnectionConfig {
22952    /// Optional. This is the project ID of consumer service project of this
22953    /// consumer endpoint.
22954    ///
22955    /// Optional. This is only applicable if consumer_network is a shared vpc
22956    /// network.
22957    pub consumer_project: std::string::String,
22958
22959    /// Optional. The consumer network of this consumer endpoint. This must be a
22960    /// resource path that includes both the host project and the network name.
22961    ///
22962    /// For example, `projects/project1/global/networks/network1`.
22963    ///
22964    /// The consumer host project of this network might be different from the
22965    /// consumer service project.
22966    pub consumer_network: std::string::String,
22967
22968    /// The IP address of the consumer endpoint.
22969    pub ip_address: std::option::Option<std::string::String>,
22970
22971    /// The connection status of the consumer endpoint.
22972    pub status: std::option::Option<std::string::String>,
22973
22974    /// The connection policy status of the consumer network.
22975    pub consumer_network_status: std::option::Option<std::string::String>,
22976
22977    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22978}
22979
22980impl PscAutoConnectionConfig {
22981    /// Creates a new default instance.
22982    pub fn new() -> Self {
22983        std::default::Default::default()
22984    }
22985
22986    /// Sets the value of [consumer_project][crate::model::PscAutoConnectionConfig::consumer_project].
22987    ///
22988    /// # Example
22989    /// ```ignore,no_run
22990    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22991    /// let x = PscAutoConnectionConfig::new().set_consumer_project("example");
22992    /// ```
22993    pub fn set_consumer_project<T: std::convert::Into<std::string::String>>(
22994        mut self,
22995        v: T,
22996    ) -> Self {
22997        self.consumer_project = v.into();
22998        self
22999    }
23000
23001    /// Sets the value of [consumer_network][crate::model::PscAutoConnectionConfig::consumer_network].
23002    ///
23003    /// # Example
23004    /// ```ignore,no_run
23005    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23006    /// let x = PscAutoConnectionConfig::new().set_consumer_network("example");
23007    /// ```
23008    pub fn set_consumer_network<T: std::convert::Into<std::string::String>>(
23009        mut self,
23010        v: T,
23011    ) -> Self {
23012        self.consumer_network = v.into();
23013        self
23014    }
23015
23016    /// Sets the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
23017    ///
23018    /// # Example
23019    /// ```ignore,no_run
23020    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23021    /// let x = PscAutoConnectionConfig::new().set_ip_address("example");
23022    /// ```
23023    pub fn set_ip_address<T>(mut self, v: T) -> Self
23024    where
23025        T: std::convert::Into<std::string::String>,
23026    {
23027        self.ip_address = std::option::Option::Some(v.into());
23028        self
23029    }
23030
23031    /// Sets or clears the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
23032    ///
23033    /// # Example
23034    /// ```ignore,no_run
23035    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23036    /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(Some("example"));
23037    /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(None::<String>);
23038    /// ```
23039    pub fn set_or_clear_ip_address<T>(mut self, v: std::option::Option<T>) -> Self
23040    where
23041        T: std::convert::Into<std::string::String>,
23042    {
23043        self.ip_address = v.map(|x| x.into());
23044        self
23045    }
23046
23047    /// Sets the value of [status][crate::model::PscAutoConnectionConfig::status].
23048    ///
23049    /// # Example
23050    /// ```ignore,no_run
23051    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23052    /// let x = PscAutoConnectionConfig::new().set_status("example");
23053    /// ```
23054    pub fn set_status<T>(mut self, v: T) -> Self
23055    where
23056        T: std::convert::Into<std::string::String>,
23057    {
23058        self.status = std::option::Option::Some(v.into());
23059        self
23060    }
23061
23062    /// Sets or clears the value of [status][crate::model::PscAutoConnectionConfig::status].
23063    ///
23064    /// # Example
23065    /// ```ignore,no_run
23066    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23067    /// let x = PscAutoConnectionConfig::new().set_or_clear_status(Some("example"));
23068    /// let x = PscAutoConnectionConfig::new().set_or_clear_status(None::<String>);
23069    /// ```
23070    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
23071    where
23072        T: std::convert::Into<std::string::String>,
23073    {
23074        self.status = v.map(|x| x.into());
23075        self
23076    }
23077
23078    /// Sets the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
23079    ///
23080    /// # Example
23081    /// ```ignore,no_run
23082    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23083    /// let x = PscAutoConnectionConfig::new().set_consumer_network_status("example");
23084    /// ```
23085    pub fn set_consumer_network_status<T>(mut self, v: T) -> Self
23086    where
23087        T: std::convert::Into<std::string::String>,
23088    {
23089        self.consumer_network_status = std::option::Option::Some(v.into());
23090        self
23091    }
23092
23093    /// Sets or clears the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
23094    ///
23095    /// # Example
23096    /// ```ignore,no_run
23097    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23098    /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(Some("example"));
23099    /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(None::<String>);
23100    /// ```
23101    pub fn set_or_clear_consumer_network_status<T>(mut self, v: std::option::Option<T>) -> Self
23102    where
23103        T: std::convert::Into<std::string::String>,
23104    {
23105        self.consumer_network_status = v.map(|x| x.into());
23106        self
23107    }
23108}
23109
23110impl wkt::message::Message for PscAutoConnectionConfig {
23111    fn typename() -> &'static str {
23112        "type.googleapis.com/google.cloud.sql.v1.PscAutoConnectionConfig"
23113    }
23114}
23115
23116/// Preferred location. This specifies where a Cloud SQL instance is located.
23117/// Note that if the preferred location is not available, the instance will be
23118/// located as close as possible within the region. Only one location may be
23119/// specified.
23120#[derive(Clone, Default, PartialEq)]
23121#[non_exhaustive]
23122pub struct LocationPreference {
23123    /// The App Engine application to follow, it must be in the same region as the
23124    /// Cloud SQL instance. WARNING: Changing this might restart the instance.
23125    #[deprecated]
23126    pub follow_gae_application: std::string::String,
23127
23128    /// The preferred Compute Engine zone (for example: us-central1-a,
23129    /// us-central1-b, etc.). WARNING: Changing this might restart the instance.
23130    pub zone: std::string::String,
23131
23132    /// The preferred Compute Engine zone for the secondary/failover
23133    /// (for example: us-central1-a, us-central1-b, etc.).
23134    /// To disable this field, set it to 'no_secondary_zone'.
23135    pub secondary_zone: std::string::String,
23136
23137    /// This is always `sql#locationPreference`.
23138    pub kind: std::string::String,
23139
23140    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23141}
23142
23143impl LocationPreference {
23144    /// Creates a new default instance.
23145    pub fn new() -> Self {
23146        std::default::Default::default()
23147    }
23148
23149    /// Sets the value of [follow_gae_application][crate::model::LocationPreference::follow_gae_application].
23150    ///
23151    /// # Example
23152    /// ```ignore,no_run
23153    /// # use google_cloud_sql_v1::model::LocationPreference;
23154    /// let x = LocationPreference::new().set_follow_gae_application("example");
23155    /// ```
23156    #[deprecated]
23157    pub fn set_follow_gae_application<T: std::convert::Into<std::string::String>>(
23158        mut self,
23159        v: T,
23160    ) -> Self {
23161        self.follow_gae_application = v.into();
23162        self
23163    }
23164
23165    /// Sets the value of [zone][crate::model::LocationPreference::zone].
23166    ///
23167    /// # Example
23168    /// ```ignore,no_run
23169    /// # use google_cloud_sql_v1::model::LocationPreference;
23170    /// let x = LocationPreference::new().set_zone("example");
23171    /// ```
23172    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23173        self.zone = v.into();
23174        self
23175    }
23176
23177    /// Sets the value of [secondary_zone][crate::model::LocationPreference::secondary_zone].
23178    ///
23179    /// # Example
23180    /// ```ignore,no_run
23181    /// # use google_cloud_sql_v1::model::LocationPreference;
23182    /// let x = LocationPreference::new().set_secondary_zone("example");
23183    /// ```
23184    pub fn set_secondary_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23185        self.secondary_zone = v.into();
23186        self
23187    }
23188
23189    /// Sets the value of [kind][crate::model::LocationPreference::kind].
23190    ///
23191    /// # Example
23192    /// ```ignore,no_run
23193    /// # use google_cloud_sql_v1::model::LocationPreference;
23194    /// let x = LocationPreference::new().set_kind("example");
23195    /// ```
23196    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23197        self.kind = v.into();
23198        self
23199    }
23200}
23201
23202impl wkt::message::Message for LocationPreference {
23203    fn typename() -> &'static str {
23204        "type.googleapis.com/google.cloud.sql.v1.LocationPreference"
23205    }
23206}
23207
23208/// Maintenance window. This specifies when a Cloud SQL instance is
23209/// restarted for system maintenance purposes.
23210#[derive(Clone, Default, PartialEq)]
23211#[non_exhaustive]
23212pub struct MaintenanceWindow {
23213    /// Hour of day - 0 to 23. Specify in the UTC time zone.
23214    pub hour: std::option::Option<wkt::Int32Value>,
23215
23216    /// Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
23217    /// `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
23218    /// Returned in output as an integer, 1 to 7, where `1` equals Monday.
23219    pub day: std::option::Option<wkt::Int32Value>,
23220
23221    /// Maintenance timing settings: `canary`, `stable`, or `week5`.
23222    /// For more information, see [About maintenance on Cloud SQL
23223    /// instances](https://cloud.google.com/sql/docs/mysql/maintenance).
23224    pub update_track: crate::model::SqlUpdateTrack,
23225
23226    /// This is always `sql#maintenanceWindow`.
23227    pub kind: std::string::String,
23228
23229    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23230}
23231
23232impl MaintenanceWindow {
23233    /// Creates a new default instance.
23234    pub fn new() -> Self {
23235        std::default::Default::default()
23236    }
23237
23238    /// Sets the value of [hour][crate::model::MaintenanceWindow::hour].
23239    ///
23240    /// # Example
23241    /// ```ignore,no_run
23242    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23243    /// use wkt::Int32Value;
23244    /// let x = MaintenanceWindow::new().set_hour(Int32Value::default()/* use setters */);
23245    /// ```
23246    pub fn set_hour<T>(mut self, v: T) -> Self
23247    where
23248        T: std::convert::Into<wkt::Int32Value>,
23249    {
23250        self.hour = std::option::Option::Some(v.into());
23251        self
23252    }
23253
23254    /// Sets or clears the value of [hour][crate::model::MaintenanceWindow::hour].
23255    ///
23256    /// # Example
23257    /// ```ignore,no_run
23258    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23259    /// use wkt::Int32Value;
23260    /// let x = MaintenanceWindow::new().set_or_clear_hour(Some(Int32Value::default()/* use setters */));
23261    /// let x = MaintenanceWindow::new().set_or_clear_hour(None::<Int32Value>);
23262    /// ```
23263    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
23264    where
23265        T: std::convert::Into<wkt::Int32Value>,
23266    {
23267        self.hour = v.map(|x| x.into());
23268        self
23269    }
23270
23271    /// Sets the value of [day][crate::model::MaintenanceWindow::day].
23272    ///
23273    /// # Example
23274    /// ```ignore,no_run
23275    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23276    /// use wkt::Int32Value;
23277    /// let x = MaintenanceWindow::new().set_day(Int32Value::default()/* use setters */);
23278    /// ```
23279    pub fn set_day<T>(mut self, v: T) -> Self
23280    where
23281        T: std::convert::Into<wkt::Int32Value>,
23282    {
23283        self.day = std::option::Option::Some(v.into());
23284        self
23285    }
23286
23287    /// Sets or clears the value of [day][crate::model::MaintenanceWindow::day].
23288    ///
23289    /// # Example
23290    /// ```ignore,no_run
23291    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23292    /// use wkt::Int32Value;
23293    /// let x = MaintenanceWindow::new().set_or_clear_day(Some(Int32Value::default()/* use setters */));
23294    /// let x = MaintenanceWindow::new().set_or_clear_day(None::<Int32Value>);
23295    /// ```
23296    pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
23297    where
23298        T: std::convert::Into<wkt::Int32Value>,
23299    {
23300        self.day = v.map(|x| x.into());
23301        self
23302    }
23303
23304    /// Sets the value of [update_track][crate::model::MaintenanceWindow::update_track].
23305    ///
23306    /// # Example
23307    /// ```ignore,no_run
23308    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23309    /// use google_cloud_sql_v1::model::SqlUpdateTrack;
23310    /// let x0 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Canary);
23311    /// let x1 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Stable);
23312    /// let x2 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Week5);
23313    /// ```
23314    pub fn set_update_track<T: std::convert::Into<crate::model::SqlUpdateTrack>>(
23315        mut self,
23316        v: T,
23317    ) -> Self {
23318        self.update_track = v.into();
23319        self
23320    }
23321
23322    /// Sets the value of [kind][crate::model::MaintenanceWindow::kind].
23323    ///
23324    /// # Example
23325    /// ```ignore,no_run
23326    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23327    /// let x = MaintenanceWindow::new().set_kind("example");
23328    /// ```
23329    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23330        self.kind = v.into();
23331        self
23332    }
23333}
23334
23335impl wkt::message::Message for MaintenanceWindow {
23336    fn typename() -> &'static str {
23337        "type.googleapis.com/google.cloud.sql.v1.MaintenanceWindow"
23338    }
23339}
23340
23341/// Deny maintenance Periods. This specifies a date range during when all CSA
23342/// rollout will be denied.
23343#[derive(Clone, Default, PartialEq)]
23344#[non_exhaustive]
23345pub struct DenyMaintenancePeriod {
23346    /// "deny maintenance period" start date. If the year of the start date is
23347    /// empty, the year of the end date also must be empty. In this case, it means
23348    /// the deny maintenance period recurs every year. The date is in format
23349    /// yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
23350    pub start_date: std::string::String,
23351
23352    /// "deny maintenance period" end date. If the year of the end date is empty,
23353    /// the year of the start date also must be empty. In this case, it means the
23354    /// no maintenance interval recurs every year. The date is in format yyyy-mm-dd
23355    /// i.e., 2020-11-01, or mm-dd, i.e., 11-01
23356    pub end_date: std::string::String,
23357
23358    /// Time in UTC when the "deny maintenance period" starts on start_date and
23359    /// ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
23360    pub time: std::string::String,
23361
23362    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23363}
23364
23365impl DenyMaintenancePeriod {
23366    /// Creates a new default instance.
23367    pub fn new() -> Self {
23368        std::default::Default::default()
23369    }
23370
23371    /// Sets the value of [start_date][crate::model::DenyMaintenancePeriod::start_date].
23372    ///
23373    /// # Example
23374    /// ```ignore,no_run
23375    /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23376    /// let x = DenyMaintenancePeriod::new().set_start_date("example");
23377    /// ```
23378    pub fn set_start_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23379        self.start_date = v.into();
23380        self
23381    }
23382
23383    /// Sets the value of [end_date][crate::model::DenyMaintenancePeriod::end_date].
23384    ///
23385    /// # Example
23386    /// ```ignore,no_run
23387    /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23388    /// let x = DenyMaintenancePeriod::new().set_end_date("example");
23389    /// ```
23390    pub fn set_end_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23391        self.end_date = v.into();
23392        self
23393    }
23394
23395    /// Sets the value of [time][crate::model::DenyMaintenancePeriod::time].
23396    ///
23397    /// # Example
23398    /// ```ignore,no_run
23399    /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23400    /// let x = DenyMaintenancePeriod::new().set_time("example");
23401    /// ```
23402    pub fn set_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23403        self.time = v.into();
23404        self
23405    }
23406}
23407
23408impl wkt::message::Message for DenyMaintenancePeriod {
23409    fn typename() -> &'static str {
23410        "type.googleapis.com/google.cloud.sql.v1.DenyMaintenancePeriod"
23411    }
23412}
23413
23414/// Insights configuration. This specifies when Cloud SQL Insights feature is
23415/// enabled and optional configuration.
23416#[derive(Clone, Default, PartialEq)]
23417#[non_exhaustive]
23418pub struct InsightsConfig {
23419    /// Whether Query Insights feature is enabled.
23420    pub query_insights_enabled: bool,
23421
23422    /// Whether Query Insights will record client address when enabled.
23423    pub record_client_address: bool,
23424
23425    /// Whether Query Insights will record application tags from query when
23426    /// enabled.
23427    pub record_application_tags: bool,
23428
23429    /// Maximum query length stored in bytes. Default value: 1024 bytes.
23430    /// Range: 256-4500 bytes. Query lengths greater than this field value will be
23431    /// truncated to this value. When unset, query length will be the default
23432    /// value. Changing query length will restart the database.
23433    pub query_string_length: std::option::Option<wkt::Int32Value>,
23434
23435    /// Number of query execution plans captured by Insights per minute
23436    /// for all queries combined. Default is 5.
23437    pub query_plans_per_minute: std::option::Option<wkt::Int32Value>,
23438
23439    /// Optional. Whether enhanced query insights feature is enabled.
23440    pub enhanced_query_insights_enabled: std::option::Option<wkt::BoolValue>,
23441
23442    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23443}
23444
23445impl InsightsConfig {
23446    /// Creates a new default instance.
23447    pub fn new() -> Self {
23448        std::default::Default::default()
23449    }
23450
23451    /// Sets the value of [query_insights_enabled][crate::model::InsightsConfig::query_insights_enabled].
23452    ///
23453    /// # Example
23454    /// ```ignore,no_run
23455    /// # use google_cloud_sql_v1::model::InsightsConfig;
23456    /// let x = InsightsConfig::new().set_query_insights_enabled(true);
23457    /// ```
23458    pub fn set_query_insights_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23459        self.query_insights_enabled = v.into();
23460        self
23461    }
23462
23463    /// Sets the value of [record_client_address][crate::model::InsightsConfig::record_client_address].
23464    ///
23465    /// # Example
23466    /// ```ignore,no_run
23467    /// # use google_cloud_sql_v1::model::InsightsConfig;
23468    /// let x = InsightsConfig::new().set_record_client_address(true);
23469    /// ```
23470    pub fn set_record_client_address<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23471        self.record_client_address = v.into();
23472        self
23473    }
23474
23475    /// Sets the value of [record_application_tags][crate::model::InsightsConfig::record_application_tags].
23476    ///
23477    /// # Example
23478    /// ```ignore,no_run
23479    /// # use google_cloud_sql_v1::model::InsightsConfig;
23480    /// let x = InsightsConfig::new().set_record_application_tags(true);
23481    /// ```
23482    pub fn set_record_application_tags<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23483        self.record_application_tags = v.into();
23484        self
23485    }
23486
23487    /// Sets the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
23488    ///
23489    /// # Example
23490    /// ```ignore,no_run
23491    /// # use google_cloud_sql_v1::model::InsightsConfig;
23492    /// use wkt::Int32Value;
23493    /// let x = InsightsConfig::new().set_query_string_length(Int32Value::default()/* use setters */);
23494    /// ```
23495    pub fn set_query_string_length<T>(mut self, v: T) -> Self
23496    where
23497        T: std::convert::Into<wkt::Int32Value>,
23498    {
23499        self.query_string_length = std::option::Option::Some(v.into());
23500        self
23501    }
23502
23503    /// Sets or clears the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
23504    ///
23505    /// # Example
23506    /// ```ignore,no_run
23507    /// # use google_cloud_sql_v1::model::InsightsConfig;
23508    /// use wkt::Int32Value;
23509    /// let x = InsightsConfig::new().set_or_clear_query_string_length(Some(Int32Value::default()/* use setters */));
23510    /// let x = InsightsConfig::new().set_or_clear_query_string_length(None::<Int32Value>);
23511    /// ```
23512    pub fn set_or_clear_query_string_length<T>(mut self, v: std::option::Option<T>) -> Self
23513    where
23514        T: std::convert::Into<wkt::Int32Value>,
23515    {
23516        self.query_string_length = v.map(|x| x.into());
23517        self
23518    }
23519
23520    /// Sets the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
23521    ///
23522    /// # Example
23523    /// ```ignore,no_run
23524    /// # use google_cloud_sql_v1::model::InsightsConfig;
23525    /// use wkt::Int32Value;
23526    /// let x = InsightsConfig::new().set_query_plans_per_minute(Int32Value::default()/* use setters */);
23527    /// ```
23528    pub fn set_query_plans_per_minute<T>(mut self, v: T) -> Self
23529    where
23530        T: std::convert::Into<wkt::Int32Value>,
23531    {
23532        self.query_plans_per_minute = std::option::Option::Some(v.into());
23533        self
23534    }
23535
23536    /// Sets or clears the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
23537    ///
23538    /// # Example
23539    /// ```ignore,no_run
23540    /// # use google_cloud_sql_v1::model::InsightsConfig;
23541    /// use wkt::Int32Value;
23542    /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(Some(Int32Value::default()/* use setters */));
23543    /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(None::<Int32Value>);
23544    /// ```
23545    pub fn set_or_clear_query_plans_per_minute<T>(mut self, v: std::option::Option<T>) -> Self
23546    where
23547        T: std::convert::Into<wkt::Int32Value>,
23548    {
23549        self.query_plans_per_minute = v.map(|x| x.into());
23550        self
23551    }
23552
23553    /// Sets the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
23554    ///
23555    /// # Example
23556    /// ```ignore,no_run
23557    /// # use google_cloud_sql_v1::model::InsightsConfig;
23558    /// use wkt::BoolValue;
23559    /// let x = InsightsConfig::new().set_enhanced_query_insights_enabled(BoolValue::default()/* use setters */);
23560    /// ```
23561    pub fn set_enhanced_query_insights_enabled<T>(mut self, v: T) -> Self
23562    where
23563        T: std::convert::Into<wkt::BoolValue>,
23564    {
23565        self.enhanced_query_insights_enabled = std::option::Option::Some(v.into());
23566        self
23567    }
23568
23569    /// Sets or clears the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
23570    ///
23571    /// # Example
23572    /// ```ignore,no_run
23573    /// # use google_cloud_sql_v1::model::InsightsConfig;
23574    /// use wkt::BoolValue;
23575    /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(Some(BoolValue::default()/* use setters */));
23576    /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(None::<BoolValue>);
23577    /// ```
23578    pub fn set_or_clear_enhanced_query_insights_enabled<T>(
23579        mut self,
23580        v: std::option::Option<T>,
23581    ) -> Self
23582    where
23583        T: std::convert::Into<wkt::BoolValue>,
23584    {
23585        self.enhanced_query_insights_enabled = v.map(|x| x.into());
23586        self
23587    }
23588}
23589
23590impl wkt::message::Message for InsightsConfig {
23591    fn typename() -> &'static str {
23592        "type.googleapis.com/google.cloud.sql.v1.InsightsConfig"
23593    }
23594}
23595
23596/// Read-replica configuration specific to MySQL databases.
23597#[derive(Clone, Default, PartialEq)]
23598#[non_exhaustive]
23599pub struct MySqlReplicaConfiguration {
23600    /// Path to a SQL dump file in Google Cloud Storage from which the replica
23601    /// instance is to be created. The URI is in the form gs://bucketName/fileName.
23602    /// Compressed gzip files (.gz) are also supported.
23603    /// Dumps have the binlog co-ordinates from which replication
23604    /// begins. This can be accomplished by setting --master-data to 1 when using
23605    /// mysqldump.
23606    pub dump_file_path: std::string::String,
23607
23608    /// The username for the replication connection.
23609    pub username: std::string::String,
23610
23611    /// The password for the replication connection.
23612    pub password: std::string::String,
23613
23614    /// Seconds to wait between connect retries. MySQL's default is 60 seconds.
23615    pub connect_retry_interval: std::option::Option<wkt::Int32Value>,
23616
23617    /// Interval in milliseconds between replication heartbeats.
23618    pub master_heartbeat_period: std::option::Option<wkt::Int64Value>,
23619
23620    /// PEM representation of the trusted CA's x509 certificate.
23621    pub ca_certificate: std::string::String,
23622
23623    /// PEM representation of the replica's x509 certificate.
23624    pub client_certificate: std::string::String,
23625
23626    /// PEM representation of the replica's private key. The corresponding public
23627    /// key is encoded in the client's certificate.
23628    pub client_key: std::string::String,
23629
23630    /// A list of permissible ciphers to use for SSL encryption.
23631    pub ssl_cipher: std::string::String,
23632
23633    /// Whether or not to check the primary instance's Common Name value in the
23634    /// certificate that it sends during the SSL handshake.
23635    pub verify_server_certificate: std::option::Option<wkt::BoolValue>,
23636
23637    /// This is always `sql#mysqlReplicaConfiguration`.
23638    pub kind: std::string::String,
23639
23640    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23641}
23642
23643impl MySqlReplicaConfiguration {
23644    /// Creates a new default instance.
23645    pub fn new() -> Self {
23646        std::default::Default::default()
23647    }
23648
23649    /// Sets the value of [dump_file_path][crate::model::MySqlReplicaConfiguration::dump_file_path].
23650    ///
23651    /// # Example
23652    /// ```ignore,no_run
23653    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23654    /// let x = MySqlReplicaConfiguration::new().set_dump_file_path("example");
23655    /// ```
23656    pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23657        self.dump_file_path = v.into();
23658        self
23659    }
23660
23661    /// Sets the value of [username][crate::model::MySqlReplicaConfiguration::username].
23662    ///
23663    /// # Example
23664    /// ```ignore,no_run
23665    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23666    /// let x = MySqlReplicaConfiguration::new().set_username("example");
23667    /// ```
23668    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23669        self.username = v.into();
23670        self
23671    }
23672
23673    /// Sets the value of [password][crate::model::MySqlReplicaConfiguration::password].
23674    ///
23675    /// # Example
23676    /// ```ignore,no_run
23677    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23678    /// let x = MySqlReplicaConfiguration::new().set_password("example");
23679    /// ```
23680    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23681        self.password = v.into();
23682        self
23683    }
23684
23685    /// Sets the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
23686    ///
23687    /// # Example
23688    /// ```ignore,no_run
23689    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23690    /// use wkt::Int32Value;
23691    /// let x = MySqlReplicaConfiguration::new().set_connect_retry_interval(Int32Value::default()/* use setters */);
23692    /// ```
23693    pub fn set_connect_retry_interval<T>(mut self, v: T) -> Self
23694    where
23695        T: std::convert::Into<wkt::Int32Value>,
23696    {
23697        self.connect_retry_interval = std::option::Option::Some(v.into());
23698        self
23699    }
23700
23701    /// Sets or clears the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
23702    ///
23703    /// # Example
23704    /// ```ignore,no_run
23705    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23706    /// use wkt::Int32Value;
23707    /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(Some(Int32Value::default()/* use setters */));
23708    /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(None::<Int32Value>);
23709    /// ```
23710    pub fn set_or_clear_connect_retry_interval<T>(mut self, v: std::option::Option<T>) -> Self
23711    where
23712        T: std::convert::Into<wkt::Int32Value>,
23713    {
23714        self.connect_retry_interval = v.map(|x| x.into());
23715        self
23716    }
23717
23718    /// Sets the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
23719    ///
23720    /// # Example
23721    /// ```ignore,no_run
23722    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23723    /// use wkt::Int64Value;
23724    /// let x = MySqlReplicaConfiguration::new().set_master_heartbeat_period(Int64Value::default()/* use setters */);
23725    /// ```
23726    pub fn set_master_heartbeat_period<T>(mut self, v: T) -> Self
23727    where
23728        T: std::convert::Into<wkt::Int64Value>,
23729    {
23730        self.master_heartbeat_period = std::option::Option::Some(v.into());
23731        self
23732    }
23733
23734    /// Sets or clears the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
23735    ///
23736    /// # Example
23737    /// ```ignore,no_run
23738    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23739    /// use wkt::Int64Value;
23740    /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(Some(Int64Value::default()/* use setters */));
23741    /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(None::<Int64Value>);
23742    /// ```
23743    pub fn set_or_clear_master_heartbeat_period<T>(mut self, v: std::option::Option<T>) -> Self
23744    where
23745        T: std::convert::Into<wkt::Int64Value>,
23746    {
23747        self.master_heartbeat_period = v.map(|x| x.into());
23748        self
23749    }
23750
23751    /// Sets the value of [ca_certificate][crate::model::MySqlReplicaConfiguration::ca_certificate].
23752    ///
23753    /// # Example
23754    /// ```ignore,no_run
23755    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23756    /// let x = MySqlReplicaConfiguration::new().set_ca_certificate("example");
23757    /// ```
23758    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23759        self.ca_certificate = v.into();
23760        self
23761    }
23762
23763    /// Sets the value of [client_certificate][crate::model::MySqlReplicaConfiguration::client_certificate].
23764    ///
23765    /// # Example
23766    /// ```ignore,no_run
23767    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23768    /// let x = MySqlReplicaConfiguration::new().set_client_certificate("example");
23769    /// ```
23770    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
23771        mut self,
23772        v: T,
23773    ) -> Self {
23774        self.client_certificate = v.into();
23775        self
23776    }
23777
23778    /// Sets the value of [client_key][crate::model::MySqlReplicaConfiguration::client_key].
23779    ///
23780    /// # Example
23781    /// ```ignore,no_run
23782    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23783    /// let x = MySqlReplicaConfiguration::new().set_client_key("example");
23784    /// ```
23785    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23786        self.client_key = v.into();
23787        self
23788    }
23789
23790    /// Sets the value of [ssl_cipher][crate::model::MySqlReplicaConfiguration::ssl_cipher].
23791    ///
23792    /// # Example
23793    /// ```ignore,no_run
23794    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23795    /// let x = MySqlReplicaConfiguration::new().set_ssl_cipher("example");
23796    /// ```
23797    pub fn set_ssl_cipher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23798        self.ssl_cipher = v.into();
23799        self
23800    }
23801
23802    /// Sets the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
23803    ///
23804    /// # Example
23805    /// ```ignore,no_run
23806    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23807    /// use wkt::BoolValue;
23808    /// let x = MySqlReplicaConfiguration::new().set_verify_server_certificate(BoolValue::default()/* use setters */);
23809    /// ```
23810    pub fn set_verify_server_certificate<T>(mut self, v: T) -> Self
23811    where
23812        T: std::convert::Into<wkt::BoolValue>,
23813    {
23814        self.verify_server_certificate = std::option::Option::Some(v.into());
23815        self
23816    }
23817
23818    /// Sets or clears the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
23819    ///
23820    /// # Example
23821    /// ```ignore,no_run
23822    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23823    /// use wkt::BoolValue;
23824    /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(Some(BoolValue::default()/* use setters */));
23825    /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(None::<BoolValue>);
23826    /// ```
23827    pub fn set_or_clear_verify_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
23828    where
23829        T: std::convert::Into<wkt::BoolValue>,
23830    {
23831        self.verify_server_certificate = v.map(|x| x.into());
23832        self
23833    }
23834
23835    /// Sets the value of [kind][crate::model::MySqlReplicaConfiguration::kind].
23836    ///
23837    /// # Example
23838    /// ```ignore,no_run
23839    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23840    /// let x = MySqlReplicaConfiguration::new().set_kind("example");
23841    /// ```
23842    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23843        self.kind = v.into();
23844        self
23845    }
23846}
23847
23848impl wkt::message::Message for MySqlReplicaConfiguration {
23849    fn typename() -> &'static str {
23850        "type.googleapis.com/google.cloud.sql.v1.MySqlReplicaConfiguration"
23851    }
23852}
23853
23854/// Disk encryption configuration for an instance.
23855#[derive(Clone, Default, PartialEq)]
23856#[non_exhaustive]
23857pub struct DiskEncryptionConfiguration {
23858    /// Resource name of KMS key for disk encryption
23859    pub kms_key_name: std::string::String,
23860
23861    /// This is always `sql#diskEncryptionConfiguration`.
23862    pub kind: std::string::String,
23863
23864    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23865}
23866
23867impl DiskEncryptionConfiguration {
23868    /// Creates a new default instance.
23869    pub fn new() -> Self {
23870        std::default::Default::default()
23871    }
23872
23873    /// Sets the value of [kms_key_name][crate::model::DiskEncryptionConfiguration::kms_key_name].
23874    ///
23875    /// # Example
23876    /// ```ignore,no_run
23877    /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
23878    /// let x = DiskEncryptionConfiguration::new().set_kms_key_name("example");
23879    /// ```
23880    pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23881        self.kms_key_name = v.into();
23882        self
23883    }
23884
23885    /// Sets the value of [kind][crate::model::DiskEncryptionConfiguration::kind].
23886    ///
23887    /// # Example
23888    /// ```ignore,no_run
23889    /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
23890    /// let x = DiskEncryptionConfiguration::new().set_kind("example");
23891    /// ```
23892    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23893        self.kind = v.into();
23894        self
23895    }
23896}
23897
23898impl wkt::message::Message for DiskEncryptionConfiguration {
23899    fn typename() -> &'static str {
23900        "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionConfiguration"
23901    }
23902}
23903
23904/// Disk encryption status for an instance.
23905#[derive(Clone, Default, PartialEq)]
23906#[non_exhaustive]
23907pub struct DiskEncryptionStatus {
23908    /// KMS key version used to encrypt the Cloud SQL instance resource
23909    pub kms_key_version_name: std::string::String,
23910
23911    /// This is always `sql#diskEncryptionStatus`.
23912    pub kind: std::string::String,
23913
23914    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23915}
23916
23917impl DiskEncryptionStatus {
23918    /// Creates a new default instance.
23919    pub fn new() -> Self {
23920        std::default::Default::default()
23921    }
23922
23923    /// Sets the value of [kms_key_version_name][crate::model::DiskEncryptionStatus::kms_key_version_name].
23924    ///
23925    /// # Example
23926    /// ```ignore,no_run
23927    /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
23928    /// let x = DiskEncryptionStatus::new().set_kms_key_version_name("example");
23929    /// ```
23930    pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
23931        mut self,
23932        v: T,
23933    ) -> Self {
23934        self.kms_key_version_name = v.into();
23935        self
23936    }
23937
23938    /// Sets the value of [kind][crate::model::DiskEncryptionStatus::kind].
23939    ///
23940    /// # Example
23941    /// ```ignore,no_run
23942    /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
23943    /// let x = DiskEncryptionStatus::new().set_kind("example");
23944    /// ```
23945    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23946        self.kind = v.into();
23947        self
23948    }
23949}
23950
23951impl wkt::message::Message for DiskEncryptionStatus {
23952    fn typename() -> &'static str {
23953        "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionStatus"
23954    }
23955}
23956
23957/// Database instance IP mapping
23958#[derive(Clone, Default, PartialEq)]
23959#[non_exhaustive]
23960pub struct IpMapping {
23961    /// The type of this IP address. A `PRIMARY` address is a public address that
23962    /// can accept incoming connections. A `PRIVATE` address is a private address
23963    /// that can accept incoming connections. An `OUTGOING` address is the source
23964    /// address of connections originating from the instance, if supported.
23965    pub r#type: crate::model::SqlIpAddressType,
23966
23967    /// The IP address assigned.
23968    pub ip_address: std::string::String,
23969
23970    /// The due time for this IP to be retired in
23971    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
23972    /// `2012-11-15T16:19:00.094Z`. This field is only available when
23973    /// the IP is scheduled to be retired.
23974    pub time_to_retire: std::option::Option<wkt::Timestamp>,
23975
23976    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23977}
23978
23979impl IpMapping {
23980    /// Creates a new default instance.
23981    pub fn new() -> Self {
23982        std::default::Default::default()
23983    }
23984
23985    /// Sets the value of [r#type][crate::model::IpMapping::type].
23986    ///
23987    /// # Example
23988    /// ```ignore,no_run
23989    /// # use google_cloud_sql_v1::model::IpMapping;
23990    /// use google_cloud_sql_v1::model::SqlIpAddressType;
23991    /// let x0 = IpMapping::new().set_type(SqlIpAddressType::Primary);
23992    /// let x1 = IpMapping::new().set_type(SqlIpAddressType::Outgoing);
23993    /// let x2 = IpMapping::new().set_type(SqlIpAddressType::Private);
23994    /// ```
23995    pub fn set_type<T: std::convert::Into<crate::model::SqlIpAddressType>>(mut self, v: T) -> Self {
23996        self.r#type = v.into();
23997        self
23998    }
23999
24000    /// Sets the value of [ip_address][crate::model::IpMapping::ip_address].
24001    ///
24002    /// # Example
24003    /// ```ignore,no_run
24004    /// # use google_cloud_sql_v1::model::IpMapping;
24005    /// let x = IpMapping::new().set_ip_address("example");
24006    /// ```
24007    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24008        self.ip_address = v.into();
24009        self
24010    }
24011
24012    /// Sets the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
24013    ///
24014    /// # Example
24015    /// ```ignore,no_run
24016    /// # use google_cloud_sql_v1::model::IpMapping;
24017    /// use wkt::Timestamp;
24018    /// let x = IpMapping::new().set_time_to_retire(Timestamp::default()/* use setters */);
24019    /// ```
24020    pub fn set_time_to_retire<T>(mut self, v: T) -> Self
24021    where
24022        T: std::convert::Into<wkt::Timestamp>,
24023    {
24024        self.time_to_retire = std::option::Option::Some(v.into());
24025        self
24026    }
24027
24028    /// Sets or clears the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
24029    ///
24030    /// # Example
24031    /// ```ignore,no_run
24032    /// # use google_cloud_sql_v1::model::IpMapping;
24033    /// use wkt::Timestamp;
24034    /// let x = IpMapping::new().set_or_clear_time_to_retire(Some(Timestamp::default()/* use setters */));
24035    /// let x = IpMapping::new().set_or_clear_time_to_retire(None::<Timestamp>);
24036    /// ```
24037    pub fn set_or_clear_time_to_retire<T>(mut self, v: std::option::Option<T>) -> Self
24038    where
24039        T: std::convert::Into<wkt::Timestamp>,
24040    {
24041        self.time_to_retire = v.map(|x| x.into());
24042        self
24043    }
24044}
24045
24046impl wkt::message::Message for IpMapping {
24047    fn typename() -> &'static str {
24048        "type.googleapis.com/google.cloud.sql.v1.IpMapping"
24049    }
24050}
24051
24052/// The sub operation type based on the operation type.
24053#[derive(Clone, Default, PartialEq)]
24054#[non_exhaustive]
24055pub struct SqlSubOperationType {
24056    /// Sub operation details corresponding to the operation type.
24057    pub sub_operation_details:
24058        std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
24059
24060    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24061}
24062
24063impl SqlSubOperationType {
24064    /// Creates a new default instance.
24065    pub fn new() -> Self {
24066        std::default::Default::default()
24067    }
24068
24069    /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details].
24070    ///
24071    /// Note that all the setters affecting `sub_operation_details` are mutually
24072    /// exclusive.
24073    ///
24074    /// # Example
24075    /// ```ignore,no_run
24076    /// # use google_cloud_sql_v1::model::SqlSubOperationType;
24077    /// use google_cloud_sql_v1::model::SqlMaintenanceType;
24078    /// let x0 = SqlSubOperationType::new().set_sub_operation_details(Some(
24079    ///     google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceMaintenance)));
24080    /// let x1 = SqlSubOperationType::new().set_sub_operation_details(Some(
24081    ///     google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::ReplicaIncludedMaintenance)));
24082    /// let x2 = SqlSubOperationType::new().set_sub_operation_details(Some(
24083    ///     google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceSelfServiceMaintenance)));
24084    /// ```
24085    pub fn set_sub_operation_details<
24086        T: std::convert::Into<
24087                std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
24088            >,
24089    >(
24090        mut self,
24091        v: T,
24092    ) -> Self {
24093        self.sub_operation_details = v.into();
24094        self
24095    }
24096
24097    /// The value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
24098    /// if it holds a `MaintenanceType`, `None` if the field is not set or
24099    /// holds a different branch.
24100    pub fn maintenance_type(&self) -> std::option::Option<&crate::model::SqlMaintenanceType> {
24101        #[allow(unreachable_patterns)]
24102        self.sub_operation_details.as_ref().and_then(|v| match v {
24103            crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v) => {
24104                std::option::Option::Some(v)
24105            }
24106            _ => std::option::Option::None,
24107        })
24108    }
24109
24110    /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
24111    /// to hold a `MaintenanceType`.
24112    ///
24113    /// Note that all the setters affecting `sub_operation_details` are
24114    /// mutually exclusive.
24115    ///
24116    /// # Example
24117    /// ```ignore,no_run
24118    /// # use google_cloud_sql_v1::model::SqlSubOperationType;
24119    /// use google_cloud_sql_v1::model::SqlMaintenanceType;
24120    /// let x0 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceMaintenance);
24121    /// let x1 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::ReplicaIncludedMaintenance);
24122    /// let x2 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceSelfServiceMaintenance);
24123    /// assert!(x0.maintenance_type().is_some());
24124    /// assert!(x1.maintenance_type().is_some());
24125    /// assert!(x2.maintenance_type().is_some());
24126    /// ```
24127    pub fn set_maintenance_type<T: std::convert::Into<crate::model::SqlMaintenanceType>>(
24128        mut self,
24129        v: T,
24130    ) -> Self {
24131        self.sub_operation_details = std::option::Option::Some(
24132            crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v.into()),
24133        );
24134        self
24135    }
24136}
24137
24138impl wkt::message::Message for SqlSubOperationType {
24139    fn typename() -> &'static str {
24140        "type.googleapis.com/google.cloud.sql.v1.SqlSubOperationType"
24141    }
24142}
24143
24144/// Defines additional types related to [SqlSubOperationType].
24145pub mod sql_sub_operation_type {
24146    #[allow(unused_imports)]
24147    use super::*;
24148
24149    /// Sub operation details corresponding to the operation type.
24150    #[derive(Clone, Debug, PartialEq)]
24151    #[non_exhaustive]
24152    pub enum SubOperationDetails {
24153        /// The type of maintenance to be performed on the instance.
24154        MaintenanceType(crate::model::SqlMaintenanceType),
24155    }
24156}
24157
24158/// An Operation resource.&nbsp;For successful operations that return an
24159/// Operation resource, only the fields relevant to the operation are populated
24160/// in the resource.
24161#[derive(Clone, Default, PartialEq)]
24162#[non_exhaustive]
24163pub struct Operation {
24164    /// This is always `sql#operation`.
24165    pub kind: std::string::String,
24166
24167    #[allow(missing_docs)]
24168    pub target_link: std::string::String,
24169
24170    /// The status of an operation.
24171    pub status: crate::model::operation::SqlOperationStatus,
24172
24173    /// The email address of the user who initiated this operation.
24174    pub user: std::string::String,
24175
24176    /// The time this operation was enqueued in UTC timezone in [RFC
24177    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
24178    /// `2012-11-15T16:19:00.094Z`.
24179    pub insert_time: std::option::Option<wkt::Timestamp>,
24180
24181    /// The time this operation actually started in UTC timezone in [RFC
24182    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
24183    /// `2012-11-15T16:19:00.094Z`.
24184    pub start_time: std::option::Option<wkt::Timestamp>,
24185
24186    /// The time this operation finished in UTC timezone in [RFC
24187    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
24188    /// `2012-11-15T16:19:00.094Z`.
24189    pub end_time: std::option::Option<wkt::Timestamp>,
24190
24191    /// If errors occurred during processing of this operation, this field will be
24192    /// populated.
24193    pub error: std::option::Option<crate::model::OperationErrors>,
24194
24195    /// An Admin API warning message.
24196    pub api_warning: std::option::Option<crate::model::ApiWarning>,
24197
24198    /// The type of the operation. Valid values are:
24199    ///
24200    /// * `CREATE`
24201    /// * `DELETE`
24202    /// * `UPDATE`
24203    /// * `RESTART`
24204    /// * `IMPORT`
24205    /// * `EXPORT`
24206    /// * `BACKUP_VOLUME`
24207    /// * `RESTORE_VOLUME`
24208    /// * `CREATE_USER`
24209    /// * `DELETE_USER`
24210    /// * `CREATE_DATABASE`
24211    /// * `DELETE_DATABASE`
24212    pub operation_type: crate::model::operation::SqlOperationType,
24213
24214    /// The context for import operation, if applicable.
24215    pub import_context: std::option::Option<crate::model::ImportContext>,
24216
24217    /// The context for export operation, if applicable.
24218    pub export_context: std::option::Option<crate::model::ExportContext>,
24219
24220    /// The context for backup operation, if applicable.
24221    pub backup_context: std::option::Option<crate::model::BackupContext>,
24222
24223    /// This field is only populated when the operation_type is
24224    /// PRE_CHECK_MAJOR_VERSION_UPGRADE.
24225    /// The PreCheckMajorVersionUpgradeContext message itself contains the details
24226    /// for that pre-check, such as the target database version for the upgrade
24227    /// and the results of the check (including any warnings or errors found).
24228    pub pre_check_major_version_upgrade_context:
24229        std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
24230
24231    /// An identifier that uniquely identifies the operation. You can use this
24232    /// identifier to retrieve the Operations resource that has information about
24233    /// the operation.
24234    pub name: std::string::String,
24235
24236    /// Name of the resource on which this operation runs.
24237    pub target_id: std::string::String,
24238
24239    /// The URI of this resource.
24240    pub self_link: std::string::String,
24241
24242    /// The project ID of the target instance related to this operation.
24243    pub target_project: std::string::String,
24244
24245    /// The context for acquire SSRS lease operation, if applicable.
24246    pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
24247
24248    /// Optional. The sub operation based on the operation type.
24249    pub sub_operation_type: std::option::Option<crate::model::SqlSubOperationType>,
24250
24251    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24252}
24253
24254impl Operation {
24255    /// Creates a new default instance.
24256    pub fn new() -> Self {
24257        std::default::Default::default()
24258    }
24259
24260    /// Sets the value of [kind][crate::model::Operation::kind].
24261    ///
24262    /// # Example
24263    /// ```ignore,no_run
24264    /// # use google_cloud_sql_v1::model::Operation;
24265    /// let x = Operation::new().set_kind("example");
24266    /// ```
24267    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24268        self.kind = v.into();
24269        self
24270    }
24271
24272    /// Sets the value of [target_link][crate::model::Operation::target_link].
24273    ///
24274    /// # Example
24275    /// ```ignore,no_run
24276    /// # use google_cloud_sql_v1::model::Operation;
24277    /// let x = Operation::new().set_target_link("example");
24278    /// ```
24279    pub fn set_target_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24280        self.target_link = v.into();
24281        self
24282    }
24283
24284    /// Sets the value of [status][crate::model::Operation::status].
24285    ///
24286    /// # Example
24287    /// ```ignore,no_run
24288    /// # use google_cloud_sql_v1::model::Operation;
24289    /// use google_cloud_sql_v1::model::operation::SqlOperationStatus;
24290    /// let x0 = Operation::new().set_status(SqlOperationStatus::Pending);
24291    /// let x1 = Operation::new().set_status(SqlOperationStatus::Running);
24292    /// let x2 = Operation::new().set_status(SqlOperationStatus::Done);
24293    /// ```
24294    pub fn set_status<T: std::convert::Into<crate::model::operation::SqlOperationStatus>>(
24295        mut self,
24296        v: T,
24297    ) -> Self {
24298        self.status = v.into();
24299        self
24300    }
24301
24302    /// Sets the value of [user][crate::model::Operation::user].
24303    ///
24304    /// # Example
24305    /// ```ignore,no_run
24306    /// # use google_cloud_sql_v1::model::Operation;
24307    /// let x = Operation::new().set_user("example");
24308    /// ```
24309    pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24310        self.user = v.into();
24311        self
24312    }
24313
24314    /// Sets the value of [insert_time][crate::model::Operation::insert_time].
24315    ///
24316    /// # Example
24317    /// ```ignore,no_run
24318    /// # use google_cloud_sql_v1::model::Operation;
24319    /// use wkt::Timestamp;
24320    /// let x = Operation::new().set_insert_time(Timestamp::default()/* use setters */);
24321    /// ```
24322    pub fn set_insert_time<T>(mut self, v: T) -> Self
24323    where
24324        T: std::convert::Into<wkt::Timestamp>,
24325    {
24326        self.insert_time = std::option::Option::Some(v.into());
24327        self
24328    }
24329
24330    /// Sets or clears the value of [insert_time][crate::model::Operation::insert_time].
24331    ///
24332    /// # Example
24333    /// ```ignore,no_run
24334    /// # use google_cloud_sql_v1::model::Operation;
24335    /// use wkt::Timestamp;
24336    /// let x = Operation::new().set_or_clear_insert_time(Some(Timestamp::default()/* use setters */));
24337    /// let x = Operation::new().set_or_clear_insert_time(None::<Timestamp>);
24338    /// ```
24339    pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
24340    where
24341        T: std::convert::Into<wkt::Timestamp>,
24342    {
24343        self.insert_time = v.map(|x| x.into());
24344        self
24345    }
24346
24347    /// Sets the value of [start_time][crate::model::Operation::start_time].
24348    ///
24349    /// # Example
24350    /// ```ignore,no_run
24351    /// # use google_cloud_sql_v1::model::Operation;
24352    /// use wkt::Timestamp;
24353    /// let x = Operation::new().set_start_time(Timestamp::default()/* use setters */);
24354    /// ```
24355    pub fn set_start_time<T>(mut self, v: T) -> Self
24356    where
24357        T: std::convert::Into<wkt::Timestamp>,
24358    {
24359        self.start_time = std::option::Option::Some(v.into());
24360        self
24361    }
24362
24363    /// Sets or clears the value of [start_time][crate::model::Operation::start_time].
24364    ///
24365    /// # Example
24366    /// ```ignore,no_run
24367    /// # use google_cloud_sql_v1::model::Operation;
24368    /// use wkt::Timestamp;
24369    /// let x = Operation::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
24370    /// let x = Operation::new().set_or_clear_start_time(None::<Timestamp>);
24371    /// ```
24372    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
24373    where
24374        T: std::convert::Into<wkt::Timestamp>,
24375    {
24376        self.start_time = v.map(|x| x.into());
24377        self
24378    }
24379
24380    /// Sets the value of [end_time][crate::model::Operation::end_time].
24381    ///
24382    /// # Example
24383    /// ```ignore,no_run
24384    /// # use google_cloud_sql_v1::model::Operation;
24385    /// use wkt::Timestamp;
24386    /// let x = Operation::new().set_end_time(Timestamp::default()/* use setters */);
24387    /// ```
24388    pub fn set_end_time<T>(mut self, v: T) -> Self
24389    where
24390        T: std::convert::Into<wkt::Timestamp>,
24391    {
24392        self.end_time = std::option::Option::Some(v.into());
24393        self
24394    }
24395
24396    /// Sets or clears the value of [end_time][crate::model::Operation::end_time].
24397    ///
24398    /// # Example
24399    /// ```ignore,no_run
24400    /// # use google_cloud_sql_v1::model::Operation;
24401    /// use wkt::Timestamp;
24402    /// let x = Operation::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
24403    /// let x = Operation::new().set_or_clear_end_time(None::<Timestamp>);
24404    /// ```
24405    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
24406    where
24407        T: std::convert::Into<wkt::Timestamp>,
24408    {
24409        self.end_time = v.map(|x| x.into());
24410        self
24411    }
24412
24413    /// Sets the value of [error][crate::model::Operation::error].
24414    ///
24415    /// # Example
24416    /// ```ignore,no_run
24417    /// # use google_cloud_sql_v1::model::Operation;
24418    /// use google_cloud_sql_v1::model::OperationErrors;
24419    /// let x = Operation::new().set_error(OperationErrors::default()/* use setters */);
24420    /// ```
24421    pub fn set_error<T>(mut self, v: T) -> Self
24422    where
24423        T: std::convert::Into<crate::model::OperationErrors>,
24424    {
24425        self.error = std::option::Option::Some(v.into());
24426        self
24427    }
24428
24429    /// Sets or clears the value of [error][crate::model::Operation::error].
24430    ///
24431    /// # Example
24432    /// ```ignore,no_run
24433    /// # use google_cloud_sql_v1::model::Operation;
24434    /// use google_cloud_sql_v1::model::OperationErrors;
24435    /// let x = Operation::new().set_or_clear_error(Some(OperationErrors::default()/* use setters */));
24436    /// let x = Operation::new().set_or_clear_error(None::<OperationErrors>);
24437    /// ```
24438    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
24439    where
24440        T: std::convert::Into<crate::model::OperationErrors>,
24441    {
24442        self.error = v.map(|x| x.into());
24443        self
24444    }
24445
24446    /// Sets the value of [api_warning][crate::model::Operation::api_warning].
24447    ///
24448    /// # Example
24449    /// ```ignore,no_run
24450    /// # use google_cloud_sql_v1::model::Operation;
24451    /// use google_cloud_sql_v1::model::ApiWarning;
24452    /// let x = Operation::new().set_api_warning(ApiWarning::default()/* use setters */);
24453    /// ```
24454    pub fn set_api_warning<T>(mut self, v: T) -> Self
24455    where
24456        T: std::convert::Into<crate::model::ApiWarning>,
24457    {
24458        self.api_warning = std::option::Option::Some(v.into());
24459        self
24460    }
24461
24462    /// Sets or clears the value of [api_warning][crate::model::Operation::api_warning].
24463    ///
24464    /// # Example
24465    /// ```ignore,no_run
24466    /// # use google_cloud_sql_v1::model::Operation;
24467    /// use google_cloud_sql_v1::model::ApiWarning;
24468    /// let x = Operation::new().set_or_clear_api_warning(Some(ApiWarning::default()/* use setters */));
24469    /// let x = Operation::new().set_or_clear_api_warning(None::<ApiWarning>);
24470    /// ```
24471    pub fn set_or_clear_api_warning<T>(mut self, v: std::option::Option<T>) -> Self
24472    where
24473        T: std::convert::Into<crate::model::ApiWarning>,
24474    {
24475        self.api_warning = v.map(|x| x.into());
24476        self
24477    }
24478
24479    /// Sets the value of [operation_type][crate::model::Operation::operation_type].
24480    ///
24481    /// # Example
24482    /// ```ignore,no_run
24483    /// # use google_cloud_sql_v1::model::Operation;
24484    /// use google_cloud_sql_v1::model::operation::SqlOperationType;
24485    /// let x0 = Operation::new().set_operation_type(SqlOperationType::Import);
24486    /// let x1 = Operation::new().set_operation_type(SqlOperationType::Export);
24487    /// let x2 = Operation::new().set_operation_type(SqlOperationType::Create);
24488    /// ```
24489    pub fn set_operation_type<T: std::convert::Into<crate::model::operation::SqlOperationType>>(
24490        mut self,
24491        v: T,
24492    ) -> Self {
24493        self.operation_type = v.into();
24494        self
24495    }
24496
24497    /// Sets the value of [import_context][crate::model::Operation::import_context].
24498    ///
24499    /// # Example
24500    /// ```ignore,no_run
24501    /// # use google_cloud_sql_v1::model::Operation;
24502    /// use google_cloud_sql_v1::model::ImportContext;
24503    /// let x = Operation::new().set_import_context(ImportContext::default()/* use setters */);
24504    /// ```
24505    pub fn set_import_context<T>(mut self, v: T) -> Self
24506    where
24507        T: std::convert::Into<crate::model::ImportContext>,
24508    {
24509        self.import_context = std::option::Option::Some(v.into());
24510        self
24511    }
24512
24513    /// Sets or clears the value of [import_context][crate::model::Operation::import_context].
24514    ///
24515    /// # Example
24516    /// ```ignore,no_run
24517    /// # use google_cloud_sql_v1::model::Operation;
24518    /// use google_cloud_sql_v1::model::ImportContext;
24519    /// let x = Operation::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
24520    /// let x = Operation::new().set_or_clear_import_context(None::<ImportContext>);
24521    /// ```
24522    pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
24523    where
24524        T: std::convert::Into<crate::model::ImportContext>,
24525    {
24526        self.import_context = v.map(|x| x.into());
24527        self
24528    }
24529
24530    /// Sets the value of [export_context][crate::model::Operation::export_context].
24531    ///
24532    /// # Example
24533    /// ```ignore,no_run
24534    /// # use google_cloud_sql_v1::model::Operation;
24535    /// use google_cloud_sql_v1::model::ExportContext;
24536    /// let x = Operation::new().set_export_context(ExportContext::default()/* use setters */);
24537    /// ```
24538    pub fn set_export_context<T>(mut self, v: T) -> Self
24539    where
24540        T: std::convert::Into<crate::model::ExportContext>,
24541    {
24542        self.export_context = std::option::Option::Some(v.into());
24543        self
24544    }
24545
24546    /// Sets or clears the value of [export_context][crate::model::Operation::export_context].
24547    ///
24548    /// # Example
24549    /// ```ignore,no_run
24550    /// # use google_cloud_sql_v1::model::Operation;
24551    /// use google_cloud_sql_v1::model::ExportContext;
24552    /// let x = Operation::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
24553    /// let x = Operation::new().set_or_clear_export_context(None::<ExportContext>);
24554    /// ```
24555    pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
24556    where
24557        T: std::convert::Into<crate::model::ExportContext>,
24558    {
24559        self.export_context = v.map(|x| x.into());
24560        self
24561    }
24562
24563    /// Sets the value of [backup_context][crate::model::Operation::backup_context].
24564    ///
24565    /// # Example
24566    /// ```ignore,no_run
24567    /// # use google_cloud_sql_v1::model::Operation;
24568    /// use google_cloud_sql_v1::model::BackupContext;
24569    /// let x = Operation::new().set_backup_context(BackupContext::default()/* use setters */);
24570    /// ```
24571    pub fn set_backup_context<T>(mut self, v: T) -> Self
24572    where
24573        T: std::convert::Into<crate::model::BackupContext>,
24574    {
24575        self.backup_context = std::option::Option::Some(v.into());
24576        self
24577    }
24578
24579    /// Sets or clears the value of [backup_context][crate::model::Operation::backup_context].
24580    ///
24581    /// # Example
24582    /// ```ignore,no_run
24583    /// # use google_cloud_sql_v1::model::Operation;
24584    /// use google_cloud_sql_v1::model::BackupContext;
24585    /// let x = Operation::new().set_or_clear_backup_context(Some(BackupContext::default()/* use setters */));
24586    /// let x = Operation::new().set_or_clear_backup_context(None::<BackupContext>);
24587    /// ```
24588    pub fn set_or_clear_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
24589    where
24590        T: std::convert::Into<crate::model::BackupContext>,
24591    {
24592        self.backup_context = v.map(|x| x.into());
24593        self
24594    }
24595
24596    /// Sets the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
24597    ///
24598    /// # Example
24599    /// ```ignore,no_run
24600    /// # use google_cloud_sql_v1::model::Operation;
24601    /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
24602    /// let x = Operation::new().set_pre_check_major_version_upgrade_context(PreCheckMajorVersionUpgradeContext::default()/* use setters */);
24603    /// ```
24604    pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
24605    where
24606        T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
24607    {
24608        self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
24609        self
24610    }
24611
24612    /// Sets or clears the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
24613    ///
24614    /// # Example
24615    /// ```ignore,no_run
24616    /// # use google_cloud_sql_v1::model::Operation;
24617    /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
24618    /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(Some(PreCheckMajorVersionUpgradeContext::default()/* use setters */));
24619    /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(None::<PreCheckMajorVersionUpgradeContext>);
24620    /// ```
24621    pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
24622        mut self,
24623        v: std::option::Option<T>,
24624    ) -> Self
24625    where
24626        T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
24627    {
24628        self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
24629        self
24630    }
24631
24632    /// Sets the value of [name][crate::model::Operation::name].
24633    ///
24634    /// # Example
24635    /// ```ignore,no_run
24636    /// # use google_cloud_sql_v1::model::Operation;
24637    /// let x = Operation::new().set_name("example");
24638    /// ```
24639    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24640        self.name = v.into();
24641        self
24642    }
24643
24644    /// Sets the value of [target_id][crate::model::Operation::target_id].
24645    ///
24646    /// # Example
24647    /// ```ignore,no_run
24648    /// # use google_cloud_sql_v1::model::Operation;
24649    /// let x = Operation::new().set_target_id("example");
24650    /// ```
24651    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24652        self.target_id = v.into();
24653        self
24654    }
24655
24656    /// Sets the value of [self_link][crate::model::Operation::self_link].
24657    ///
24658    /// # Example
24659    /// ```ignore,no_run
24660    /// # use google_cloud_sql_v1::model::Operation;
24661    /// let x = Operation::new().set_self_link("example");
24662    /// ```
24663    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24664        self.self_link = v.into();
24665        self
24666    }
24667
24668    /// Sets the value of [target_project][crate::model::Operation::target_project].
24669    ///
24670    /// # Example
24671    /// ```ignore,no_run
24672    /// # use google_cloud_sql_v1::model::Operation;
24673    /// let x = Operation::new().set_target_project("example");
24674    /// ```
24675    pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24676        self.target_project = v.into();
24677        self
24678    }
24679
24680    /// Sets the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
24681    ///
24682    /// # Example
24683    /// ```ignore,no_run
24684    /// # use google_cloud_sql_v1::model::Operation;
24685    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
24686    /// let x = Operation::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
24687    /// ```
24688    pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
24689    where
24690        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
24691    {
24692        self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
24693        self
24694    }
24695
24696    /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
24697    ///
24698    /// # Example
24699    /// ```ignore,no_run
24700    /// # use google_cloud_sql_v1::model::Operation;
24701    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
24702    /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
24703    /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
24704    /// ```
24705    pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
24706    where
24707        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
24708    {
24709        self.acquire_ssrs_lease_context = v.map(|x| x.into());
24710        self
24711    }
24712
24713    /// Sets the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
24714    ///
24715    /// # Example
24716    /// ```ignore,no_run
24717    /// # use google_cloud_sql_v1::model::Operation;
24718    /// use google_cloud_sql_v1::model::SqlSubOperationType;
24719    /// let x = Operation::new().set_sub_operation_type(SqlSubOperationType::default()/* use setters */);
24720    /// ```
24721    pub fn set_sub_operation_type<T>(mut self, v: T) -> Self
24722    where
24723        T: std::convert::Into<crate::model::SqlSubOperationType>,
24724    {
24725        self.sub_operation_type = std::option::Option::Some(v.into());
24726        self
24727    }
24728
24729    /// Sets or clears the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
24730    ///
24731    /// # Example
24732    /// ```ignore,no_run
24733    /// # use google_cloud_sql_v1::model::Operation;
24734    /// use google_cloud_sql_v1::model::SqlSubOperationType;
24735    /// let x = Operation::new().set_or_clear_sub_operation_type(Some(SqlSubOperationType::default()/* use setters */));
24736    /// let x = Operation::new().set_or_clear_sub_operation_type(None::<SqlSubOperationType>);
24737    /// ```
24738    pub fn set_or_clear_sub_operation_type<T>(mut self, v: std::option::Option<T>) -> Self
24739    where
24740        T: std::convert::Into<crate::model::SqlSubOperationType>,
24741    {
24742        self.sub_operation_type = v.map(|x| x.into());
24743        self
24744    }
24745}
24746
24747impl wkt::message::Message for Operation {
24748    fn typename() -> &'static str {
24749        "type.googleapis.com/google.cloud.sql.v1.Operation"
24750    }
24751}
24752
24753/// Defines additional types related to [Operation].
24754pub mod operation {
24755    #[allow(unused_imports)]
24756    use super::*;
24757
24758    /// The type of Cloud SQL operation.
24759    ///
24760    /// # Working with unknown values
24761    ///
24762    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24763    /// additional enum variants at any time. Adding new variants is not considered
24764    /// a breaking change. Applications should write their code in anticipation of:
24765    ///
24766    /// - New values appearing in future releases of the client library, **and**
24767    /// - New values received dynamically, without application changes.
24768    ///
24769    /// Please consult the [Working with enums] section in the user guide for some
24770    /// guidelines.
24771    ///
24772    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24773    #[derive(Clone, Debug, PartialEq)]
24774    #[non_exhaustive]
24775    pub enum SqlOperationType {
24776        /// Unknown operation type.
24777        Unspecified,
24778        /// Imports data into a Cloud SQL instance.
24779        Import,
24780        /// Exports data from a Cloud SQL instance to a Cloud Storage
24781        /// bucket.
24782        Export,
24783        /// Creates a new Cloud SQL instance.
24784        Create,
24785        /// Updates the settings of a Cloud SQL instance.
24786        Update,
24787        /// Deletes a Cloud SQL instance.
24788        Delete,
24789        /// Restarts the Cloud SQL instance.
24790        Restart,
24791        #[allow(missing_docs)]
24792        #[deprecated]
24793        Backup,
24794        #[allow(missing_docs)]
24795        #[deprecated]
24796        Snapshot,
24797        /// Performs instance backup.
24798        BackupVolume,
24799        /// Deletes an instance backup.
24800        DeleteVolume,
24801        /// Restores an instance backup.
24802        RestoreVolume,
24803        /// Injects a privileged user in mysql for MOB instances.
24804        InjectUser,
24805        /// Clones a Cloud SQL instance.
24806        Clone,
24807        /// Stops replication on a Cloud SQL read replica instance.
24808        StopReplica,
24809        /// Starts replication on a Cloud SQL read replica instance.
24810        StartReplica,
24811        /// Promotes a Cloud SQL replica instance.
24812        PromoteReplica,
24813        /// Creates a Cloud SQL replica instance.
24814        CreateReplica,
24815        /// Creates a new user in a Cloud SQL instance.
24816        CreateUser,
24817        /// Deletes a user from a Cloud SQL instance.
24818        DeleteUser,
24819        /// Updates an existing user in a Cloud SQL instance. If a user with the
24820        /// specified username doesn't exist, a new user is created.
24821        UpdateUser,
24822        /// Creates a database in the Cloud SQL instance.
24823        CreateDatabase,
24824        /// Deletes a database in the Cloud SQL instance.
24825        DeleteDatabase,
24826        /// Updates a database in the Cloud SQL instance.
24827        UpdateDatabase,
24828        /// Performs failover of an HA-enabled Cloud SQL
24829        /// failover replica.
24830        Failover,
24831        /// Deletes the backup taken by a backup run.
24832        DeleteBackup,
24833        #[allow(missing_docs)]
24834        RecreateReplica,
24835        /// Truncates a general or slow log table in MySQL.
24836        TruncateLog,
24837        /// Demotes the stand-alone instance to be a Cloud SQL
24838        /// read replica for an external database server.
24839        DemoteMaster,
24840        /// Indicates that the instance is currently in maintenance. Maintenance
24841        /// typically causes the instance to be unavailable for 1-3 minutes.
24842        Maintenance,
24843        /// This field is deprecated, and will be removed in future version of API.
24844        #[deprecated]
24845        EnablePrivateIp,
24846        #[allow(missing_docs)]
24847        #[deprecated]
24848        DeferMaintenance,
24849        /// Creates clone instance.
24850        #[deprecated]
24851        CreateClone,
24852        /// Reschedule maintenance to another time.
24853        RescheduleMaintenance,
24854        /// Starts external sync of a Cloud SQL EM replica to an external primary
24855        /// instance.
24856        StartExternalSync,
24857        /// Recovers logs from an instance's old data disk.
24858        LogCleanup,
24859        /// Performs auto-restart of an HA-enabled Cloud SQL database for auto
24860        /// recovery.
24861        AutoRestart,
24862        /// Re-encrypts CMEK instances with latest key version.
24863        Reencrypt,
24864        /// Switches the roles of the primary and replica pair. The target instance
24865        /// should be the replica.
24866        Switchover,
24867        /// Update a backup.
24868        UpdateBackup,
24869        /// Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
24870        AcquireSsrsLease,
24871        /// Release a lease for the setup of SQL Server Reporting Services (SSRS).
24872        ReleaseSsrsLease,
24873        /// Reconfigures old primary after a promote replica operation. Effect of a
24874        /// promote operation to the old primary is executed in this operation,
24875        /// asynchronously from the promote replica operation executed to the
24876        /// replica.
24877        ReconfigureOldPrimary,
24878        /// Indicates that the instance, its read replicas, and its cascading
24879        /// replicas are in maintenance. Maintenance typically gets initiated on
24880        /// groups of replicas first, followed by the primary instance. For each
24881        /// instance, maintenance typically causes the instance to be unavailable for
24882        /// 1-3 minutes.
24883        #[deprecated]
24884        ClusterMaintenance,
24885        /// Indicates that the instance (and any of its replicas) are currently in
24886        /// maintenance. This is initiated as a self-service request by using SSM.
24887        /// Maintenance typically causes the instance to be unavailable for 1-3
24888        /// minutes.
24889        #[deprecated]
24890        SelfServiceMaintenance,
24891        /// Switches a primary instance to a replica. This operation runs as part of
24892        /// a switchover operation to the original primary instance.
24893        SwitchoverToReplica,
24894        /// Updates the major version of a Cloud SQL instance.
24895        MajorVersionUpgrade,
24896        /// Deprecated: ADVANCED_BACKUP is deprecated. Use ENHANCED_BACKUP instead.
24897        #[deprecated]
24898        AdvancedBackup,
24899        /// Changes the BackupTier of a Cloud SQL instance.
24900        ManageBackup,
24901        /// Creates a backup for an Enhanced BackupTier Cloud SQL instance.
24902        EnhancedBackup,
24903        /// Repairs entire read pool or specified read pool nodes in the read pool.
24904        RepairReadPool,
24905        /// Creates a Cloud SQL read pool instance.
24906        CreateReadPool,
24907        /// If set, the enum was initialized with an unknown value.
24908        ///
24909        /// Applications can examine the value using [SqlOperationType::value] or
24910        /// [SqlOperationType::name].
24911        UnknownValue(sql_operation_type::UnknownValue),
24912    }
24913
24914    #[doc(hidden)]
24915    pub mod sql_operation_type {
24916        #[allow(unused_imports)]
24917        use super::*;
24918        #[derive(Clone, Debug, PartialEq)]
24919        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24920    }
24921
24922    impl SqlOperationType {
24923        /// Gets the enum value.
24924        ///
24925        /// Returns `None` if the enum contains an unknown value deserialized from
24926        /// the string representation of enums.
24927        pub fn value(&self) -> std::option::Option<i32> {
24928            match self {
24929                Self::Unspecified => std::option::Option::Some(0),
24930                Self::Import => std::option::Option::Some(1),
24931                Self::Export => std::option::Option::Some(2),
24932                Self::Create => std::option::Option::Some(3),
24933                Self::Update => std::option::Option::Some(4),
24934                Self::Delete => std::option::Option::Some(5),
24935                Self::Restart => std::option::Option::Some(6),
24936                Self::Backup => std::option::Option::Some(7),
24937                Self::Snapshot => std::option::Option::Some(8),
24938                Self::BackupVolume => std::option::Option::Some(9),
24939                Self::DeleteVolume => std::option::Option::Some(10),
24940                Self::RestoreVolume => std::option::Option::Some(11),
24941                Self::InjectUser => std::option::Option::Some(12),
24942                Self::Clone => std::option::Option::Some(14),
24943                Self::StopReplica => std::option::Option::Some(15),
24944                Self::StartReplica => std::option::Option::Some(16),
24945                Self::PromoteReplica => std::option::Option::Some(17),
24946                Self::CreateReplica => std::option::Option::Some(18),
24947                Self::CreateUser => std::option::Option::Some(19),
24948                Self::DeleteUser => std::option::Option::Some(20),
24949                Self::UpdateUser => std::option::Option::Some(21),
24950                Self::CreateDatabase => std::option::Option::Some(22),
24951                Self::DeleteDatabase => std::option::Option::Some(23),
24952                Self::UpdateDatabase => std::option::Option::Some(24),
24953                Self::Failover => std::option::Option::Some(25),
24954                Self::DeleteBackup => std::option::Option::Some(26),
24955                Self::RecreateReplica => std::option::Option::Some(27),
24956                Self::TruncateLog => std::option::Option::Some(28),
24957                Self::DemoteMaster => std::option::Option::Some(29),
24958                Self::Maintenance => std::option::Option::Some(30),
24959                Self::EnablePrivateIp => std::option::Option::Some(31),
24960                Self::DeferMaintenance => std::option::Option::Some(32),
24961                Self::CreateClone => std::option::Option::Some(33),
24962                Self::RescheduleMaintenance => std::option::Option::Some(34),
24963                Self::StartExternalSync => std::option::Option::Some(35),
24964                Self::LogCleanup => std::option::Option::Some(36),
24965                Self::AutoRestart => std::option::Option::Some(37),
24966                Self::Reencrypt => std::option::Option::Some(38),
24967                Self::Switchover => std::option::Option::Some(39),
24968                Self::UpdateBackup => std::option::Option::Some(40),
24969                Self::AcquireSsrsLease => std::option::Option::Some(42),
24970                Self::ReleaseSsrsLease => std::option::Option::Some(43),
24971                Self::ReconfigureOldPrimary => std::option::Option::Some(44),
24972                Self::ClusterMaintenance => std::option::Option::Some(45),
24973                Self::SelfServiceMaintenance => std::option::Option::Some(46),
24974                Self::SwitchoverToReplica => std::option::Option::Some(47),
24975                Self::MajorVersionUpgrade => std::option::Option::Some(48),
24976                Self::AdvancedBackup => std::option::Option::Some(49),
24977                Self::ManageBackup => std::option::Option::Some(50),
24978                Self::EnhancedBackup => std::option::Option::Some(51),
24979                Self::RepairReadPool => std::option::Option::Some(52),
24980                Self::CreateReadPool => std::option::Option::Some(53),
24981                Self::UnknownValue(u) => u.0.value(),
24982            }
24983        }
24984
24985        /// Gets the enum value as a string.
24986        ///
24987        /// Returns `None` if the enum contains an unknown value deserialized from
24988        /// the integer representation of enums.
24989        pub fn name(&self) -> std::option::Option<&str> {
24990            match self {
24991                Self::Unspecified => std::option::Option::Some("SQL_OPERATION_TYPE_UNSPECIFIED"),
24992                Self::Import => std::option::Option::Some("IMPORT"),
24993                Self::Export => std::option::Option::Some("EXPORT"),
24994                Self::Create => std::option::Option::Some("CREATE"),
24995                Self::Update => std::option::Option::Some("UPDATE"),
24996                Self::Delete => std::option::Option::Some("DELETE"),
24997                Self::Restart => std::option::Option::Some("RESTART"),
24998                Self::Backup => std::option::Option::Some("BACKUP"),
24999                Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
25000                Self::BackupVolume => std::option::Option::Some("BACKUP_VOLUME"),
25001                Self::DeleteVolume => std::option::Option::Some("DELETE_VOLUME"),
25002                Self::RestoreVolume => std::option::Option::Some("RESTORE_VOLUME"),
25003                Self::InjectUser => std::option::Option::Some("INJECT_USER"),
25004                Self::Clone => std::option::Option::Some("CLONE"),
25005                Self::StopReplica => std::option::Option::Some("STOP_REPLICA"),
25006                Self::StartReplica => std::option::Option::Some("START_REPLICA"),
25007                Self::PromoteReplica => std::option::Option::Some("PROMOTE_REPLICA"),
25008                Self::CreateReplica => std::option::Option::Some("CREATE_REPLICA"),
25009                Self::CreateUser => std::option::Option::Some("CREATE_USER"),
25010                Self::DeleteUser => std::option::Option::Some("DELETE_USER"),
25011                Self::UpdateUser => std::option::Option::Some("UPDATE_USER"),
25012                Self::CreateDatabase => std::option::Option::Some("CREATE_DATABASE"),
25013                Self::DeleteDatabase => std::option::Option::Some("DELETE_DATABASE"),
25014                Self::UpdateDatabase => std::option::Option::Some("UPDATE_DATABASE"),
25015                Self::Failover => std::option::Option::Some("FAILOVER"),
25016                Self::DeleteBackup => std::option::Option::Some("DELETE_BACKUP"),
25017                Self::RecreateReplica => std::option::Option::Some("RECREATE_REPLICA"),
25018                Self::TruncateLog => std::option::Option::Some("TRUNCATE_LOG"),
25019                Self::DemoteMaster => std::option::Option::Some("DEMOTE_MASTER"),
25020                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
25021                Self::EnablePrivateIp => std::option::Option::Some("ENABLE_PRIVATE_IP"),
25022                Self::DeferMaintenance => std::option::Option::Some("DEFER_MAINTENANCE"),
25023                Self::CreateClone => std::option::Option::Some("CREATE_CLONE"),
25024                Self::RescheduleMaintenance => std::option::Option::Some("RESCHEDULE_MAINTENANCE"),
25025                Self::StartExternalSync => std::option::Option::Some("START_EXTERNAL_SYNC"),
25026                Self::LogCleanup => std::option::Option::Some("LOG_CLEANUP"),
25027                Self::AutoRestart => std::option::Option::Some("AUTO_RESTART"),
25028                Self::Reencrypt => std::option::Option::Some("REENCRYPT"),
25029                Self::Switchover => std::option::Option::Some("SWITCHOVER"),
25030                Self::UpdateBackup => std::option::Option::Some("UPDATE_BACKUP"),
25031                Self::AcquireSsrsLease => std::option::Option::Some("ACQUIRE_SSRS_LEASE"),
25032                Self::ReleaseSsrsLease => std::option::Option::Some("RELEASE_SSRS_LEASE"),
25033                Self::ReconfigureOldPrimary => std::option::Option::Some("RECONFIGURE_OLD_PRIMARY"),
25034                Self::ClusterMaintenance => std::option::Option::Some("CLUSTER_MAINTENANCE"),
25035                Self::SelfServiceMaintenance => {
25036                    std::option::Option::Some("SELF_SERVICE_MAINTENANCE")
25037                }
25038                Self::SwitchoverToReplica => std::option::Option::Some("SWITCHOVER_TO_REPLICA"),
25039                Self::MajorVersionUpgrade => std::option::Option::Some("MAJOR_VERSION_UPGRADE"),
25040                Self::AdvancedBackup => std::option::Option::Some("ADVANCED_BACKUP"),
25041                Self::ManageBackup => std::option::Option::Some("MANAGE_BACKUP"),
25042                Self::EnhancedBackup => std::option::Option::Some("ENHANCED_BACKUP"),
25043                Self::RepairReadPool => std::option::Option::Some("REPAIR_READ_POOL"),
25044                Self::CreateReadPool => std::option::Option::Some("CREATE_READ_POOL"),
25045                Self::UnknownValue(u) => u.0.name(),
25046            }
25047        }
25048    }
25049
25050    impl std::default::Default for SqlOperationType {
25051        fn default() -> Self {
25052            use std::convert::From;
25053            Self::from(0)
25054        }
25055    }
25056
25057    impl std::fmt::Display for SqlOperationType {
25058        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25059            wkt::internal::display_enum(f, self.name(), self.value())
25060        }
25061    }
25062
25063    impl std::convert::From<i32> for SqlOperationType {
25064        fn from(value: i32) -> Self {
25065            match value {
25066                0 => Self::Unspecified,
25067                1 => Self::Import,
25068                2 => Self::Export,
25069                3 => Self::Create,
25070                4 => Self::Update,
25071                5 => Self::Delete,
25072                6 => Self::Restart,
25073                7 => Self::Backup,
25074                8 => Self::Snapshot,
25075                9 => Self::BackupVolume,
25076                10 => Self::DeleteVolume,
25077                11 => Self::RestoreVolume,
25078                12 => Self::InjectUser,
25079                14 => Self::Clone,
25080                15 => Self::StopReplica,
25081                16 => Self::StartReplica,
25082                17 => Self::PromoteReplica,
25083                18 => Self::CreateReplica,
25084                19 => Self::CreateUser,
25085                20 => Self::DeleteUser,
25086                21 => Self::UpdateUser,
25087                22 => Self::CreateDatabase,
25088                23 => Self::DeleteDatabase,
25089                24 => Self::UpdateDatabase,
25090                25 => Self::Failover,
25091                26 => Self::DeleteBackup,
25092                27 => Self::RecreateReplica,
25093                28 => Self::TruncateLog,
25094                29 => Self::DemoteMaster,
25095                30 => Self::Maintenance,
25096                31 => Self::EnablePrivateIp,
25097                32 => Self::DeferMaintenance,
25098                33 => Self::CreateClone,
25099                34 => Self::RescheduleMaintenance,
25100                35 => Self::StartExternalSync,
25101                36 => Self::LogCleanup,
25102                37 => Self::AutoRestart,
25103                38 => Self::Reencrypt,
25104                39 => Self::Switchover,
25105                40 => Self::UpdateBackup,
25106                42 => Self::AcquireSsrsLease,
25107                43 => Self::ReleaseSsrsLease,
25108                44 => Self::ReconfigureOldPrimary,
25109                45 => Self::ClusterMaintenance,
25110                46 => Self::SelfServiceMaintenance,
25111                47 => Self::SwitchoverToReplica,
25112                48 => Self::MajorVersionUpgrade,
25113                49 => Self::AdvancedBackup,
25114                50 => Self::ManageBackup,
25115                51 => Self::EnhancedBackup,
25116                52 => Self::RepairReadPool,
25117                53 => Self::CreateReadPool,
25118                _ => Self::UnknownValue(sql_operation_type::UnknownValue(
25119                    wkt::internal::UnknownEnumValue::Integer(value),
25120                )),
25121            }
25122        }
25123    }
25124
25125    impl std::convert::From<&str> for SqlOperationType {
25126        fn from(value: &str) -> Self {
25127            use std::string::ToString;
25128            match value {
25129                "SQL_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
25130                "IMPORT" => Self::Import,
25131                "EXPORT" => Self::Export,
25132                "CREATE" => Self::Create,
25133                "UPDATE" => Self::Update,
25134                "DELETE" => Self::Delete,
25135                "RESTART" => Self::Restart,
25136                "BACKUP" => Self::Backup,
25137                "SNAPSHOT" => Self::Snapshot,
25138                "BACKUP_VOLUME" => Self::BackupVolume,
25139                "DELETE_VOLUME" => Self::DeleteVolume,
25140                "RESTORE_VOLUME" => Self::RestoreVolume,
25141                "INJECT_USER" => Self::InjectUser,
25142                "CLONE" => Self::Clone,
25143                "STOP_REPLICA" => Self::StopReplica,
25144                "START_REPLICA" => Self::StartReplica,
25145                "PROMOTE_REPLICA" => Self::PromoteReplica,
25146                "CREATE_REPLICA" => Self::CreateReplica,
25147                "CREATE_USER" => Self::CreateUser,
25148                "DELETE_USER" => Self::DeleteUser,
25149                "UPDATE_USER" => Self::UpdateUser,
25150                "CREATE_DATABASE" => Self::CreateDatabase,
25151                "DELETE_DATABASE" => Self::DeleteDatabase,
25152                "UPDATE_DATABASE" => Self::UpdateDatabase,
25153                "FAILOVER" => Self::Failover,
25154                "DELETE_BACKUP" => Self::DeleteBackup,
25155                "RECREATE_REPLICA" => Self::RecreateReplica,
25156                "TRUNCATE_LOG" => Self::TruncateLog,
25157                "DEMOTE_MASTER" => Self::DemoteMaster,
25158                "MAINTENANCE" => Self::Maintenance,
25159                "ENABLE_PRIVATE_IP" => Self::EnablePrivateIp,
25160                "DEFER_MAINTENANCE" => Self::DeferMaintenance,
25161                "CREATE_CLONE" => Self::CreateClone,
25162                "RESCHEDULE_MAINTENANCE" => Self::RescheduleMaintenance,
25163                "START_EXTERNAL_SYNC" => Self::StartExternalSync,
25164                "LOG_CLEANUP" => Self::LogCleanup,
25165                "AUTO_RESTART" => Self::AutoRestart,
25166                "REENCRYPT" => Self::Reencrypt,
25167                "SWITCHOVER" => Self::Switchover,
25168                "UPDATE_BACKUP" => Self::UpdateBackup,
25169                "ACQUIRE_SSRS_LEASE" => Self::AcquireSsrsLease,
25170                "RELEASE_SSRS_LEASE" => Self::ReleaseSsrsLease,
25171                "RECONFIGURE_OLD_PRIMARY" => Self::ReconfigureOldPrimary,
25172                "CLUSTER_MAINTENANCE" => Self::ClusterMaintenance,
25173                "SELF_SERVICE_MAINTENANCE" => Self::SelfServiceMaintenance,
25174                "SWITCHOVER_TO_REPLICA" => Self::SwitchoverToReplica,
25175                "MAJOR_VERSION_UPGRADE" => Self::MajorVersionUpgrade,
25176                "ADVANCED_BACKUP" => Self::AdvancedBackup,
25177                "MANAGE_BACKUP" => Self::ManageBackup,
25178                "ENHANCED_BACKUP" => Self::EnhancedBackup,
25179                "REPAIR_READ_POOL" => Self::RepairReadPool,
25180                "CREATE_READ_POOL" => Self::CreateReadPool,
25181                _ => Self::UnknownValue(sql_operation_type::UnknownValue(
25182                    wkt::internal::UnknownEnumValue::String(value.to_string()),
25183                )),
25184            }
25185        }
25186    }
25187
25188    impl serde::ser::Serialize for SqlOperationType {
25189        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25190        where
25191            S: serde::Serializer,
25192        {
25193            match self {
25194                Self::Unspecified => serializer.serialize_i32(0),
25195                Self::Import => serializer.serialize_i32(1),
25196                Self::Export => serializer.serialize_i32(2),
25197                Self::Create => serializer.serialize_i32(3),
25198                Self::Update => serializer.serialize_i32(4),
25199                Self::Delete => serializer.serialize_i32(5),
25200                Self::Restart => serializer.serialize_i32(6),
25201                Self::Backup => serializer.serialize_i32(7),
25202                Self::Snapshot => serializer.serialize_i32(8),
25203                Self::BackupVolume => serializer.serialize_i32(9),
25204                Self::DeleteVolume => serializer.serialize_i32(10),
25205                Self::RestoreVolume => serializer.serialize_i32(11),
25206                Self::InjectUser => serializer.serialize_i32(12),
25207                Self::Clone => serializer.serialize_i32(14),
25208                Self::StopReplica => serializer.serialize_i32(15),
25209                Self::StartReplica => serializer.serialize_i32(16),
25210                Self::PromoteReplica => serializer.serialize_i32(17),
25211                Self::CreateReplica => serializer.serialize_i32(18),
25212                Self::CreateUser => serializer.serialize_i32(19),
25213                Self::DeleteUser => serializer.serialize_i32(20),
25214                Self::UpdateUser => serializer.serialize_i32(21),
25215                Self::CreateDatabase => serializer.serialize_i32(22),
25216                Self::DeleteDatabase => serializer.serialize_i32(23),
25217                Self::UpdateDatabase => serializer.serialize_i32(24),
25218                Self::Failover => serializer.serialize_i32(25),
25219                Self::DeleteBackup => serializer.serialize_i32(26),
25220                Self::RecreateReplica => serializer.serialize_i32(27),
25221                Self::TruncateLog => serializer.serialize_i32(28),
25222                Self::DemoteMaster => serializer.serialize_i32(29),
25223                Self::Maintenance => serializer.serialize_i32(30),
25224                Self::EnablePrivateIp => serializer.serialize_i32(31),
25225                Self::DeferMaintenance => serializer.serialize_i32(32),
25226                Self::CreateClone => serializer.serialize_i32(33),
25227                Self::RescheduleMaintenance => serializer.serialize_i32(34),
25228                Self::StartExternalSync => serializer.serialize_i32(35),
25229                Self::LogCleanup => serializer.serialize_i32(36),
25230                Self::AutoRestart => serializer.serialize_i32(37),
25231                Self::Reencrypt => serializer.serialize_i32(38),
25232                Self::Switchover => serializer.serialize_i32(39),
25233                Self::UpdateBackup => serializer.serialize_i32(40),
25234                Self::AcquireSsrsLease => serializer.serialize_i32(42),
25235                Self::ReleaseSsrsLease => serializer.serialize_i32(43),
25236                Self::ReconfigureOldPrimary => serializer.serialize_i32(44),
25237                Self::ClusterMaintenance => serializer.serialize_i32(45),
25238                Self::SelfServiceMaintenance => serializer.serialize_i32(46),
25239                Self::SwitchoverToReplica => serializer.serialize_i32(47),
25240                Self::MajorVersionUpgrade => serializer.serialize_i32(48),
25241                Self::AdvancedBackup => serializer.serialize_i32(49),
25242                Self::ManageBackup => serializer.serialize_i32(50),
25243                Self::EnhancedBackup => serializer.serialize_i32(51),
25244                Self::RepairReadPool => serializer.serialize_i32(52),
25245                Self::CreateReadPool => serializer.serialize_i32(53),
25246                Self::UnknownValue(u) => u.0.serialize(serializer),
25247            }
25248        }
25249    }
25250
25251    impl<'de> serde::de::Deserialize<'de> for SqlOperationType {
25252        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25253        where
25254            D: serde::Deserializer<'de>,
25255        {
25256            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationType>::new(
25257                ".google.cloud.sql.v1.Operation.SqlOperationType",
25258            ))
25259        }
25260    }
25261
25262    /// The status of an operation.
25263    ///
25264    /// # Working with unknown values
25265    ///
25266    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25267    /// additional enum variants at any time. Adding new variants is not considered
25268    /// a breaking change. Applications should write their code in anticipation of:
25269    ///
25270    /// - New values appearing in future releases of the client library, **and**
25271    /// - New values received dynamically, without application changes.
25272    ///
25273    /// Please consult the [Working with enums] section in the user guide for some
25274    /// guidelines.
25275    ///
25276    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
25277    #[derive(Clone, Debug, PartialEq)]
25278    #[non_exhaustive]
25279    pub enum SqlOperationStatus {
25280        /// The state of the operation is unknown.
25281        Unspecified,
25282        /// The operation has been queued, but has not started yet.
25283        Pending,
25284        /// The operation is running.
25285        Running,
25286        /// The operation completed.
25287        Done,
25288        /// If set, the enum was initialized with an unknown value.
25289        ///
25290        /// Applications can examine the value using [SqlOperationStatus::value] or
25291        /// [SqlOperationStatus::name].
25292        UnknownValue(sql_operation_status::UnknownValue),
25293    }
25294
25295    #[doc(hidden)]
25296    pub mod sql_operation_status {
25297        #[allow(unused_imports)]
25298        use super::*;
25299        #[derive(Clone, Debug, PartialEq)]
25300        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25301    }
25302
25303    impl SqlOperationStatus {
25304        /// Gets the enum value.
25305        ///
25306        /// Returns `None` if the enum contains an unknown value deserialized from
25307        /// the string representation of enums.
25308        pub fn value(&self) -> std::option::Option<i32> {
25309            match self {
25310                Self::Unspecified => std::option::Option::Some(0),
25311                Self::Pending => std::option::Option::Some(1),
25312                Self::Running => std::option::Option::Some(2),
25313                Self::Done => std::option::Option::Some(3),
25314                Self::UnknownValue(u) => u.0.value(),
25315            }
25316        }
25317
25318        /// Gets the enum value as a string.
25319        ///
25320        /// Returns `None` if the enum contains an unknown value deserialized from
25321        /// the integer representation of enums.
25322        pub fn name(&self) -> std::option::Option<&str> {
25323            match self {
25324                Self::Unspecified => std::option::Option::Some("SQL_OPERATION_STATUS_UNSPECIFIED"),
25325                Self::Pending => std::option::Option::Some("PENDING"),
25326                Self::Running => std::option::Option::Some("RUNNING"),
25327                Self::Done => std::option::Option::Some("DONE"),
25328                Self::UnknownValue(u) => u.0.name(),
25329            }
25330        }
25331    }
25332
25333    impl std::default::Default for SqlOperationStatus {
25334        fn default() -> Self {
25335            use std::convert::From;
25336            Self::from(0)
25337        }
25338    }
25339
25340    impl std::fmt::Display for SqlOperationStatus {
25341        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25342            wkt::internal::display_enum(f, self.name(), self.value())
25343        }
25344    }
25345
25346    impl std::convert::From<i32> for SqlOperationStatus {
25347        fn from(value: i32) -> Self {
25348            match value {
25349                0 => Self::Unspecified,
25350                1 => Self::Pending,
25351                2 => Self::Running,
25352                3 => Self::Done,
25353                _ => Self::UnknownValue(sql_operation_status::UnknownValue(
25354                    wkt::internal::UnknownEnumValue::Integer(value),
25355                )),
25356            }
25357        }
25358    }
25359
25360    impl std::convert::From<&str> for SqlOperationStatus {
25361        fn from(value: &str) -> Self {
25362            use std::string::ToString;
25363            match value {
25364                "SQL_OPERATION_STATUS_UNSPECIFIED" => Self::Unspecified,
25365                "PENDING" => Self::Pending,
25366                "RUNNING" => Self::Running,
25367                "DONE" => Self::Done,
25368                _ => Self::UnknownValue(sql_operation_status::UnknownValue(
25369                    wkt::internal::UnknownEnumValue::String(value.to_string()),
25370                )),
25371            }
25372        }
25373    }
25374
25375    impl serde::ser::Serialize for SqlOperationStatus {
25376        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25377        where
25378            S: serde::Serializer,
25379        {
25380            match self {
25381                Self::Unspecified => serializer.serialize_i32(0),
25382                Self::Pending => serializer.serialize_i32(1),
25383                Self::Running => serializer.serialize_i32(2),
25384                Self::Done => serializer.serialize_i32(3),
25385                Self::UnknownValue(u) => u.0.serialize(serializer),
25386            }
25387        }
25388    }
25389
25390    impl<'de> serde::de::Deserialize<'de> for SqlOperationStatus {
25391        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25392        where
25393            D: serde::Deserializer<'de>,
25394        {
25395            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationStatus>::new(
25396                ".google.cloud.sql.v1.Operation.SqlOperationStatus",
25397            ))
25398        }
25399    }
25400}
25401
25402/// Database instance operation error.
25403#[derive(Clone, Default, PartialEq)]
25404#[non_exhaustive]
25405pub struct OperationError {
25406    /// This is always `sql#operationError`.
25407    pub kind: std::string::String,
25408
25409    /// Identifies the specific error that occurred.
25410    pub code: std::string::String,
25411
25412    /// Additional information about the error encountered.
25413    pub message: std::string::String,
25414
25415    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25416}
25417
25418impl OperationError {
25419    /// Creates a new default instance.
25420    pub fn new() -> Self {
25421        std::default::Default::default()
25422    }
25423
25424    /// Sets the value of [kind][crate::model::OperationError::kind].
25425    ///
25426    /// # Example
25427    /// ```ignore,no_run
25428    /// # use google_cloud_sql_v1::model::OperationError;
25429    /// let x = OperationError::new().set_kind("example");
25430    /// ```
25431    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25432        self.kind = v.into();
25433        self
25434    }
25435
25436    /// Sets the value of [code][crate::model::OperationError::code].
25437    ///
25438    /// # Example
25439    /// ```ignore,no_run
25440    /// # use google_cloud_sql_v1::model::OperationError;
25441    /// let x = OperationError::new().set_code("example");
25442    /// ```
25443    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25444        self.code = v.into();
25445        self
25446    }
25447
25448    /// Sets the value of [message][crate::model::OperationError::message].
25449    ///
25450    /// # Example
25451    /// ```ignore,no_run
25452    /// # use google_cloud_sql_v1::model::OperationError;
25453    /// let x = OperationError::new().set_message("example");
25454    /// ```
25455    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25456        self.message = v.into();
25457        self
25458    }
25459}
25460
25461impl wkt::message::Message for OperationError {
25462    fn typename() -> &'static str {
25463        "type.googleapis.com/google.cloud.sql.v1.OperationError"
25464    }
25465}
25466
25467/// Database instance operation errors list wrapper.
25468#[derive(Clone, Default, PartialEq)]
25469#[non_exhaustive]
25470pub struct OperationErrors {
25471    /// This is always `sql#operationErrors`.
25472    pub kind: std::string::String,
25473
25474    /// The list of errors encountered while processing this operation.
25475    pub errors: std::vec::Vec<crate::model::OperationError>,
25476
25477    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25478}
25479
25480impl OperationErrors {
25481    /// Creates a new default instance.
25482    pub fn new() -> Self {
25483        std::default::Default::default()
25484    }
25485
25486    /// Sets the value of [kind][crate::model::OperationErrors::kind].
25487    ///
25488    /// # Example
25489    /// ```ignore,no_run
25490    /// # use google_cloud_sql_v1::model::OperationErrors;
25491    /// let x = OperationErrors::new().set_kind("example");
25492    /// ```
25493    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25494        self.kind = v.into();
25495        self
25496    }
25497
25498    /// Sets the value of [errors][crate::model::OperationErrors::errors].
25499    ///
25500    /// # Example
25501    /// ```ignore,no_run
25502    /// # use google_cloud_sql_v1::model::OperationErrors;
25503    /// use google_cloud_sql_v1::model::OperationError;
25504    /// let x = OperationErrors::new()
25505    ///     .set_errors([
25506    ///         OperationError::default()/* use setters */,
25507    ///         OperationError::default()/* use (different) setters */,
25508    ///     ]);
25509    /// ```
25510    pub fn set_errors<T, V>(mut self, v: T) -> Self
25511    where
25512        T: std::iter::IntoIterator<Item = V>,
25513        V: std::convert::Into<crate::model::OperationError>,
25514    {
25515        use std::iter::Iterator;
25516        self.errors = v.into_iter().map(|i| i.into()).collect();
25517        self
25518    }
25519}
25520
25521impl wkt::message::Message for OperationErrors {
25522    fn typename() -> &'static str {
25523        "type.googleapis.com/google.cloud.sql.v1.OperationErrors"
25524    }
25525}
25526
25527/// Database instance local user password validation policy.
25528/// This message defines the password policy for local database users.
25529/// When enabled, it enforces constraints on password complexity, length,
25530/// and reuse. Keep this policy enabled to help prevent unauthorized access.
25531#[derive(Clone, Default, PartialEq)]
25532#[non_exhaustive]
25533pub struct PasswordValidationPolicy {
25534    /// Minimum number of characters allowed.
25535    pub min_length: std::option::Option<wkt::Int32Value>,
25536
25537    /// The complexity of the password.
25538    pub complexity: crate::model::password_validation_policy::Complexity,
25539
25540    /// Number of previous passwords that cannot be reused.
25541    pub reuse_interval: std::option::Option<wkt::Int32Value>,
25542
25543    /// Disallow username as a part of the password.
25544    pub disallow_username_substring: std::option::Option<wkt::BoolValue>,
25545
25546    /// Minimum interval after which the password can be changed. This flag is only
25547    /// supported for PostgreSQL.
25548    pub password_change_interval: std::option::Option<wkt::Duration>,
25549
25550    /// Whether to enable the password policy or not. When enabled, passwords must
25551    /// meet complexity requirements. Keep this policy enabled to help prevent
25552    /// unauthorized access. Disabling this policy allows weak passwords.
25553    pub enable_password_policy: std::option::Option<wkt::BoolValue>,
25554
25555    /// This field is deprecated and will be removed in a future version of the
25556    /// API.
25557    #[deprecated]
25558    pub disallow_compromised_credentials: std::option::Option<wkt::BoolValue>,
25559
25560    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25561}
25562
25563impl PasswordValidationPolicy {
25564    /// Creates a new default instance.
25565    pub fn new() -> Self {
25566        std::default::Default::default()
25567    }
25568
25569    /// Sets the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
25570    ///
25571    /// # Example
25572    /// ```ignore,no_run
25573    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25574    /// use wkt::Int32Value;
25575    /// let x = PasswordValidationPolicy::new().set_min_length(Int32Value::default()/* use setters */);
25576    /// ```
25577    pub fn set_min_length<T>(mut self, v: T) -> Self
25578    where
25579        T: std::convert::Into<wkt::Int32Value>,
25580    {
25581        self.min_length = std::option::Option::Some(v.into());
25582        self
25583    }
25584
25585    /// Sets or clears the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
25586    ///
25587    /// # Example
25588    /// ```ignore,no_run
25589    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25590    /// use wkt::Int32Value;
25591    /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(Some(Int32Value::default()/* use setters */));
25592    /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(None::<Int32Value>);
25593    /// ```
25594    pub fn set_or_clear_min_length<T>(mut self, v: std::option::Option<T>) -> Self
25595    where
25596        T: std::convert::Into<wkt::Int32Value>,
25597    {
25598        self.min_length = v.map(|x| x.into());
25599        self
25600    }
25601
25602    /// Sets the value of [complexity][crate::model::PasswordValidationPolicy::complexity].
25603    ///
25604    /// # Example
25605    /// ```ignore,no_run
25606    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25607    /// use google_cloud_sql_v1::model::password_validation_policy::Complexity;
25608    /// let x0 = PasswordValidationPolicy::new().set_complexity(Complexity::Default);
25609    /// ```
25610    pub fn set_complexity<
25611        T: std::convert::Into<crate::model::password_validation_policy::Complexity>,
25612    >(
25613        mut self,
25614        v: T,
25615    ) -> Self {
25616        self.complexity = v.into();
25617        self
25618    }
25619
25620    /// Sets the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
25621    ///
25622    /// # Example
25623    /// ```ignore,no_run
25624    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25625    /// use wkt::Int32Value;
25626    /// let x = PasswordValidationPolicy::new().set_reuse_interval(Int32Value::default()/* use setters */);
25627    /// ```
25628    pub fn set_reuse_interval<T>(mut self, v: T) -> Self
25629    where
25630        T: std::convert::Into<wkt::Int32Value>,
25631    {
25632        self.reuse_interval = std::option::Option::Some(v.into());
25633        self
25634    }
25635
25636    /// Sets or clears the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
25637    ///
25638    /// # Example
25639    /// ```ignore,no_run
25640    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25641    /// use wkt::Int32Value;
25642    /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(Some(Int32Value::default()/* use setters */));
25643    /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(None::<Int32Value>);
25644    /// ```
25645    pub fn set_or_clear_reuse_interval<T>(mut self, v: std::option::Option<T>) -> Self
25646    where
25647        T: std::convert::Into<wkt::Int32Value>,
25648    {
25649        self.reuse_interval = v.map(|x| x.into());
25650        self
25651    }
25652
25653    /// Sets the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
25654    ///
25655    /// # Example
25656    /// ```ignore,no_run
25657    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25658    /// use wkt::BoolValue;
25659    /// let x = PasswordValidationPolicy::new().set_disallow_username_substring(BoolValue::default()/* use setters */);
25660    /// ```
25661    pub fn set_disallow_username_substring<T>(mut self, v: T) -> Self
25662    where
25663        T: std::convert::Into<wkt::BoolValue>,
25664    {
25665        self.disallow_username_substring = std::option::Option::Some(v.into());
25666        self
25667    }
25668
25669    /// Sets or clears the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
25670    ///
25671    /// # Example
25672    /// ```ignore,no_run
25673    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25674    /// use wkt::BoolValue;
25675    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(Some(BoolValue::default()/* use setters */));
25676    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(None::<BoolValue>);
25677    /// ```
25678    pub fn set_or_clear_disallow_username_substring<T>(mut self, v: std::option::Option<T>) -> Self
25679    where
25680        T: std::convert::Into<wkt::BoolValue>,
25681    {
25682        self.disallow_username_substring = v.map(|x| x.into());
25683        self
25684    }
25685
25686    /// Sets the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
25687    ///
25688    /// # Example
25689    /// ```ignore,no_run
25690    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25691    /// use wkt::Duration;
25692    /// let x = PasswordValidationPolicy::new().set_password_change_interval(Duration::default()/* use setters */);
25693    /// ```
25694    pub fn set_password_change_interval<T>(mut self, v: T) -> Self
25695    where
25696        T: std::convert::Into<wkt::Duration>,
25697    {
25698        self.password_change_interval = std::option::Option::Some(v.into());
25699        self
25700    }
25701
25702    /// Sets or clears the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
25703    ///
25704    /// # Example
25705    /// ```ignore,no_run
25706    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25707    /// use wkt::Duration;
25708    /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(Some(Duration::default()/* use setters */));
25709    /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(None::<Duration>);
25710    /// ```
25711    pub fn set_or_clear_password_change_interval<T>(mut self, v: std::option::Option<T>) -> Self
25712    where
25713        T: std::convert::Into<wkt::Duration>,
25714    {
25715        self.password_change_interval = v.map(|x| x.into());
25716        self
25717    }
25718
25719    /// Sets the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
25720    ///
25721    /// # Example
25722    /// ```ignore,no_run
25723    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25724    /// use wkt::BoolValue;
25725    /// let x = PasswordValidationPolicy::new().set_enable_password_policy(BoolValue::default()/* use setters */);
25726    /// ```
25727    pub fn set_enable_password_policy<T>(mut self, v: T) -> Self
25728    where
25729        T: std::convert::Into<wkt::BoolValue>,
25730    {
25731        self.enable_password_policy = std::option::Option::Some(v.into());
25732        self
25733    }
25734
25735    /// Sets or clears the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
25736    ///
25737    /// # Example
25738    /// ```ignore,no_run
25739    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25740    /// use wkt::BoolValue;
25741    /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(Some(BoolValue::default()/* use setters */));
25742    /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(None::<BoolValue>);
25743    /// ```
25744    pub fn set_or_clear_enable_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
25745    where
25746        T: std::convert::Into<wkt::BoolValue>,
25747    {
25748        self.enable_password_policy = v.map(|x| x.into());
25749        self
25750    }
25751
25752    /// Sets the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
25753    ///
25754    /// # Example
25755    /// ```ignore,no_run
25756    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25757    /// use wkt::BoolValue;
25758    /// let x = PasswordValidationPolicy::new().set_disallow_compromised_credentials(BoolValue::default()/* use setters */);
25759    /// ```
25760    #[deprecated]
25761    pub fn set_disallow_compromised_credentials<T>(mut self, v: T) -> Self
25762    where
25763        T: std::convert::Into<wkt::BoolValue>,
25764    {
25765        self.disallow_compromised_credentials = std::option::Option::Some(v.into());
25766        self
25767    }
25768
25769    /// Sets or clears the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
25770    ///
25771    /// # Example
25772    /// ```ignore,no_run
25773    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25774    /// use wkt::BoolValue;
25775    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(Some(BoolValue::default()/* use setters */));
25776    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(None::<BoolValue>);
25777    /// ```
25778    #[deprecated]
25779    pub fn set_or_clear_disallow_compromised_credentials<T>(
25780        mut self,
25781        v: std::option::Option<T>,
25782    ) -> Self
25783    where
25784        T: std::convert::Into<wkt::BoolValue>,
25785    {
25786        self.disallow_compromised_credentials = v.map(|x| x.into());
25787        self
25788    }
25789}
25790
25791impl wkt::message::Message for PasswordValidationPolicy {
25792    fn typename() -> &'static str {
25793        "type.googleapis.com/google.cloud.sql.v1.PasswordValidationPolicy"
25794    }
25795}
25796
25797/// Defines additional types related to [PasswordValidationPolicy].
25798pub mod password_validation_policy {
25799    #[allow(unused_imports)]
25800    use super::*;
25801
25802    /// The complexity choices of the password.
25803    ///
25804    /// # Working with unknown values
25805    ///
25806    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25807    /// additional enum variants at any time. Adding new variants is not considered
25808    /// a breaking change. Applications should write their code in anticipation of:
25809    ///
25810    /// - New values appearing in future releases of the client library, **and**
25811    /// - New values received dynamically, without application changes.
25812    ///
25813    /// Please consult the [Working with enums] section in the user guide for some
25814    /// guidelines.
25815    ///
25816    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
25817    #[derive(Clone, Debug, PartialEq)]
25818    #[non_exhaustive]
25819    pub enum Complexity {
25820        /// Complexity check is not specified.
25821        Unspecified,
25822        /// A combination of lowercase, uppercase, numeric, and non-alphanumeric
25823        /// characters.
25824        Default,
25825        /// If set, the enum was initialized with an unknown value.
25826        ///
25827        /// Applications can examine the value using [Complexity::value] or
25828        /// [Complexity::name].
25829        UnknownValue(complexity::UnknownValue),
25830    }
25831
25832    #[doc(hidden)]
25833    pub mod complexity {
25834        #[allow(unused_imports)]
25835        use super::*;
25836        #[derive(Clone, Debug, PartialEq)]
25837        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25838    }
25839
25840    impl Complexity {
25841        /// Gets the enum value.
25842        ///
25843        /// Returns `None` if the enum contains an unknown value deserialized from
25844        /// the string representation of enums.
25845        pub fn value(&self) -> std::option::Option<i32> {
25846            match self {
25847                Self::Unspecified => std::option::Option::Some(0),
25848                Self::Default => std::option::Option::Some(1),
25849                Self::UnknownValue(u) => u.0.value(),
25850            }
25851        }
25852
25853        /// Gets the enum value as a string.
25854        ///
25855        /// Returns `None` if the enum contains an unknown value deserialized from
25856        /// the integer representation of enums.
25857        pub fn name(&self) -> std::option::Option<&str> {
25858            match self {
25859                Self::Unspecified => std::option::Option::Some("COMPLEXITY_UNSPECIFIED"),
25860                Self::Default => std::option::Option::Some("COMPLEXITY_DEFAULT"),
25861                Self::UnknownValue(u) => u.0.name(),
25862            }
25863        }
25864    }
25865
25866    impl std::default::Default for Complexity {
25867        fn default() -> Self {
25868            use std::convert::From;
25869            Self::from(0)
25870        }
25871    }
25872
25873    impl std::fmt::Display for Complexity {
25874        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25875            wkt::internal::display_enum(f, self.name(), self.value())
25876        }
25877    }
25878
25879    impl std::convert::From<i32> for Complexity {
25880        fn from(value: i32) -> Self {
25881            match value {
25882                0 => Self::Unspecified,
25883                1 => Self::Default,
25884                _ => Self::UnknownValue(complexity::UnknownValue(
25885                    wkt::internal::UnknownEnumValue::Integer(value),
25886                )),
25887            }
25888        }
25889    }
25890
25891    impl std::convert::From<&str> for Complexity {
25892        fn from(value: &str) -> Self {
25893            use std::string::ToString;
25894            match value {
25895                "COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
25896                "COMPLEXITY_DEFAULT" => Self::Default,
25897                _ => Self::UnknownValue(complexity::UnknownValue(
25898                    wkt::internal::UnknownEnumValue::String(value.to_string()),
25899                )),
25900            }
25901        }
25902    }
25903
25904    impl serde::ser::Serialize for Complexity {
25905        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25906        where
25907            S: serde::Serializer,
25908        {
25909            match self {
25910                Self::Unspecified => serializer.serialize_i32(0),
25911                Self::Default => serializer.serialize_i32(1),
25912                Self::UnknownValue(u) => u.0.serialize(serializer),
25913            }
25914        }
25915    }
25916
25917    impl<'de> serde::de::Deserialize<'de> for Complexity {
25918        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25919        where
25920            D: serde::Deserializer<'de>,
25921        {
25922            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Complexity>::new(
25923                ".google.cloud.sql.v1.PasswordValidationPolicy.Complexity",
25924            ))
25925        }
25926    }
25927}
25928
25929/// Data cache configurations.
25930#[derive(Clone, Default, PartialEq)]
25931#[non_exhaustive]
25932pub struct DataCacheConfig {
25933    /// Whether data cache is enabled for the instance.
25934    pub data_cache_enabled: bool,
25935
25936    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25937}
25938
25939impl DataCacheConfig {
25940    /// Creates a new default instance.
25941    pub fn new() -> Self {
25942        std::default::Default::default()
25943    }
25944
25945    /// Sets the value of [data_cache_enabled][crate::model::DataCacheConfig::data_cache_enabled].
25946    ///
25947    /// # Example
25948    /// ```ignore,no_run
25949    /// # use google_cloud_sql_v1::model::DataCacheConfig;
25950    /// let x = DataCacheConfig::new().set_data_cache_enabled(true);
25951    /// ```
25952    pub fn set_data_cache_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
25953        self.data_cache_enabled = v.into();
25954        self
25955    }
25956}
25957
25958impl wkt::message::Message for DataCacheConfig {
25959    fn typename() -> &'static str {
25960        "type.googleapis.com/google.cloud.sql.v1.DataCacheConfig"
25961    }
25962}
25963
25964/// Config used to determine the final backup settings for the instance.
25965#[derive(Clone, Default, PartialEq)]
25966#[non_exhaustive]
25967pub struct FinalBackupConfig {
25968    /// Whether the final backup is enabled for the instance.
25969    pub enabled: std::option::Option<bool>,
25970
25971    /// The number of days to retain the final backup after the instance deletion.
25972    /// The final backup will be purged at (time_of_instance_deletion +
25973    /// retention_days).
25974    pub retention_days: std::option::Option<i32>,
25975
25976    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25977}
25978
25979impl FinalBackupConfig {
25980    /// Creates a new default instance.
25981    pub fn new() -> Self {
25982        std::default::Default::default()
25983    }
25984
25985    /// Sets the value of [enabled][crate::model::FinalBackupConfig::enabled].
25986    ///
25987    /// # Example
25988    /// ```ignore,no_run
25989    /// # use google_cloud_sql_v1::model::FinalBackupConfig;
25990    /// let x = FinalBackupConfig::new().set_enabled(true);
25991    /// ```
25992    pub fn set_enabled<T>(mut self, v: T) -> Self
25993    where
25994        T: std::convert::Into<bool>,
25995    {
25996        self.enabled = std::option::Option::Some(v.into());
25997        self
25998    }
25999
26000    /// Sets or clears the value of [enabled][crate::model::FinalBackupConfig::enabled].
26001    ///
26002    /// # Example
26003    /// ```ignore,no_run
26004    /// # use google_cloud_sql_v1::model::FinalBackupConfig;
26005    /// let x = FinalBackupConfig::new().set_or_clear_enabled(Some(false));
26006    /// let x = FinalBackupConfig::new().set_or_clear_enabled(None::<bool>);
26007    /// ```
26008    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
26009    where
26010        T: std::convert::Into<bool>,
26011    {
26012        self.enabled = v.map(|x| x.into());
26013        self
26014    }
26015
26016    /// Sets the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
26017    ///
26018    /// # Example
26019    /// ```ignore,no_run
26020    /// # use google_cloud_sql_v1::model::FinalBackupConfig;
26021    /// let x = FinalBackupConfig::new().set_retention_days(42);
26022    /// ```
26023    pub fn set_retention_days<T>(mut self, v: T) -> Self
26024    where
26025        T: std::convert::Into<i32>,
26026    {
26027        self.retention_days = std::option::Option::Some(v.into());
26028        self
26029    }
26030
26031    /// Sets or clears the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
26032    ///
26033    /// # Example
26034    /// ```ignore,no_run
26035    /// # use google_cloud_sql_v1::model::FinalBackupConfig;
26036    /// let x = FinalBackupConfig::new().set_or_clear_retention_days(Some(42));
26037    /// let x = FinalBackupConfig::new().set_or_clear_retention_days(None::<i32>);
26038    /// ```
26039    pub fn set_or_clear_retention_days<T>(mut self, v: std::option::Option<T>) -> Self
26040    where
26041        T: std::convert::Into<i32>,
26042    {
26043        self.retention_days = v.map(|x| x.into());
26044        self
26045    }
26046}
26047
26048impl wkt::message::Message for FinalBackupConfig {
26049    fn typename() -> &'static str {
26050        "type.googleapis.com/google.cloud.sql.v1.FinalBackupConfig"
26051    }
26052}
26053
26054/// Database instance settings.
26055#[derive(Clone, Default, PartialEq)]
26056#[non_exhaustive]
26057pub struct Settings {
26058    /// The version of instance settings. This is a required field for update
26059    /// method to make sure concurrent updates are handled properly. During update,
26060    /// use the most recent settingsVersion value for this instance and do not try
26061    /// to update this value.
26062    pub settings_version: std::option::Option<wkt::Int64Value>,
26063
26064    /// The App Engine app IDs that can access this instance.
26065    /// (Deprecated) Applied to First Generation instances only.
26066    #[deprecated]
26067    pub authorized_gae_applications: std::vec::Vec<std::string::String>,
26068
26069    /// The tier (or machine type) for this instance, for example
26070    /// `db-custom-1-3840`. WARNING: Changing this restarts the instance.
26071    pub tier: std::string::String,
26072
26073    /// This is always `sql#settings`.
26074    pub kind: std::string::String,
26075
26076    /// User-provided labels, represented as a dictionary where each label is a
26077    /// single key value pair.
26078    pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
26079
26080    /// Availability type. Potential values:
26081    ///
26082    /// * `ZONAL`: The instance serves data from only one zone. Outages in that
26083    ///   zone affect data accessibility.
26084    /// * `REGIONAL`: The instance can serve data from more than one zone in a
26085    ///   region (it is highly available)./
26086    ///
26087    /// For more information, see [Overview of the High Availability
26088    /// Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
26089    pub availability_type: crate::model::SqlAvailabilityType,
26090
26091    /// The pricing plan for this instance. This can be either `PER_USE` or
26092    /// `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
26093    pub pricing_plan: crate::model::SqlPricingPlan,
26094
26095    /// The type of replication this instance uses. This can be either
26096    /// `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
26097    /// applicable to First Generation instances.
26098    #[deprecated]
26099    pub replication_type: crate::model::SqlReplicationType,
26100
26101    /// The maximum size to which storage capacity can be automatically increased.
26102    /// The default value is 0, which specifies that there is no limit.
26103    pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
26104
26105    /// The activation policy specifies when the instance is activated; it is
26106    /// applicable only when the instance state is RUNNABLE. Valid values:
26107    ///
26108    /// * `ALWAYS`: The instance is on, and remains so even in the absence of
26109    ///   connection requests.
26110    /// * `NEVER`: The instance is off; it is not activated, even if a
26111    ///   connection request arrives.
26112    pub activation_policy: crate::model::settings::SqlActivationPolicy,
26113
26114    /// The settings for IP Management. This allows to enable or disable the
26115    /// instance IP and manage which external networks can connect to the instance.
26116    /// The IPv4 address cannot be disabled for Second Generation instances.
26117    pub ip_configuration: std::option::Option<crate::model::IpConfiguration>,
26118
26119    /// Configuration to increase storage size automatically. The default value is
26120    /// true.
26121    pub storage_auto_resize: std::option::Option<wkt::BoolValue>,
26122
26123    /// The location preference settings. This allows the instance to be located as
26124    /// near as possible to either an App Engine app or Compute Engine zone for
26125    /// better performance. App Engine co-location was only applicable to First
26126    /// Generation instances.
26127    pub location_preference: std::option::Option<crate::model::LocationPreference>,
26128
26129    /// The database flags passed to the instance at startup.
26130    pub database_flags: std::vec::Vec<crate::model::DatabaseFlags>,
26131
26132    /// The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
26133    /// First Generation instances.
26134    pub data_disk_type: crate::model::SqlDataDiskType,
26135
26136    /// The maintenance window for this instance. This specifies when the instance
26137    /// can be restarted for maintenance purposes.
26138    pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,
26139
26140    /// The daily backup configuration for the instance.
26141    pub backup_configuration: std::option::Option<crate::model::BackupConfiguration>,
26142
26143    /// Configuration specific to read replica instances. Indicates whether
26144    /// replication is enabled or not. WARNING: Changing this restarts the
26145    /// instance.
26146    pub database_replication_enabled: std::option::Option<wkt::BoolValue>,
26147
26148    /// Configuration specific to read replica instances. Indicates whether
26149    /// database flags for crash-safe replication are enabled. This property was
26150    /// only applicable to First Generation instances.
26151    #[deprecated]
26152    pub crash_safe_replication_enabled: std::option::Option<wkt::BoolValue>,
26153
26154    /// The size of data disk, in GB. The data disk size minimum is 10GB.
26155    pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
26156
26157    /// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
26158    pub active_directory_config: std::option::Option<crate::model::SqlActiveDirectoryConfig>,
26159
26160    /// The name of server Instance collation.
26161    pub collation: std::string::String,
26162
26163    /// Deny maintenance periods
26164    pub deny_maintenance_periods: std::vec::Vec<crate::model::DenyMaintenancePeriod>,
26165
26166    /// Insights configuration, for now relevant only for Postgres.
26167    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
26168
26169    /// The local user password validation policy of the instance.
26170    pub password_validation_policy: std::option::Option<crate::model::PasswordValidationPolicy>,
26171
26172    /// SQL Server specific audit configuration.
26173    pub sql_server_audit_config: std::option::Option<crate::model::SqlServerAuditConfig>,
26174
26175    /// Optional. The edition of the instance.
26176    pub edition: crate::model::settings::Edition,
26177
26178    /// Specifies if connections must use Cloud SQL connectors.
26179    /// Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
26180    /// can be connected without Cloud SQL
26181    /// Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
26182    /// Connectors).
26183    ///
26184    /// Note that using REQUIRED disables all existing authorized networks. If
26185    /// this field is not specified when creating a new instance, NOT_REQUIRED is
26186    /// used. If this field is not specified when patching or updating an existing
26187    /// instance, it is left unchanged in the instance.
26188    pub connector_enforcement: crate::model::settings::ConnectorEnforcement,
26189
26190    /// Configuration to protect against accidental instance deletion.
26191    pub deletion_protection_enabled: std::option::Option<wkt::BoolValue>,
26192
26193    /// Server timezone, relevant only for Cloud SQL for SQL Server.
26194    pub time_zone: std::string::String,
26195
26196    /// Specifies advanced machine configuration for the instances relevant only
26197    /// for SQL Server.
26198    pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
26199
26200    /// Configuration for data cache.
26201    pub data_cache_config: std::option::Option<crate::model::DataCacheConfig>,
26202
26203    /// Optional. Configuration value for recreation of replica after certain
26204    /// replication lag
26205    pub replication_lag_max_seconds: std::option::Option<wkt::Int32Value>,
26206
26207    /// Optional. When this parameter is set to true, Cloud SQL instances can
26208    /// connect to Vertex AI to pass requests for real-time predictions and
26209    /// insights to the AI. The default value is false. This applies only to Cloud
26210    /// SQL for MySQL and Cloud SQL for PostgreSQL instances.
26211    pub enable_google_ml_integration: std::option::Option<wkt::BoolValue>,
26212
26213    /// Optional. By default, Cloud SQL instances have schema extraction disabled
26214    /// for Dataplex. When this parameter is set to true, schema extraction for
26215    /// Dataplex on Cloud SQL instances is activated.
26216    pub enable_dataplex_integration: std::option::Option<wkt::BoolValue>,
26217
26218    /// Optional. When this parameter is set to true, Cloud SQL retains backups of
26219    /// the instance even after the instance is deleted. The ON_DEMAND backup will
26220    /// be retained until customer deletes the backup or the project. The AUTOMATED
26221    /// backup will be retained based on the backups retention setting.
26222    pub retain_backups_on_delete: std::option::Option<wkt::BoolValue>,
26223
26224    /// Optional. Provisioned number of I/O operations per second for the data
26225    /// disk. This field is only used for hyperdisk-balanced disk types.
26226    pub data_disk_provisioned_iops: std::option::Option<i64>,
26227
26228    /// Optional. Provisioned throughput measured in MiB per second for the data
26229    /// disk. This field is only used for hyperdisk-balanced disk types.
26230    pub data_disk_provisioned_throughput: std::option::Option<i64>,
26231
26232    /// Optional. The managed connection pooling configuration for the instance.
26233    pub connection_pool_config: std::option::Option<crate::model::ConnectionPoolConfig>,
26234
26235    /// Optional. The final backup configuration for the instance.
26236    pub final_backup_config: std::option::Option<crate::model::FinalBackupConfig>,
26237
26238    /// Optional. The read pool auto-scale configuration for the instance.
26239    pub read_pool_auto_scale_config: std::option::Option<crate::model::ReadPoolAutoScaleConfig>,
26240
26241    /// Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
26242    /// parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
26243    /// versions. The MySQL version must be 8.0.35 or higher.
26244    pub auto_upgrade_enabled: std::option::Option<bool>,
26245
26246    /// Optional. The Microsoft Entra ID configuration for the SQL Server instance.
26247    pub entraid_config: std::option::Option<crate::model::SqlServerEntraIdConfig>,
26248
26249    /// This parameter controls whether to allow using ExecuteSql API to connect to
26250    /// the instance. Not allowed by default.
26251    pub data_api_access: std::option::Option<crate::model::settings::DataApiAccess>,
26252
26253    /// Optional. Configuration for Performance Capture, provides diagnostic
26254    /// metrics during high load situations.
26255    pub performance_capture_config: std::option::Option<crate::model::PerformanceCaptureConfig>,
26256
26257    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26258}
26259
26260impl Settings {
26261    /// Creates a new default instance.
26262    pub fn new() -> Self {
26263        std::default::Default::default()
26264    }
26265
26266    /// Sets the value of [settings_version][crate::model::Settings::settings_version].
26267    ///
26268    /// # Example
26269    /// ```ignore,no_run
26270    /// # use google_cloud_sql_v1::model::Settings;
26271    /// use wkt::Int64Value;
26272    /// let x = Settings::new().set_settings_version(Int64Value::default()/* use setters */);
26273    /// ```
26274    pub fn set_settings_version<T>(mut self, v: T) -> Self
26275    where
26276        T: std::convert::Into<wkt::Int64Value>,
26277    {
26278        self.settings_version = std::option::Option::Some(v.into());
26279        self
26280    }
26281
26282    /// Sets or clears the value of [settings_version][crate::model::Settings::settings_version].
26283    ///
26284    /// # Example
26285    /// ```ignore,no_run
26286    /// # use google_cloud_sql_v1::model::Settings;
26287    /// use wkt::Int64Value;
26288    /// let x = Settings::new().set_or_clear_settings_version(Some(Int64Value::default()/* use setters */));
26289    /// let x = Settings::new().set_or_clear_settings_version(None::<Int64Value>);
26290    /// ```
26291    pub fn set_or_clear_settings_version<T>(mut self, v: std::option::Option<T>) -> Self
26292    where
26293        T: std::convert::Into<wkt::Int64Value>,
26294    {
26295        self.settings_version = v.map(|x| x.into());
26296        self
26297    }
26298
26299    /// Sets the value of [authorized_gae_applications][crate::model::Settings::authorized_gae_applications].
26300    ///
26301    /// # Example
26302    /// ```ignore,no_run
26303    /// # use google_cloud_sql_v1::model::Settings;
26304    /// let x = Settings::new().set_authorized_gae_applications(["a", "b", "c"]);
26305    /// ```
26306    #[deprecated]
26307    pub fn set_authorized_gae_applications<T, V>(mut self, v: T) -> Self
26308    where
26309        T: std::iter::IntoIterator<Item = V>,
26310        V: std::convert::Into<std::string::String>,
26311    {
26312        use std::iter::Iterator;
26313        self.authorized_gae_applications = v.into_iter().map(|i| i.into()).collect();
26314        self
26315    }
26316
26317    /// Sets the value of [tier][crate::model::Settings::tier].
26318    ///
26319    /// # Example
26320    /// ```ignore,no_run
26321    /// # use google_cloud_sql_v1::model::Settings;
26322    /// let x = Settings::new().set_tier("example");
26323    /// ```
26324    pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26325        self.tier = v.into();
26326        self
26327    }
26328
26329    /// Sets the value of [kind][crate::model::Settings::kind].
26330    ///
26331    /// # Example
26332    /// ```ignore,no_run
26333    /// # use google_cloud_sql_v1::model::Settings;
26334    /// let x = Settings::new().set_kind("example");
26335    /// ```
26336    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26337        self.kind = v.into();
26338        self
26339    }
26340
26341    /// Sets the value of [user_labels][crate::model::Settings::user_labels].
26342    ///
26343    /// # Example
26344    /// ```ignore,no_run
26345    /// # use google_cloud_sql_v1::model::Settings;
26346    /// let x = Settings::new().set_user_labels([
26347    ///     ("key0", "abc"),
26348    ///     ("key1", "xyz"),
26349    /// ]);
26350    /// ```
26351    pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
26352    where
26353        T: std::iter::IntoIterator<Item = (K, V)>,
26354        K: std::convert::Into<std::string::String>,
26355        V: std::convert::Into<std::string::String>,
26356    {
26357        use std::iter::Iterator;
26358        self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
26359        self
26360    }
26361
26362    /// Sets the value of [availability_type][crate::model::Settings::availability_type].
26363    ///
26364    /// # Example
26365    /// ```ignore,no_run
26366    /// # use google_cloud_sql_v1::model::Settings;
26367    /// use google_cloud_sql_v1::model::SqlAvailabilityType;
26368    /// let x0 = Settings::new().set_availability_type(SqlAvailabilityType::Zonal);
26369    /// let x1 = Settings::new().set_availability_type(SqlAvailabilityType::Regional);
26370    /// ```
26371    pub fn set_availability_type<T: std::convert::Into<crate::model::SqlAvailabilityType>>(
26372        mut self,
26373        v: T,
26374    ) -> Self {
26375        self.availability_type = v.into();
26376        self
26377    }
26378
26379    /// Sets the value of [pricing_plan][crate::model::Settings::pricing_plan].
26380    ///
26381    /// # Example
26382    /// ```ignore,no_run
26383    /// # use google_cloud_sql_v1::model::Settings;
26384    /// use google_cloud_sql_v1::model::SqlPricingPlan;
26385    /// let x0 = Settings::new().set_pricing_plan(SqlPricingPlan::Package);
26386    /// let x1 = Settings::new().set_pricing_plan(SqlPricingPlan::PerUse);
26387    /// ```
26388    pub fn set_pricing_plan<T: std::convert::Into<crate::model::SqlPricingPlan>>(
26389        mut self,
26390        v: T,
26391    ) -> Self {
26392        self.pricing_plan = v.into();
26393        self
26394    }
26395
26396    /// Sets the value of [replication_type][crate::model::Settings::replication_type].
26397    ///
26398    /// # Example
26399    /// ```ignore,no_run
26400    /// # use google_cloud_sql_v1::model::Settings;
26401    /// use google_cloud_sql_v1::model::SqlReplicationType;
26402    /// let x0 = Settings::new().set_replication_type(SqlReplicationType::Synchronous);
26403    /// let x1 = Settings::new().set_replication_type(SqlReplicationType::Asynchronous);
26404    /// ```
26405    #[deprecated]
26406    pub fn set_replication_type<T: std::convert::Into<crate::model::SqlReplicationType>>(
26407        mut self,
26408        v: T,
26409    ) -> Self {
26410        self.replication_type = v.into();
26411        self
26412    }
26413
26414    /// Sets the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
26415    ///
26416    /// # Example
26417    /// ```ignore,no_run
26418    /// # use google_cloud_sql_v1::model::Settings;
26419    /// use wkt::Int64Value;
26420    /// let x = Settings::new().set_storage_auto_resize_limit(Int64Value::default()/* use setters */);
26421    /// ```
26422    pub fn set_storage_auto_resize_limit<T>(mut self, v: T) -> Self
26423    where
26424        T: std::convert::Into<wkt::Int64Value>,
26425    {
26426        self.storage_auto_resize_limit = std::option::Option::Some(v.into());
26427        self
26428    }
26429
26430    /// Sets or clears the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
26431    ///
26432    /// # Example
26433    /// ```ignore,no_run
26434    /// # use google_cloud_sql_v1::model::Settings;
26435    /// use wkt::Int64Value;
26436    /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(Some(Int64Value::default()/* use setters */));
26437    /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(None::<Int64Value>);
26438    /// ```
26439    pub fn set_or_clear_storage_auto_resize_limit<T>(mut self, v: std::option::Option<T>) -> Self
26440    where
26441        T: std::convert::Into<wkt::Int64Value>,
26442    {
26443        self.storage_auto_resize_limit = v.map(|x| x.into());
26444        self
26445    }
26446
26447    /// Sets the value of [activation_policy][crate::model::Settings::activation_policy].
26448    ///
26449    /// # Example
26450    /// ```ignore,no_run
26451    /// # use google_cloud_sql_v1::model::Settings;
26452    /// use google_cloud_sql_v1::model::settings::SqlActivationPolicy;
26453    /// let x0 = Settings::new().set_activation_policy(SqlActivationPolicy::Always);
26454    /// let x1 = Settings::new().set_activation_policy(SqlActivationPolicy::Never);
26455    /// ```
26456    pub fn set_activation_policy<
26457        T: std::convert::Into<crate::model::settings::SqlActivationPolicy>,
26458    >(
26459        mut self,
26460        v: T,
26461    ) -> Self {
26462        self.activation_policy = v.into();
26463        self
26464    }
26465
26466    /// Sets the value of [ip_configuration][crate::model::Settings::ip_configuration].
26467    ///
26468    /// # Example
26469    /// ```ignore,no_run
26470    /// # use google_cloud_sql_v1::model::Settings;
26471    /// use google_cloud_sql_v1::model::IpConfiguration;
26472    /// let x = Settings::new().set_ip_configuration(IpConfiguration::default()/* use setters */);
26473    /// ```
26474    pub fn set_ip_configuration<T>(mut self, v: T) -> Self
26475    where
26476        T: std::convert::Into<crate::model::IpConfiguration>,
26477    {
26478        self.ip_configuration = std::option::Option::Some(v.into());
26479        self
26480    }
26481
26482    /// Sets or clears the value of [ip_configuration][crate::model::Settings::ip_configuration].
26483    ///
26484    /// # Example
26485    /// ```ignore,no_run
26486    /// # use google_cloud_sql_v1::model::Settings;
26487    /// use google_cloud_sql_v1::model::IpConfiguration;
26488    /// let x = Settings::new().set_or_clear_ip_configuration(Some(IpConfiguration::default()/* use setters */));
26489    /// let x = Settings::new().set_or_clear_ip_configuration(None::<IpConfiguration>);
26490    /// ```
26491    pub fn set_or_clear_ip_configuration<T>(mut self, v: std::option::Option<T>) -> Self
26492    where
26493        T: std::convert::Into<crate::model::IpConfiguration>,
26494    {
26495        self.ip_configuration = v.map(|x| x.into());
26496        self
26497    }
26498
26499    /// Sets the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
26500    ///
26501    /// # Example
26502    /// ```ignore,no_run
26503    /// # use google_cloud_sql_v1::model::Settings;
26504    /// use wkt::BoolValue;
26505    /// let x = Settings::new().set_storage_auto_resize(BoolValue::default()/* use setters */);
26506    /// ```
26507    pub fn set_storage_auto_resize<T>(mut self, v: T) -> Self
26508    where
26509        T: std::convert::Into<wkt::BoolValue>,
26510    {
26511        self.storage_auto_resize = std::option::Option::Some(v.into());
26512        self
26513    }
26514
26515    /// Sets or clears the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
26516    ///
26517    /// # Example
26518    /// ```ignore,no_run
26519    /// # use google_cloud_sql_v1::model::Settings;
26520    /// use wkt::BoolValue;
26521    /// let x = Settings::new().set_or_clear_storage_auto_resize(Some(BoolValue::default()/* use setters */));
26522    /// let x = Settings::new().set_or_clear_storage_auto_resize(None::<BoolValue>);
26523    /// ```
26524    pub fn set_or_clear_storage_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
26525    where
26526        T: std::convert::Into<wkt::BoolValue>,
26527    {
26528        self.storage_auto_resize = v.map(|x| x.into());
26529        self
26530    }
26531
26532    /// Sets the value of [location_preference][crate::model::Settings::location_preference].
26533    ///
26534    /// # Example
26535    /// ```ignore,no_run
26536    /// # use google_cloud_sql_v1::model::Settings;
26537    /// use google_cloud_sql_v1::model::LocationPreference;
26538    /// let x = Settings::new().set_location_preference(LocationPreference::default()/* use setters */);
26539    /// ```
26540    pub fn set_location_preference<T>(mut self, v: T) -> Self
26541    where
26542        T: std::convert::Into<crate::model::LocationPreference>,
26543    {
26544        self.location_preference = std::option::Option::Some(v.into());
26545        self
26546    }
26547
26548    /// Sets or clears the value of [location_preference][crate::model::Settings::location_preference].
26549    ///
26550    /// # Example
26551    /// ```ignore,no_run
26552    /// # use google_cloud_sql_v1::model::Settings;
26553    /// use google_cloud_sql_v1::model::LocationPreference;
26554    /// let x = Settings::new().set_or_clear_location_preference(Some(LocationPreference::default()/* use setters */));
26555    /// let x = Settings::new().set_or_clear_location_preference(None::<LocationPreference>);
26556    /// ```
26557    pub fn set_or_clear_location_preference<T>(mut self, v: std::option::Option<T>) -> Self
26558    where
26559        T: std::convert::Into<crate::model::LocationPreference>,
26560    {
26561        self.location_preference = v.map(|x| x.into());
26562        self
26563    }
26564
26565    /// Sets the value of [database_flags][crate::model::Settings::database_flags].
26566    ///
26567    /// # Example
26568    /// ```ignore,no_run
26569    /// # use google_cloud_sql_v1::model::Settings;
26570    /// use google_cloud_sql_v1::model::DatabaseFlags;
26571    /// let x = Settings::new()
26572    ///     .set_database_flags([
26573    ///         DatabaseFlags::default()/* use setters */,
26574    ///         DatabaseFlags::default()/* use (different) setters */,
26575    ///     ]);
26576    /// ```
26577    pub fn set_database_flags<T, V>(mut self, v: T) -> Self
26578    where
26579        T: std::iter::IntoIterator<Item = V>,
26580        V: std::convert::Into<crate::model::DatabaseFlags>,
26581    {
26582        use std::iter::Iterator;
26583        self.database_flags = v.into_iter().map(|i| i.into()).collect();
26584        self
26585    }
26586
26587    /// Sets the value of [data_disk_type][crate::model::Settings::data_disk_type].
26588    ///
26589    /// # Example
26590    /// ```ignore,no_run
26591    /// # use google_cloud_sql_v1::model::Settings;
26592    /// use google_cloud_sql_v1::model::SqlDataDiskType;
26593    /// let x0 = Settings::new().set_data_disk_type(SqlDataDiskType::PdSsd);
26594    /// let x1 = Settings::new().set_data_disk_type(SqlDataDiskType::PdHdd);
26595    /// let x2 = Settings::new().set_data_disk_type(SqlDataDiskType::HyperdiskBalanced);
26596    /// ```
26597    pub fn set_data_disk_type<T: std::convert::Into<crate::model::SqlDataDiskType>>(
26598        mut self,
26599        v: T,
26600    ) -> Self {
26601        self.data_disk_type = v.into();
26602        self
26603    }
26604
26605    /// Sets the value of [maintenance_window][crate::model::Settings::maintenance_window].
26606    ///
26607    /// # Example
26608    /// ```ignore,no_run
26609    /// # use google_cloud_sql_v1::model::Settings;
26610    /// use google_cloud_sql_v1::model::MaintenanceWindow;
26611    /// let x = Settings::new().set_maintenance_window(MaintenanceWindow::default()/* use setters */);
26612    /// ```
26613    pub fn set_maintenance_window<T>(mut self, v: T) -> Self
26614    where
26615        T: std::convert::Into<crate::model::MaintenanceWindow>,
26616    {
26617        self.maintenance_window = std::option::Option::Some(v.into());
26618        self
26619    }
26620
26621    /// Sets or clears the value of [maintenance_window][crate::model::Settings::maintenance_window].
26622    ///
26623    /// # Example
26624    /// ```ignore,no_run
26625    /// # use google_cloud_sql_v1::model::Settings;
26626    /// use google_cloud_sql_v1::model::MaintenanceWindow;
26627    /// let x = Settings::new().set_or_clear_maintenance_window(Some(MaintenanceWindow::default()/* use setters */));
26628    /// let x = Settings::new().set_or_clear_maintenance_window(None::<MaintenanceWindow>);
26629    /// ```
26630    pub fn set_or_clear_maintenance_window<T>(mut self, v: std::option::Option<T>) -> Self
26631    where
26632        T: std::convert::Into<crate::model::MaintenanceWindow>,
26633    {
26634        self.maintenance_window = v.map(|x| x.into());
26635        self
26636    }
26637
26638    /// Sets the value of [backup_configuration][crate::model::Settings::backup_configuration].
26639    ///
26640    /// # Example
26641    /// ```ignore,no_run
26642    /// # use google_cloud_sql_v1::model::Settings;
26643    /// use google_cloud_sql_v1::model::BackupConfiguration;
26644    /// let x = Settings::new().set_backup_configuration(BackupConfiguration::default()/* use setters */);
26645    /// ```
26646    pub fn set_backup_configuration<T>(mut self, v: T) -> Self
26647    where
26648        T: std::convert::Into<crate::model::BackupConfiguration>,
26649    {
26650        self.backup_configuration = std::option::Option::Some(v.into());
26651        self
26652    }
26653
26654    /// Sets or clears the value of [backup_configuration][crate::model::Settings::backup_configuration].
26655    ///
26656    /// # Example
26657    /// ```ignore,no_run
26658    /// # use google_cloud_sql_v1::model::Settings;
26659    /// use google_cloud_sql_v1::model::BackupConfiguration;
26660    /// let x = Settings::new().set_or_clear_backup_configuration(Some(BackupConfiguration::default()/* use setters */));
26661    /// let x = Settings::new().set_or_clear_backup_configuration(None::<BackupConfiguration>);
26662    /// ```
26663    pub fn set_or_clear_backup_configuration<T>(mut self, v: std::option::Option<T>) -> Self
26664    where
26665        T: std::convert::Into<crate::model::BackupConfiguration>,
26666    {
26667        self.backup_configuration = v.map(|x| x.into());
26668        self
26669    }
26670
26671    /// Sets the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
26672    ///
26673    /// # Example
26674    /// ```ignore,no_run
26675    /// # use google_cloud_sql_v1::model::Settings;
26676    /// use wkt::BoolValue;
26677    /// let x = Settings::new().set_database_replication_enabled(BoolValue::default()/* use setters */);
26678    /// ```
26679    pub fn set_database_replication_enabled<T>(mut self, v: T) -> Self
26680    where
26681        T: std::convert::Into<wkt::BoolValue>,
26682    {
26683        self.database_replication_enabled = std::option::Option::Some(v.into());
26684        self
26685    }
26686
26687    /// Sets or clears the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
26688    ///
26689    /// # Example
26690    /// ```ignore,no_run
26691    /// # use google_cloud_sql_v1::model::Settings;
26692    /// use wkt::BoolValue;
26693    /// let x = Settings::new().set_or_clear_database_replication_enabled(Some(BoolValue::default()/* use setters */));
26694    /// let x = Settings::new().set_or_clear_database_replication_enabled(None::<BoolValue>);
26695    /// ```
26696    pub fn set_or_clear_database_replication_enabled<T>(mut self, v: std::option::Option<T>) -> Self
26697    where
26698        T: std::convert::Into<wkt::BoolValue>,
26699    {
26700        self.database_replication_enabled = v.map(|x| x.into());
26701        self
26702    }
26703
26704    /// Sets the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
26705    ///
26706    /// # Example
26707    /// ```ignore,no_run
26708    /// # use google_cloud_sql_v1::model::Settings;
26709    /// use wkt::BoolValue;
26710    /// let x = Settings::new().set_crash_safe_replication_enabled(BoolValue::default()/* use setters */);
26711    /// ```
26712    #[deprecated]
26713    pub fn set_crash_safe_replication_enabled<T>(mut self, v: T) -> Self
26714    where
26715        T: std::convert::Into<wkt::BoolValue>,
26716    {
26717        self.crash_safe_replication_enabled = std::option::Option::Some(v.into());
26718        self
26719    }
26720
26721    /// Sets or clears the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
26722    ///
26723    /// # Example
26724    /// ```ignore,no_run
26725    /// # use google_cloud_sql_v1::model::Settings;
26726    /// use wkt::BoolValue;
26727    /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(Some(BoolValue::default()/* use setters */));
26728    /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(None::<BoolValue>);
26729    /// ```
26730    #[deprecated]
26731    pub fn set_or_clear_crash_safe_replication_enabled<T>(
26732        mut self,
26733        v: std::option::Option<T>,
26734    ) -> Self
26735    where
26736        T: std::convert::Into<wkt::BoolValue>,
26737    {
26738        self.crash_safe_replication_enabled = v.map(|x| x.into());
26739        self
26740    }
26741
26742    /// Sets the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
26743    ///
26744    /// # Example
26745    /// ```ignore,no_run
26746    /// # use google_cloud_sql_v1::model::Settings;
26747    /// use wkt::Int64Value;
26748    /// let x = Settings::new().set_data_disk_size_gb(Int64Value::default()/* use setters */);
26749    /// ```
26750    pub fn set_data_disk_size_gb<T>(mut self, v: T) -> Self
26751    where
26752        T: std::convert::Into<wkt::Int64Value>,
26753    {
26754        self.data_disk_size_gb = std::option::Option::Some(v.into());
26755        self
26756    }
26757
26758    /// Sets or clears the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
26759    ///
26760    /// # Example
26761    /// ```ignore,no_run
26762    /// # use google_cloud_sql_v1::model::Settings;
26763    /// use wkt::Int64Value;
26764    /// let x = Settings::new().set_or_clear_data_disk_size_gb(Some(Int64Value::default()/* use setters */));
26765    /// let x = Settings::new().set_or_clear_data_disk_size_gb(None::<Int64Value>);
26766    /// ```
26767    pub fn set_or_clear_data_disk_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
26768    where
26769        T: std::convert::Into<wkt::Int64Value>,
26770    {
26771        self.data_disk_size_gb = v.map(|x| x.into());
26772        self
26773    }
26774
26775    /// Sets the value of [active_directory_config][crate::model::Settings::active_directory_config].
26776    ///
26777    /// # Example
26778    /// ```ignore,no_run
26779    /// # use google_cloud_sql_v1::model::Settings;
26780    /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
26781    /// let x = Settings::new().set_active_directory_config(SqlActiveDirectoryConfig::default()/* use setters */);
26782    /// ```
26783    pub fn set_active_directory_config<T>(mut self, v: T) -> Self
26784    where
26785        T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
26786    {
26787        self.active_directory_config = std::option::Option::Some(v.into());
26788        self
26789    }
26790
26791    /// Sets or clears the value of [active_directory_config][crate::model::Settings::active_directory_config].
26792    ///
26793    /// # Example
26794    /// ```ignore,no_run
26795    /// # use google_cloud_sql_v1::model::Settings;
26796    /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
26797    /// let x = Settings::new().set_or_clear_active_directory_config(Some(SqlActiveDirectoryConfig::default()/* use setters */));
26798    /// let x = Settings::new().set_or_clear_active_directory_config(None::<SqlActiveDirectoryConfig>);
26799    /// ```
26800    pub fn set_or_clear_active_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
26801    where
26802        T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
26803    {
26804        self.active_directory_config = v.map(|x| x.into());
26805        self
26806    }
26807
26808    /// Sets the value of [collation][crate::model::Settings::collation].
26809    ///
26810    /// # Example
26811    /// ```ignore,no_run
26812    /// # use google_cloud_sql_v1::model::Settings;
26813    /// let x = Settings::new().set_collation("example");
26814    /// ```
26815    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26816        self.collation = v.into();
26817        self
26818    }
26819
26820    /// Sets the value of [deny_maintenance_periods][crate::model::Settings::deny_maintenance_periods].
26821    ///
26822    /// # Example
26823    /// ```ignore,no_run
26824    /// # use google_cloud_sql_v1::model::Settings;
26825    /// use google_cloud_sql_v1::model::DenyMaintenancePeriod;
26826    /// let x = Settings::new()
26827    ///     .set_deny_maintenance_periods([
26828    ///         DenyMaintenancePeriod::default()/* use setters */,
26829    ///         DenyMaintenancePeriod::default()/* use (different) setters */,
26830    ///     ]);
26831    /// ```
26832    pub fn set_deny_maintenance_periods<T, V>(mut self, v: T) -> Self
26833    where
26834        T: std::iter::IntoIterator<Item = V>,
26835        V: std::convert::Into<crate::model::DenyMaintenancePeriod>,
26836    {
26837        use std::iter::Iterator;
26838        self.deny_maintenance_periods = v.into_iter().map(|i| i.into()).collect();
26839        self
26840    }
26841
26842    /// Sets the value of [insights_config][crate::model::Settings::insights_config].
26843    ///
26844    /// # Example
26845    /// ```ignore,no_run
26846    /// # use google_cloud_sql_v1::model::Settings;
26847    /// use google_cloud_sql_v1::model::InsightsConfig;
26848    /// let x = Settings::new().set_insights_config(InsightsConfig::default()/* use setters */);
26849    /// ```
26850    pub fn set_insights_config<T>(mut self, v: T) -> Self
26851    where
26852        T: std::convert::Into<crate::model::InsightsConfig>,
26853    {
26854        self.insights_config = std::option::Option::Some(v.into());
26855        self
26856    }
26857
26858    /// Sets or clears the value of [insights_config][crate::model::Settings::insights_config].
26859    ///
26860    /// # Example
26861    /// ```ignore,no_run
26862    /// # use google_cloud_sql_v1::model::Settings;
26863    /// use google_cloud_sql_v1::model::InsightsConfig;
26864    /// let x = Settings::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
26865    /// let x = Settings::new().set_or_clear_insights_config(None::<InsightsConfig>);
26866    /// ```
26867    pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
26868    where
26869        T: std::convert::Into<crate::model::InsightsConfig>,
26870    {
26871        self.insights_config = v.map(|x| x.into());
26872        self
26873    }
26874
26875    /// Sets the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
26876    ///
26877    /// # Example
26878    /// ```ignore,no_run
26879    /// # use google_cloud_sql_v1::model::Settings;
26880    /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
26881    /// let x = Settings::new().set_password_validation_policy(PasswordValidationPolicy::default()/* use setters */);
26882    /// ```
26883    pub fn set_password_validation_policy<T>(mut self, v: T) -> Self
26884    where
26885        T: std::convert::Into<crate::model::PasswordValidationPolicy>,
26886    {
26887        self.password_validation_policy = std::option::Option::Some(v.into());
26888        self
26889    }
26890
26891    /// Sets or clears the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
26892    ///
26893    /// # Example
26894    /// ```ignore,no_run
26895    /// # use google_cloud_sql_v1::model::Settings;
26896    /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
26897    /// let x = Settings::new().set_or_clear_password_validation_policy(Some(PasswordValidationPolicy::default()/* use setters */));
26898    /// let x = Settings::new().set_or_clear_password_validation_policy(None::<PasswordValidationPolicy>);
26899    /// ```
26900    pub fn set_or_clear_password_validation_policy<T>(mut self, v: std::option::Option<T>) -> Self
26901    where
26902        T: std::convert::Into<crate::model::PasswordValidationPolicy>,
26903    {
26904        self.password_validation_policy = v.map(|x| x.into());
26905        self
26906    }
26907
26908    /// Sets the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
26909    ///
26910    /// # Example
26911    /// ```ignore,no_run
26912    /// # use google_cloud_sql_v1::model::Settings;
26913    /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
26914    /// let x = Settings::new().set_sql_server_audit_config(SqlServerAuditConfig::default()/* use setters */);
26915    /// ```
26916    pub fn set_sql_server_audit_config<T>(mut self, v: T) -> Self
26917    where
26918        T: std::convert::Into<crate::model::SqlServerAuditConfig>,
26919    {
26920        self.sql_server_audit_config = std::option::Option::Some(v.into());
26921        self
26922    }
26923
26924    /// Sets or clears the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
26925    ///
26926    /// # Example
26927    /// ```ignore,no_run
26928    /// # use google_cloud_sql_v1::model::Settings;
26929    /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
26930    /// let x = Settings::new().set_or_clear_sql_server_audit_config(Some(SqlServerAuditConfig::default()/* use setters */));
26931    /// let x = Settings::new().set_or_clear_sql_server_audit_config(None::<SqlServerAuditConfig>);
26932    /// ```
26933    pub fn set_or_clear_sql_server_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
26934    where
26935        T: std::convert::Into<crate::model::SqlServerAuditConfig>,
26936    {
26937        self.sql_server_audit_config = v.map(|x| x.into());
26938        self
26939    }
26940
26941    /// Sets the value of [edition][crate::model::Settings::edition].
26942    ///
26943    /// # Example
26944    /// ```ignore,no_run
26945    /// # use google_cloud_sql_v1::model::Settings;
26946    /// use google_cloud_sql_v1::model::settings::Edition;
26947    /// let x0 = Settings::new().set_edition(Edition::Enterprise);
26948    /// let x1 = Settings::new().set_edition(Edition::EnterprisePlus);
26949    /// ```
26950    pub fn set_edition<T: std::convert::Into<crate::model::settings::Edition>>(
26951        mut self,
26952        v: T,
26953    ) -> Self {
26954        self.edition = v.into();
26955        self
26956    }
26957
26958    /// Sets the value of [connector_enforcement][crate::model::Settings::connector_enforcement].
26959    ///
26960    /// # Example
26961    /// ```ignore,no_run
26962    /// # use google_cloud_sql_v1::model::Settings;
26963    /// use google_cloud_sql_v1::model::settings::ConnectorEnforcement;
26964    /// let x0 = Settings::new().set_connector_enforcement(ConnectorEnforcement::NotRequired);
26965    /// let x1 = Settings::new().set_connector_enforcement(ConnectorEnforcement::Required);
26966    /// ```
26967    pub fn set_connector_enforcement<
26968        T: std::convert::Into<crate::model::settings::ConnectorEnforcement>,
26969    >(
26970        mut self,
26971        v: T,
26972    ) -> Self {
26973        self.connector_enforcement = v.into();
26974        self
26975    }
26976
26977    /// Sets the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
26978    ///
26979    /// # Example
26980    /// ```ignore,no_run
26981    /// # use google_cloud_sql_v1::model::Settings;
26982    /// use wkt::BoolValue;
26983    /// let x = Settings::new().set_deletion_protection_enabled(BoolValue::default()/* use setters */);
26984    /// ```
26985    pub fn set_deletion_protection_enabled<T>(mut self, v: T) -> Self
26986    where
26987        T: std::convert::Into<wkt::BoolValue>,
26988    {
26989        self.deletion_protection_enabled = std::option::Option::Some(v.into());
26990        self
26991    }
26992
26993    /// Sets or clears the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
26994    ///
26995    /// # Example
26996    /// ```ignore,no_run
26997    /// # use google_cloud_sql_v1::model::Settings;
26998    /// use wkt::BoolValue;
26999    /// let x = Settings::new().set_or_clear_deletion_protection_enabled(Some(BoolValue::default()/* use setters */));
27000    /// let x = Settings::new().set_or_clear_deletion_protection_enabled(None::<BoolValue>);
27001    /// ```
27002    pub fn set_or_clear_deletion_protection_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27003    where
27004        T: std::convert::Into<wkt::BoolValue>,
27005    {
27006        self.deletion_protection_enabled = v.map(|x| x.into());
27007        self
27008    }
27009
27010    /// Sets the value of [time_zone][crate::model::Settings::time_zone].
27011    ///
27012    /// # Example
27013    /// ```ignore,no_run
27014    /// # use google_cloud_sql_v1::model::Settings;
27015    /// let x = Settings::new().set_time_zone("example");
27016    /// ```
27017    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27018        self.time_zone = v.into();
27019        self
27020    }
27021
27022    /// Sets the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
27023    ///
27024    /// # Example
27025    /// ```ignore,no_run
27026    /// # use google_cloud_sql_v1::model::Settings;
27027    /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
27028    /// let x = Settings::new().set_advanced_machine_features(AdvancedMachineFeatures::default()/* use setters */);
27029    /// ```
27030    pub fn set_advanced_machine_features<T>(mut self, v: T) -> Self
27031    where
27032        T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
27033    {
27034        self.advanced_machine_features = std::option::Option::Some(v.into());
27035        self
27036    }
27037
27038    /// Sets or clears the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
27039    ///
27040    /// # Example
27041    /// ```ignore,no_run
27042    /// # use google_cloud_sql_v1::model::Settings;
27043    /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
27044    /// let x = Settings::new().set_or_clear_advanced_machine_features(Some(AdvancedMachineFeatures::default()/* use setters */));
27045    /// let x = Settings::new().set_or_clear_advanced_machine_features(None::<AdvancedMachineFeatures>);
27046    /// ```
27047    pub fn set_or_clear_advanced_machine_features<T>(mut self, v: std::option::Option<T>) -> Self
27048    where
27049        T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
27050    {
27051        self.advanced_machine_features = v.map(|x| x.into());
27052        self
27053    }
27054
27055    /// Sets the value of [data_cache_config][crate::model::Settings::data_cache_config].
27056    ///
27057    /// # Example
27058    /// ```ignore,no_run
27059    /// # use google_cloud_sql_v1::model::Settings;
27060    /// use google_cloud_sql_v1::model::DataCacheConfig;
27061    /// let x = Settings::new().set_data_cache_config(DataCacheConfig::default()/* use setters */);
27062    /// ```
27063    pub fn set_data_cache_config<T>(mut self, v: T) -> Self
27064    where
27065        T: std::convert::Into<crate::model::DataCacheConfig>,
27066    {
27067        self.data_cache_config = std::option::Option::Some(v.into());
27068        self
27069    }
27070
27071    /// Sets or clears the value of [data_cache_config][crate::model::Settings::data_cache_config].
27072    ///
27073    /// # Example
27074    /// ```ignore,no_run
27075    /// # use google_cloud_sql_v1::model::Settings;
27076    /// use google_cloud_sql_v1::model::DataCacheConfig;
27077    /// let x = Settings::new().set_or_clear_data_cache_config(Some(DataCacheConfig::default()/* use setters */));
27078    /// let x = Settings::new().set_or_clear_data_cache_config(None::<DataCacheConfig>);
27079    /// ```
27080    pub fn set_or_clear_data_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
27081    where
27082        T: std::convert::Into<crate::model::DataCacheConfig>,
27083    {
27084        self.data_cache_config = v.map(|x| x.into());
27085        self
27086    }
27087
27088    /// Sets the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
27089    ///
27090    /// # Example
27091    /// ```ignore,no_run
27092    /// # use google_cloud_sql_v1::model::Settings;
27093    /// use wkt::Int32Value;
27094    /// let x = Settings::new().set_replication_lag_max_seconds(Int32Value::default()/* use setters */);
27095    /// ```
27096    pub fn set_replication_lag_max_seconds<T>(mut self, v: T) -> Self
27097    where
27098        T: std::convert::Into<wkt::Int32Value>,
27099    {
27100        self.replication_lag_max_seconds = std::option::Option::Some(v.into());
27101        self
27102    }
27103
27104    /// Sets or clears the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
27105    ///
27106    /// # Example
27107    /// ```ignore,no_run
27108    /// # use google_cloud_sql_v1::model::Settings;
27109    /// use wkt::Int32Value;
27110    /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(Some(Int32Value::default()/* use setters */));
27111    /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(None::<Int32Value>);
27112    /// ```
27113    pub fn set_or_clear_replication_lag_max_seconds<T>(mut self, v: std::option::Option<T>) -> Self
27114    where
27115        T: std::convert::Into<wkt::Int32Value>,
27116    {
27117        self.replication_lag_max_seconds = v.map(|x| x.into());
27118        self
27119    }
27120
27121    /// Sets the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
27122    ///
27123    /// # Example
27124    /// ```ignore,no_run
27125    /// # use google_cloud_sql_v1::model::Settings;
27126    /// use wkt::BoolValue;
27127    /// let x = Settings::new().set_enable_google_ml_integration(BoolValue::default()/* use setters */);
27128    /// ```
27129    pub fn set_enable_google_ml_integration<T>(mut self, v: T) -> Self
27130    where
27131        T: std::convert::Into<wkt::BoolValue>,
27132    {
27133        self.enable_google_ml_integration = std::option::Option::Some(v.into());
27134        self
27135    }
27136
27137    /// Sets or clears the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
27138    ///
27139    /// # Example
27140    /// ```ignore,no_run
27141    /// # use google_cloud_sql_v1::model::Settings;
27142    /// use wkt::BoolValue;
27143    /// let x = Settings::new().set_or_clear_enable_google_ml_integration(Some(BoolValue::default()/* use setters */));
27144    /// let x = Settings::new().set_or_clear_enable_google_ml_integration(None::<BoolValue>);
27145    /// ```
27146    pub fn set_or_clear_enable_google_ml_integration<T>(mut self, v: std::option::Option<T>) -> Self
27147    where
27148        T: std::convert::Into<wkt::BoolValue>,
27149    {
27150        self.enable_google_ml_integration = v.map(|x| x.into());
27151        self
27152    }
27153
27154    /// Sets the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
27155    ///
27156    /// # Example
27157    /// ```ignore,no_run
27158    /// # use google_cloud_sql_v1::model::Settings;
27159    /// use wkt::BoolValue;
27160    /// let x = Settings::new().set_enable_dataplex_integration(BoolValue::default()/* use setters */);
27161    /// ```
27162    pub fn set_enable_dataplex_integration<T>(mut self, v: T) -> Self
27163    where
27164        T: std::convert::Into<wkt::BoolValue>,
27165    {
27166        self.enable_dataplex_integration = std::option::Option::Some(v.into());
27167        self
27168    }
27169
27170    /// Sets or clears the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
27171    ///
27172    /// # Example
27173    /// ```ignore,no_run
27174    /// # use google_cloud_sql_v1::model::Settings;
27175    /// use wkt::BoolValue;
27176    /// let x = Settings::new().set_or_clear_enable_dataplex_integration(Some(BoolValue::default()/* use setters */));
27177    /// let x = Settings::new().set_or_clear_enable_dataplex_integration(None::<BoolValue>);
27178    /// ```
27179    pub fn set_or_clear_enable_dataplex_integration<T>(mut self, v: std::option::Option<T>) -> Self
27180    where
27181        T: std::convert::Into<wkt::BoolValue>,
27182    {
27183        self.enable_dataplex_integration = v.map(|x| x.into());
27184        self
27185    }
27186
27187    /// Sets the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
27188    ///
27189    /// # Example
27190    /// ```ignore,no_run
27191    /// # use google_cloud_sql_v1::model::Settings;
27192    /// use wkt::BoolValue;
27193    /// let x = Settings::new().set_retain_backups_on_delete(BoolValue::default()/* use setters */);
27194    /// ```
27195    pub fn set_retain_backups_on_delete<T>(mut self, v: T) -> Self
27196    where
27197        T: std::convert::Into<wkt::BoolValue>,
27198    {
27199        self.retain_backups_on_delete = std::option::Option::Some(v.into());
27200        self
27201    }
27202
27203    /// Sets or clears the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
27204    ///
27205    /// # Example
27206    /// ```ignore,no_run
27207    /// # use google_cloud_sql_v1::model::Settings;
27208    /// use wkt::BoolValue;
27209    /// let x = Settings::new().set_or_clear_retain_backups_on_delete(Some(BoolValue::default()/* use setters */));
27210    /// let x = Settings::new().set_or_clear_retain_backups_on_delete(None::<BoolValue>);
27211    /// ```
27212    pub fn set_or_clear_retain_backups_on_delete<T>(mut self, v: std::option::Option<T>) -> Self
27213    where
27214        T: std::convert::Into<wkt::BoolValue>,
27215    {
27216        self.retain_backups_on_delete = v.map(|x| x.into());
27217        self
27218    }
27219
27220    /// Sets the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
27221    ///
27222    /// # Example
27223    /// ```ignore,no_run
27224    /// # use google_cloud_sql_v1::model::Settings;
27225    /// let x = Settings::new().set_data_disk_provisioned_iops(42);
27226    /// ```
27227    pub fn set_data_disk_provisioned_iops<T>(mut self, v: T) -> Self
27228    where
27229        T: std::convert::Into<i64>,
27230    {
27231        self.data_disk_provisioned_iops = std::option::Option::Some(v.into());
27232        self
27233    }
27234
27235    /// Sets or clears the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
27236    ///
27237    /// # Example
27238    /// ```ignore,no_run
27239    /// # use google_cloud_sql_v1::model::Settings;
27240    /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(Some(42));
27241    /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(None::<i32>);
27242    /// ```
27243    pub fn set_or_clear_data_disk_provisioned_iops<T>(mut self, v: std::option::Option<T>) -> Self
27244    where
27245        T: std::convert::Into<i64>,
27246    {
27247        self.data_disk_provisioned_iops = v.map(|x| x.into());
27248        self
27249    }
27250
27251    /// Sets the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
27252    ///
27253    /// # Example
27254    /// ```ignore,no_run
27255    /// # use google_cloud_sql_v1::model::Settings;
27256    /// let x = Settings::new().set_data_disk_provisioned_throughput(42);
27257    /// ```
27258    pub fn set_data_disk_provisioned_throughput<T>(mut self, v: T) -> Self
27259    where
27260        T: std::convert::Into<i64>,
27261    {
27262        self.data_disk_provisioned_throughput = std::option::Option::Some(v.into());
27263        self
27264    }
27265
27266    /// Sets or clears the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
27267    ///
27268    /// # Example
27269    /// ```ignore,no_run
27270    /// # use google_cloud_sql_v1::model::Settings;
27271    /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(Some(42));
27272    /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(None::<i32>);
27273    /// ```
27274    pub fn set_or_clear_data_disk_provisioned_throughput<T>(
27275        mut self,
27276        v: std::option::Option<T>,
27277    ) -> Self
27278    where
27279        T: std::convert::Into<i64>,
27280    {
27281        self.data_disk_provisioned_throughput = v.map(|x| x.into());
27282        self
27283    }
27284
27285    /// Sets the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
27286    ///
27287    /// # Example
27288    /// ```ignore,no_run
27289    /// # use google_cloud_sql_v1::model::Settings;
27290    /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
27291    /// let x = Settings::new().set_connection_pool_config(ConnectionPoolConfig::default()/* use setters */);
27292    /// ```
27293    pub fn set_connection_pool_config<T>(mut self, v: T) -> Self
27294    where
27295        T: std::convert::Into<crate::model::ConnectionPoolConfig>,
27296    {
27297        self.connection_pool_config = std::option::Option::Some(v.into());
27298        self
27299    }
27300
27301    /// Sets or clears the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
27302    ///
27303    /// # Example
27304    /// ```ignore,no_run
27305    /// # use google_cloud_sql_v1::model::Settings;
27306    /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
27307    /// let x = Settings::new().set_or_clear_connection_pool_config(Some(ConnectionPoolConfig::default()/* use setters */));
27308    /// let x = Settings::new().set_or_clear_connection_pool_config(None::<ConnectionPoolConfig>);
27309    /// ```
27310    pub fn set_or_clear_connection_pool_config<T>(mut self, v: std::option::Option<T>) -> Self
27311    where
27312        T: std::convert::Into<crate::model::ConnectionPoolConfig>,
27313    {
27314        self.connection_pool_config = v.map(|x| x.into());
27315        self
27316    }
27317
27318    /// Sets the value of [final_backup_config][crate::model::Settings::final_backup_config].
27319    ///
27320    /// # Example
27321    /// ```ignore,no_run
27322    /// # use google_cloud_sql_v1::model::Settings;
27323    /// use google_cloud_sql_v1::model::FinalBackupConfig;
27324    /// let x = Settings::new().set_final_backup_config(FinalBackupConfig::default()/* use setters */);
27325    /// ```
27326    pub fn set_final_backup_config<T>(mut self, v: T) -> Self
27327    where
27328        T: std::convert::Into<crate::model::FinalBackupConfig>,
27329    {
27330        self.final_backup_config = std::option::Option::Some(v.into());
27331        self
27332    }
27333
27334    /// Sets or clears the value of [final_backup_config][crate::model::Settings::final_backup_config].
27335    ///
27336    /// # Example
27337    /// ```ignore,no_run
27338    /// # use google_cloud_sql_v1::model::Settings;
27339    /// use google_cloud_sql_v1::model::FinalBackupConfig;
27340    /// let x = Settings::new().set_or_clear_final_backup_config(Some(FinalBackupConfig::default()/* use setters */));
27341    /// let x = Settings::new().set_or_clear_final_backup_config(None::<FinalBackupConfig>);
27342    /// ```
27343    pub fn set_or_clear_final_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
27344    where
27345        T: std::convert::Into<crate::model::FinalBackupConfig>,
27346    {
27347        self.final_backup_config = v.map(|x| x.into());
27348        self
27349    }
27350
27351    /// Sets the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
27352    ///
27353    /// # Example
27354    /// ```ignore,no_run
27355    /// # use google_cloud_sql_v1::model::Settings;
27356    /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
27357    /// let x = Settings::new().set_read_pool_auto_scale_config(ReadPoolAutoScaleConfig::default()/* use setters */);
27358    /// ```
27359    pub fn set_read_pool_auto_scale_config<T>(mut self, v: T) -> Self
27360    where
27361        T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
27362    {
27363        self.read_pool_auto_scale_config = std::option::Option::Some(v.into());
27364        self
27365    }
27366
27367    /// Sets or clears the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
27368    ///
27369    /// # Example
27370    /// ```ignore,no_run
27371    /// # use google_cloud_sql_v1::model::Settings;
27372    /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
27373    /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(Some(ReadPoolAutoScaleConfig::default()/* use setters */));
27374    /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(None::<ReadPoolAutoScaleConfig>);
27375    /// ```
27376    pub fn set_or_clear_read_pool_auto_scale_config<T>(mut self, v: std::option::Option<T>) -> Self
27377    where
27378        T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
27379    {
27380        self.read_pool_auto_scale_config = v.map(|x| x.into());
27381        self
27382    }
27383
27384    /// Sets the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
27385    ///
27386    /// # Example
27387    /// ```ignore,no_run
27388    /// # use google_cloud_sql_v1::model::Settings;
27389    /// let x = Settings::new().set_auto_upgrade_enabled(true);
27390    /// ```
27391    pub fn set_auto_upgrade_enabled<T>(mut self, v: T) -> Self
27392    where
27393        T: std::convert::Into<bool>,
27394    {
27395        self.auto_upgrade_enabled = std::option::Option::Some(v.into());
27396        self
27397    }
27398
27399    /// Sets or clears the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
27400    ///
27401    /// # Example
27402    /// ```ignore,no_run
27403    /// # use google_cloud_sql_v1::model::Settings;
27404    /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(Some(false));
27405    /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(None::<bool>);
27406    /// ```
27407    pub fn set_or_clear_auto_upgrade_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27408    where
27409        T: std::convert::Into<bool>,
27410    {
27411        self.auto_upgrade_enabled = v.map(|x| x.into());
27412        self
27413    }
27414
27415    /// Sets the value of [entraid_config][crate::model::Settings::entraid_config].
27416    ///
27417    /// # Example
27418    /// ```ignore,no_run
27419    /// # use google_cloud_sql_v1::model::Settings;
27420    /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
27421    /// let x = Settings::new().set_entraid_config(SqlServerEntraIdConfig::default()/* use setters */);
27422    /// ```
27423    pub fn set_entraid_config<T>(mut self, v: T) -> Self
27424    where
27425        T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
27426    {
27427        self.entraid_config = std::option::Option::Some(v.into());
27428        self
27429    }
27430
27431    /// Sets or clears the value of [entraid_config][crate::model::Settings::entraid_config].
27432    ///
27433    /// # Example
27434    /// ```ignore,no_run
27435    /// # use google_cloud_sql_v1::model::Settings;
27436    /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
27437    /// let x = Settings::new().set_or_clear_entraid_config(Some(SqlServerEntraIdConfig::default()/* use setters */));
27438    /// let x = Settings::new().set_or_clear_entraid_config(None::<SqlServerEntraIdConfig>);
27439    /// ```
27440    pub fn set_or_clear_entraid_config<T>(mut self, v: std::option::Option<T>) -> Self
27441    where
27442        T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
27443    {
27444        self.entraid_config = v.map(|x| x.into());
27445        self
27446    }
27447
27448    /// Sets the value of [data_api_access][crate::model::Settings::data_api_access].
27449    ///
27450    /// # Example
27451    /// ```ignore,no_run
27452    /// # use google_cloud_sql_v1::model::Settings;
27453    /// use google_cloud_sql_v1::model::settings::DataApiAccess;
27454    /// let x0 = Settings::new().set_data_api_access(DataApiAccess::DisallowDataApi);
27455    /// let x1 = Settings::new().set_data_api_access(DataApiAccess::AllowDataApi);
27456    /// ```
27457    pub fn set_data_api_access<T>(mut self, v: T) -> Self
27458    where
27459        T: std::convert::Into<crate::model::settings::DataApiAccess>,
27460    {
27461        self.data_api_access = std::option::Option::Some(v.into());
27462        self
27463    }
27464
27465    /// Sets or clears the value of [data_api_access][crate::model::Settings::data_api_access].
27466    ///
27467    /// # Example
27468    /// ```ignore,no_run
27469    /// # use google_cloud_sql_v1::model::Settings;
27470    /// use google_cloud_sql_v1::model::settings::DataApiAccess;
27471    /// let x0 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::DisallowDataApi));
27472    /// let x1 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::AllowDataApi));
27473    /// let x_none = Settings::new().set_or_clear_data_api_access(None::<DataApiAccess>);
27474    /// ```
27475    pub fn set_or_clear_data_api_access<T>(mut self, v: std::option::Option<T>) -> Self
27476    where
27477        T: std::convert::Into<crate::model::settings::DataApiAccess>,
27478    {
27479        self.data_api_access = v.map(|x| x.into());
27480        self
27481    }
27482
27483    /// Sets the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
27484    ///
27485    /// # Example
27486    /// ```ignore,no_run
27487    /// # use google_cloud_sql_v1::model::Settings;
27488    /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27489    /// let x = Settings::new().set_performance_capture_config(PerformanceCaptureConfig::default()/* use setters */);
27490    /// ```
27491    pub fn set_performance_capture_config<T>(mut self, v: T) -> Self
27492    where
27493        T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
27494    {
27495        self.performance_capture_config = std::option::Option::Some(v.into());
27496        self
27497    }
27498
27499    /// Sets or clears the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
27500    ///
27501    /// # Example
27502    /// ```ignore,no_run
27503    /// # use google_cloud_sql_v1::model::Settings;
27504    /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27505    /// let x = Settings::new().set_or_clear_performance_capture_config(Some(PerformanceCaptureConfig::default()/* use setters */));
27506    /// let x = Settings::new().set_or_clear_performance_capture_config(None::<PerformanceCaptureConfig>);
27507    /// ```
27508    pub fn set_or_clear_performance_capture_config<T>(mut self, v: std::option::Option<T>) -> Self
27509    where
27510        T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
27511    {
27512        self.performance_capture_config = v.map(|x| x.into());
27513        self
27514    }
27515}
27516
27517impl wkt::message::Message for Settings {
27518    fn typename() -> &'static str {
27519        "type.googleapis.com/google.cloud.sql.v1.Settings"
27520    }
27521}
27522
27523/// Defines additional types related to [Settings].
27524pub mod settings {
27525    #[allow(unused_imports)]
27526    use super::*;
27527
27528    /// Specifies when the instance is activated.
27529    ///
27530    /// # Working with unknown values
27531    ///
27532    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27533    /// additional enum variants at any time. Adding new variants is not considered
27534    /// a breaking change. Applications should write their code in anticipation of:
27535    ///
27536    /// - New values appearing in future releases of the client library, **and**
27537    /// - New values received dynamically, without application changes.
27538    ///
27539    /// Please consult the [Working with enums] section in the user guide for some
27540    /// guidelines.
27541    ///
27542    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27543    #[derive(Clone, Debug, PartialEq)]
27544    #[non_exhaustive]
27545    pub enum SqlActivationPolicy {
27546        /// Unknown activation plan.
27547        Unspecified,
27548        /// The instance is always up and running.
27549        Always,
27550        /// The instance never starts.
27551        Never,
27552        /// The instance starts upon receiving requests.
27553        #[deprecated]
27554        OnDemand,
27555        /// If set, the enum was initialized with an unknown value.
27556        ///
27557        /// Applications can examine the value using [SqlActivationPolicy::value] or
27558        /// [SqlActivationPolicy::name].
27559        UnknownValue(sql_activation_policy::UnknownValue),
27560    }
27561
27562    #[doc(hidden)]
27563    pub mod sql_activation_policy {
27564        #[allow(unused_imports)]
27565        use super::*;
27566        #[derive(Clone, Debug, PartialEq)]
27567        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27568    }
27569
27570    impl SqlActivationPolicy {
27571        /// Gets the enum value.
27572        ///
27573        /// Returns `None` if the enum contains an unknown value deserialized from
27574        /// the string representation of enums.
27575        pub fn value(&self) -> std::option::Option<i32> {
27576            match self {
27577                Self::Unspecified => std::option::Option::Some(0),
27578                Self::Always => std::option::Option::Some(1),
27579                Self::Never => std::option::Option::Some(2),
27580                Self::OnDemand => std::option::Option::Some(3),
27581                Self::UnknownValue(u) => u.0.value(),
27582            }
27583        }
27584
27585        /// Gets the enum value as a string.
27586        ///
27587        /// Returns `None` if the enum contains an unknown value deserialized from
27588        /// the integer representation of enums.
27589        pub fn name(&self) -> std::option::Option<&str> {
27590            match self {
27591                Self::Unspecified => std::option::Option::Some("SQL_ACTIVATION_POLICY_UNSPECIFIED"),
27592                Self::Always => std::option::Option::Some("ALWAYS"),
27593                Self::Never => std::option::Option::Some("NEVER"),
27594                Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
27595                Self::UnknownValue(u) => u.0.name(),
27596            }
27597        }
27598    }
27599
27600    impl std::default::Default for SqlActivationPolicy {
27601        fn default() -> Self {
27602            use std::convert::From;
27603            Self::from(0)
27604        }
27605    }
27606
27607    impl std::fmt::Display for SqlActivationPolicy {
27608        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27609            wkt::internal::display_enum(f, self.name(), self.value())
27610        }
27611    }
27612
27613    impl std::convert::From<i32> for SqlActivationPolicy {
27614        fn from(value: i32) -> Self {
27615            match value {
27616                0 => Self::Unspecified,
27617                1 => Self::Always,
27618                2 => Self::Never,
27619                3 => Self::OnDemand,
27620                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
27621                    wkt::internal::UnknownEnumValue::Integer(value),
27622                )),
27623            }
27624        }
27625    }
27626
27627    impl std::convert::From<&str> for SqlActivationPolicy {
27628        fn from(value: &str) -> Self {
27629            use std::string::ToString;
27630            match value {
27631                "SQL_ACTIVATION_POLICY_UNSPECIFIED" => Self::Unspecified,
27632                "ALWAYS" => Self::Always,
27633                "NEVER" => Self::Never,
27634                "ON_DEMAND" => Self::OnDemand,
27635                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
27636                    wkt::internal::UnknownEnumValue::String(value.to_string()),
27637                )),
27638            }
27639        }
27640    }
27641
27642    impl serde::ser::Serialize for SqlActivationPolicy {
27643        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27644        where
27645            S: serde::Serializer,
27646        {
27647            match self {
27648                Self::Unspecified => serializer.serialize_i32(0),
27649                Self::Always => serializer.serialize_i32(1),
27650                Self::Never => serializer.serialize_i32(2),
27651                Self::OnDemand => serializer.serialize_i32(3),
27652                Self::UnknownValue(u) => u.0.serialize(serializer),
27653            }
27654        }
27655    }
27656
27657    impl<'de> serde::de::Deserialize<'de> for SqlActivationPolicy {
27658        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27659        where
27660            D: serde::Deserializer<'de>,
27661        {
27662            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlActivationPolicy>::new(
27663                ".google.cloud.sql.v1.Settings.SqlActivationPolicy",
27664            ))
27665        }
27666    }
27667
27668    /// The edition of the instance.
27669    ///
27670    /// # Working with unknown values
27671    ///
27672    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27673    /// additional enum variants at any time. Adding new variants is not considered
27674    /// a breaking change. Applications should write their code in anticipation of:
27675    ///
27676    /// - New values appearing in future releases of the client library, **and**
27677    /// - New values received dynamically, without application changes.
27678    ///
27679    /// Please consult the [Working with enums] section in the user guide for some
27680    /// guidelines.
27681    ///
27682    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27683    #[derive(Clone, Debug, PartialEq)]
27684    #[non_exhaustive]
27685    pub enum Edition {
27686        /// The instance did not specify the edition.
27687        Unspecified,
27688        /// The instance is an enterprise edition.
27689        Enterprise,
27690        /// The instance is an Enterprise Plus edition.
27691        EnterprisePlus,
27692        /// If set, the enum was initialized with an unknown value.
27693        ///
27694        /// Applications can examine the value using [Edition::value] or
27695        /// [Edition::name].
27696        UnknownValue(edition::UnknownValue),
27697    }
27698
27699    #[doc(hidden)]
27700    pub mod edition {
27701        #[allow(unused_imports)]
27702        use super::*;
27703        #[derive(Clone, Debug, PartialEq)]
27704        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27705    }
27706
27707    impl Edition {
27708        /// Gets the enum value.
27709        ///
27710        /// Returns `None` if the enum contains an unknown value deserialized from
27711        /// the string representation of enums.
27712        pub fn value(&self) -> std::option::Option<i32> {
27713            match self {
27714                Self::Unspecified => std::option::Option::Some(0),
27715                Self::Enterprise => std::option::Option::Some(2),
27716                Self::EnterprisePlus => std::option::Option::Some(3),
27717                Self::UnknownValue(u) => u.0.value(),
27718            }
27719        }
27720
27721        /// Gets the enum value as a string.
27722        ///
27723        /// Returns `None` if the enum contains an unknown value deserialized from
27724        /// the integer representation of enums.
27725        pub fn name(&self) -> std::option::Option<&str> {
27726            match self {
27727                Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
27728                Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
27729                Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
27730                Self::UnknownValue(u) => u.0.name(),
27731            }
27732        }
27733    }
27734
27735    impl std::default::Default for Edition {
27736        fn default() -> Self {
27737            use std::convert::From;
27738            Self::from(0)
27739        }
27740    }
27741
27742    impl std::fmt::Display for Edition {
27743        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27744            wkt::internal::display_enum(f, self.name(), self.value())
27745        }
27746    }
27747
27748    impl std::convert::From<i32> for Edition {
27749        fn from(value: i32) -> Self {
27750            match value {
27751                0 => Self::Unspecified,
27752                2 => Self::Enterprise,
27753                3 => Self::EnterprisePlus,
27754                _ => Self::UnknownValue(edition::UnknownValue(
27755                    wkt::internal::UnknownEnumValue::Integer(value),
27756                )),
27757            }
27758        }
27759    }
27760
27761    impl std::convert::From<&str> for Edition {
27762        fn from(value: &str) -> Self {
27763            use std::string::ToString;
27764            match value {
27765                "EDITION_UNSPECIFIED" => Self::Unspecified,
27766                "ENTERPRISE" => Self::Enterprise,
27767                "ENTERPRISE_PLUS" => Self::EnterprisePlus,
27768                _ => Self::UnknownValue(edition::UnknownValue(
27769                    wkt::internal::UnknownEnumValue::String(value.to_string()),
27770                )),
27771            }
27772        }
27773    }
27774
27775    impl serde::ser::Serialize for Edition {
27776        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27777        where
27778            S: serde::Serializer,
27779        {
27780            match self {
27781                Self::Unspecified => serializer.serialize_i32(0),
27782                Self::Enterprise => serializer.serialize_i32(2),
27783                Self::EnterprisePlus => serializer.serialize_i32(3),
27784                Self::UnknownValue(u) => u.0.serialize(serializer),
27785            }
27786        }
27787    }
27788
27789    impl<'de> serde::de::Deserialize<'de> for Edition {
27790        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27791        where
27792            D: serde::Deserializer<'de>,
27793        {
27794            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
27795                ".google.cloud.sql.v1.Settings.Edition",
27796            ))
27797        }
27798    }
27799
27800    /// The options for enforcing Cloud SQL connectors in the instance.
27801    ///
27802    /// # Working with unknown values
27803    ///
27804    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27805    /// additional enum variants at any time. Adding new variants is not considered
27806    /// a breaking change. Applications should write their code in anticipation of:
27807    ///
27808    /// - New values appearing in future releases of the client library, **and**
27809    /// - New values received dynamically, without application changes.
27810    ///
27811    /// Please consult the [Working with enums] section in the user guide for some
27812    /// guidelines.
27813    ///
27814    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27815    #[derive(Clone, Debug, PartialEq)]
27816    #[non_exhaustive]
27817    pub enum ConnectorEnforcement {
27818        /// The requirement for Cloud SQL connectors is unknown.
27819        Unspecified,
27820        /// Do not require Cloud SQL connectors.
27821        NotRequired,
27822        /// Require all connections to use Cloud SQL connectors, including the
27823        /// Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
27824        /// Note: This disables all existing authorized networks.
27825        Required,
27826        /// If set, the enum was initialized with an unknown value.
27827        ///
27828        /// Applications can examine the value using [ConnectorEnforcement::value] or
27829        /// [ConnectorEnforcement::name].
27830        UnknownValue(connector_enforcement::UnknownValue),
27831    }
27832
27833    #[doc(hidden)]
27834    pub mod connector_enforcement {
27835        #[allow(unused_imports)]
27836        use super::*;
27837        #[derive(Clone, Debug, PartialEq)]
27838        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27839    }
27840
27841    impl ConnectorEnforcement {
27842        /// Gets the enum value.
27843        ///
27844        /// Returns `None` if the enum contains an unknown value deserialized from
27845        /// the string representation of enums.
27846        pub fn value(&self) -> std::option::Option<i32> {
27847            match self {
27848                Self::Unspecified => std::option::Option::Some(0),
27849                Self::NotRequired => std::option::Option::Some(1),
27850                Self::Required => std::option::Option::Some(2),
27851                Self::UnknownValue(u) => u.0.value(),
27852            }
27853        }
27854
27855        /// Gets the enum value as a string.
27856        ///
27857        /// Returns `None` if the enum contains an unknown value deserialized from
27858        /// the integer representation of enums.
27859        pub fn name(&self) -> std::option::Option<&str> {
27860            match self {
27861                Self::Unspecified => std::option::Option::Some("CONNECTOR_ENFORCEMENT_UNSPECIFIED"),
27862                Self::NotRequired => std::option::Option::Some("NOT_REQUIRED"),
27863                Self::Required => std::option::Option::Some("REQUIRED"),
27864                Self::UnknownValue(u) => u.0.name(),
27865            }
27866        }
27867    }
27868
27869    impl std::default::Default for ConnectorEnforcement {
27870        fn default() -> Self {
27871            use std::convert::From;
27872            Self::from(0)
27873        }
27874    }
27875
27876    impl std::fmt::Display for ConnectorEnforcement {
27877        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27878            wkt::internal::display_enum(f, self.name(), self.value())
27879        }
27880    }
27881
27882    impl std::convert::From<i32> for ConnectorEnforcement {
27883        fn from(value: i32) -> Self {
27884            match value {
27885                0 => Self::Unspecified,
27886                1 => Self::NotRequired,
27887                2 => Self::Required,
27888                _ => Self::UnknownValue(connector_enforcement::UnknownValue(
27889                    wkt::internal::UnknownEnumValue::Integer(value),
27890                )),
27891            }
27892        }
27893    }
27894
27895    impl std::convert::From<&str> for ConnectorEnforcement {
27896        fn from(value: &str) -> Self {
27897            use std::string::ToString;
27898            match value {
27899                "CONNECTOR_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
27900                "NOT_REQUIRED" => Self::NotRequired,
27901                "REQUIRED" => Self::Required,
27902                _ => Self::UnknownValue(connector_enforcement::UnknownValue(
27903                    wkt::internal::UnknownEnumValue::String(value.to_string()),
27904                )),
27905            }
27906        }
27907    }
27908
27909    impl serde::ser::Serialize for ConnectorEnforcement {
27910        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27911        where
27912            S: serde::Serializer,
27913        {
27914            match self {
27915                Self::Unspecified => serializer.serialize_i32(0),
27916                Self::NotRequired => serializer.serialize_i32(1),
27917                Self::Required => serializer.serialize_i32(2),
27918                Self::UnknownValue(u) => u.0.serialize(serializer),
27919            }
27920        }
27921    }
27922
27923    impl<'de> serde::de::Deserialize<'de> for ConnectorEnforcement {
27924        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27925        where
27926            D: serde::Deserializer<'de>,
27927        {
27928            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectorEnforcement>::new(
27929                ".google.cloud.sql.v1.Settings.ConnectorEnforcement",
27930            ))
27931        }
27932    }
27933
27934    /// ExecuteSql API's access to the instance.
27935    ///
27936    /// # Working with unknown values
27937    ///
27938    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27939    /// additional enum variants at any time. Adding new variants is not considered
27940    /// a breaking change. Applications should write their code in anticipation of:
27941    ///
27942    /// - New values appearing in future releases of the client library, **and**
27943    /// - New values received dynamically, without application changes.
27944    ///
27945    /// Please consult the [Working with enums] section in the user guide for some
27946    /// guidelines.
27947    ///
27948    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27949    #[derive(Clone, Debug, PartialEq)]
27950    #[non_exhaustive]
27951    pub enum DataApiAccess {
27952        /// Unspecified, effectively the same as `DISALLOW_DATA_API`.
27953        Unspecified,
27954        /// Disallow using ExecuteSql API to connect to the instance.
27955        DisallowDataApi,
27956        /// Allow using ExecuteSql API to connect to the instance. For private IP
27957        /// instances, this allows authorized users to access the instance from
27958        /// the public internet using ExecuteSql API.
27959        AllowDataApi,
27960        /// If set, the enum was initialized with an unknown value.
27961        ///
27962        /// Applications can examine the value using [DataApiAccess::value] or
27963        /// [DataApiAccess::name].
27964        UnknownValue(data_api_access::UnknownValue),
27965    }
27966
27967    #[doc(hidden)]
27968    pub mod data_api_access {
27969        #[allow(unused_imports)]
27970        use super::*;
27971        #[derive(Clone, Debug, PartialEq)]
27972        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27973    }
27974
27975    impl DataApiAccess {
27976        /// Gets the enum value.
27977        ///
27978        /// Returns `None` if the enum contains an unknown value deserialized from
27979        /// the string representation of enums.
27980        pub fn value(&self) -> std::option::Option<i32> {
27981            match self {
27982                Self::Unspecified => std::option::Option::Some(0),
27983                Self::DisallowDataApi => std::option::Option::Some(1),
27984                Self::AllowDataApi => std::option::Option::Some(2),
27985                Self::UnknownValue(u) => u.0.value(),
27986            }
27987        }
27988
27989        /// Gets the enum value as a string.
27990        ///
27991        /// Returns `None` if the enum contains an unknown value deserialized from
27992        /// the integer representation of enums.
27993        pub fn name(&self) -> std::option::Option<&str> {
27994            match self {
27995                Self::Unspecified => std::option::Option::Some("DATA_API_ACCESS_UNSPECIFIED"),
27996                Self::DisallowDataApi => std::option::Option::Some("DISALLOW_DATA_API"),
27997                Self::AllowDataApi => std::option::Option::Some("ALLOW_DATA_API"),
27998                Self::UnknownValue(u) => u.0.name(),
27999            }
28000        }
28001    }
28002
28003    impl std::default::Default for DataApiAccess {
28004        fn default() -> Self {
28005            use std::convert::From;
28006            Self::from(0)
28007        }
28008    }
28009
28010    impl std::fmt::Display for DataApiAccess {
28011        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28012            wkt::internal::display_enum(f, self.name(), self.value())
28013        }
28014    }
28015
28016    impl std::convert::From<i32> for DataApiAccess {
28017        fn from(value: i32) -> Self {
28018            match value {
28019                0 => Self::Unspecified,
28020                1 => Self::DisallowDataApi,
28021                2 => Self::AllowDataApi,
28022                _ => Self::UnknownValue(data_api_access::UnknownValue(
28023                    wkt::internal::UnknownEnumValue::Integer(value),
28024                )),
28025            }
28026        }
28027    }
28028
28029    impl std::convert::From<&str> for DataApiAccess {
28030        fn from(value: &str) -> Self {
28031            use std::string::ToString;
28032            match value {
28033                "DATA_API_ACCESS_UNSPECIFIED" => Self::Unspecified,
28034                "DISALLOW_DATA_API" => Self::DisallowDataApi,
28035                "ALLOW_DATA_API" => Self::AllowDataApi,
28036                _ => Self::UnknownValue(data_api_access::UnknownValue(
28037                    wkt::internal::UnknownEnumValue::String(value.to_string()),
28038                )),
28039            }
28040        }
28041    }
28042
28043    impl serde::ser::Serialize for DataApiAccess {
28044        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28045        where
28046            S: serde::Serializer,
28047        {
28048            match self {
28049                Self::Unspecified => serializer.serialize_i32(0),
28050                Self::DisallowDataApi => serializer.serialize_i32(1),
28051                Self::AllowDataApi => serializer.serialize_i32(2),
28052                Self::UnknownValue(u) => u.0.serialize(serializer),
28053            }
28054        }
28055    }
28056
28057    impl<'de> serde::de::Deserialize<'de> for DataApiAccess {
28058        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28059        where
28060            D: serde::Deserializer<'de>,
28061        {
28062            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataApiAccess>::new(
28063                ".google.cloud.sql.v1.Settings.DataApiAccess",
28064            ))
28065        }
28066    }
28067}
28068
28069/// Performance Capture configuration.
28070#[derive(Clone, Default, PartialEq)]
28071#[non_exhaustive]
28072pub struct PerformanceCaptureConfig {
28073    /// Optional. Enable or disable the Performance Capture feature.
28074    pub enabled: std::option::Option<bool>,
28075
28076    /// Optional. The time interval in seconds between any two probes.
28077    pub probing_interval_seconds: std::option::Option<i32>,
28078
28079    /// Optional. The minimum number of consecutive readings above threshold that
28080    /// triggers instance state capture.
28081    pub probe_threshold: std::option::Option<i32>,
28082
28083    /// Optional. The minimum number of server threads running to trigger the
28084    /// capture on primary.
28085    pub running_threads_threshold: std::option::Option<i32>,
28086
28087    /// Optional. The minimum number of seconds replica must be lagging behind
28088    /// primary to trigger capture on replica.
28089    pub seconds_behind_source_threshold: std::option::Option<i32>,
28090
28091    /// Optional. The amount of time in seconds that a transaction needs to have
28092    /// been open before the watcher starts recording it.
28093    pub transaction_duration_threshold: std::option::Option<i32>,
28094
28095    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28096}
28097
28098impl PerformanceCaptureConfig {
28099    /// Creates a new default instance.
28100    pub fn new() -> Self {
28101        std::default::Default::default()
28102    }
28103
28104    /// Sets the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
28105    ///
28106    /// # Example
28107    /// ```ignore,no_run
28108    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28109    /// let x = PerformanceCaptureConfig::new().set_enabled(true);
28110    /// ```
28111    pub fn set_enabled<T>(mut self, v: T) -> Self
28112    where
28113        T: std::convert::Into<bool>,
28114    {
28115        self.enabled = std::option::Option::Some(v.into());
28116        self
28117    }
28118
28119    /// Sets or clears the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
28120    ///
28121    /// # Example
28122    /// ```ignore,no_run
28123    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28124    /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(Some(false));
28125    /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(None::<bool>);
28126    /// ```
28127    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28128    where
28129        T: std::convert::Into<bool>,
28130    {
28131        self.enabled = v.map(|x| x.into());
28132        self
28133    }
28134
28135    /// Sets the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
28136    ///
28137    /// # Example
28138    /// ```ignore,no_run
28139    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28140    /// let x = PerformanceCaptureConfig::new().set_probing_interval_seconds(42);
28141    /// ```
28142    pub fn set_probing_interval_seconds<T>(mut self, v: T) -> Self
28143    where
28144        T: std::convert::Into<i32>,
28145    {
28146        self.probing_interval_seconds = std::option::Option::Some(v.into());
28147        self
28148    }
28149
28150    /// Sets or clears the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
28151    ///
28152    /// # Example
28153    /// ```ignore,no_run
28154    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28155    /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(Some(42));
28156    /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(None::<i32>);
28157    /// ```
28158    pub fn set_or_clear_probing_interval_seconds<T>(mut self, v: std::option::Option<T>) -> Self
28159    where
28160        T: std::convert::Into<i32>,
28161    {
28162        self.probing_interval_seconds = v.map(|x| x.into());
28163        self
28164    }
28165
28166    /// Sets the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
28167    ///
28168    /// # Example
28169    /// ```ignore,no_run
28170    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28171    /// let x = PerformanceCaptureConfig::new().set_probe_threshold(42);
28172    /// ```
28173    pub fn set_probe_threshold<T>(mut self, v: T) -> Self
28174    where
28175        T: std::convert::Into<i32>,
28176    {
28177        self.probe_threshold = std::option::Option::Some(v.into());
28178        self
28179    }
28180
28181    /// Sets or clears the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
28182    ///
28183    /// # Example
28184    /// ```ignore,no_run
28185    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28186    /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(Some(42));
28187    /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(None::<i32>);
28188    /// ```
28189    pub fn set_or_clear_probe_threshold<T>(mut self, v: std::option::Option<T>) -> Self
28190    where
28191        T: std::convert::Into<i32>,
28192    {
28193        self.probe_threshold = v.map(|x| x.into());
28194        self
28195    }
28196
28197    /// Sets the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
28198    ///
28199    /// # Example
28200    /// ```ignore,no_run
28201    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28202    /// let x = PerformanceCaptureConfig::new().set_running_threads_threshold(42);
28203    /// ```
28204    pub fn set_running_threads_threshold<T>(mut self, v: T) -> Self
28205    where
28206        T: std::convert::Into<i32>,
28207    {
28208        self.running_threads_threshold = std::option::Option::Some(v.into());
28209        self
28210    }
28211
28212    /// Sets or clears the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
28213    ///
28214    /// # Example
28215    /// ```ignore,no_run
28216    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28217    /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(Some(42));
28218    /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(None::<i32>);
28219    /// ```
28220    pub fn set_or_clear_running_threads_threshold<T>(mut self, v: std::option::Option<T>) -> Self
28221    where
28222        T: std::convert::Into<i32>,
28223    {
28224        self.running_threads_threshold = v.map(|x| x.into());
28225        self
28226    }
28227
28228    /// Sets the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
28229    ///
28230    /// # Example
28231    /// ```ignore,no_run
28232    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28233    /// let x = PerformanceCaptureConfig::new().set_seconds_behind_source_threshold(42);
28234    /// ```
28235    pub fn set_seconds_behind_source_threshold<T>(mut self, v: T) -> Self
28236    where
28237        T: std::convert::Into<i32>,
28238    {
28239        self.seconds_behind_source_threshold = std::option::Option::Some(v.into());
28240        self
28241    }
28242
28243    /// Sets or clears the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
28244    ///
28245    /// # Example
28246    /// ```ignore,no_run
28247    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28248    /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(Some(42));
28249    /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(None::<i32>);
28250    /// ```
28251    pub fn set_or_clear_seconds_behind_source_threshold<T>(
28252        mut self,
28253        v: std::option::Option<T>,
28254    ) -> Self
28255    where
28256        T: std::convert::Into<i32>,
28257    {
28258        self.seconds_behind_source_threshold = v.map(|x| x.into());
28259        self
28260    }
28261
28262    /// Sets the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
28263    ///
28264    /// # Example
28265    /// ```ignore,no_run
28266    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28267    /// let x = PerformanceCaptureConfig::new().set_transaction_duration_threshold(42);
28268    /// ```
28269    pub fn set_transaction_duration_threshold<T>(mut self, v: T) -> Self
28270    where
28271        T: std::convert::Into<i32>,
28272    {
28273        self.transaction_duration_threshold = std::option::Option::Some(v.into());
28274        self
28275    }
28276
28277    /// Sets or clears the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
28278    ///
28279    /// # Example
28280    /// ```ignore,no_run
28281    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28282    /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(Some(42));
28283    /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(None::<i32>);
28284    /// ```
28285    pub fn set_or_clear_transaction_duration_threshold<T>(
28286        mut self,
28287        v: std::option::Option<T>,
28288    ) -> Self
28289    where
28290        T: std::convert::Into<i32>,
28291    {
28292        self.transaction_duration_threshold = v.map(|x| x.into());
28293        self
28294    }
28295}
28296
28297impl wkt::message::Message for PerformanceCaptureConfig {
28298    fn typename() -> &'static str {
28299        "type.googleapis.com/google.cloud.sql.v1.PerformanceCaptureConfig"
28300    }
28301}
28302
28303/// Connection pool flags for Cloud SQL instances managed connection pool
28304/// configuration.
28305#[derive(Clone, Default, PartialEq)]
28306#[non_exhaustive]
28307pub struct ConnectionPoolFlags {
28308    /// Required. The name of the flag.
28309    pub name: std::string::String,
28310
28311    /// Required. The value of the flag. Boolean flags are set to `on` for true
28312    /// and `off` for false. This field must be omitted if the flag
28313    /// doesn't take a value.
28314    pub value: std::string::String,
28315
28316    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28317}
28318
28319impl ConnectionPoolFlags {
28320    /// Creates a new default instance.
28321    pub fn new() -> Self {
28322        std::default::Default::default()
28323    }
28324
28325    /// Sets the value of [name][crate::model::ConnectionPoolFlags::name].
28326    ///
28327    /// # Example
28328    /// ```ignore,no_run
28329    /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
28330    /// let x = ConnectionPoolFlags::new().set_name("example");
28331    /// ```
28332    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28333        self.name = v.into();
28334        self
28335    }
28336
28337    /// Sets the value of [value][crate::model::ConnectionPoolFlags::value].
28338    ///
28339    /// # Example
28340    /// ```ignore,no_run
28341    /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
28342    /// let x = ConnectionPoolFlags::new().set_value("example");
28343    /// ```
28344    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28345        self.value = v.into();
28346        self
28347    }
28348}
28349
28350impl wkt::message::Message for ConnectionPoolFlags {
28351    fn typename() -> &'static str {
28352        "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolFlags"
28353    }
28354}
28355
28356/// The managed connection pooling configuration.
28357#[derive(Clone, Default, PartialEq)]
28358#[non_exhaustive]
28359pub struct ConnectionPoolConfig {
28360    /// Whether managed connection pooling is enabled.
28361    pub connection_pooling_enabled: std::option::Option<bool>,
28362
28363    /// Optional. List of connection pool configuration flags.
28364    pub flags: std::vec::Vec<crate::model::ConnectionPoolFlags>,
28365
28366    /// Output only. Number of connection poolers.
28367    pub pooler_count: std::option::Option<i32>,
28368
28369    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28370}
28371
28372impl ConnectionPoolConfig {
28373    /// Creates a new default instance.
28374    pub fn new() -> Self {
28375        std::default::Default::default()
28376    }
28377
28378    /// Sets the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
28379    ///
28380    /// # Example
28381    /// ```ignore,no_run
28382    /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28383    /// let x = ConnectionPoolConfig::new().set_connection_pooling_enabled(true);
28384    /// ```
28385    pub fn set_connection_pooling_enabled<T>(mut self, v: T) -> Self
28386    where
28387        T: std::convert::Into<bool>,
28388    {
28389        self.connection_pooling_enabled = std::option::Option::Some(v.into());
28390        self
28391    }
28392
28393    /// Sets or clears the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
28394    ///
28395    /// # Example
28396    /// ```ignore,no_run
28397    /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28398    /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(Some(false));
28399    /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(None::<bool>);
28400    /// ```
28401    pub fn set_or_clear_connection_pooling_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28402    where
28403        T: std::convert::Into<bool>,
28404    {
28405        self.connection_pooling_enabled = v.map(|x| x.into());
28406        self
28407    }
28408
28409    /// Sets the value of [flags][crate::model::ConnectionPoolConfig::flags].
28410    ///
28411    /// # Example
28412    /// ```ignore,no_run
28413    /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28414    /// use google_cloud_sql_v1::model::ConnectionPoolFlags;
28415    /// let x = ConnectionPoolConfig::new()
28416    ///     .set_flags([
28417    ///         ConnectionPoolFlags::default()/* use setters */,
28418    ///         ConnectionPoolFlags::default()/* use (different) setters */,
28419    ///     ]);
28420    /// ```
28421    pub fn set_flags<T, V>(mut self, v: T) -> Self
28422    where
28423        T: std::iter::IntoIterator<Item = V>,
28424        V: std::convert::Into<crate::model::ConnectionPoolFlags>,
28425    {
28426        use std::iter::Iterator;
28427        self.flags = v.into_iter().map(|i| i.into()).collect();
28428        self
28429    }
28430
28431    /// Sets the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
28432    ///
28433    /// # Example
28434    /// ```ignore,no_run
28435    /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28436    /// let x = ConnectionPoolConfig::new().set_pooler_count(42);
28437    /// ```
28438    pub fn set_pooler_count<T>(mut self, v: T) -> Self
28439    where
28440        T: std::convert::Into<i32>,
28441    {
28442        self.pooler_count = std::option::Option::Some(v.into());
28443        self
28444    }
28445
28446    /// Sets or clears the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
28447    ///
28448    /// # Example
28449    /// ```ignore,no_run
28450    /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28451    /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(Some(42));
28452    /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(None::<i32>);
28453    /// ```
28454    pub fn set_or_clear_pooler_count<T>(mut self, v: std::option::Option<T>) -> Self
28455    where
28456        T: std::convert::Into<i32>,
28457    {
28458        self.pooler_count = v.map(|x| x.into());
28459        self
28460    }
28461}
28462
28463impl wkt::message::Message for ConnectionPoolConfig {
28464    fn typename() -> &'static str {
28465        "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolConfig"
28466    }
28467}
28468
28469/// The read pool auto-scale configuration.
28470#[derive(Clone, Default, PartialEq)]
28471#[non_exhaustive]
28472pub struct ReadPoolAutoScaleConfig {
28473    /// Indicates whether read pool auto scaling is enabled.
28474    pub enabled: std::option::Option<bool>,
28475
28476    /// Minimum number of read pool nodes to be maintained.
28477    pub min_node_count: std::option::Option<i32>,
28478
28479    /// Maximum number of read pool nodes to be maintained.
28480    pub max_node_count: std::option::Option<i32>,
28481
28482    /// Optional. Target metrics for read pool auto scaling.
28483    pub target_metrics: std::vec::Vec<crate::model::read_pool_auto_scale_config::TargetMetric>,
28484
28485    /// Indicates whether read pool auto scaling supports scale in operations
28486    /// (removing nodes).
28487    pub disable_scale_in: std::option::Option<bool>,
28488
28489    /// The cooldown period for scale-in operations.
28490    pub scale_in_cooldown_seconds: std::option::Option<i32>,
28491
28492    /// The cooldown period for scale-out operations.
28493    pub scale_out_cooldown_seconds: std::option::Option<i32>,
28494
28495    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28496}
28497
28498impl ReadPoolAutoScaleConfig {
28499    /// Creates a new default instance.
28500    pub fn new() -> Self {
28501        std::default::Default::default()
28502    }
28503
28504    /// Sets the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
28505    ///
28506    /// # Example
28507    /// ```ignore,no_run
28508    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28509    /// let x = ReadPoolAutoScaleConfig::new().set_enabled(true);
28510    /// ```
28511    pub fn set_enabled<T>(mut self, v: T) -> Self
28512    where
28513        T: std::convert::Into<bool>,
28514    {
28515        self.enabled = std::option::Option::Some(v.into());
28516        self
28517    }
28518
28519    /// Sets or clears the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
28520    ///
28521    /// # Example
28522    /// ```ignore,no_run
28523    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28524    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(Some(false));
28525    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(None::<bool>);
28526    /// ```
28527    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28528    where
28529        T: std::convert::Into<bool>,
28530    {
28531        self.enabled = v.map(|x| x.into());
28532        self
28533    }
28534
28535    /// Sets the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
28536    ///
28537    /// # Example
28538    /// ```ignore,no_run
28539    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28540    /// let x = ReadPoolAutoScaleConfig::new().set_min_node_count(42);
28541    /// ```
28542    pub fn set_min_node_count<T>(mut self, v: T) -> Self
28543    where
28544        T: std::convert::Into<i32>,
28545    {
28546        self.min_node_count = std::option::Option::Some(v.into());
28547        self
28548    }
28549
28550    /// Sets or clears the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
28551    ///
28552    /// # Example
28553    /// ```ignore,no_run
28554    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28555    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(Some(42));
28556    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(None::<i32>);
28557    /// ```
28558    pub fn set_or_clear_min_node_count<T>(mut self, v: std::option::Option<T>) -> Self
28559    where
28560        T: std::convert::Into<i32>,
28561    {
28562        self.min_node_count = v.map(|x| x.into());
28563        self
28564    }
28565
28566    /// Sets the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
28567    ///
28568    /// # Example
28569    /// ```ignore,no_run
28570    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28571    /// let x = ReadPoolAutoScaleConfig::new().set_max_node_count(42);
28572    /// ```
28573    pub fn set_max_node_count<T>(mut self, v: T) -> Self
28574    where
28575        T: std::convert::Into<i32>,
28576    {
28577        self.max_node_count = std::option::Option::Some(v.into());
28578        self
28579    }
28580
28581    /// Sets or clears the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
28582    ///
28583    /// # Example
28584    /// ```ignore,no_run
28585    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28586    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(Some(42));
28587    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(None::<i32>);
28588    /// ```
28589    pub fn set_or_clear_max_node_count<T>(mut self, v: std::option::Option<T>) -> Self
28590    where
28591        T: std::convert::Into<i32>,
28592    {
28593        self.max_node_count = v.map(|x| x.into());
28594        self
28595    }
28596
28597    /// Sets the value of [target_metrics][crate::model::ReadPoolAutoScaleConfig::target_metrics].
28598    ///
28599    /// # Example
28600    /// ```ignore,no_run
28601    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28602    /// use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28603    /// let x = ReadPoolAutoScaleConfig::new()
28604    ///     .set_target_metrics([
28605    ///         TargetMetric::default()/* use setters */,
28606    ///         TargetMetric::default()/* use (different) setters */,
28607    ///     ]);
28608    /// ```
28609    pub fn set_target_metrics<T, V>(mut self, v: T) -> Self
28610    where
28611        T: std::iter::IntoIterator<Item = V>,
28612        V: std::convert::Into<crate::model::read_pool_auto_scale_config::TargetMetric>,
28613    {
28614        use std::iter::Iterator;
28615        self.target_metrics = v.into_iter().map(|i| i.into()).collect();
28616        self
28617    }
28618
28619    /// Sets the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
28620    ///
28621    /// # Example
28622    /// ```ignore,no_run
28623    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28624    /// let x = ReadPoolAutoScaleConfig::new().set_disable_scale_in(true);
28625    /// ```
28626    pub fn set_disable_scale_in<T>(mut self, v: T) -> Self
28627    where
28628        T: std::convert::Into<bool>,
28629    {
28630        self.disable_scale_in = std::option::Option::Some(v.into());
28631        self
28632    }
28633
28634    /// Sets or clears the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
28635    ///
28636    /// # Example
28637    /// ```ignore,no_run
28638    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28639    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(Some(false));
28640    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(None::<bool>);
28641    /// ```
28642    pub fn set_or_clear_disable_scale_in<T>(mut self, v: std::option::Option<T>) -> Self
28643    where
28644        T: std::convert::Into<bool>,
28645    {
28646        self.disable_scale_in = v.map(|x| x.into());
28647        self
28648    }
28649
28650    /// Sets the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
28651    ///
28652    /// # Example
28653    /// ```ignore,no_run
28654    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28655    /// let x = ReadPoolAutoScaleConfig::new().set_scale_in_cooldown_seconds(42);
28656    /// ```
28657    pub fn set_scale_in_cooldown_seconds<T>(mut self, v: T) -> Self
28658    where
28659        T: std::convert::Into<i32>,
28660    {
28661        self.scale_in_cooldown_seconds = std::option::Option::Some(v.into());
28662        self
28663    }
28664
28665    /// Sets or clears the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
28666    ///
28667    /// # Example
28668    /// ```ignore,no_run
28669    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28670    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(Some(42));
28671    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(None::<i32>);
28672    /// ```
28673    pub fn set_or_clear_scale_in_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
28674    where
28675        T: std::convert::Into<i32>,
28676    {
28677        self.scale_in_cooldown_seconds = v.map(|x| x.into());
28678        self
28679    }
28680
28681    /// Sets the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
28682    ///
28683    /// # Example
28684    /// ```ignore,no_run
28685    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28686    /// let x = ReadPoolAutoScaleConfig::new().set_scale_out_cooldown_seconds(42);
28687    /// ```
28688    pub fn set_scale_out_cooldown_seconds<T>(mut self, v: T) -> Self
28689    where
28690        T: std::convert::Into<i32>,
28691    {
28692        self.scale_out_cooldown_seconds = std::option::Option::Some(v.into());
28693        self
28694    }
28695
28696    /// Sets or clears the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
28697    ///
28698    /// # Example
28699    /// ```ignore,no_run
28700    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28701    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(Some(42));
28702    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(None::<i32>);
28703    /// ```
28704    pub fn set_or_clear_scale_out_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
28705    where
28706        T: std::convert::Into<i32>,
28707    {
28708        self.scale_out_cooldown_seconds = v.map(|x| x.into());
28709        self
28710    }
28711}
28712
28713impl wkt::message::Message for ReadPoolAutoScaleConfig {
28714    fn typename() -> &'static str {
28715        "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig"
28716    }
28717}
28718
28719/// Defines additional types related to [ReadPoolAutoScaleConfig].
28720pub mod read_pool_auto_scale_config {
28721    #[allow(unused_imports)]
28722    use super::*;
28723
28724    /// Target metric for read pool auto scaling.
28725    #[derive(Clone, Default, PartialEq)]
28726    #[non_exhaustive]
28727    pub struct TargetMetric {
28728        /// The metric name to be used for auto scaling.
28729        pub metric: std::option::Option<std::string::String>,
28730
28731        /// The target value for the metric.
28732        pub target_value: std::option::Option<f32>,
28733
28734        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28735    }
28736
28737    impl TargetMetric {
28738        /// Creates a new default instance.
28739        pub fn new() -> Self {
28740            std::default::Default::default()
28741        }
28742
28743        /// Sets the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
28744        ///
28745        /// # Example
28746        /// ```ignore,no_run
28747        /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28748        /// let x = TargetMetric::new().set_metric("example");
28749        /// ```
28750        pub fn set_metric<T>(mut self, v: T) -> Self
28751        where
28752            T: std::convert::Into<std::string::String>,
28753        {
28754            self.metric = std::option::Option::Some(v.into());
28755            self
28756        }
28757
28758        /// Sets or clears the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
28759        ///
28760        /// # Example
28761        /// ```ignore,no_run
28762        /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28763        /// let x = TargetMetric::new().set_or_clear_metric(Some("example"));
28764        /// let x = TargetMetric::new().set_or_clear_metric(None::<String>);
28765        /// ```
28766        pub fn set_or_clear_metric<T>(mut self, v: std::option::Option<T>) -> Self
28767        where
28768            T: std::convert::Into<std::string::String>,
28769        {
28770            self.metric = v.map(|x| x.into());
28771            self
28772        }
28773
28774        /// Sets the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
28775        ///
28776        /// # Example
28777        /// ```ignore,no_run
28778        /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28779        /// let x = TargetMetric::new().set_target_value(42.0);
28780        /// ```
28781        pub fn set_target_value<T>(mut self, v: T) -> Self
28782        where
28783            T: std::convert::Into<f32>,
28784        {
28785            self.target_value = std::option::Option::Some(v.into());
28786            self
28787        }
28788
28789        /// Sets or clears the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
28790        ///
28791        /// # Example
28792        /// ```ignore,no_run
28793        /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28794        /// let x = TargetMetric::new().set_or_clear_target_value(Some(42.0));
28795        /// let x = TargetMetric::new().set_or_clear_target_value(None::<f32>);
28796        /// ```
28797        pub fn set_or_clear_target_value<T>(mut self, v: std::option::Option<T>) -> Self
28798        where
28799            T: std::convert::Into<f32>,
28800        {
28801            self.target_value = v.map(|x| x.into());
28802            self
28803        }
28804    }
28805
28806    impl wkt::message::Message for TargetMetric {
28807        fn typename() -> &'static str {
28808            "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric"
28809        }
28810    }
28811}
28812
28813/// Specifies options for controlling advanced machine features.
28814#[derive(Clone, Default, PartialEq)]
28815#[non_exhaustive]
28816pub struct AdvancedMachineFeatures {
28817    /// The number of threads per physical core.
28818    pub threads_per_core: i32,
28819
28820    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28821}
28822
28823impl AdvancedMachineFeatures {
28824    /// Creates a new default instance.
28825    pub fn new() -> Self {
28826        std::default::Default::default()
28827    }
28828
28829    /// Sets the value of [threads_per_core][crate::model::AdvancedMachineFeatures::threads_per_core].
28830    ///
28831    /// # Example
28832    /// ```ignore,no_run
28833    /// # use google_cloud_sql_v1::model::AdvancedMachineFeatures;
28834    /// let x = AdvancedMachineFeatures::new().set_threads_per_core(42);
28835    /// ```
28836    pub fn set_threads_per_core<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
28837        self.threads_per_core = v.into();
28838        self
28839    }
28840}
28841
28842impl wkt::message::Message for AdvancedMachineFeatures {
28843    fn typename() -> &'static str {
28844        "type.googleapis.com/google.cloud.sql.v1.AdvancedMachineFeatures"
28845    }
28846}
28847
28848/// SslCerts Resource
28849#[derive(Clone, Default, PartialEq)]
28850#[non_exhaustive]
28851pub struct SslCert {
28852    /// This is always `sql#sslCert`.
28853    pub kind: std::string::String,
28854
28855    /// Serial number, as extracted from the certificate.
28856    pub cert_serial_number: std::string::String,
28857
28858    /// PEM representation.
28859    pub cert: std::string::String,
28860
28861    /// The time when the certificate was created in [RFC
28862    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
28863    /// `2012-11-15T16:19:00.094Z`
28864    pub create_time: std::option::Option<wkt::Timestamp>,
28865
28866    /// User supplied name.  Constrained to [a-zA-Z.-_ ]+.
28867    pub common_name: std::string::String,
28868
28869    /// The time when the certificate expires in [RFC
28870    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
28871    /// `2012-11-15T16:19:00.094Z`.
28872    pub expiration_time: std::option::Option<wkt::Timestamp>,
28873
28874    /// Sha1 Fingerprint.
28875    pub sha1_fingerprint: std::string::String,
28876
28877    /// Name of the database instance.
28878    pub instance: std::string::String,
28879
28880    /// The URI of this resource.
28881    pub self_link: std::string::String,
28882
28883    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28884}
28885
28886impl SslCert {
28887    /// Creates a new default instance.
28888    pub fn new() -> Self {
28889        std::default::Default::default()
28890    }
28891
28892    /// Sets the value of [kind][crate::model::SslCert::kind].
28893    ///
28894    /// # Example
28895    /// ```ignore,no_run
28896    /// # use google_cloud_sql_v1::model::SslCert;
28897    /// let x = SslCert::new().set_kind("example");
28898    /// ```
28899    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28900        self.kind = v.into();
28901        self
28902    }
28903
28904    /// Sets the value of [cert_serial_number][crate::model::SslCert::cert_serial_number].
28905    ///
28906    /// # Example
28907    /// ```ignore,no_run
28908    /// # use google_cloud_sql_v1::model::SslCert;
28909    /// let x = SslCert::new().set_cert_serial_number("example");
28910    /// ```
28911    pub fn set_cert_serial_number<T: std::convert::Into<std::string::String>>(
28912        mut self,
28913        v: T,
28914    ) -> Self {
28915        self.cert_serial_number = v.into();
28916        self
28917    }
28918
28919    /// Sets the value of [cert][crate::model::SslCert::cert].
28920    ///
28921    /// # Example
28922    /// ```ignore,no_run
28923    /// # use google_cloud_sql_v1::model::SslCert;
28924    /// let x = SslCert::new().set_cert("example");
28925    /// ```
28926    pub fn set_cert<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28927        self.cert = v.into();
28928        self
28929    }
28930
28931    /// Sets the value of [create_time][crate::model::SslCert::create_time].
28932    ///
28933    /// # Example
28934    /// ```ignore,no_run
28935    /// # use google_cloud_sql_v1::model::SslCert;
28936    /// use wkt::Timestamp;
28937    /// let x = SslCert::new().set_create_time(Timestamp::default()/* use setters */);
28938    /// ```
28939    pub fn set_create_time<T>(mut self, v: T) -> Self
28940    where
28941        T: std::convert::Into<wkt::Timestamp>,
28942    {
28943        self.create_time = std::option::Option::Some(v.into());
28944        self
28945    }
28946
28947    /// Sets or clears the value of [create_time][crate::model::SslCert::create_time].
28948    ///
28949    /// # Example
28950    /// ```ignore,no_run
28951    /// # use google_cloud_sql_v1::model::SslCert;
28952    /// use wkt::Timestamp;
28953    /// let x = SslCert::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
28954    /// let x = SslCert::new().set_or_clear_create_time(None::<Timestamp>);
28955    /// ```
28956    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
28957    where
28958        T: std::convert::Into<wkt::Timestamp>,
28959    {
28960        self.create_time = v.map(|x| x.into());
28961        self
28962    }
28963
28964    /// Sets the value of [common_name][crate::model::SslCert::common_name].
28965    ///
28966    /// # Example
28967    /// ```ignore,no_run
28968    /// # use google_cloud_sql_v1::model::SslCert;
28969    /// let x = SslCert::new().set_common_name("example");
28970    /// ```
28971    pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28972        self.common_name = v.into();
28973        self
28974    }
28975
28976    /// Sets the value of [expiration_time][crate::model::SslCert::expiration_time].
28977    ///
28978    /// # Example
28979    /// ```ignore,no_run
28980    /// # use google_cloud_sql_v1::model::SslCert;
28981    /// use wkt::Timestamp;
28982    /// let x = SslCert::new().set_expiration_time(Timestamp::default()/* use setters */);
28983    /// ```
28984    pub fn set_expiration_time<T>(mut self, v: T) -> Self
28985    where
28986        T: std::convert::Into<wkt::Timestamp>,
28987    {
28988        self.expiration_time = std::option::Option::Some(v.into());
28989        self
28990    }
28991
28992    /// Sets or clears the value of [expiration_time][crate::model::SslCert::expiration_time].
28993    ///
28994    /// # Example
28995    /// ```ignore,no_run
28996    /// # use google_cloud_sql_v1::model::SslCert;
28997    /// use wkt::Timestamp;
28998    /// let x = SslCert::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
28999    /// let x = SslCert::new().set_or_clear_expiration_time(None::<Timestamp>);
29000    /// ```
29001    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
29002    where
29003        T: std::convert::Into<wkt::Timestamp>,
29004    {
29005        self.expiration_time = v.map(|x| x.into());
29006        self
29007    }
29008
29009    /// Sets the value of [sha1_fingerprint][crate::model::SslCert::sha1_fingerprint].
29010    ///
29011    /// # Example
29012    /// ```ignore,no_run
29013    /// # use google_cloud_sql_v1::model::SslCert;
29014    /// let x = SslCert::new().set_sha1_fingerprint("example");
29015    /// ```
29016    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
29017        mut self,
29018        v: T,
29019    ) -> Self {
29020        self.sha1_fingerprint = v.into();
29021        self
29022    }
29023
29024    /// Sets the value of [instance][crate::model::SslCert::instance].
29025    ///
29026    /// # Example
29027    /// ```ignore,no_run
29028    /// # use google_cloud_sql_v1::model::SslCert;
29029    /// let x = SslCert::new().set_instance("example");
29030    /// ```
29031    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29032        self.instance = v.into();
29033        self
29034    }
29035
29036    /// Sets the value of [self_link][crate::model::SslCert::self_link].
29037    ///
29038    /// # Example
29039    /// ```ignore,no_run
29040    /// # use google_cloud_sql_v1::model::SslCert;
29041    /// let x = SslCert::new().set_self_link("example");
29042    /// ```
29043    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29044        self.self_link = v.into();
29045        self
29046    }
29047}
29048
29049impl wkt::message::Message for SslCert {
29050    fn typename() -> &'static str {
29051        "type.googleapis.com/google.cloud.sql.v1.SslCert"
29052    }
29053}
29054
29055/// SslCertDetail.
29056#[derive(Clone, Default, PartialEq)]
29057#[non_exhaustive]
29058pub struct SslCertDetail {
29059    /// The public information about the cert.
29060    pub cert_info: std::option::Option<crate::model::SslCert>,
29061
29062    /// The private key for the client cert, in pem format.  Keep private in order
29063    /// to protect your security.
29064    pub cert_private_key: std::string::String,
29065
29066    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29067}
29068
29069impl SslCertDetail {
29070    /// Creates a new default instance.
29071    pub fn new() -> Self {
29072        std::default::Default::default()
29073    }
29074
29075    /// Sets the value of [cert_info][crate::model::SslCertDetail::cert_info].
29076    ///
29077    /// # Example
29078    /// ```ignore,no_run
29079    /// # use google_cloud_sql_v1::model::SslCertDetail;
29080    /// use google_cloud_sql_v1::model::SslCert;
29081    /// let x = SslCertDetail::new().set_cert_info(SslCert::default()/* use setters */);
29082    /// ```
29083    pub fn set_cert_info<T>(mut self, v: T) -> Self
29084    where
29085        T: std::convert::Into<crate::model::SslCert>,
29086    {
29087        self.cert_info = std::option::Option::Some(v.into());
29088        self
29089    }
29090
29091    /// Sets or clears the value of [cert_info][crate::model::SslCertDetail::cert_info].
29092    ///
29093    /// # Example
29094    /// ```ignore,no_run
29095    /// # use google_cloud_sql_v1::model::SslCertDetail;
29096    /// use google_cloud_sql_v1::model::SslCert;
29097    /// let x = SslCertDetail::new().set_or_clear_cert_info(Some(SslCert::default()/* use setters */));
29098    /// let x = SslCertDetail::new().set_or_clear_cert_info(None::<SslCert>);
29099    /// ```
29100    pub fn set_or_clear_cert_info<T>(mut self, v: std::option::Option<T>) -> Self
29101    where
29102        T: std::convert::Into<crate::model::SslCert>,
29103    {
29104        self.cert_info = v.map(|x| x.into());
29105        self
29106    }
29107
29108    /// Sets the value of [cert_private_key][crate::model::SslCertDetail::cert_private_key].
29109    ///
29110    /// # Example
29111    /// ```ignore,no_run
29112    /// # use google_cloud_sql_v1::model::SslCertDetail;
29113    /// let x = SslCertDetail::new().set_cert_private_key("example");
29114    /// ```
29115    pub fn set_cert_private_key<T: std::convert::Into<std::string::String>>(
29116        mut self,
29117        v: T,
29118    ) -> Self {
29119        self.cert_private_key = v.into();
29120        self
29121    }
29122}
29123
29124impl wkt::message::Message for SslCertDetail {
29125    fn typename() -> &'static str {
29126        "type.googleapis.com/google.cloud.sql.v1.SslCertDetail"
29127    }
29128}
29129
29130/// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
29131#[derive(Clone, Default, PartialEq)]
29132#[non_exhaustive]
29133pub struct SqlActiveDirectoryConfig {
29134    /// This is always sql#activeDirectoryConfig.
29135    pub kind: std::string::String,
29136
29137    /// The name of the domain (e.g., mydomain.com).
29138    pub domain: std::string::String,
29139
29140    /// Optional. The mode of the Active Directory configuration.
29141    pub mode: crate::model::sql_active_directory_config::ActiveDirectoryMode,
29142
29143    /// Optional. Domain controller IPv4 addresses used to bootstrap Active
29144    /// Directory.
29145    pub dns_servers: std::vec::Vec<std::string::String>,
29146
29147    /// Optional. The secret manager key storing the administrator credential.
29148    /// (e.g., projects/{project}/secrets/{secret}).
29149    pub admin_credential_secret_name: std::string::String,
29150
29151    /// Optional. The organizational unit distinguished name. This is the full
29152    /// hierarchical path to the organizational unit.
29153    pub organizational_unit: std::string::String,
29154
29155    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29156}
29157
29158impl SqlActiveDirectoryConfig {
29159    /// Creates a new default instance.
29160    pub fn new() -> Self {
29161        std::default::Default::default()
29162    }
29163
29164    /// Sets the value of [kind][crate::model::SqlActiveDirectoryConfig::kind].
29165    ///
29166    /// # Example
29167    /// ```ignore,no_run
29168    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
29169    /// let x = SqlActiveDirectoryConfig::new().set_kind("example");
29170    /// ```
29171    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29172        self.kind = v.into();
29173        self
29174    }
29175
29176    /// Sets the value of [domain][crate::model::SqlActiveDirectoryConfig::domain].
29177    ///
29178    /// # Example
29179    /// ```ignore,no_run
29180    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
29181    /// let x = SqlActiveDirectoryConfig::new().set_domain("example");
29182    /// ```
29183    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29184        self.domain = v.into();
29185        self
29186    }
29187
29188    /// Sets the value of [mode][crate::model::SqlActiveDirectoryConfig::mode].
29189    ///
29190    /// # Example
29191    /// ```ignore,no_run
29192    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
29193    /// use google_cloud_sql_v1::model::sql_active_directory_config::ActiveDirectoryMode;
29194    /// let x0 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::ManagedActiveDirectory);
29195    /// let x1 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::CustomerManagedActiveDirectory);
29196    /// ```
29197    pub fn set_mode<
29198        T: std::convert::Into<crate::model::sql_active_directory_config::ActiveDirectoryMode>,
29199    >(
29200        mut self,
29201        v: T,
29202    ) -> Self {
29203        self.mode = v.into();
29204        self
29205    }
29206
29207    /// Sets the value of [dns_servers][crate::model::SqlActiveDirectoryConfig::dns_servers].
29208    ///
29209    /// # Example
29210    /// ```ignore,no_run
29211    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
29212    /// let x = SqlActiveDirectoryConfig::new().set_dns_servers(["a", "b", "c"]);
29213    /// ```
29214    pub fn set_dns_servers<T, V>(mut self, v: T) -> Self
29215    where
29216        T: std::iter::IntoIterator<Item = V>,
29217        V: std::convert::Into<std::string::String>,
29218    {
29219        use std::iter::Iterator;
29220        self.dns_servers = v.into_iter().map(|i| i.into()).collect();
29221        self
29222    }
29223
29224    /// Sets the value of [admin_credential_secret_name][crate::model::SqlActiveDirectoryConfig::admin_credential_secret_name].
29225    ///
29226    /// # Example
29227    /// ```ignore,no_run
29228    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
29229    /// let x = SqlActiveDirectoryConfig::new().set_admin_credential_secret_name("example");
29230    /// ```
29231    pub fn set_admin_credential_secret_name<T: std::convert::Into<std::string::String>>(
29232        mut self,
29233        v: T,
29234    ) -> Self {
29235        self.admin_credential_secret_name = v.into();
29236        self
29237    }
29238
29239    /// Sets the value of [organizational_unit][crate::model::SqlActiveDirectoryConfig::organizational_unit].
29240    ///
29241    /// # Example
29242    /// ```ignore,no_run
29243    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
29244    /// let x = SqlActiveDirectoryConfig::new().set_organizational_unit("example");
29245    /// ```
29246    pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
29247        mut self,
29248        v: T,
29249    ) -> Self {
29250        self.organizational_unit = v.into();
29251        self
29252    }
29253}
29254
29255impl wkt::message::Message for SqlActiveDirectoryConfig {
29256    fn typename() -> &'static str {
29257        "type.googleapis.com/google.cloud.sql.v1.SqlActiveDirectoryConfig"
29258    }
29259}
29260
29261/// Defines additional types related to [SqlActiveDirectoryConfig].
29262pub mod sql_active_directory_config {
29263    #[allow(unused_imports)]
29264    use super::*;
29265
29266    /// The modes of Active Directory configuration.
29267    ///
29268    /// # Working with unknown values
29269    ///
29270    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29271    /// additional enum variants at any time. Adding new variants is not considered
29272    /// a breaking change. Applications should write their code in anticipation of:
29273    ///
29274    /// - New values appearing in future releases of the client library, **and**
29275    /// - New values received dynamically, without application changes.
29276    ///
29277    /// Please consult the [Working with enums] section in the user guide for some
29278    /// guidelines.
29279    ///
29280    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
29281    #[derive(Clone, Debug, PartialEq)]
29282    #[non_exhaustive]
29283    pub enum ActiveDirectoryMode {
29284        /// Unspecified mode. Will default to MANAGED_ACTIVE_DIRECTORY if the mode is
29285        /// not specified to maintain backward compatibility.
29286        Unspecified,
29287        /// Managed Active Directory mode.
29288        ManagedActiveDirectory,
29289        /// Deprecated: Use CUSTOMER_MANAGED_ACTIVE_DIRECTORY instead.
29290        #[deprecated]
29291        SelfManagedActiveDirectory,
29292        /// Customer-managed Active Directory mode.
29293        CustomerManagedActiveDirectory,
29294        /// If set, the enum was initialized with an unknown value.
29295        ///
29296        /// Applications can examine the value using [ActiveDirectoryMode::value] or
29297        /// [ActiveDirectoryMode::name].
29298        UnknownValue(active_directory_mode::UnknownValue),
29299    }
29300
29301    #[doc(hidden)]
29302    pub mod active_directory_mode {
29303        #[allow(unused_imports)]
29304        use super::*;
29305        #[derive(Clone, Debug, PartialEq)]
29306        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29307    }
29308
29309    impl ActiveDirectoryMode {
29310        /// Gets the enum value.
29311        ///
29312        /// Returns `None` if the enum contains an unknown value deserialized from
29313        /// the string representation of enums.
29314        pub fn value(&self) -> std::option::Option<i32> {
29315            match self {
29316                Self::Unspecified => std::option::Option::Some(0),
29317                Self::ManagedActiveDirectory => std::option::Option::Some(1),
29318                Self::SelfManagedActiveDirectory => std::option::Option::Some(2),
29319                Self::CustomerManagedActiveDirectory => std::option::Option::Some(3),
29320                Self::UnknownValue(u) => u.0.value(),
29321            }
29322        }
29323
29324        /// Gets the enum value as a string.
29325        ///
29326        /// Returns `None` if the enum contains an unknown value deserialized from
29327        /// the integer representation of enums.
29328        pub fn name(&self) -> std::option::Option<&str> {
29329            match self {
29330                Self::Unspecified => std::option::Option::Some("ACTIVE_DIRECTORY_MODE_UNSPECIFIED"),
29331                Self::ManagedActiveDirectory => {
29332                    std::option::Option::Some("MANAGED_ACTIVE_DIRECTORY")
29333                }
29334                Self::SelfManagedActiveDirectory => {
29335                    std::option::Option::Some("SELF_MANAGED_ACTIVE_DIRECTORY")
29336                }
29337                Self::CustomerManagedActiveDirectory => {
29338                    std::option::Option::Some("CUSTOMER_MANAGED_ACTIVE_DIRECTORY")
29339                }
29340                Self::UnknownValue(u) => u.0.name(),
29341            }
29342        }
29343    }
29344
29345    impl std::default::Default for ActiveDirectoryMode {
29346        fn default() -> Self {
29347            use std::convert::From;
29348            Self::from(0)
29349        }
29350    }
29351
29352    impl std::fmt::Display for ActiveDirectoryMode {
29353        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29354            wkt::internal::display_enum(f, self.name(), self.value())
29355        }
29356    }
29357
29358    impl std::convert::From<i32> for ActiveDirectoryMode {
29359        fn from(value: i32) -> Self {
29360            match value {
29361                0 => Self::Unspecified,
29362                1 => Self::ManagedActiveDirectory,
29363                2 => Self::SelfManagedActiveDirectory,
29364                3 => Self::CustomerManagedActiveDirectory,
29365                _ => Self::UnknownValue(active_directory_mode::UnknownValue(
29366                    wkt::internal::UnknownEnumValue::Integer(value),
29367                )),
29368            }
29369        }
29370    }
29371
29372    impl std::convert::From<&str> for ActiveDirectoryMode {
29373        fn from(value: &str) -> Self {
29374            use std::string::ToString;
29375            match value {
29376                "ACTIVE_DIRECTORY_MODE_UNSPECIFIED" => Self::Unspecified,
29377                "MANAGED_ACTIVE_DIRECTORY" => Self::ManagedActiveDirectory,
29378                "SELF_MANAGED_ACTIVE_DIRECTORY" => Self::SelfManagedActiveDirectory,
29379                "CUSTOMER_MANAGED_ACTIVE_DIRECTORY" => Self::CustomerManagedActiveDirectory,
29380                _ => Self::UnknownValue(active_directory_mode::UnknownValue(
29381                    wkt::internal::UnknownEnumValue::String(value.to_string()),
29382                )),
29383            }
29384        }
29385    }
29386
29387    impl serde::ser::Serialize for ActiveDirectoryMode {
29388        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29389        where
29390            S: serde::Serializer,
29391        {
29392            match self {
29393                Self::Unspecified => serializer.serialize_i32(0),
29394                Self::ManagedActiveDirectory => serializer.serialize_i32(1),
29395                Self::SelfManagedActiveDirectory => serializer.serialize_i32(2),
29396                Self::CustomerManagedActiveDirectory => serializer.serialize_i32(3),
29397                Self::UnknownValue(u) => u.0.serialize(serializer),
29398            }
29399        }
29400    }
29401
29402    impl<'de> serde::de::Deserialize<'de> for ActiveDirectoryMode {
29403        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29404        where
29405            D: serde::Deserializer<'de>,
29406        {
29407            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActiveDirectoryMode>::new(
29408                ".google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode",
29409            ))
29410        }
29411    }
29412}
29413
29414/// SQL Server specific audit configuration.
29415#[derive(Clone, Default, PartialEq)]
29416#[non_exhaustive]
29417pub struct SqlServerAuditConfig {
29418    /// This is always sql#sqlServerAuditConfig
29419    pub kind: std::string::String,
29420
29421    /// The name of the destination bucket (e.g., gs://mybucket).
29422    pub bucket: std::string::String,
29423
29424    /// How long to keep generated audit files.
29425    pub retention_interval: std::option::Option<wkt::Duration>,
29426
29427    /// How often to upload generated audit files.
29428    pub upload_interval: std::option::Option<wkt::Duration>,
29429
29430    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29431}
29432
29433impl SqlServerAuditConfig {
29434    /// Creates a new default instance.
29435    pub fn new() -> Self {
29436        std::default::Default::default()
29437    }
29438
29439    /// Sets the value of [kind][crate::model::SqlServerAuditConfig::kind].
29440    ///
29441    /// # Example
29442    /// ```ignore,no_run
29443    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29444    /// let x = SqlServerAuditConfig::new().set_kind("example");
29445    /// ```
29446    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29447        self.kind = v.into();
29448        self
29449    }
29450
29451    /// Sets the value of [bucket][crate::model::SqlServerAuditConfig::bucket].
29452    ///
29453    /// # Example
29454    /// ```ignore,no_run
29455    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29456    /// let x = SqlServerAuditConfig::new().set_bucket("example");
29457    /// ```
29458    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29459        self.bucket = v.into();
29460        self
29461    }
29462
29463    /// Sets the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
29464    ///
29465    /// # Example
29466    /// ```ignore,no_run
29467    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29468    /// use wkt::Duration;
29469    /// let x = SqlServerAuditConfig::new().set_retention_interval(Duration::default()/* use setters */);
29470    /// ```
29471    pub fn set_retention_interval<T>(mut self, v: T) -> Self
29472    where
29473        T: std::convert::Into<wkt::Duration>,
29474    {
29475        self.retention_interval = std::option::Option::Some(v.into());
29476        self
29477    }
29478
29479    /// Sets or clears the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
29480    ///
29481    /// # Example
29482    /// ```ignore,no_run
29483    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29484    /// use wkt::Duration;
29485    /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(Some(Duration::default()/* use setters */));
29486    /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(None::<Duration>);
29487    /// ```
29488    pub fn set_or_clear_retention_interval<T>(mut self, v: std::option::Option<T>) -> Self
29489    where
29490        T: std::convert::Into<wkt::Duration>,
29491    {
29492        self.retention_interval = v.map(|x| x.into());
29493        self
29494    }
29495
29496    /// Sets the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
29497    ///
29498    /// # Example
29499    /// ```ignore,no_run
29500    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29501    /// use wkt::Duration;
29502    /// let x = SqlServerAuditConfig::new().set_upload_interval(Duration::default()/* use setters */);
29503    /// ```
29504    pub fn set_upload_interval<T>(mut self, v: T) -> Self
29505    where
29506        T: std::convert::Into<wkt::Duration>,
29507    {
29508        self.upload_interval = std::option::Option::Some(v.into());
29509        self
29510    }
29511
29512    /// Sets or clears the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
29513    ///
29514    /// # Example
29515    /// ```ignore,no_run
29516    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29517    /// use wkt::Duration;
29518    /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(Some(Duration::default()/* use setters */));
29519    /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(None::<Duration>);
29520    /// ```
29521    pub fn set_or_clear_upload_interval<T>(mut self, v: std::option::Option<T>) -> Self
29522    where
29523        T: std::convert::Into<wkt::Duration>,
29524    {
29525        self.upload_interval = v.map(|x| x.into());
29526        self
29527    }
29528}
29529
29530impl wkt::message::Message for SqlServerAuditConfig {
29531    fn typename() -> &'static str {
29532        "type.googleapis.com/google.cloud.sql.v1.SqlServerAuditConfig"
29533    }
29534}
29535
29536/// SQL Server Entra ID configuration.
29537#[derive(Clone, Default, PartialEq)]
29538#[non_exhaustive]
29539pub struct SqlServerEntraIdConfig {
29540    /// Output only. This is always sql#sqlServerEntraIdConfig
29541    pub kind: std::string::String,
29542
29543    /// Optional. The tenant ID for the Entra ID configuration.
29544    pub tenant_id: std::string::String,
29545
29546    /// Optional. The application ID for the Entra ID configuration.
29547    pub application_id: std::string::String,
29548
29549    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29550}
29551
29552impl SqlServerEntraIdConfig {
29553    /// Creates a new default instance.
29554    pub fn new() -> Self {
29555        std::default::Default::default()
29556    }
29557
29558    /// Sets the value of [kind][crate::model::SqlServerEntraIdConfig::kind].
29559    ///
29560    /// # Example
29561    /// ```ignore,no_run
29562    /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29563    /// let x = SqlServerEntraIdConfig::new().set_kind("example");
29564    /// ```
29565    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29566        self.kind = v.into();
29567        self
29568    }
29569
29570    /// Sets the value of [tenant_id][crate::model::SqlServerEntraIdConfig::tenant_id].
29571    ///
29572    /// # Example
29573    /// ```ignore,no_run
29574    /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29575    /// let x = SqlServerEntraIdConfig::new().set_tenant_id("example");
29576    /// ```
29577    pub fn set_tenant_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29578        self.tenant_id = v.into();
29579        self
29580    }
29581
29582    /// Sets the value of [application_id][crate::model::SqlServerEntraIdConfig::application_id].
29583    ///
29584    /// # Example
29585    /// ```ignore,no_run
29586    /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29587    /// let x = SqlServerEntraIdConfig::new().set_application_id("example");
29588    /// ```
29589    pub fn set_application_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29590        self.application_id = v.into();
29591        self
29592    }
29593}
29594
29595impl wkt::message::Message for SqlServerEntraIdConfig {
29596    fn typename() -> &'static str {
29597        "type.googleapis.com/google.cloud.sql.v1.SqlServerEntraIdConfig"
29598    }
29599}
29600
29601/// Acquire SSRS lease context.
29602#[derive(Clone, Default, PartialEq)]
29603#[non_exhaustive]
29604pub struct AcquireSsrsLeaseContext {
29605    /// The username to be used as the setup login to connect to the database
29606    /// server for SSRS setup.
29607    pub setup_login: std::option::Option<std::string::String>,
29608
29609    /// The username to be used as the service login to connect to the report
29610    /// database for SSRS setup.
29611    pub service_login: std::option::Option<std::string::String>,
29612
29613    /// The report database to be used for SSRS setup.
29614    pub report_database: std::option::Option<std::string::String>,
29615
29616    /// Lease duration needed for SSRS setup.
29617    pub duration: std::option::Option<wkt::Duration>,
29618
29619    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29620}
29621
29622impl AcquireSsrsLeaseContext {
29623    /// Creates a new default instance.
29624    pub fn new() -> Self {
29625        std::default::Default::default()
29626    }
29627
29628    /// Sets the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
29629    ///
29630    /// # Example
29631    /// ```ignore,no_run
29632    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29633    /// let x = AcquireSsrsLeaseContext::new().set_setup_login("example");
29634    /// ```
29635    pub fn set_setup_login<T>(mut self, v: T) -> Self
29636    where
29637        T: std::convert::Into<std::string::String>,
29638    {
29639        self.setup_login = std::option::Option::Some(v.into());
29640        self
29641    }
29642
29643    /// Sets or clears the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
29644    ///
29645    /// # Example
29646    /// ```ignore,no_run
29647    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29648    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(Some("example"));
29649    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(None::<String>);
29650    /// ```
29651    pub fn set_or_clear_setup_login<T>(mut self, v: std::option::Option<T>) -> Self
29652    where
29653        T: std::convert::Into<std::string::String>,
29654    {
29655        self.setup_login = v.map(|x| x.into());
29656        self
29657    }
29658
29659    /// Sets the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
29660    ///
29661    /// # Example
29662    /// ```ignore,no_run
29663    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29664    /// let x = AcquireSsrsLeaseContext::new().set_service_login("example");
29665    /// ```
29666    pub fn set_service_login<T>(mut self, v: T) -> Self
29667    where
29668        T: std::convert::Into<std::string::String>,
29669    {
29670        self.service_login = std::option::Option::Some(v.into());
29671        self
29672    }
29673
29674    /// Sets or clears the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
29675    ///
29676    /// # Example
29677    /// ```ignore,no_run
29678    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29679    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(Some("example"));
29680    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(None::<String>);
29681    /// ```
29682    pub fn set_or_clear_service_login<T>(mut self, v: std::option::Option<T>) -> Self
29683    where
29684        T: std::convert::Into<std::string::String>,
29685    {
29686        self.service_login = v.map(|x| x.into());
29687        self
29688    }
29689
29690    /// Sets the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
29691    ///
29692    /// # Example
29693    /// ```ignore,no_run
29694    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29695    /// let x = AcquireSsrsLeaseContext::new().set_report_database("example");
29696    /// ```
29697    pub fn set_report_database<T>(mut self, v: T) -> Self
29698    where
29699        T: std::convert::Into<std::string::String>,
29700    {
29701        self.report_database = std::option::Option::Some(v.into());
29702        self
29703    }
29704
29705    /// Sets or clears the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
29706    ///
29707    /// # Example
29708    /// ```ignore,no_run
29709    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29710    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(Some("example"));
29711    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(None::<String>);
29712    /// ```
29713    pub fn set_or_clear_report_database<T>(mut self, v: std::option::Option<T>) -> Self
29714    where
29715        T: std::convert::Into<std::string::String>,
29716    {
29717        self.report_database = v.map(|x| x.into());
29718        self
29719    }
29720
29721    /// Sets the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
29722    ///
29723    /// # Example
29724    /// ```ignore,no_run
29725    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29726    /// use wkt::Duration;
29727    /// let x = AcquireSsrsLeaseContext::new().set_duration(Duration::default()/* use setters */);
29728    /// ```
29729    pub fn set_duration<T>(mut self, v: T) -> Self
29730    where
29731        T: std::convert::Into<wkt::Duration>,
29732    {
29733        self.duration = std::option::Option::Some(v.into());
29734        self
29735    }
29736
29737    /// Sets or clears the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
29738    ///
29739    /// # Example
29740    /// ```ignore,no_run
29741    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29742    /// use wkt::Duration;
29743    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
29744    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(None::<Duration>);
29745    /// ```
29746    pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
29747    where
29748        T: std::convert::Into<wkt::Duration>,
29749    {
29750        self.duration = v.map(|x| x.into());
29751        self
29752    }
29753}
29754
29755impl wkt::message::Message for AcquireSsrsLeaseContext {
29756    fn typename() -> &'static str {
29757        "type.googleapis.com/google.cloud.sql.v1.AcquireSsrsLeaseContext"
29758    }
29759}
29760
29761/// DNS metadata.
29762#[derive(Clone, Default, PartialEq)]
29763#[non_exhaustive]
29764pub struct DnsNameMapping {
29765    /// Output only. The DNS name.
29766    pub name: std::string::String,
29767
29768    /// Output only. The connection type of the DNS name.
29769    pub connection_type: crate::model::dns_name_mapping::ConnectionType,
29770
29771    /// Output only. The scope that the DNS name applies to.
29772    pub dns_scope: crate::model::dns_name_mapping::DnsScope,
29773
29774    /// Output only. The manager for this DNS record.
29775    pub record_manager: crate::model::dns_name_mapping::RecordManager,
29776
29777    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29778}
29779
29780impl DnsNameMapping {
29781    /// Creates a new default instance.
29782    pub fn new() -> Self {
29783        std::default::Default::default()
29784    }
29785
29786    /// Sets the value of [name][crate::model::DnsNameMapping::name].
29787    ///
29788    /// # Example
29789    /// ```ignore,no_run
29790    /// # use google_cloud_sql_v1::model::DnsNameMapping;
29791    /// let x = DnsNameMapping::new().set_name("example");
29792    /// ```
29793    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29794        self.name = v.into();
29795        self
29796    }
29797
29798    /// Sets the value of [connection_type][crate::model::DnsNameMapping::connection_type].
29799    ///
29800    /// # Example
29801    /// ```ignore,no_run
29802    /// # use google_cloud_sql_v1::model::DnsNameMapping;
29803    /// use google_cloud_sql_v1::model::dns_name_mapping::ConnectionType;
29804    /// let x0 = DnsNameMapping::new().set_connection_type(ConnectionType::Public);
29805    /// let x1 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServicesAccess);
29806    /// let x2 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServiceConnect);
29807    /// ```
29808    pub fn set_connection_type<
29809        T: std::convert::Into<crate::model::dns_name_mapping::ConnectionType>,
29810    >(
29811        mut self,
29812        v: T,
29813    ) -> Self {
29814        self.connection_type = v.into();
29815        self
29816    }
29817
29818    /// Sets the value of [dns_scope][crate::model::DnsNameMapping::dns_scope].
29819    ///
29820    /// # Example
29821    /// ```ignore,no_run
29822    /// # use google_cloud_sql_v1::model::DnsNameMapping;
29823    /// use google_cloud_sql_v1::model::dns_name_mapping::DnsScope;
29824    /// let x0 = DnsNameMapping::new().set_dns_scope(DnsScope::Instance);
29825    /// let x1 = DnsNameMapping::new().set_dns_scope(DnsScope::Cluster);
29826    /// ```
29827    pub fn set_dns_scope<T: std::convert::Into<crate::model::dns_name_mapping::DnsScope>>(
29828        mut self,
29829        v: T,
29830    ) -> Self {
29831        self.dns_scope = v.into();
29832        self
29833    }
29834
29835    /// Sets the value of [record_manager][crate::model::DnsNameMapping::record_manager].
29836    ///
29837    /// # Example
29838    /// ```ignore,no_run
29839    /// # use google_cloud_sql_v1::model::DnsNameMapping;
29840    /// use google_cloud_sql_v1::model::dns_name_mapping::RecordManager;
29841    /// let x0 = DnsNameMapping::new().set_record_manager(RecordManager::Customer);
29842    /// let x1 = DnsNameMapping::new().set_record_manager(RecordManager::CloudSqlAutomation);
29843    /// ```
29844    pub fn set_record_manager<
29845        T: std::convert::Into<crate::model::dns_name_mapping::RecordManager>,
29846    >(
29847        mut self,
29848        v: T,
29849    ) -> Self {
29850        self.record_manager = v.into();
29851        self
29852    }
29853}
29854
29855impl wkt::message::Message for DnsNameMapping {
29856    fn typename() -> &'static str {
29857        "type.googleapis.com/google.cloud.sql.v1.DnsNameMapping"
29858    }
29859}
29860
29861/// Defines additional types related to [DnsNameMapping].
29862pub mod dns_name_mapping {
29863    #[allow(unused_imports)]
29864    use super::*;
29865
29866    /// The connection type of the DNS name.
29867    /// This enum is not frozen, and new values may be added in the future.
29868    ///
29869    /// # Working with unknown values
29870    ///
29871    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29872    /// additional enum variants at any time. Adding new variants is not considered
29873    /// a breaking change. Applications should write their code in anticipation of:
29874    ///
29875    /// - New values appearing in future releases of the client library, **and**
29876    /// - New values received dynamically, without application changes.
29877    ///
29878    /// Please consult the [Working with enums] section in the user guide for some
29879    /// guidelines.
29880    ///
29881    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
29882    #[derive(Clone, Debug, PartialEq)]
29883    #[non_exhaustive]
29884    pub enum ConnectionType {
29885        /// Unknown connection type.
29886        Unspecified,
29887        /// Public IP.
29888        Public,
29889        /// Private services access (private IP).
29890        PrivateServicesAccess,
29891        /// Private Service Connect.
29892        PrivateServiceConnect,
29893        /// If set, the enum was initialized with an unknown value.
29894        ///
29895        /// Applications can examine the value using [ConnectionType::value] or
29896        /// [ConnectionType::name].
29897        UnknownValue(connection_type::UnknownValue),
29898    }
29899
29900    #[doc(hidden)]
29901    pub mod connection_type {
29902        #[allow(unused_imports)]
29903        use super::*;
29904        #[derive(Clone, Debug, PartialEq)]
29905        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29906    }
29907
29908    impl ConnectionType {
29909        /// Gets the enum value.
29910        ///
29911        /// Returns `None` if the enum contains an unknown value deserialized from
29912        /// the string representation of enums.
29913        pub fn value(&self) -> std::option::Option<i32> {
29914            match self {
29915                Self::Unspecified => std::option::Option::Some(0),
29916                Self::Public => std::option::Option::Some(1),
29917                Self::PrivateServicesAccess => std::option::Option::Some(2),
29918                Self::PrivateServiceConnect => std::option::Option::Some(3),
29919                Self::UnknownValue(u) => u.0.value(),
29920            }
29921        }
29922
29923        /// Gets the enum value as a string.
29924        ///
29925        /// Returns `None` if the enum contains an unknown value deserialized from
29926        /// the integer representation of enums.
29927        pub fn name(&self) -> std::option::Option<&str> {
29928            match self {
29929                Self::Unspecified => std::option::Option::Some("CONNECTION_TYPE_UNSPECIFIED"),
29930                Self::Public => std::option::Option::Some("PUBLIC"),
29931                Self::PrivateServicesAccess => std::option::Option::Some("PRIVATE_SERVICES_ACCESS"),
29932                Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
29933                Self::UnknownValue(u) => u.0.name(),
29934            }
29935        }
29936    }
29937
29938    impl std::default::Default for ConnectionType {
29939        fn default() -> Self {
29940            use std::convert::From;
29941            Self::from(0)
29942        }
29943    }
29944
29945    impl std::fmt::Display for ConnectionType {
29946        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29947            wkt::internal::display_enum(f, self.name(), self.value())
29948        }
29949    }
29950
29951    impl std::convert::From<i32> for ConnectionType {
29952        fn from(value: i32) -> Self {
29953            match value {
29954                0 => Self::Unspecified,
29955                1 => Self::Public,
29956                2 => Self::PrivateServicesAccess,
29957                3 => Self::PrivateServiceConnect,
29958                _ => Self::UnknownValue(connection_type::UnknownValue(
29959                    wkt::internal::UnknownEnumValue::Integer(value),
29960                )),
29961            }
29962        }
29963    }
29964
29965    impl std::convert::From<&str> for ConnectionType {
29966        fn from(value: &str) -> Self {
29967            use std::string::ToString;
29968            match value {
29969                "CONNECTION_TYPE_UNSPECIFIED" => Self::Unspecified,
29970                "PUBLIC" => Self::Public,
29971                "PRIVATE_SERVICES_ACCESS" => Self::PrivateServicesAccess,
29972                "PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
29973                _ => Self::UnknownValue(connection_type::UnknownValue(
29974                    wkt::internal::UnknownEnumValue::String(value.to_string()),
29975                )),
29976            }
29977        }
29978    }
29979
29980    impl serde::ser::Serialize for ConnectionType {
29981        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29982        where
29983            S: serde::Serializer,
29984        {
29985            match self {
29986                Self::Unspecified => serializer.serialize_i32(0),
29987                Self::Public => serializer.serialize_i32(1),
29988                Self::PrivateServicesAccess => serializer.serialize_i32(2),
29989                Self::PrivateServiceConnect => serializer.serialize_i32(3),
29990                Self::UnknownValue(u) => u.0.serialize(serializer),
29991            }
29992        }
29993    }
29994
29995    impl<'de> serde::de::Deserialize<'de> for ConnectionType {
29996        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29997        where
29998            D: serde::Deserializer<'de>,
29999        {
30000            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionType>::new(
30001                ".google.cloud.sql.v1.DnsNameMapping.ConnectionType",
30002            ))
30003        }
30004    }
30005
30006    /// The scope that the DNS name applies to.
30007    ///
30008    /// # Working with unknown values
30009    ///
30010    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30011    /// additional enum variants at any time. Adding new variants is not considered
30012    /// a breaking change. Applications should write their code in anticipation of:
30013    ///
30014    /// - New values appearing in future releases of the client library, **and**
30015    /// - New values received dynamically, without application changes.
30016    ///
30017    /// Please consult the [Working with enums] section in the user guide for some
30018    /// guidelines.
30019    ///
30020    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
30021    #[derive(Clone, Debug, PartialEq)]
30022    #[non_exhaustive]
30023    pub enum DnsScope {
30024        /// DNS scope not set. This value should not be used.
30025        Unspecified,
30026        /// Indicates an instance-level DNS name.
30027        Instance,
30028        /// Indicates a cluster-level DNS name.
30029        Cluster,
30030        /// If set, the enum was initialized with an unknown value.
30031        ///
30032        /// Applications can examine the value using [DnsScope::value] or
30033        /// [DnsScope::name].
30034        UnknownValue(dns_scope::UnknownValue),
30035    }
30036
30037    #[doc(hidden)]
30038    pub mod dns_scope {
30039        #[allow(unused_imports)]
30040        use super::*;
30041        #[derive(Clone, Debug, PartialEq)]
30042        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30043    }
30044
30045    impl DnsScope {
30046        /// Gets the enum value.
30047        ///
30048        /// Returns `None` if the enum contains an unknown value deserialized from
30049        /// the string representation of enums.
30050        pub fn value(&self) -> std::option::Option<i32> {
30051            match self {
30052                Self::Unspecified => std::option::Option::Some(0),
30053                Self::Instance => std::option::Option::Some(1),
30054                Self::Cluster => std::option::Option::Some(2),
30055                Self::UnknownValue(u) => u.0.value(),
30056            }
30057        }
30058
30059        /// Gets the enum value as a string.
30060        ///
30061        /// Returns `None` if the enum contains an unknown value deserialized from
30062        /// the integer representation of enums.
30063        pub fn name(&self) -> std::option::Option<&str> {
30064            match self {
30065                Self::Unspecified => std::option::Option::Some("DNS_SCOPE_UNSPECIFIED"),
30066                Self::Instance => std::option::Option::Some("INSTANCE"),
30067                Self::Cluster => std::option::Option::Some("CLUSTER"),
30068                Self::UnknownValue(u) => u.0.name(),
30069            }
30070        }
30071    }
30072
30073    impl std::default::Default for DnsScope {
30074        fn default() -> Self {
30075            use std::convert::From;
30076            Self::from(0)
30077        }
30078    }
30079
30080    impl std::fmt::Display for DnsScope {
30081        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30082            wkt::internal::display_enum(f, self.name(), self.value())
30083        }
30084    }
30085
30086    impl std::convert::From<i32> for DnsScope {
30087        fn from(value: i32) -> Self {
30088            match value {
30089                0 => Self::Unspecified,
30090                1 => Self::Instance,
30091                2 => Self::Cluster,
30092                _ => Self::UnknownValue(dns_scope::UnknownValue(
30093                    wkt::internal::UnknownEnumValue::Integer(value),
30094                )),
30095            }
30096        }
30097    }
30098
30099    impl std::convert::From<&str> for DnsScope {
30100        fn from(value: &str) -> Self {
30101            use std::string::ToString;
30102            match value {
30103                "DNS_SCOPE_UNSPECIFIED" => Self::Unspecified,
30104                "INSTANCE" => Self::Instance,
30105                "CLUSTER" => Self::Cluster,
30106                _ => Self::UnknownValue(dns_scope::UnknownValue(
30107                    wkt::internal::UnknownEnumValue::String(value.to_string()),
30108                )),
30109            }
30110        }
30111    }
30112
30113    impl serde::ser::Serialize for DnsScope {
30114        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30115        where
30116            S: serde::Serializer,
30117        {
30118            match self {
30119                Self::Unspecified => serializer.serialize_i32(0),
30120                Self::Instance => serializer.serialize_i32(1),
30121                Self::Cluster => serializer.serialize_i32(2),
30122                Self::UnknownValue(u) => u.0.serialize(serializer),
30123            }
30124        }
30125    }
30126
30127    impl<'de> serde::de::Deserialize<'de> for DnsScope {
30128        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30129        where
30130            D: serde::Deserializer<'de>,
30131        {
30132            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DnsScope>::new(
30133                ".google.cloud.sql.v1.DnsNameMapping.DnsScope",
30134            ))
30135        }
30136    }
30137
30138    /// The system responsible for managing the DNS record.
30139    ///
30140    /// # Working with unknown values
30141    ///
30142    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30143    /// additional enum variants at any time. Adding new variants is not considered
30144    /// a breaking change. Applications should write their code in anticipation of:
30145    ///
30146    /// - New values appearing in future releases of the client library, **and**
30147    /// - New values received dynamically, without application changes.
30148    ///
30149    /// Please consult the [Working with enums] section in the user guide for some
30150    /// guidelines.
30151    ///
30152    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
30153    #[derive(Clone, Debug, PartialEq)]
30154    #[non_exhaustive]
30155    pub enum RecordManager {
30156        /// Record manager not set. This value should not be used.
30157        Unspecified,
30158        /// The record may be managed by the customer. It is not automatically
30159        /// managed by Cloud SQL automation.
30160        Customer,
30161        /// The record is managed by Cloud SQL, which will create, update,
30162        /// and delete the DNS records for the zone automatically when
30163        /// the Cloud SQL database instance is created or updated.
30164        CloudSqlAutomation,
30165        /// If set, the enum was initialized with an unknown value.
30166        ///
30167        /// Applications can examine the value using [RecordManager::value] or
30168        /// [RecordManager::name].
30169        UnknownValue(record_manager::UnknownValue),
30170    }
30171
30172    #[doc(hidden)]
30173    pub mod record_manager {
30174        #[allow(unused_imports)]
30175        use super::*;
30176        #[derive(Clone, Debug, PartialEq)]
30177        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30178    }
30179
30180    impl RecordManager {
30181        /// Gets the enum value.
30182        ///
30183        /// Returns `None` if the enum contains an unknown value deserialized from
30184        /// the string representation of enums.
30185        pub fn value(&self) -> std::option::Option<i32> {
30186            match self {
30187                Self::Unspecified => std::option::Option::Some(0),
30188                Self::Customer => std::option::Option::Some(1),
30189                Self::CloudSqlAutomation => std::option::Option::Some(2),
30190                Self::UnknownValue(u) => u.0.value(),
30191            }
30192        }
30193
30194        /// Gets the enum value as a string.
30195        ///
30196        /// Returns `None` if the enum contains an unknown value deserialized from
30197        /// the integer representation of enums.
30198        pub fn name(&self) -> std::option::Option<&str> {
30199            match self {
30200                Self::Unspecified => std::option::Option::Some("RECORD_MANAGER_UNSPECIFIED"),
30201                Self::Customer => std::option::Option::Some("CUSTOMER"),
30202                Self::CloudSqlAutomation => std::option::Option::Some("CLOUD_SQL_AUTOMATION"),
30203                Self::UnknownValue(u) => u.0.name(),
30204            }
30205        }
30206    }
30207
30208    impl std::default::Default for RecordManager {
30209        fn default() -> Self {
30210            use std::convert::From;
30211            Self::from(0)
30212        }
30213    }
30214
30215    impl std::fmt::Display for RecordManager {
30216        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30217            wkt::internal::display_enum(f, self.name(), self.value())
30218        }
30219    }
30220
30221    impl std::convert::From<i32> for RecordManager {
30222        fn from(value: i32) -> Self {
30223            match value {
30224                0 => Self::Unspecified,
30225                1 => Self::Customer,
30226                2 => Self::CloudSqlAutomation,
30227                _ => Self::UnknownValue(record_manager::UnknownValue(
30228                    wkt::internal::UnknownEnumValue::Integer(value),
30229                )),
30230            }
30231        }
30232    }
30233
30234    impl std::convert::From<&str> for RecordManager {
30235        fn from(value: &str) -> Self {
30236            use std::string::ToString;
30237            match value {
30238                "RECORD_MANAGER_UNSPECIFIED" => Self::Unspecified,
30239                "CUSTOMER" => Self::Customer,
30240                "CLOUD_SQL_AUTOMATION" => Self::CloudSqlAutomation,
30241                _ => Self::UnknownValue(record_manager::UnknownValue(
30242                    wkt::internal::UnknownEnumValue::String(value.to_string()),
30243                )),
30244            }
30245        }
30246    }
30247
30248    impl serde::ser::Serialize for RecordManager {
30249        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30250        where
30251            S: serde::Serializer,
30252        {
30253            match self {
30254                Self::Unspecified => serializer.serialize_i32(0),
30255                Self::Customer => serializer.serialize_i32(1),
30256                Self::CloudSqlAutomation => serializer.serialize_i32(2),
30257                Self::UnknownValue(u) => u.0.serialize(serializer),
30258            }
30259        }
30260    }
30261
30262    impl<'de> serde::de::Deserialize<'de> for RecordManager {
30263        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30264        where
30265            D: serde::Deserializer<'de>,
30266        {
30267            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RecordManager>::new(
30268                ".google.cloud.sql.v1.DnsNameMapping.RecordManager",
30269            ))
30270        }
30271    }
30272}
30273
30274#[allow(missing_docs)]
30275#[derive(Clone, Default, PartialEq)]
30276#[non_exhaustive]
30277pub struct SqlSslCertsDeleteRequest {
30278    /// Cloud SQL instance ID. This does not include the project ID.
30279    pub instance: std::string::String,
30280
30281    /// Project ID of the project that contains the instance.
30282    pub project: std::string::String,
30283
30284    /// Sha1 FingerPrint.
30285    pub sha1_fingerprint: std::string::String,
30286
30287    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30288}
30289
30290impl SqlSslCertsDeleteRequest {
30291    /// Creates a new default instance.
30292    pub fn new() -> Self {
30293        std::default::Default::default()
30294    }
30295
30296    /// Sets the value of [instance][crate::model::SqlSslCertsDeleteRequest::instance].
30297    ///
30298    /// # Example
30299    /// ```ignore,no_run
30300    /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
30301    /// let x = SqlSslCertsDeleteRequest::new().set_instance("example");
30302    /// ```
30303    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30304        self.instance = v.into();
30305        self
30306    }
30307
30308    /// Sets the value of [project][crate::model::SqlSslCertsDeleteRequest::project].
30309    ///
30310    /// # Example
30311    /// ```ignore,no_run
30312    /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
30313    /// let x = SqlSslCertsDeleteRequest::new().set_project("example");
30314    /// ```
30315    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30316        self.project = v.into();
30317        self
30318    }
30319
30320    /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsDeleteRequest::sha1_fingerprint].
30321    ///
30322    /// # Example
30323    /// ```ignore,no_run
30324    /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
30325    /// let x = SqlSslCertsDeleteRequest::new().set_sha1_fingerprint("example");
30326    /// ```
30327    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
30328        mut self,
30329        v: T,
30330    ) -> Self {
30331        self.sha1_fingerprint = v.into();
30332        self
30333    }
30334}
30335
30336impl wkt::message::Message for SqlSslCertsDeleteRequest {
30337    fn typename() -> &'static str {
30338        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsDeleteRequest"
30339    }
30340}
30341
30342#[allow(missing_docs)]
30343#[derive(Clone, Default, PartialEq)]
30344#[non_exhaustive]
30345pub struct SqlSslCertsGetRequest {
30346    /// Cloud SQL instance ID. This does not include the project ID.
30347    pub instance: std::string::String,
30348
30349    /// Project ID of the project that contains the instance.
30350    pub project: std::string::String,
30351
30352    /// Sha1 FingerPrint.
30353    pub sha1_fingerprint: std::string::String,
30354
30355    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30356}
30357
30358impl SqlSslCertsGetRequest {
30359    /// Creates a new default instance.
30360    pub fn new() -> Self {
30361        std::default::Default::default()
30362    }
30363
30364    /// Sets the value of [instance][crate::model::SqlSslCertsGetRequest::instance].
30365    ///
30366    /// # Example
30367    /// ```ignore,no_run
30368    /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
30369    /// let x = SqlSslCertsGetRequest::new().set_instance("example");
30370    /// ```
30371    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30372        self.instance = v.into();
30373        self
30374    }
30375
30376    /// Sets the value of [project][crate::model::SqlSslCertsGetRequest::project].
30377    ///
30378    /// # Example
30379    /// ```ignore,no_run
30380    /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
30381    /// let x = SqlSslCertsGetRequest::new().set_project("example");
30382    /// ```
30383    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30384        self.project = v.into();
30385        self
30386    }
30387
30388    /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsGetRequest::sha1_fingerprint].
30389    ///
30390    /// # Example
30391    /// ```ignore,no_run
30392    /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
30393    /// let x = SqlSslCertsGetRequest::new().set_sha1_fingerprint("example");
30394    /// ```
30395    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
30396        mut self,
30397        v: T,
30398    ) -> Self {
30399        self.sha1_fingerprint = v.into();
30400        self
30401    }
30402}
30403
30404impl wkt::message::Message for SqlSslCertsGetRequest {
30405    fn typename() -> &'static str {
30406        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsGetRequest"
30407    }
30408}
30409
30410#[allow(missing_docs)]
30411#[derive(Clone, Default, PartialEq)]
30412#[non_exhaustive]
30413pub struct SqlSslCertsInsertRequest {
30414    /// Cloud SQL instance ID. This does not include the project ID.
30415    pub instance: std::string::String,
30416
30417    /// Project ID of the project that contains the instance.
30418    pub project: std::string::String,
30419
30420    #[allow(missing_docs)]
30421    pub body: std::option::Option<crate::model::SslCertsInsertRequest>,
30422
30423    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30424}
30425
30426impl SqlSslCertsInsertRequest {
30427    /// Creates a new default instance.
30428    pub fn new() -> Self {
30429        std::default::Default::default()
30430    }
30431
30432    /// Sets the value of [instance][crate::model::SqlSslCertsInsertRequest::instance].
30433    ///
30434    /// # Example
30435    /// ```ignore,no_run
30436    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30437    /// let x = SqlSslCertsInsertRequest::new().set_instance("example");
30438    /// ```
30439    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30440        self.instance = v.into();
30441        self
30442    }
30443
30444    /// Sets the value of [project][crate::model::SqlSslCertsInsertRequest::project].
30445    ///
30446    /// # Example
30447    /// ```ignore,no_run
30448    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30449    /// let x = SqlSslCertsInsertRequest::new().set_project("example");
30450    /// ```
30451    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30452        self.project = v.into();
30453        self
30454    }
30455
30456    /// Sets the value of [body][crate::model::SqlSslCertsInsertRequest::body].
30457    ///
30458    /// # Example
30459    /// ```ignore,no_run
30460    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30461    /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
30462    /// let x = SqlSslCertsInsertRequest::new().set_body(SslCertsInsertRequest::default()/* use setters */);
30463    /// ```
30464    pub fn set_body<T>(mut self, v: T) -> Self
30465    where
30466        T: std::convert::Into<crate::model::SslCertsInsertRequest>,
30467    {
30468        self.body = std::option::Option::Some(v.into());
30469        self
30470    }
30471
30472    /// Sets or clears the value of [body][crate::model::SqlSslCertsInsertRequest::body].
30473    ///
30474    /// # Example
30475    /// ```ignore,no_run
30476    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30477    /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
30478    /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(Some(SslCertsInsertRequest::default()/* use setters */));
30479    /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(None::<SslCertsInsertRequest>);
30480    /// ```
30481    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
30482    where
30483        T: std::convert::Into<crate::model::SslCertsInsertRequest>,
30484    {
30485        self.body = v.map(|x| x.into());
30486        self
30487    }
30488}
30489
30490impl wkt::message::Message for SqlSslCertsInsertRequest {
30491    fn typename() -> &'static str {
30492        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsInsertRequest"
30493    }
30494}
30495
30496#[allow(missing_docs)]
30497#[derive(Clone, Default, PartialEq)]
30498#[non_exhaustive]
30499pub struct SqlSslCertsListRequest {
30500    /// Cloud SQL instance ID. This does not include the project ID.
30501    pub instance: std::string::String,
30502
30503    /// Project ID of the project that contains the instance.
30504    pub project: std::string::String,
30505
30506    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30507}
30508
30509impl SqlSslCertsListRequest {
30510    /// Creates a new default instance.
30511    pub fn new() -> Self {
30512        std::default::Default::default()
30513    }
30514
30515    /// Sets the value of [instance][crate::model::SqlSslCertsListRequest::instance].
30516    ///
30517    /// # Example
30518    /// ```ignore,no_run
30519    /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
30520    /// let x = SqlSslCertsListRequest::new().set_instance("example");
30521    /// ```
30522    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30523        self.instance = v.into();
30524        self
30525    }
30526
30527    /// Sets the value of [project][crate::model::SqlSslCertsListRequest::project].
30528    ///
30529    /// # Example
30530    /// ```ignore,no_run
30531    /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
30532    /// let x = SqlSslCertsListRequest::new().set_project("example");
30533    /// ```
30534    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30535        self.project = v.into();
30536        self
30537    }
30538}
30539
30540impl wkt::message::Message for SqlSslCertsListRequest {
30541    fn typename() -> &'static str {
30542        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsListRequest"
30543    }
30544}
30545
30546/// SslCerts insert request.
30547#[derive(Clone, Default, PartialEq)]
30548#[non_exhaustive]
30549pub struct SslCertsInsertRequest {
30550    /// User supplied name.  Must be a distinct name from the other certificates
30551    /// for this instance.
30552    pub common_name: std::string::String,
30553
30554    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30555}
30556
30557impl SslCertsInsertRequest {
30558    /// Creates a new default instance.
30559    pub fn new() -> Self {
30560        std::default::Default::default()
30561    }
30562
30563    /// Sets the value of [common_name][crate::model::SslCertsInsertRequest::common_name].
30564    ///
30565    /// # Example
30566    /// ```ignore,no_run
30567    /// # use google_cloud_sql_v1::model::SslCertsInsertRequest;
30568    /// let x = SslCertsInsertRequest::new().set_common_name("example");
30569    /// ```
30570    pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30571        self.common_name = v.into();
30572        self
30573    }
30574}
30575
30576impl wkt::message::Message for SslCertsInsertRequest {
30577    fn typename() -> &'static str {
30578        "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertRequest"
30579    }
30580}
30581
30582/// SslCert insert response.
30583#[derive(Clone, Default, PartialEq)]
30584#[non_exhaustive]
30585pub struct SslCertsInsertResponse {
30586    /// This is always `sql#sslCertsInsert`.
30587    pub kind: std::string::String,
30588
30589    /// The operation to track the ssl certs insert request.
30590    pub operation: std::option::Option<crate::model::Operation>,
30591
30592    /// The server Certificate Authority's certificate.  If this is missing you can
30593    /// force a new one to be generated by calling resetSslConfig method on
30594    /// instances resource.
30595    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
30596
30597    /// The new client certificate and private key.
30598    pub client_cert: std::option::Option<crate::model::SslCertDetail>,
30599
30600    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30601}
30602
30603impl SslCertsInsertResponse {
30604    /// Creates a new default instance.
30605    pub fn new() -> Self {
30606        std::default::Default::default()
30607    }
30608
30609    /// Sets the value of [kind][crate::model::SslCertsInsertResponse::kind].
30610    ///
30611    /// # Example
30612    /// ```ignore,no_run
30613    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30614    /// let x = SslCertsInsertResponse::new().set_kind("example");
30615    /// ```
30616    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30617        self.kind = v.into();
30618        self
30619    }
30620
30621    /// Sets the value of [operation][crate::model::SslCertsInsertResponse::operation].
30622    ///
30623    /// # Example
30624    /// ```ignore,no_run
30625    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30626    /// use google_cloud_sql_v1::model::Operation;
30627    /// let x = SslCertsInsertResponse::new().set_operation(Operation::default()/* use setters */);
30628    /// ```
30629    pub fn set_operation<T>(mut self, v: T) -> Self
30630    where
30631        T: std::convert::Into<crate::model::Operation>,
30632    {
30633        self.operation = std::option::Option::Some(v.into());
30634        self
30635    }
30636
30637    /// Sets or clears the value of [operation][crate::model::SslCertsInsertResponse::operation].
30638    ///
30639    /// # Example
30640    /// ```ignore,no_run
30641    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30642    /// use google_cloud_sql_v1::model::Operation;
30643    /// let x = SslCertsInsertResponse::new().set_or_clear_operation(Some(Operation::default()/* use setters */));
30644    /// let x = SslCertsInsertResponse::new().set_or_clear_operation(None::<Operation>);
30645    /// ```
30646    pub fn set_or_clear_operation<T>(mut self, v: std::option::Option<T>) -> Self
30647    where
30648        T: std::convert::Into<crate::model::Operation>,
30649    {
30650        self.operation = v.map(|x| x.into());
30651        self
30652    }
30653
30654    /// Sets the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
30655    ///
30656    /// # Example
30657    /// ```ignore,no_run
30658    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30659    /// use google_cloud_sql_v1::model::SslCert;
30660    /// let x = SslCertsInsertResponse::new().set_server_ca_cert(SslCert::default()/* use setters */);
30661    /// ```
30662    pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
30663    where
30664        T: std::convert::Into<crate::model::SslCert>,
30665    {
30666        self.server_ca_cert = std::option::Option::Some(v.into());
30667        self
30668    }
30669
30670    /// Sets or clears the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
30671    ///
30672    /// # Example
30673    /// ```ignore,no_run
30674    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30675    /// use google_cloud_sql_v1::model::SslCert;
30676    /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
30677    /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(None::<SslCert>);
30678    /// ```
30679    pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
30680    where
30681        T: std::convert::Into<crate::model::SslCert>,
30682    {
30683        self.server_ca_cert = v.map(|x| x.into());
30684        self
30685    }
30686
30687    /// Sets the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
30688    ///
30689    /// # Example
30690    /// ```ignore,no_run
30691    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30692    /// use google_cloud_sql_v1::model::SslCertDetail;
30693    /// let x = SslCertsInsertResponse::new().set_client_cert(SslCertDetail::default()/* use setters */);
30694    /// ```
30695    pub fn set_client_cert<T>(mut self, v: T) -> Self
30696    where
30697        T: std::convert::Into<crate::model::SslCertDetail>,
30698    {
30699        self.client_cert = std::option::Option::Some(v.into());
30700        self
30701    }
30702
30703    /// Sets or clears the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
30704    ///
30705    /// # Example
30706    /// ```ignore,no_run
30707    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30708    /// use google_cloud_sql_v1::model::SslCertDetail;
30709    /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(Some(SslCertDetail::default()/* use setters */));
30710    /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(None::<SslCertDetail>);
30711    /// ```
30712    pub fn set_or_clear_client_cert<T>(mut self, v: std::option::Option<T>) -> Self
30713    where
30714        T: std::convert::Into<crate::model::SslCertDetail>,
30715    {
30716        self.client_cert = v.map(|x| x.into());
30717        self
30718    }
30719}
30720
30721impl wkt::message::Message for SslCertsInsertResponse {
30722    fn typename() -> &'static str {
30723        "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertResponse"
30724    }
30725}
30726
30727/// SslCerts list response.
30728#[derive(Clone, Default, PartialEq)]
30729#[non_exhaustive]
30730pub struct SslCertsListResponse {
30731    /// This is always `sql#sslCertsList`.
30732    pub kind: std::string::String,
30733
30734    /// List of client certificates for the instance.
30735    pub items: std::vec::Vec<crate::model::SslCert>,
30736
30737    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30738}
30739
30740impl SslCertsListResponse {
30741    /// Creates a new default instance.
30742    pub fn new() -> Self {
30743        std::default::Default::default()
30744    }
30745
30746    /// Sets the value of [kind][crate::model::SslCertsListResponse::kind].
30747    ///
30748    /// # Example
30749    /// ```ignore,no_run
30750    /// # use google_cloud_sql_v1::model::SslCertsListResponse;
30751    /// let x = SslCertsListResponse::new().set_kind("example");
30752    /// ```
30753    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30754        self.kind = v.into();
30755        self
30756    }
30757
30758    /// Sets the value of [items][crate::model::SslCertsListResponse::items].
30759    ///
30760    /// # Example
30761    /// ```ignore,no_run
30762    /// # use google_cloud_sql_v1::model::SslCertsListResponse;
30763    /// use google_cloud_sql_v1::model::SslCert;
30764    /// let x = SslCertsListResponse::new()
30765    ///     .set_items([
30766    ///         SslCert::default()/* use setters */,
30767    ///         SslCert::default()/* use (different) setters */,
30768    ///     ]);
30769    /// ```
30770    pub fn set_items<T, V>(mut self, v: T) -> Self
30771    where
30772        T: std::iter::IntoIterator<Item = V>,
30773        V: std::convert::Into<crate::model::SslCert>,
30774    {
30775        use std::iter::Iterator;
30776        self.items = v.into_iter().map(|i| i.into()).collect();
30777        self
30778    }
30779}
30780
30781impl wkt::message::Message for SslCertsListResponse {
30782    fn typename() -> &'static str {
30783        "type.googleapis.com/google.cloud.sql.v1.SslCertsListResponse"
30784    }
30785}
30786
30787/// Tiers list request.
30788#[derive(Clone, Default, PartialEq)]
30789#[non_exhaustive]
30790pub struct SqlTiersListRequest {
30791    /// Project ID of the project for which to list tiers.
30792    pub project: std::string::String,
30793
30794    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30795}
30796
30797impl SqlTiersListRequest {
30798    /// Creates a new default instance.
30799    pub fn new() -> Self {
30800        std::default::Default::default()
30801    }
30802
30803    /// Sets the value of [project][crate::model::SqlTiersListRequest::project].
30804    ///
30805    /// # Example
30806    /// ```ignore,no_run
30807    /// # use google_cloud_sql_v1::model::SqlTiersListRequest;
30808    /// let x = SqlTiersListRequest::new().set_project("example");
30809    /// ```
30810    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30811        self.project = v.into();
30812        self
30813    }
30814}
30815
30816impl wkt::message::Message for SqlTiersListRequest {
30817    fn typename() -> &'static str {
30818        "type.googleapis.com/google.cloud.sql.v1.SqlTiersListRequest"
30819    }
30820}
30821
30822/// Tiers list response.
30823#[derive(Clone, Default, PartialEq)]
30824#[non_exhaustive]
30825pub struct TiersListResponse {
30826    /// This is always `sql#tiersList`.
30827    pub kind: std::string::String,
30828
30829    /// List of tiers.
30830    pub items: std::vec::Vec<crate::model::Tier>,
30831
30832    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30833}
30834
30835impl TiersListResponse {
30836    /// Creates a new default instance.
30837    pub fn new() -> Self {
30838        std::default::Default::default()
30839    }
30840
30841    /// Sets the value of [kind][crate::model::TiersListResponse::kind].
30842    ///
30843    /// # Example
30844    /// ```ignore,no_run
30845    /// # use google_cloud_sql_v1::model::TiersListResponse;
30846    /// let x = TiersListResponse::new().set_kind("example");
30847    /// ```
30848    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30849        self.kind = v.into();
30850        self
30851    }
30852
30853    /// Sets the value of [items][crate::model::TiersListResponse::items].
30854    ///
30855    /// # Example
30856    /// ```ignore,no_run
30857    /// # use google_cloud_sql_v1::model::TiersListResponse;
30858    /// use google_cloud_sql_v1::model::Tier;
30859    /// let x = TiersListResponse::new()
30860    ///     .set_items([
30861    ///         Tier::default()/* use setters */,
30862    ///         Tier::default()/* use (different) setters */,
30863    ///     ]);
30864    /// ```
30865    pub fn set_items<T, V>(mut self, v: T) -> Self
30866    where
30867        T: std::iter::IntoIterator<Item = V>,
30868        V: std::convert::Into<crate::model::Tier>,
30869    {
30870        use std::iter::Iterator;
30871        self.items = v.into_iter().map(|i| i.into()).collect();
30872        self
30873    }
30874}
30875
30876impl wkt::message::Message for TiersListResponse {
30877    fn typename() -> &'static str {
30878        "type.googleapis.com/google.cloud.sql.v1.TiersListResponse"
30879    }
30880}
30881
30882/// A Google Cloud SQL service tier resource.
30883#[derive(Clone, Default, PartialEq)]
30884#[non_exhaustive]
30885pub struct Tier {
30886    /// An identifier for the machine type, for example, `db-custom-1-3840`. For
30887    /// related information, see [Pricing](/sql/pricing).
30888    pub tier: std::string::String,
30889
30890    /// The maximum RAM usage of this tier in bytes.
30891    pub ram: i64,
30892
30893    /// This is always `sql#tier`.
30894    pub kind: std::string::String,
30895
30896    /// The maximum disk size of this tier in bytes.
30897    pub disk_quota: i64,
30898
30899    /// The applicable regions for this tier.
30900    pub region: std::vec::Vec<std::string::String>,
30901
30902    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30903}
30904
30905impl Tier {
30906    /// Creates a new default instance.
30907    pub fn new() -> Self {
30908        std::default::Default::default()
30909    }
30910
30911    /// Sets the value of [tier][crate::model::Tier::tier].
30912    ///
30913    /// # Example
30914    /// ```ignore,no_run
30915    /// # use google_cloud_sql_v1::model::Tier;
30916    /// let x = Tier::new().set_tier("example");
30917    /// ```
30918    pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30919        self.tier = v.into();
30920        self
30921    }
30922
30923    /// Sets the value of [ram][crate::model::Tier::ram].
30924    ///
30925    /// # Example
30926    /// ```ignore,no_run
30927    /// # use google_cloud_sql_v1::model::Tier;
30928    /// let x = Tier::new().set_ram(42);
30929    /// ```
30930    pub fn set_ram<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
30931        self.ram = v.into();
30932        self
30933    }
30934
30935    /// Sets the value of [kind][crate::model::Tier::kind].
30936    ///
30937    /// # Example
30938    /// ```ignore,no_run
30939    /// # use google_cloud_sql_v1::model::Tier;
30940    /// let x = Tier::new().set_kind("example");
30941    /// ```
30942    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30943        self.kind = v.into();
30944        self
30945    }
30946
30947    /// Sets the value of [disk_quota][crate::model::Tier::disk_quota].
30948    ///
30949    /// # Example
30950    /// ```ignore,no_run
30951    /// # use google_cloud_sql_v1::model::Tier;
30952    /// let x = Tier::new().set_disk_quota(42);
30953    /// ```
30954    pub fn set_disk_quota<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
30955        self.disk_quota = v.into();
30956        self
30957    }
30958
30959    /// Sets the value of [region][crate::model::Tier::region].
30960    ///
30961    /// # Example
30962    /// ```ignore,no_run
30963    /// # use google_cloud_sql_v1::model::Tier;
30964    /// let x = Tier::new().set_region(["a", "b", "c"]);
30965    /// ```
30966    pub fn set_region<T, V>(mut self, v: T) -> Self
30967    where
30968        T: std::iter::IntoIterator<Item = V>,
30969        V: std::convert::Into<std::string::String>,
30970    {
30971        use std::iter::Iterator;
30972        self.region = v.into_iter().map(|i| i.into()).collect();
30973        self
30974    }
30975}
30976
30977impl wkt::message::Message for Tier {
30978    fn typename() -> &'static str {
30979        "type.googleapis.com/google.cloud.sql.v1.Tier"
30980    }
30981}
30982
30983#[allow(missing_docs)]
30984#[derive(Clone, Default, PartialEq)]
30985#[non_exhaustive]
30986pub struct SqlUsersDeleteRequest {
30987    /// Host of the user in the instance.
30988    pub host: std::string::String,
30989
30990    /// Database instance ID. This does not include the project ID.
30991    pub instance: std::string::String,
30992
30993    /// Name of the user in the instance.
30994    pub name: std::string::String,
30995
30996    /// Project ID of the project that contains the instance.
30997    pub project: std::string::String,
30998
30999    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31000}
31001
31002impl SqlUsersDeleteRequest {
31003    /// Creates a new default instance.
31004    pub fn new() -> Self {
31005        std::default::Default::default()
31006    }
31007
31008    /// Sets the value of [host][crate::model::SqlUsersDeleteRequest::host].
31009    ///
31010    /// # Example
31011    /// ```ignore,no_run
31012    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
31013    /// let x = SqlUsersDeleteRequest::new().set_host("example");
31014    /// ```
31015    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31016        self.host = v.into();
31017        self
31018    }
31019
31020    /// Sets the value of [instance][crate::model::SqlUsersDeleteRequest::instance].
31021    ///
31022    /// # Example
31023    /// ```ignore,no_run
31024    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
31025    /// let x = SqlUsersDeleteRequest::new().set_instance("example");
31026    /// ```
31027    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31028        self.instance = v.into();
31029        self
31030    }
31031
31032    /// Sets the value of [name][crate::model::SqlUsersDeleteRequest::name].
31033    ///
31034    /// # Example
31035    /// ```ignore,no_run
31036    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
31037    /// let x = SqlUsersDeleteRequest::new().set_name("example");
31038    /// ```
31039    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31040        self.name = v.into();
31041        self
31042    }
31043
31044    /// Sets the value of [project][crate::model::SqlUsersDeleteRequest::project].
31045    ///
31046    /// # Example
31047    /// ```ignore,no_run
31048    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
31049    /// let x = SqlUsersDeleteRequest::new().set_project("example");
31050    /// ```
31051    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31052        self.project = v.into();
31053        self
31054    }
31055}
31056
31057impl wkt::message::Message for SqlUsersDeleteRequest {
31058    fn typename() -> &'static str {
31059        "type.googleapis.com/google.cloud.sql.v1.SqlUsersDeleteRequest"
31060    }
31061}
31062
31063/// Request message for Users Get RPC
31064#[derive(Clone, Default, PartialEq)]
31065#[non_exhaustive]
31066pub struct SqlUsersGetRequest {
31067    /// Database instance ID. This does not include the project ID.
31068    pub instance: std::string::String,
31069
31070    /// User of the instance.
31071    pub name: std::string::String,
31072
31073    /// Project ID of the project that contains the instance.
31074    pub project: std::string::String,
31075
31076    /// Host of a user of the instance.
31077    pub host: std::string::String,
31078
31079    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31080}
31081
31082impl SqlUsersGetRequest {
31083    /// Creates a new default instance.
31084    pub fn new() -> Self {
31085        std::default::Default::default()
31086    }
31087
31088    /// Sets the value of [instance][crate::model::SqlUsersGetRequest::instance].
31089    ///
31090    /// # Example
31091    /// ```ignore,no_run
31092    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
31093    /// let x = SqlUsersGetRequest::new().set_instance("example");
31094    /// ```
31095    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31096        self.instance = v.into();
31097        self
31098    }
31099
31100    /// Sets the value of [name][crate::model::SqlUsersGetRequest::name].
31101    ///
31102    /// # Example
31103    /// ```ignore,no_run
31104    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
31105    /// let x = SqlUsersGetRequest::new().set_name("example");
31106    /// ```
31107    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31108        self.name = v.into();
31109        self
31110    }
31111
31112    /// Sets the value of [project][crate::model::SqlUsersGetRequest::project].
31113    ///
31114    /// # Example
31115    /// ```ignore,no_run
31116    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
31117    /// let x = SqlUsersGetRequest::new().set_project("example");
31118    /// ```
31119    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31120        self.project = v.into();
31121        self
31122    }
31123
31124    /// Sets the value of [host][crate::model::SqlUsersGetRequest::host].
31125    ///
31126    /// # Example
31127    /// ```ignore,no_run
31128    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
31129    /// let x = SqlUsersGetRequest::new().set_host("example");
31130    /// ```
31131    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31132        self.host = v.into();
31133        self
31134    }
31135}
31136
31137impl wkt::message::Message for SqlUsersGetRequest {
31138    fn typename() -> &'static str {
31139        "type.googleapis.com/google.cloud.sql.v1.SqlUsersGetRequest"
31140    }
31141}
31142
31143#[allow(missing_docs)]
31144#[derive(Clone, Default, PartialEq)]
31145#[non_exhaustive]
31146pub struct SqlUsersInsertRequest {
31147    /// Database instance ID. This does not include the project ID.
31148    pub instance: std::string::String,
31149
31150    /// Project ID of the project that contains the instance.
31151    pub project: std::string::String,
31152
31153    #[allow(missing_docs)]
31154    pub body: std::option::Option<crate::model::User>,
31155
31156    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31157}
31158
31159impl SqlUsersInsertRequest {
31160    /// Creates a new default instance.
31161    pub fn new() -> Self {
31162        std::default::Default::default()
31163    }
31164
31165    /// Sets the value of [instance][crate::model::SqlUsersInsertRequest::instance].
31166    ///
31167    /// # Example
31168    /// ```ignore,no_run
31169    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
31170    /// let x = SqlUsersInsertRequest::new().set_instance("example");
31171    /// ```
31172    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31173        self.instance = v.into();
31174        self
31175    }
31176
31177    /// Sets the value of [project][crate::model::SqlUsersInsertRequest::project].
31178    ///
31179    /// # Example
31180    /// ```ignore,no_run
31181    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
31182    /// let x = SqlUsersInsertRequest::new().set_project("example");
31183    /// ```
31184    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31185        self.project = v.into();
31186        self
31187    }
31188
31189    /// Sets the value of [body][crate::model::SqlUsersInsertRequest::body].
31190    ///
31191    /// # Example
31192    /// ```ignore,no_run
31193    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
31194    /// use google_cloud_sql_v1::model::User;
31195    /// let x = SqlUsersInsertRequest::new().set_body(User::default()/* use setters */);
31196    /// ```
31197    pub fn set_body<T>(mut self, v: T) -> Self
31198    where
31199        T: std::convert::Into<crate::model::User>,
31200    {
31201        self.body = std::option::Option::Some(v.into());
31202        self
31203    }
31204
31205    /// Sets or clears the value of [body][crate::model::SqlUsersInsertRequest::body].
31206    ///
31207    /// # Example
31208    /// ```ignore,no_run
31209    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
31210    /// use google_cloud_sql_v1::model::User;
31211    /// let x = SqlUsersInsertRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
31212    /// let x = SqlUsersInsertRequest::new().set_or_clear_body(None::<User>);
31213    /// ```
31214    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
31215    where
31216        T: std::convert::Into<crate::model::User>,
31217    {
31218        self.body = v.map(|x| x.into());
31219        self
31220    }
31221}
31222
31223impl wkt::message::Message for SqlUsersInsertRequest {
31224    fn typename() -> &'static str {
31225        "type.googleapis.com/google.cloud.sql.v1.SqlUsersInsertRequest"
31226    }
31227}
31228
31229#[allow(missing_docs)]
31230#[derive(Clone, Default, PartialEq)]
31231#[non_exhaustive]
31232pub struct SqlUsersListRequest {
31233    /// Database instance ID. This does not include the project ID.
31234    pub instance: std::string::String,
31235
31236    /// Project ID of the project that contains the instance.
31237    pub project: std::string::String,
31238
31239    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31240}
31241
31242impl SqlUsersListRequest {
31243    /// Creates a new default instance.
31244    pub fn new() -> Self {
31245        std::default::Default::default()
31246    }
31247
31248    /// Sets the value of [instance][crate::model::SqlUsersListRequest::instance].
31249    ///
31250    /// # Example
31251    /// ```ignore,no_run
31252    /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
31253    /// let x = SqlUsersListRequest::new().set_instance("example");
31254    /// ```
31255    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31256        self.instance = v.into();
31257        self
31258    }
31259
31260    /// Sets the value of [project][crate::model::SqlUsersListRequest::project].
31261    ///
31262    /// # Example
31263    /// ```ignore,no_run
31264    /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
31265    /// let x = SqlUsersListRequest::new().set_project("example");
31266    /// ```
31267    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31268        self.project = v.into();
31269        self
31270    }
31271}
31272
31273impl wkt::message::Message for SqlUsersListRequest {
31274    fn typename() -> &'static str {
31275        "type.googleapis.com/google.cloud.sql.v1.SqlUsersListRequest"
31276    }
31277}
31278
31279#[allow(missing_docs)]
31280#[derive(Clone, Default, PartialEq)]
31281#[non_exhaustive]
31282pub struct SqlUsersUpdateRequest {
31283    /// Optional. Host of the user in the instance.
31284    pub host: std::string::String,
31285
31286    /// Database instance ID. This does not include the project ID.
31287    pub instance: std::string::String,
31288
31289    /// Name of the user in the instance.
31290    pub name: std::string::String,
31291
31292    /// Project ID of the project that contains the instance.
31293    pub project: std::string::String,
31294
31295    /// Optional. List of database roles to grant to the user. body.database_roles
31296    /// will be ignored for update request.
31297    pub database_roles: std::vec::Vec<std::string::String>,
31298
31299    /// Optional. Specifies whether to revoke existing roles that are not present
31300    /// in the `database_roles` field. If `false` or unset, the database roles
31301    /// specified in `database_roles` are added to the user's existing roles.
31302    pub revoke_existing_roles: std::option::Option<bool>,
31303
31304    #[allow(missing_docs)]
31305    pub body: std::option::Option<crate::model::User>,
31306
31307    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31308}
31309
31310impl SqlUsersUpdateRequest {
31311    /// Creates a new default instance.
31312    pub fn new() -> Self {
31313        std::default::Default::default()
31314    }
31315
31316    /// Sets the value of [host][crate::model::SqlUsersUpdateRequest::host].
31317    ///
31318    /// # Example
31319    /// ```ignore,no_run
31320    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31321    /// let x = SqlUsersUpdateRequest::new().set_host("example");
31322    /// ```
31323    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31324        self.host = v.into();
31325        self
31326    }
31327
31328    /// Sets the value of [instance][crate::model::SqlUsersUpdateRequest::instance].
31329    ///
31330    /// # Example
31331    /// ```ignore,no_run
31332    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31333    /// let x = SqlUsersUpdateRequest::new().set_instance("example");
31334    /// ```
31335    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31336        self.instance = v.into();
31337        self
31338    }
31339
31340    /// Sets the value of [name][crate::model::SqlUsersUpdateRequest::name].
31341    ///
31342    /// # Example
31343    /// ```ignore,no_run
31344    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31345    /// let x = SqlUsersUpdateRequest::new().set_name("example");
31346    /// ```
31347    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31348        self.name = v.into();
31349        self
31350    }
31351
31352    /// Sets the value of [project][crate::model::SqlUsersUpdateRequest::project].
31353    ///
31354    /// # Example
31355    /// ```ignore,no_run
31356    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31357    /// let x = SqlUsersUpdateRequest::new().set_project("example");
31358    /// ```
31359    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31360        self.project = v.into();
31361        self
31362    }
31363
31364    /// Sets the value of [database_roles][crate::model::SqlUsersUpdateRequest::database_roles].
31365    ///
31366    /// # Example
31367    /// ```ignore,no_run
31368    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31369    /// let x = SqlUsersUpdateRequest::new().set_database_roles(["a", "b", "c"]);
31370    /// ```
31371    pub fn set_database_roles<T, V>(mut self, v: T) -> Self
31372    where
31373        T: std::iter::IntoIterator<Item = V>,
31374        V: std::convert::Into<std::string::String>,
31375    {
31376        use std::iter::Iterator;
31377        self.database_roles = v.into_iter().map(|i| i.into()).collect();
31378        self
31379    }
31380
31381    /// Sets the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
31382    ///
31383    /// # Example
31384    /// ```ignore,no_run
31385    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31386    /// let x = SqlUsersUpdateRequest::new().set_revoke_existing_roles(true);
31387    /// ```
31388    pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
31389    where
31390        T: std::convert::Into<bool>,
31391    {
31392        self.revoke_existing_roles = std::option::Option::Some(v.into());
31393        self
31394    }
31395
31396    /// Sets or clears the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
31397    ///
31398    /// # Example
31399    /// ```ignore,no_run
31400    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31401    /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_roles(Some(false));
31402    /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_roles(None::<bool>);
31403    /// ```
31404    pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
31405    where
31406        T: std::convert::Into<bool>,
31407    {
31408        self.revoke_existing_roles = v.map(|x| x.into());
31409        self
31410    }
31411
31412    /// Sets the value of [body][crate::model::SqlUsersUpdateRequest::body].
31413    ///
31414    /// # Example
31415    /// ```ignore,no_run
31416    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31417    /// use google_cloud_sql_v1::model::User;
31418    /// let x = SqlUsersUpdateRequest::new().set_body(User::default()/* use setters */);
31419    /// ```
31420    pub fn set_body<T>(mut self, v: T) -> Self
31421    where
31422        T: std::convert::Into<crate::model::User>,
31423    {
31424        self.body = std::option::Option::Some(v.into());
31425        self
31426    }
31427
31428    /// Sets or clears the value of [body][crate::model::SqlUsersUpdateRequest::body].
31429    ///
31430    /// # Example
31431    /// ```ignore,no_run
31432    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31433    /// use google_cloud_sql_v1::model::User;
31434    /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
31435    /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(None::<User>);
31436    /// ```
31437    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
31438    where
31439        T: std::convert::Into<crate::model::User>,
31440    {
31441        self.body = v.map(|x| x.into());
31442        self
31443    }
31444}
31445
31446impl wkt::message::Message for SqlUsersUpdateRequest {
31447    fn typename() -> &'static str {
31448        "type.googleapis.com/google.cloud.sql.v1.SqlUsersUpdateRequest"
31449    }
31450}
31451
31452/// User level password validation policy.
31453#[derive(Clone, Default, PartialEq)]
31454#[non_exhaustive]
31455pub struct UserPasswordValidationPolicy {
31456    /// Number of failed login attempts allowed before user get locked.
31457    pub allowed_failed_attempts: i32,
31458
31459    /// Expiration duration after password is updated.
31460    pub password_expiration_duration: std::option::Option<wkt::Duration>,
31461
31462    /// If true, failed login attempts check will be enabled.
31463    pub enable_failed_attempts_check: bool,
31464
31465    /// Output only. Read-only password status.
31466    pub status: std::option::Option<crate::model::PasswordStatus>,
31467
31468    /// If true, the user must specify the current password before changing the
31469    /// password. This flag is supported only for MySQL.
31470    pub enable_password_verification: bool,
31471
31472    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31473}
31474
31475impl UserPasswordValidationPolicy {
31476    /// Creates a new default instance.
31477    pub fn new() -> Self {
31478        std::default::Default::default()
31479    }
31480
31481    /// Sets the value of [allowed_failed_attempts][crate::model::UserPasswordValidationPolicy::allowed_failed_attempts].
31482    ///
31483    /// # Example
31484    /// ```ignore,no_run
31485    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31486    /// let x = UserPasswordValidationPolicy::new().set_allowed_failed_attempts(42);
31487    /// ```
31488    pub fn set_allowed_failed_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
31489        self.allowed_failed_attempts = v.into();
31490        self
31491    }
31492
31493    /// Sets the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
31494    ///
31495    /// # Example
31496    /// ```ignore,no_run
31497    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31498    /// use wkt::Duration;
31499    /// let x = UserPasswordValidationPolicy::new().set_password_expiration_duration(Duration::default()/* use setters */);
31500    /// ```
31501    pub fn set_password_expiration_duration<T>(mut self, v: T) -> Self
31502    where
31503        T: std::convert::Into<wkt::Duration>,
31504    {
31505        self.password_expiration_duration = std::option::Option::Some(v.into());
31506        self
31507    }
31508
31509    /// Sets or clears the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
31510    ///
31511    /// # Example
31512    /// ```ignore,no_run
31513    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31514    /// use wkt::Duration;
31515    /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(Some(Duration::default()/* use setters */));
31516    /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(None::<Duration>);
31517    /// ```
31518    pub fn set_or_clear_password_expiration_duration<T>(mut self, v: std::option::Option<T>) -> Self
31519    where
31520        T: std::convert::Into<wkt::Duration>,
31521    {
31522        self.password_expiration_duration = v.map(|x| x.into());
31523        self
31524    }
31525
31526    /// Sets the value of [enable_failed_attempts_check][crate::model::UserPasswordValidationPolicy::enable_failed_attempts_check].
31527    ///
31528    /// # Example
31529    /// ```ignore,no_run
31530    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31531    /// let x = UserPasswordValidationPolicy::new().set_enable_failed_attempts_check(true);
31532    /// ```
31533    pub fn set_enable_failed_attempts_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31534        self.enable_failed_attempts_check = v.into();
31535        self
31536    }
31537
31538    /// Sets the value of [status][crate::model::UserPasswordValidationPolicy::status].
31539    ///
31540    /// # Example
31541    /// ```ignore,no_run
31542    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31543    /// use google_cloud_sql_v1::model::PasswordStatus;
31544    /// let x = UserPasswordValidationPolicy::new().set_status(PasswordStatus::default()/* use setters */);
31545    /// ```
31546    pub fn set_status<T>(mut self, v: T) -> Self
31547    where
31548        T: std::convert::Into<crate::model::PasswordStatus>,
31549    {
31550        self.status = std::option::Option::Some(v.into());
31551        self
31552    }
31553
31554    /// Sets or clears the value of [status][crate::model::UserPasswordValidationPolicy::status].
31555    ///
31556    /// # Example
31557    /// ```ignore,no_run
31558    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31559    /// use google_cloud_sql_v1::model::PasswordStatus;
31560    /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(Some(PasswordStatus::default()/* use setters */));
31561    /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(None::<PasswordStatus>);
31562    /// ```
31563    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
31564    where
31565        T: std::convert::Into<crate::model::PasswordStatus>,
31566    {
31567        self.status = v.map(|x| x.into());
31568        self
31569    }
31570
31571    /// Sets the value of [enable_password_verification][crate::model::UserPasswordValidationPolicy::enable_password_verification].
31572    ///
31573    /// # Example
31574    /// ```ignore,no_run
31575    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31576    /// let x = UserPasswordValidationPolicy::new().set_enable_password_verification(true);
31577    /// ```
31578    pub fn set_enable_password_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31579        self.enable_password_verification = v.into();
31580        self
31581    }
31582}
31583
31584impl wkt::message::Message for UserPasswordValidationPolicy {
31585    fn typename() -> &'static str {
31586        "type.googleapis.com/google.cloud.sql.v1.UserPasswordValidationPolicy"
31587    }
31588}
31589
31590/// Read-only password status.
31591#[derive(Clone, Default, PartialEq)]
31592#[non_exhaustive]
31593pub struct PasswordStatus {
31594    /// If true, user does not have login privileges.
31595    pub locked: bool,
31596
31597    /// The expiration time of the current password.
31598    pub password_expiration_time: std::option::Option<wkt::Timestamp>,
31599
31600    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31601}
31602
31603impl PasswordStatus {
31604    /// Creates a new default instance.
31605    pub fn new() -> Self {
31606        std::default::Default::default()
31607    }
31608
31609    /// Sets the value of [locked][crate::model::PasswordStatus::locked].
31610    ///
31611    /// # Example
31612    /// ```ignore,no_run
31613    /// # use google_cloud_sql_v1::model::PasswordStatus;
31614    /// let x = PasswordStatus::new().set_locked(true);
31615    /// ```
31616    pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31617        self.locked = v.into();
31618        self
31619    }
31620
31621    /// Sets the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
31622    ///
31623    /// # Example
31624    /// ```ignore,no_run
31625    /// # use google_cloud_sql_v1::model::PasswordStatus;
31626    /// use wkt::Timestamp;
31627    /// let x = PasswordStatus::new().set_password_expiration_time(Timestamp::default()/* use setters */);
31628    /// ```
31629    pub fn set_password_expiration_time<T>(mut self, v: T) -> Self
31630    where
31631        T: std::convert::Into<wkt::Timestamp>,
31632    {
31633        self.password_expiration_time = std::option::Option::Some(v.into());
31634        self
31635    }
31636
31637    /// Sets or clears the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
31638    ///
31639    /// # Example
31640    /// ```ignore,no_run
31641    /// # use google_cloud_sql_v1::model::PasswordStatus;
31642    /// use wkt::Timestamp;
31643    /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(Some(Timestamp::default()/* use setters */));
31644    /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(None::<Timestamp>);
31645    /// ```
31646    pub fn set_or_clear_password_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
31647    where
31648        T: std::convert::Into<wkt::Timestamp>,
31649    {
31650        self.password_expiration_time = v.map(|x| x.into());
31651        self
31652    }
31653}
31654
31655impl wkt::message::Message for PasswordStatus {
31656    fn typename() -> &'static str {
31657        "type.googleapis.com/google.cloud.sql.v1.PasswordStatus"
31658    }
31659}
31660
31661/// A Cloud SQL user resource.
31662#[derive(Clone, Default, PartialEq)]
31663#[non_exhaustive]
31664pub struct User {
31665    /// This is always `sql#user`.
31666    pub kind: std::string::String,
31667
31668    /// The password for the user.
31669    pub password: std::string::String,
31670
31671    /// This field is deprecated and will be removed from a future version of the
31672    /// API.
31673    pub etag: std::string::String,
31674
31675    /// The name of the user in the Cloud SQL instance. Can be omitted for
31676    /// `update` because it is already specified in the URL.
31677    pub name: std::string::String,
31678
31679    /// Optional. The host from which the user can connect. For `insert`
31680    /// operations, host defaults to an empty string. For `update`
31681    /// operations, host is specified as part of the request URL. The host name
31682    /// cannot be updated after insertion.  For a MySQL instance, it's required;
31683    /// for a PostgreSQL or SQL Server instance, it's optional.
31684    pub host: std::string::String,
31685
31686    /// The name of the Cloud SQL instance. This does not include the project ID.
31687    /// Can be omitted for `update` because it is already specified on the
31688    /// URL.
31689    pub instance: std::string::String,
31690
31691    /// The project ID of the project containing the Cloud SQL database. The Google
31692    /// apps domain is prefixed if applicable. Can be omitted for `update` because
31693    /// it is already specified on the URL.
31694    pub project: std::string::String,
31695
31696    /// The user type. It determines the method to authenticate the user during
31697    /// login. The default is the database's built-in user type.
31698    pub r#type: crate::model::user::SqlUserType,
31699
31700    /// Optional. The full email for an IAM user. For normal database users, this
31701    /// will not be filled. Only applicable to MySQL database users.
31702    pub iam_email: std::string::String,
31703
31704    /// User level password validation policy.
31705    pub password_policy: std::option::Option<crate::model::UserPasswordValidationPolicy>,
31706
31707    /// Dual password status for the user.
31708    pub dual_password_type: std::option::Option<crate::model::user::DualPasswordType>,
31709
31710    /// Indicates if a group is active or inactive for IAM database authentication.
31711    pub iam_status: std::option::Option<crate::model::user::IamStatus>,
31712
31713    /// Optional. Role memberships of the user
31714    pub database_roles: std::vec::Vec<std::string::String>,
31715
31716    /// User details for specific database type
31717    pub user_details: std::option::Option<crate::model::user::UserDetails>,
31718
31719    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31720}
31721
31722impl User {
31723    /// Creates a new default instance.
31724    pub fn new() -> Self {
31725        std::default::Default::default()
31726    }
31727
31728    /// Sets the value of [kind][crate::model::User::kind].
31729    ///
31730    /// # Example
31731    /// ```ignore,no_run
31732    /// # use google_cloud_sql_v1::model::User;
31733    /// let x = User::new().set_kind("example");
31734    /// ```
31735    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31736        self.kind = v.into();
31737        self
31738    }
31739
31740    /// Sets the value of [password][crate::model::User::password].
31741    ///
31742    /// # Example
31743    /// ```ignore,no_run
31744    /// # use google_cloud_sql_v1::model::User;
31745    /// let x = User::new().set_password("example");
31746    /// ```
31747    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31748        self.password = v.into();
31749        self
31750    }
31751
31752    /// Sets the value of [etag][crate::model::User::etag].
31753    ///
31754    /// # Example
31755    /// ```ignore,no_run
31756    /// # use google_cloud_sql_v1::model::User;
31757    /// let x = User::new().set_etag("example");
31758    /// ```
31759    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31760        self.etag = v.into();
31761        self
31762    }
31763
31764    /// Sets the value of [name][crate::model::User::name].
31765    ///
31766    /// # Example
31767    /// ```ignore,no_run
31768    /// # use google_cloud_sql_v1::model::User;
31769    /// let x = User::new().set_name("example");
31770    /// ```
31771    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31772        self.name = v.into();
31773        self
31774    }
31775
31776    /// Sets the value of [host][crate::model::User::host].
31777    ///
31778    /// # Example
31779    /// ```ignore,no_run
31780    /// # use google_cloud_sql_v1::model::User;
31781    /// let x = User::new().set_host("example");
31782    /// ```
31783    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31784        self.host = v.into();
31785        self
31786    }
31787
31788    /// Sets the value of [instance][crate::model::User::instance].
31789    ///
31790    /// # Example
31791    /// ```ignore,no_run
31792    /// # use google_cloud_sql_v1::model::User;
31793    /// let x = User::new().set_instance("example");
31794    /// ```
31795    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31796        self.instance = v.into();
31797        self
31798    }
31799
31800    /// Sets the value of [project][crate::model::User::project].
31801    ///
31802    /// # Example
31803    /// ```ignore,no_run
31804    /// # use google_cloud_sql_v1::model::User;
31805    /// let x = User::new().set_project("example");
31806    /// ```
31807    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31808        self.project = v.into();
31809        self
31810    }
31811
31812    /// Sets the value of [r#type][crate::model::User::type].
31813    ///
31814    /// # Example
31815    /// ```ignore,no_run
31816    /// # use google_cloud_sql_v1::model::User;
31817    /// use google_cloud_sql_v1::model::user::SqlUserType;
31818    /// let x0 = User::new().set_type(SqlUserType::CloudIamUser);
31819    /// let x1 = User::new().set_type(SqlUserType::CloudIamServiceAccount);
31820    /// let x2 = User::new().set_type(SqlUserType::CloudIamGroup);
31821    /// ```
31822    pub fn set_type<T: std::convert::Into<crate::model::user::SqlUserType>>(
31823        mut self,
31824        v: T,
31825    ) -> Self {
31826        self.r#type = v.into();
31827        self
31828    }
31829
31830    /// Sets the value of [iam_email][crate::model::User::iam_email].
31831    ///
31832    /// # Example
31833    /// ```ignore,no_run
31834    /// # use google_cloud_sql_v1::model::User;
31835    /// let x = User::new().set_iam_email("example");
31836    /// ```
31837    pub fn set_iam_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31838        self.iam_email = v.into();
31839        self
31840    }
31841
31842    /// Sets the value of [password_policy][crate::model::User::password_policy].
31843    ///
31844    /// # Example
31845    /// ```ignore,no_run
31846    /// # use google_cloud_sql_v1::model::User;
31847    /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31848    /// let x = User::new().set_password_policy(UserPasswordValidationPolicy::default()/* use setters */);
31849    /// ```
31850    pub fn set_password_policy<T>(mut self, v: T) -> Self
31851    where
31852        T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
31853    {
31854        self.password_policy = std::option::Option::Some(v.into());
31855        self
31856    }
31857
31858    /// Sets or clears the value of [password_policy][crate::model::User::password_policy].
31859    ///
31860    /// # Example
31861    /// ```ignore,no_run
31862    /// # use google_cloud_sql_v1::model::User;
31863    /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31864    /// let x = User::new().set_or_clear_password_policy(Some(UserPasswordValidationPolicy::default()/* use setters */));
31865    /// let x = User::new().set_or_clear_password_policy(None::<UserPasswordValidationPolicy>);
31866    /// ```
31867    pub fn set_or_clear_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
31868    where
31869        T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
31870    {
31871        self.password_policy = v.map(|x| x.into());
31872        self
31873    }
31874
31875    /// Sets the value of [dual_password_type][crate::model::User::dual_password_type].
31876    ///
31877    /// # Example
31878    /// ```ignore,no_run
31879    /// # use google_cloud_sql_v1::model::User;
31880    /// use google_cloud_sql_v1::model::user::DualPasswordType;
31881    /// let x0 = User::new().set_dual_password_type(DualPasswordType::NoModifyDualPassword);
31882    /// let x1 = User::new().set_dual_password_type(DualPasswordType::NoDualPassword);
31883    /// let x2 = User::new().set_dual_password_type(DualPasswordType::DualPassword);
31884    /// ```
31885    pub fn set_dual_password_type<T>(mut self, v: T) -> Self
31886    where
31887        T: std::convert::Into<crate::model::user::DualPasswordType>,
31888    {
31889        self.dual_password_type = std::option::Option::Some(v.into());
31890        self
31891    }
31892
31893    /// Sets or clears the value of [dual_password_type][crate::model::User::dual_password_type].
31894    ///
31895    /// # Example
31896    /// ```ignore,no_run
31897    /// # use google_cloud_sql_v1::model::User;
31898    /// use google_cloud_sql_v1::model::user::DualPasswordType;
31899    /// let x0 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoModifyDualPassword));
31900    /// let x1 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoDualPassword));
31901    /// let x2 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::DualPassword));
31902    /// let x_none = User::new().set_or_clear_dual_password_type(None::<DualPasswordType>);
31903    /// ```
31904    pub fn set_or_clear_dual_password_type<T>(mut self, v: std::option::Option<T>) -> Self
31905    where
31906        T: std::convert::Into<crate::model::user::DualPasswordType>,
31907    {
31908        self.dual_password_type = v.map(|x| x.into());
31909        self
31910    }
31911
31912    /// Sets the value of [iam_status][crate::model::User::iam_status].
31913    ///
31914    /// # Example
31915    /// ```ignore,no_run
31916    /// # use google_cloud_sql_v1::model::User;
31917    /// use google_cloud_sql_v1::model::user::IamStatus;
31918    /// let x0 = User::new().set_iam_status(IamStatus::Inactive);
31919    /// let x1 = User::new().set_iam_status(IamStatus::Active);
31920    /// ```
31921    pub fn set_iam_status<T>(mut self, v: T) -> Self
31922    where
31923        T: std::convert::Into<crate::model::user::IamStatus>,
31924    {
31925        self.iam_status = std::option::Option::Some(v.into());
31926        self
31927    }
31928
31929    /// Sets or clears the value of [iam_status][crate::model::User::iam_status].
31930    ///
31931    /// # Example
31932    /// ```ignore,no_run
31933    /// # use google_cloud_sql_v1::model::User;
31934    /// use google_cloud_sql_v1::model::user::IamStatus;
31935    /// let x0 = User::new().set_or_clear_iam_status(Some(IamStatus::Inactive));
31936    /// let x1 = User::new().set_or_clear_iam_status(Some(IamStatus::Active));
31937    /// let x_none = User::new().set_or_clear_iam_status(None::<IamStatus>);
31938    /// ```
31939    pub fn set_or_clear_iam_status<T>(mut self, v: std::option::Option<T>) -> Self
31940    where
31941        T: std::convert::Into<crate::model::user::IamStatus>,
31942    {
31943        self.iam_status = v.map(|x| x.into());
31944        self
31945    }
31946
31947    /// Sets the value of [database_roles][crate::model::User::database_roles].
31948    ///
31949    /// # Example
31950    /// ```ignore,no_run
31951    /// # use google_cloud_sql_v1::model::User;
31952    /// let x = User::new().set_database_roles(["a", "b", "c"]);
31953    /// ```
31954    pub fn set_database_roles<T, V>(mut self, v: T) -> Self
31955    where
31956        T: std::iter::IntoIterator<Item = V>,
31957        V: std::convert::Into<std::string::String>,
31958    {
31959        use std::iter::Iterator;
31960        self.database_roles = v.into_iter().map(|i| i.into()).collect();
31961        self
31962    }
31963
31964    /// Sets the value of [user_details][crate::model::User::user_details].
31965    ///
31966    /// Note that all the setters affecting `user_details` are mutually
31967    /// exclusive.
31968    ///
31969    /// # Example
31970    /// ```ignore,no_run
31971    /// # use google_cloud_sql_v1::model::User;
31972    /// use google_cloud_sql_v1::model::SqlServerUserDetails;
31973    /// let x = User::new().set_user_details(Some(
31974    ///     google_cloud_sql_v1::model::user::UserDetails::SqlserverUserDetails(SqlServerUserDetails::default().into())));
31975    /// ```
31976    pub fn set_user_details<
31977        T: std::convert::Into<std::option::Option<crate::model::user::UserDetails>>,
31978    >(
31979        mut self,
31980        v: T,
31981    ) -> Self {
31982        self.user_details = v.into();
31983        self
31984    }
31985
31986    /// The value of [user_details][crate::model::User::user_details]
31987    /// if it holds a `SqlserverUserDetails`, `None` if the field is not set or
31988    /// holds a different branch.
31989    pub fn sqlserver_user_details(
31990        &self,
31991    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerUserDetails>> {
31992        #[allow(unreachable_patterns)]
31993        self.user_details.as_ref().and_then(|v| match v {
31994            crate::model::user::UserDetails::SqlserverUserDetails(v) => {
31995                std::option::Option::Some(v)
31996            }
31997            _ => std::option::Option::None,
31998        })
31999    }
32000
32001    /// Sets the value of [user_details][crate::model::User::user_details]
32002    /// to hold a `SqlserverUserDetails`.
32003    ///
32004    /// Note that all the setters affecting `user_details` are
32005    /// mutually exclusive.
32006    ///
32007    /// # Example
32008    /// ```ignore,no_run
32009    /// # use google_cloud_sql_v1::model::User;
32010    /// use google_cloud_sql_v1::model::SqlServerUserDetails;
32011    /// let x = User::new().set_sqlserver_user_details(SqlServerUserDetails::default()/* use setters */);
32012    /// assert!(x.sqlserver_user_details().is_some());
32013    /// ```
32014    pub fn set_sqlserver_user_details<
32015        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerUserDetails>>,
32016    >(
32017        mut self,
32018        v: T,
32019    ) -> Self {
32020        self.user_details = std::option::Option::Some(
32021            crate::model::user::UserDetails::SqlserverUserDetails(v.into()),
32022        );
32023        self
32024    }
32025}
32026
32027impl wkt::message::Message for User {
32028    fn typename() -> &'static str {
32029        "type.googleapis.com/google.cloud.sql.v1.User"
32030    }
32031}
32032
32033/// Defines additional types related to [User].
32034pub mod user {
32035    #[allow(unused_imports)]
32036    use super::*;
32037
32038    /// The user type.
32039    ///
32040    /// # Working with unknown values
32041    ///
32042    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32043    /// additional enum variants at any time. Adding new variants is not considered
32044    /// a breaking change. Applications should write their code in anticipation of:
32045    ///
32046    /// - New values appearing in future releases of the client library, **and**
32047    /// - New values received dynamically, without application changes.
32048    ///
32049    /// Please consult the [Working with enums] section in the user guide for some
32050    /// guidelines.
32051    ///
32052    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32053    #[derive(Clone, Debug, PartialEq)]
32054    #[non_exhaustive]
32055    pub enum SqlUserType {
32056        /// The database's built-in user type.
32057        BuiltIn,
32058        /// Cloud IAM user.
32059        CloudIamUser,
32060        /// Cloud IAM service account.
32061        CloudIamServiceAccount,
32062        /// Cloud IAM group. Not used for login.
32063        CloudIamGroup,
32064        /// Read-only. Login for a user that belongs to the Cloud IAM group.
32065        CloudIamGroupUser,
32066        /// Read-only. Login for a service account that belongs to the
32067        /// Cloud IAM group.
32068        CloudIamGroupServiceAccount,
32069        /// Microsoft Entra ID user.
32070        EntraidUser,
32071        /// If set, the enum was initialized with an unknown value.
32072        ///
32073        /// Applications can examine the value using [SqlUserType::value] or
32074        /// [SqlUserType::name].
32075        UnknownValue(sql_user_type::UnknownValue),
32076    }
32077
32078    #[doc(hidden)]
32079    pub mod sql_user_type {
32080        #[allow(unused_imports)]
32081        use super::*;
32082        #[derive(Clone, Debug, PartialEq)]
32083        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32084    }
32085
32086    impl SqlUserType {
32087        /// Gets the enum value.
32088        ///
32089        /// Returns `None` if the enum contains an unknown value deserialized from
32090        /// the string representation of enums.
32091        pub fn value(&self) -> std::option::Option<i32> {
32092            match self {
32093                Self::BuiltIn => std::option::Option::Some(0),
32094                Self::CloudIamUser => std::option::Option::Some(1),
32095                Self::CloudIamServiceAccount => std::option::Option::Some(2),
32096                Self::CloudIamGroup => std::option::Option::Some(3),
32097                Self::CloudIamGroupUser => std::option::Option::Some(4),
32098                Self::CloudIamGroupServiceAccount => std::option::Option::Some(5),
32099                Self::EntraidUser => std::option::Option::Some(7),
32100                Self::UnknownValue(u) => u.0.value(),
32101            }
32102        }
32103
32104        /// Gets the enum value as a string.
32105        ///
32106        /// Returns `None` if the enum contains an unknown value deserialized from
32107        /// the integer representation of enums.
32108        pub fn name(&self) -> std::option::Option<&str> {
32109            match self {
32110                Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
32111                Self::CloudIamUser => std::option::Option::Some("CLOUD_IAM_USER"),
32112                Self::CloudIamServiceAccount => {
32113                    std::option::Option::Some("CLOUD_IAM_SERVICE_ACCOUNT")
32114                }
32115                Self::CloudIamGroup => std::option::Option::Some("CLOUD_IAM_GROUP"),
32116                Self::CloudIamGroupUser => std::option::Option::Some("CLOUD_IAM_GROUP_USER"),
32117                Self::CloudIamGroupServiceAccount => {
32118                    std::option::Option::Some("CLOUD_IAM_GROUP_SERVICE_ACCOUNT")
32119                }
32120                Self::EntraidUser => std::option::Option::Some("ENTRAID_USER"),
32121                Self::UnknownValue(u) => u.0.name(),
32122            }
32123        }
32124    }
32125
32126    impl std::default::Default for SqlUserType {
32127        fn default() -> Self {
32128            use std::convert::From;
32129            Self::from(0)
32130        }
32131    }
32132
32133    impl std::fmt::Display for SqlUserType {
32134        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32135            wkt::internal::display_enum(f, self.name(), self.value())
32136        }
32137    }
32138
32139    impl std::convert::From<i32> for SqlUserType {
32140        fn from(value: i32) -> Self {
32141            match value {
32142                0 => Self::BuiltIn,
32143                1 => Self::CloudIamUser,
32144                2 => Self::CloudIamServiceAccount,
32145                3 => Self::CloudIamGroup,
32146                4 => Self::CloudIamGroupUser,
32147                5 => Self::CloudIamGroupServiceAccount,
32148                7 => Self::EntraidUser,
32149                _ => Self::UnknownValue(sql_user_type::UnknownValue(
32150                    wkt::internal::UnknownEnumValue::Integer(value),
32151                )),
32152            }
32153        }
32154    }
32155
32156    impl std::convert::From<&str> for SqlUserType {
32157        fn from(value: &str) -> Self {
32158            use std::string::ToString;
32159            match value {
32160                "BUILT_IN" => Self::BuiltIn,
32161                "CLOUD_IAM_USER" => Self::CloudIamUser,
32162                "CLOUD_IAM_SERVICE_ACCOUNT" => Self::CloudIamServiceAccount,
32163                "CLOUD_IAM_GROUP" => Self::CloudIamGroup,
32164                "CLOUD_IAM_GROUP_USER" => Self::CloudIamGroupUser,
32165                "CLOUD_IAM_GROUP_SERVICE_ACCOUNT" => Self::CloudIamGroupServiceAccount,
32166                "ENTRAID_USER" => Self::EntraidUser,
32167                _ => Self::UnknownValue(sql_user_type::UnknownValue(
32168                    wkt::internal::UnknownEnumValue::String(value.to_string()),
32169                )),
32170            }
32171        }
32172    }
32173
32174    impl serde::ser::Serialize for SqlUserType {
32175        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32176        where
32177            S: serde::Serializer,
32178        {
32179            match self {
32180                Self::BuiltIn => serializer.serialize_i32(0),
32181                Self::CloudIamUser => serializer.serialize_i32(1),
32182                Self::CloudIamServiceAccount => serializer.serialize_i32(2),
32183                Self::CloudIamGroup => serializer.serialize_i32(3),
32184                Self::CloudIamGroupUser => serializer.serialize_i32(4),
32185                Self::CloudIamGroupServiceAccount => serializer.serialize_i32(5),
32186                Self::EntraidUser => serializer.serialize_i32(7),
32187                Self::UnknownValue(u) => u.0.serialize(serializer),
32188            }
32189        }
32190    }
32191
32192    impl<'de> serde::de::Deserialize<'de> for SqlUserType {
32193        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32194        where
32195            D: serde::Deserializer<'de>,
32196        {
32197            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUserType>::new(
32198                ".google.cloud.sql.v1.User.SqlUserType",
32199            ))
32200        }
32201    }
32202
32203    /// The type of retained password.
32204    ///
32205    /// # Working with unknown values
32206    ///
32207    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32208    /// additional enum variants at any time. Adding new variants is not considered
32209    /// a breaking change. Applications should write their code in anticipation of:
32210    ///
32211    /// - New values appearing in future releases of the client library, **and**
32212    /// - New values received dynamically, without application changes.
32213    ///
32214    /// Please consult the [Working with enums] section in the user guide for some
32215    /// guidelines.
32216    ///
32217    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32218    #[derive(Clone, Debug, PartialEq)]
32219    #[non_exhaustive]
32220    pub enum DualPasswordType {
32221        /// The default value.
32222        Unspecified,
32223        /// Do not update the user's dual password status.
32224        NoModifyDualPassword,
32225        /// No dual password usable for connecting using this user.
32226        NoDualPassword,
32227        /// Dual password usable for connecting using this user.
32228        DualPassword,
32229        /// If set, the enum was initialized with an unknown value.
32230        ///
32231        /// Applications can examine the value using [DualPasswordType::value] or
32232        /// [DualPasswordType::name].
32233        UnknownValue(dual_password_type::UnknownValue),
32234    }
32235
32236    #[doc(hidden)]
32237    pub mod dual_password_type {
32238        #[allow(unused_imports)]
32239        use super::*;
32240        #[derive(Clone, Debug, PartialEq)]
32241        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32242    }
32243
32244    impl DualPasswordType {
32245        /// Gets the enum value.
32246        ///
32247        /// Returns `None` if the enum contains an unknown value deserialized from
32248        /// the string representation of enums.
32249        pub fn value(&self) -> std::option::Option<i32> {
32250            match self {
32251                Self::Unspecified => std::option::Option::Some(0),
32252                Self::NoModifyDualPassword => std::option::Option::Some(1),
32253                Self::NoDualPassword => std::option::Option::Some(2),
32254                Self::DualPassword => std::option::Option::Some(3),
32255                Self::UnknownValue(u) => u.0.value(),
32256            }
32257        }
32258
32259        /// Gets the enum value as a string.
32260        ///
32261        /// Returns `None` if the enum contains an unknown value deserialized from
32262        /// the integer representation of enums.
32263        pub fn name(&self) -> std::option::Option<&str> {
32264            match self {
32265                Self::Unspecified => std::option::Option::Some("DUAL_PASSWORD_TYPE_UNSPECIFIED"),
32266                Self::NoModifyDualPassword => std::option::Option::Some("NO_MODIFY_DUAL_PASSWORD"),
32267                Self::NoDualPassword => std::option::Option::Some("NO_DUAL_PASSWORD"),
32268                Self::DualPassword => std::option::Option::Some("DUAL_PASSWORD"),
32269                Self::UnknownValue(u) => u.0.name(),
32270            }
32271        }
32272    }
32273
32274    impl std::default::Default for DualPasswordType {
32275        fn default() -> Self {
32276            use std::convert::From;
32277            Self::from(0)
32278        }
32279    }
32280
32281    impl std::fmt::Display for DualPasswordType {
32282        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32283            wkt::internal::display_enum(f, self.name(), self.value())
32284        }
32285    }
32286
32287    impl std::convert::From<i32> for DualPasswordType {
32288        fn from(value: i32) -> Self {
32289            match value {
32290                0 => Self::Unspecified,
32291                1 => Self::NoModifyDualPassword,
32292                2 => Self::NoDualPassword,
32293                3 => Self::DualPassword,
32294                _ => Self::UnknownValue(dual_password_type::UnknownValue(
32295                    wkt::internal::UnknownEnumValue::Integer(value),
32296                )),
32297            }
32298        }
32299    }
32300
32301    impl std::convert::From<&str> for DualPasswordType {
32302        fn from(value: &str) -> Self {
32303            use std::string::ToString;
32304            match value {
32305                "DUAL_PASSWORD_TYPE_UNSPECIFIED" => Self::Unspecified,
32306                "NO_MODIFY_DUAL_PASSWORD" => Self::NoModifyDualPassword,
32307                "NO_DUAL_PASSWORD" => Self::NoDualPassword,
32308                "DUAL_PASSWORD" => Self::DualPassword,
32309                _ => Self::UnknownValue(dual_password_type::UnknownValue(
32310                    wkt::internal::UnknownEnumValue::String(value.to_string()),
32311                )),
32312            }
32313        }
32314    }
32315
32316    impl serde::ser::Serialize for DualPasswordType {
32317        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32318        where
32319            S: serde::Serializer,
32320        {
32321            match self {
32322                Self::Unspecified => serializer.serialize_i32(0),
32323                Self::NoModifyDualPassword => serializer.serialize_i32(1),
32324                Self::NoDualPassword => serializer.serialize_i32(2),
32325                Self::DualPassword => serializer.serialize_i32(3),
32326                Self::UnknownValue(u) => u.0.serialize(serializer),
32327            }
32328        }
32329    }
32330
32331    impl<'de> serde::de::Deserialize<'de> for DualPasswordType {
32332        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32333        where
32334            D: serde::Deserializer<'de>,
32335        {
32336            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DualPasswordType>::new(
32337                ".google.cloud.sql.v1.User.DualPasswordType",
32338            ))
32339        }
32340    }
32341
32342    /// Indicates if a group is available for IAM database authentication.
32343    ///
32344    /// # Working with unknown values
32345    ///
32346    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32347    /// additional enum variants at any time. Adding new variants is not considered
32348    /// a breaking change. Applications should write their code in anticipation of:
32349    ///
32350    /// - New values appearing in future releases of the client library, **and**
32351    /// - New values received dynamically, without application changes.
32352    ///
32353    /// Please consult the [Working with enums] section in the user guide for some
32354    /// guidelines.
32355    ///
32356    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32357    #[derive(Clone, Debug, PartialEq)]
32358    #[non_exhaustive]
32359    pub enum IamStatus {
32360        /// The default value for users that are not of type CLOUD_IAM_GROUP.
32361        /// Only CLOUD_IAM_GROUP users will be inactive or active.
32362        /// Users with an IamStatus of IAM_STATUS_UNSPECIFIED will not
32363        /// display whether they are active or inactive as that is not applicable to
32364        /// them.
32365        Unspecified,
32366        /// INACTIVE indicates a group is not available for IAM database
32367        /// authentication.
32368        Inactive,
32369        /// ACTIVE indicates a group is available for IAM database authentication.
32370        Active,
32371        /// If set, the enum was initialized with an unknown value.
32372        ///
32373        /// Applications can examine the value using [IamStatus::value] or
32374        /// [IamStatus::name].
32375        UnknownValue(iam_status::UnknownValue),
32376    }
32377
32378    #[doc(hidden)]
32379    pub mod iam_status {
32380        #[allow(unused_imports)]
32381        use super::*;
32382        #[derive(Clone, Debug, PartialEq)]
32383        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32384    }
32385
32386    impl IamStatus {
32387        /// Gets the enum value.
32388        ///
32389        /// Returns `None` if the enum contains an unknown value deserialized from
32390        /// the string representation of enums.
32391        pub fn value(&self) -> std::option::Option<i32> {
32392            match self {
32393                Self::Unspecified => std::option::Option::Some(0),
32394                Self::Inactive => std::option::Option::Some(1),
32395                Self::Active => std::option::Option::Some(2),
32396                Self::UnknownValue(u) => u.0.value(),
32397            }
32398        }
32399
32400        /// Gets the enum value as a string.
32401        ///
32402        /// Returns `None` if the enum contains an unknown value deserialized from
32403        /// the integer representation of enums.
32404        pub fn name(&self) -> std::option::Option<&str> {
32405            match self {
32406                Self::Unspecified => std::option::Option::Some("IAM_STATUS_UNSPECIFIED"),
32407                Self::Inactive => std::option::Option::Some("INACTIVE"),
32408                Self::Active => std::option::Option::Some("ACTIVE"),
32409                Self::UnknownValue(u) => u.0.name(),
32410            }
32411        }
32412    }
32413
32414    impl std::default::Default for IamStatus {
32415        fn default() -> Self {
32416            use std::convert::From;
32417            Self::from(0)
32418        }
32419    }
32420
32421    impl std::fmt::Display for IamStatus {
32422        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32423            wkt::internal::display_enum(f, self.name(), self.value())
32424        }
32425    }
32426
32427    impl std::convert::From<i32> for IamStatus {
32428        fn from(value: i32) -> Self {
32429            match value {
32430                0 => Self::Unspecified,
32431                1 => Self::Inactive,
32432                2 => Self::Active,
32433                _ => Self::UnknownValue(iam_status::UnknownValue(
32434                    wkt::internal::UnknownEnumValue::Integer(value),
32435                )),
32436            }
32437        }
32438    }
32439
32440    impl std::convert::From<&str> for IamStatus {
32441        fn from(value: &str) -> Self {
32442            use std::string::ToString;
32443            match value {
32444                "IAM_STATUS_UNSPECIFIED" => Self::Unspecified,
32445                "INACTIVE" => Self::Inactive,
32446                "ACTIVE" => Self::Active,
32447                _ => Self::UnknownValue(iam_status::UnknownValue(
32448                    wkt::internal::UnknownEnumValue::String(value.to_string()),
32449                )),
32450            }
32451        }
32452    }
32453
32454    impl serde::ser::Serialize for IamStatus {
32455        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32456        where
32457            S: serde::Serializer,
32458        {
32459            match self {
32460                Self::Unspecified => serializer.serialize_i32(0),
32461                Self::Inactive => serializer.serialize_i32(1),
32462                Self::Active => serializer.serialize_i32(2),
32463                Self::UnknownValue(u) => u.0.serialize(serializer),
32464            }
32465        }
32466    }
32467
32468    impl<'de> serde::de::Deserialize<'de> for IamStatus {
32469        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32470        where
32471            D: serde::Deserializer<'de>,
32472        {
32473            deserializer.deserialize_any(wkt::internal::EnumVisitor::<IamStatus>::new(
32474                ".google.cloud.sql.v1.User.IamStatus",
32475            ))
32476        }
32477    }
32478
32479    /// User details for specific database type
32480    #[derive(Clone, Debug, PartialEq)]
32481    #[non_exhaustive]
32482    pub enum UserDetails {
32483        #[allow(missing_docs)]
32484        SqlserverUserDetails(std::boxed::Box<crate::model::SqlServerUserDetails>),
32485    }
32486}
32487
32488/// Represents a Sql Server user on the Cloud SQL instance.
32489#[derive(Clone, Default, PartialEq)]
32490#[non_exhaustive]
32491pub struct SqlServerUserDetails {
32492    /// If the user has been disabled
32493    pub disabled: bool,
32494
32495    /// The server roles for this user
32496    pub server_roles: std::vec::Vec<std::string::String>,
32497
32498    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32499}
32500
32501impl SqlServerUserDetails {
32502    /// Creates a new default instance.
32503    pub fn new() -> Self {
32504        std::default::Default::default()
32505    }
32506
32507    /// Sets the value of [disabled][crate::model::SqlServerUserDetails::disabled].
32508    ///
32509    /// # Example
32510    /// ```ignore,no_run
32511    /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
32512    /// let x = SqlServerUserDetails::new().set_disabled(true);
32513    /// ```
32514    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
32515        self.disabled = v.into();
32516        self
32517    }
32518
32519    /// Sets the value of [server_roles][crate::model::SqlServerUserDetails::server_roles].
32520    ///
32521    /// # Example
32522    /// ```ignore,no_run
32523    /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
32524    /// let x = SqlServerUserDetails::new().set_server_roles(["a", "b", "c"]);
32525    /// ```
32526    pub fn set_server_roles<T, V>(mut self, v: T) -> Self
32527    where
32528        T: std::iter::IntoIterator<Item = V>,
32529        V: std::convert::Into<std::string::String>,
32530    {
32531        use std::iter::Iterator;
32532        self.server_roles = v.into_iter().map(|i| i.into()).collect();
32533        self
32534    }
32535}
32536
32537impl wkt::message::Message for SqlServerUserDetails {
32538    fn typename() -> &'static str {
32539        "type.googleapis.com/google.cloud.sql.v1.SqlServerUserDetails"
32540    }
32541}
32542
32543/// User list response.
32544#[derive(Clone, Default, PartialEq)]
32545#[non_exhaustive]
32546pub struct UsersListResponse {
32547    /// This is always `sql#usersList`.
32548    pub kind: std::string::String,
32549
32550    /// List of user resources in the instance.
32551    pub items: std::vec::Vec<crate::model::User>,
32552
32553    /// Unused.
32554    #[deprecated]
32555    pub next_page_token: std::string::String,
32556
32557    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32558}
32559
32560impl UsersListResponse {
32561    /// Creates a new default instance.
32562    pub fn new() -> Self {
32563        std::default::Default::default()
32564    }
32565
32566    /// Sets the value of [kind][crate::model::UsersListResponse::kind].
32567    ///
32568    /// # Example
32569    /// ```ignore,no_run
32570    /// # use google_cloud_sql_v1::model::UsersListResponse;
32571    /// let x = UsersListResponse::new().set_kind("example");
32572    /// ```
32573    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32574        self.kind = v.into();
32575        self
32576    }
32577
32578    /// Sets the value of [items][crate::model::UsersListResponse::items].
32579    ///
32580    /// # Example
32581    /// ```ignore,no_run
32582    /// # use google_cloud_sql_v1::model::UsersListResponse;
32583    /// use google_cloud_sql_v1::model::User;
32584    /// let x = UsersListResponse::new()
32585    ///     .set_items([
32586    ///         User::default()/* use setters */,
32587    ///         User::default()/* use (different) setters */,
32588    ///     ]);
32589    /// ```
32590    pub fn set_items<T, V>(mut self, v: T) -> Self
32591    where
32592        T: std::iter::IntoIterator<Item = V>,
32593        V: std::convert::Into<crate::model::User>,
32594    {
32595        use std::iter::Iterator;
32596        self.items = v.into_iter().map(|i| i.into()).collect();
32597        self
32598    }
32599
32600    /// Sets the value of [next_page_token][crate::model::UsersListResponse::next_page_token].
32601    ///
32602    /// # Example
32603    /// ```ignore,no_run
32604    /// # use google_cloud_sql_v1::model::UsersListResponse;
32605    /// let x = UsersListResponse::new().set_next_page_token("example");
32606    /// ```
32607    #[deprecated]
32608    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32609        self.next_page_token = v.into();
32610        self
32611    }
32612}
32613
32614impl wkt::message::Message for UsersListResponse {
32615    fn typename() -> &'static str {
32616        "type.googleapis.com/google.cloud.sql.v1.UsersListResponse"
32617    }
32618}
32619
32620/// The status of a backup run.
32621///
32622/// # Working with unknown values
32623///
32624/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32625/// additional enum variants at any time. Adding new variants is not considered
32626/// a breaking change. Applications should write their code in anticipation of:
32627///
32628/// - New values appearing in future releases of the client library, **and**
32629/// - New values received dynamically, without application changes.
32630///
32631/// Please consult the [Working with enums] section in the user guide for some
32632/// guidelines.
32633///
32634/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32635#[derive(Clone, Debug, PartialEq)]
32636#[non_exhaustive]
32637pub enum SqlBackupRunStatus {
32638    /// The status of the run is unknown.
32639    Unspecified,
32640    /// The backup operation was enqueued.
32641    Enqueued,
32642    /// The backup is overdue across a given backup window. Indicates a
32643    /// problem. Example: Long-running operation in progress during
32644    /// the whole window.
32645    Overdue,
32646    /// The backup is in progress.
32647    Running,
32648    /// The backup failed.
32649    Failed,
32650    /// The backup was successful.
32651    Successful,
32652    /// The backup was skipped (without problems) for a given backup
32653    /// window. Example: Instance was idle.
32654    Skipped,
32655    /// The backup is about to be deleted.
32656    DeletionPending,
32657    /// The backup deletion failed.
32658    DeletionFailed,
32659    /// The backup has been deleted.
32660    Deleted,
32661    /// If set, the enum was initialized with an unknown value.
32662    ///
32663    /// Applications can examine the value using [SqlBackupRunStatus::value] or
32664    /// [SqlBackupRunStatus::name].
32665    UnknownValue(sql_backup_run_status::UnknownValue),
32666}
32667
32668#[doc(hidden)]
32669pub mod sql_backup_run_status {
32670    #[allow(unused_imports)]
32671    use super::*;
32672    #[derive(Clone, Debug, PartialEq)]
32673    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32674}
32675
32676impl SqlBackupRunStatus {
32677    /// Gets the enum value.
32678    ///
32679    /// Returns `None` if the enum contains an unknown value deserialized from
32680    /// the string representation of enums.
32681    pub fn value(&self) -> std::option::Option<i32> {
32682        match self {
32683            Self::Unspecified => std::option::Option::Some(0),
32684            Self::Enqueued => std::option::Option::Some(1),
32685            Self::Overdue => std::option::Option::Some(2),
32686            Self::Running => std::option::Option::Some(3),
32687            Self::Failed => std::option::Option::Some(4),
32688            Self::Successful => std::option::Option::Some(5),
32689            Self::Skipped => std::option::Option::Some(6),
32690            Self::DeletionPending => std::option::Option::Some(7),
32691            Self::DeletionFailed => std::option::Option::Some(8),
32692            Self::Deleted => std::option::Option::Some(9),
32693            Self::UnknownValue(u) => u.0.value(),
32694        }
32695    }
32696
32697    /// Gets the enum value as a string.
32698    ///
32699    /// Returns `None` if the enum contains an unknown value deserialized from
32700    /// the integer representation of enums.
32701    pub fn name(&self) -> std::option::Option<&str> {
32702        match self {
32703            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_STATUS_UNSPECIFIED"),
32704            Self::Enqueued => std::option::Option::Some("ENQUEUED"),
32705            Self::Overdue => std::option::Option::Some("OVERDUE"),
32706            Self::Running => std::option::Option::Some("RUNNING"),
32707            Self::Failed => std::option::Option::Some("FAILED"),
32708            Self::Successful => std::option::Option::Some("SUCCESSFUL"),
32709            Self::Skipped => std::option::Option::Some("SKIPPED"),
32710            Self::DeletionPending => std::option::Option::Some("DELETION_PENDING"),
32711            Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
32712            Self::Deleted => std::option::Option::Some("DELETED"),
32713            Self::UnknownValue(u) => u.0.name(),
32714        }
32715    }
32716}
32717
32718impl std::default::Default for SqlBackupRunStatus {
32719    fn default() -> Self {
32720        use std::convert::From;
32721        Self::from(0)
32722    }
32723}
32724
32725impl std::fmt::Display for SqlBackupRunStatus {
32726    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32727        wkt::internal::display_enum(f, self.name(), self.value())
32728    }
32729}
32730
32731impl std::convert::From<i32> for SqlBackupRunStatus {
32732    fn from(value: i32) -> Self {
32733        match value {
32734            0 => Self::Unspecified,
32735            1 => Self::Enqueued,
32736            2 => Self::Overdue,
32737            3 => Self::Running,
32738            4 => Self::Failed,
32739            5 => Self::Successful,
32740            6 => Self::Skipped,
32741            7 => Self::DeletionPending,
32742            8 => Self::DeletionFailed,
32743            9 => Self::Deleted,
32744            _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
32745                wkt::internal::UnknownEnumValue::Integer(value),
32746            )),
32747        }
32748    }
32749}
32750
32751impl std::convert::From<&str> for SqlBackupRunStatus {
32752    fn from(value: &str) -> Self {
32753        use std::string::ToString;
32754        match value {
32755            "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" => Self::Unspecified,
32756            "ENQUEUED" => Self::Enqueued,
32757            "OVERDUE" => Self::Overdue,
32758            "RUNNING" => Self::Running,
32759            "FAILED" => Self::Failed,
32760            "SUCCESSFUL" => Self::Successful,
32761            "SKIPPED" => Self::Skipped,
32762            "DELETION_PENDING" => Self::DeletionPending,
32763            "DELETION_FAILED" => Self::DeletionFailed,
32764            "DELETED" => Self::Deleted,
32765            _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
32766                wkt::internal::UnknownEnumValue::String(value.to_string()),
32767            )),
32768        }
32769    }
32770}
32771
32772impl serde::ser::Serialize for SqlBackupRunStatus {
32773    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32774    where
32775        S: serde::Serializer,
32776    {
32777        match self {
32778            Self::Unspecified => serializer.serialize_i32(0),
32779            Self::Enqueued => serializer.serialize_i32(1),
32780            Self::Overdue => serializer.serialize_i32(2),
32781            Self::Running => serializer.serialize_i32(3),
32782            Self::Failed => serializer.serialize_i32(4),
32783            Self::Successful => serializer.serialize_i32(5),
32784            Self::Skipped => serializer.serialize_i32(6),
32785            Self::DeletionPending => serializer.serialize_i32(7),
32786            Self::DeletionFailed => serializer.serialize_i32(8),
32787            Self::Deleted => serializer.serialize_i32(9),
32788            Self::UnknownValue(u) => u.0.serialize(serializer),
32789        }
32790    }
32791}
32792
32793impl<'de> serde::de::Deserialize<'de> for SqlBackupRunStatus {
32794    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32795    where
32796        D: serde::Deserializer<'de>,
32797    {
32798        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunStatus>::new(
32799            ".google.cloud.sql.v1.SqlBackupRunStatus",
32800        ))
32801    }
32802}
32803
32804/// Defines the supported backup kinds.
32805///
32806/// # Working with unknown values
32807///
32808/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32809/// additional enum variants at any time. Adding new variants is not considered
32810/// a breaking change. Applications should write their code in anticipation of:
32811///
32812/// - New values appearing in future releases of the client library, **and**
32813/// - New values received dynamically, without application changes.
32814///
32815/// Please consult the [Working with enums] section in the user guide for some
32816/// guidelines.
32817///
32818/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32819#[derive(Clone, Debug, PartialEq)]
32820#[non_exhaustive]
32821pub enum SqlBackupKind {
32822    /// This is an unknown BackupKind.
32823    Unspecified,
32824    /// Snapshot-based backups.
32825    Snapshot,
32826    /// Physical backups.
32827    Physical,
32828    /// If set, the enum was initialized with an unknown value.
32829    ///
32830    /// Applications can examine the value using [SqlBackupKind::value] or
32831    /// [SqlBackupKind::name].
32832    UnknownValue(sql_backup_kind::UnknownValue),
32833}
32834
32835#[doc(hidden)]
32836pub mod sql_backup_kind {
32837    #[allow(unused_imports)]
32838    use super::*;
32839    #[derive(Clone, Debug, PartialEq)]
32840    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32841}
32842
32843impl SqlBackupKind {
32844    /// Gets the enum value.
32845    ///
32846    /// Returns `None` if the enum contains an unknown value deserialized from
32847    /// the string representation of enums.
32848    pub fn value(&self) -> std::option::Option<i32> {
32849        match self {
32850            Self::Unspecified => std::option::Option::Some(0),
32851            Self::Snapshot => std::option::Option::Some(1),
32852            Self::Physical => std::option::Option::Some(2),
32853            Self::UnknownValue(u) => u.0.value(),
32854        }
32855    }
32856
32857    /// Gets the enum value as a string.
32858    ///
32859    /// Returns `None` if the enum contains an unknown value deserialized from
32860    /// the integer representation of enums.
32861    pub fn name(&self) -> std::option::Option<&str> {
32862        match self {
32863            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_KIND_UNSPECIFIED"),
32864            Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
32865            Self::Physical => std::option::Option::Some("PHYSICAL"),
32866            Self::UnknownValue(u) => u.0.name(),
32867        }
32868    }
32869}
32870
32871impl std::default::Default for SqlBackupKind {
32872    fn default() -> Self {
32873        use std::convert::From;
32874        Self::from(0)
32875    }
32876}
32877
32878impl std::fmt::Display for SqlBackupKind {
32879    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32880        wkt::internal::display_enum(f, self.name(), self.value())
32881    }
32882}
32883
32884impl std::convert::From<i32> for SqlBackupKind {
32885    fn from(value: i32) -> Self {
32886        match value {
32887            0 => Self::Unspecified,
32888            1 => Self::Snapshot,
32889            2 => Self::Physical,
32890            _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
32891                wkt::internal::UnknownEnumValue::Integer(value),
32892            )),
32893        }
32894    }
32895}
32896
32897impl std::convert::From<&str> for SqlBackupKind {
32898    fn from(value: &str) -> Self {
32899        use std::string::ToString;
32900        match value {
32901            "SQL_BACKUP_KIND_UNSPECIFIED" => Self::Unspecified,
32902            "SNAPSHOT" => Self::Snapshot,
32903            "PHYSICAL" => Self::Physical,
32904            _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
32905                wkt::internal::UnknownEnumValue::String(value.to_string()),
32906            )),
32907        }
32908    }
32909}
32910
32911impl serde::ser::Serialize for SqlBackupKind {
32912    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32913    where
32914        S: serde::Serializer,
32915    {
32916        match self {
32917            Self::Unspecified => serializer.serialize_i32(0),
32918            Self::Snapshot => serializer.serialize_i32(1),
32919            Self::Physical => serializer.serialize_i32(2),
32920            Self::UnknownValue(u) => u.0.serialize(serializer),
32921        }
32922    }
32923}
32924
32925impl<'de> serde::de::Deserialize<'de> for SqlBackupKind {
32926    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32927    where
32928        D: serde::Deserializer<'de>,
32929    {
32930        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupKind>::new(
32931            ".google.cloud.sql.v1.SqlBackupKind",
32932        ))
32933    }
32934}
32935
32936/// Type of backup (i.e. automated, on demand, etc).
32937///
32938/// # Working with unknown values
32939///
32940/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32941/// additional enum variants at any time. Adding new variants is not considered
32942/// a breaking change. Applications should write their code in anticipation of:
32943///
32944/// - New values appearing in future releases of the client library, **and**
32945/// - New values received dynamically, without application changes.
32946///
32947/// Please consult the [Working with enums] section in the user guide for some
32948/// guidelines.
32949///
32950/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32951#[derive(Clone, Debug, PartialEq)]
32952#[non_exhaustive]
32953pub enum SqlBackupRunType {
32954    /// This is an unknown BackupRun type.
32955    Unspecified,
32956    /// The backup schedule automatically triggers a backup.
32957    Automated,
32958    /// The user manually triggers a backup.
32959    OnDemand,
32960    /// If set, the enum was initialized with an unknown value.
32961    ///
32962    /// Applications can examine the value using [SqlBackupRunType::value] or
32963    /// [SqlBackupRunType::name].
32964    UnknownValue(sql_backup_run_type::UnknownValue),
32965}
32966
32967#[doc(hidden)]
32968pub mod sql_backup_run_type {
32969    #[allow(unused_imports)]
32970    use super::*;
32971    #[derive(Clone, Debug, PartialEq)]
32972    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32973}
32974
32975impl SqlBackupRunType {
32976    /// Gets the enum value.
32977    ///
32978    /// Returns `None` if the enum contains an unknown value deserialized from
32979    /// the string representation of enums.
32980    pub fn value(&self) -> std::option::Option<i32> {
32981        match self {
32982            Self::Unspecified => std::option::Option::Some(0),
32983            Self::Automated => std::option::Option::Some(1),
32984            Self::OnDemand => std::option::Option::Some(2),
32985            Self::UnknownValue(u) => u.0.value(),
32986        }
32987    }
32988
32989    /// Gets the enum value as a string.
32990    ///
32991    /// Returns `None` if the enum contains an unknown value deserialized from
32992    /// the integer representation of enums.
32993    pub fn name(&self) -> std::option::Option<&str> {
32994        match self {
32995            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_TYPE_UNSPECIFIED"),
32996            Self::Automated => std::option::Option::Some("AUTOMATED"),
32997            Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
32998            Self::UnknownValue(u) => u.0.name(),
32999        }
33000    }
33001}
33002
33003impl std::default::Default for SqlBackupRunType {
33004    fn default() -> Self {
33005        use std::convert::From;
33006        Self::from(0)
33007    }
33008}
33009
33010impl std::fmt::Display for SqlBackupRunType {
33011    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33012        wkt::internal::display_enum(f, self.name(), self.value())
33013    }
33014}
33015
33016impl std::convert::From<i32> for SqlBackupRunType {
33017    fn from(value: i32) -> Self {
33018        match value {
33019            0 => Self::Unspecified,
33020            1 => Self::Automated,
33021            2 => Self::OnDemand,
33022            _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
33023                wkt::internal::UnknownEnumValue::Integer(value),
33024            )),
33025        }
33026    }
33027}
33028
33029impl std::convert::From<&str> for SqlBackupRunType {
33030    fn from(value: &str) -> Self {
33031        use std::string::ToString;
33032        match value {
33033            "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" => Self::Unspecified,
33034            "AUTOMATED" => Self::Automated,
33035            "ON_DEMAND" => Self::OnDemand,
33036            _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
33037                wkt::internal::UnknownEnumValue::String(value.to_string()),
33038            )),
33039        }
33040    }
33041}
33042
33043impl serde::ser::Serialize for SqlBackupRunType {
33044    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33045    where
33046        S: serde::Serializer,
33047    {
33048        match self {
33049            Self::Unspecified => serializer.serialize_i32(0),
33050            Self::Automated => serializer.serialize_i32(1),
33051            Self::OnDemand => serializer.serialize_i32(2),
33052            Self::UnknownValue(u) => u.0.serialize(serializer),
33053        }
33054    }
33055}
33056
33057impl<'de> serde::de::Deserialize<'de> for SqlBackupRunType {
33058    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33059    where
33060        D: serde::Deserializer<'de>,
33061    {
33062        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunType>::new(
33063            ".google.cloud.sql.v1.SqlBackupRunType",
33064        ))
33065    }
33066}
33067
33068/// Enum for [SqlFlagType].
33069///
33070/// # Working with unknown values
33071///
33072/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33073/// additional enum variants at any time. Adding new variants is not considered
33074/// a breaking change. Applications should write their code in anticipation of:
33075///
33076/// - New values appearing in future releases of the client library, **and**
33077/// - New values received dynamically, without application changes.
33078///
33079/// Please consult the [Working with enums] section in the user guide for some
33080/// guidelines.
33081///
33082/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33083#[derive(Clone, Debug, PartialEq)]
33084#[non_exhaustive]
33085pub enum SqlFlagType {
33086    /// This is an unknown flag type.
33087    Unspecified,
33088    /// Boolean type flag.
33089    Boolean,
33090    /// String type flag.
33091    String,
33092    /// Integer type flag.
33093    Integer,
33094    /// Flag type used for a server startup option.
33095    None,
33096    /// Type introduced specially for MySQL TimeZone offset. Accept a string value
33097    /// with the format [-12:59, 13:00].
33098    MysqlTimezoneOffset,
33099    /// Float type flag.
33100    Float,
33101    /// Comma-separated list of the strings in a SqlFlagType enum.
33102    RepeatedString,
33103    /// If set, the enum was initialized with an unknown value.
33104    ///
33105    /// Applications can examine the value using [SqlFlagType::value] or
33106    /// [SqlFlagType::name].
33107    UnknownValue(sql_flag_type::UnknownValue),
33108}
33109
33110#[doc(hidden)]
33111pub mod sql_flag_type {
33112    #[allow(unused_imports)]
33113    use super::*;
33114    #[derive(Clone, Debug, PartialEq)]
33115    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33116}
33117
33118impl SqlFlagType {
33119    /// Gets the enum value.
33120    ///
33121    /// Returns `None` if the enum contains an unknown value deserialized from
33122    /// the string representation of enums.
33123    pub fn value(&self) -> std::option::Option<i32> {
33124        match self {
33125            Self::Unspecified => std::option::Option::Some(0),
33126            Self::Boolean => std::option::Option::Some(1),
33127            Self::String => std::option::Option::Some(2),
33128            Self::Integer => std::option::Option::Some(3),
33129            Self::None => std::option::Option::Some(4),
33130            Self::MysqlTimezoneOffset => std::option::Option::Some(5),
33131            Self::Float => std::option::Option::Some(6),
33132            Self::RepeatedString => std::option::Option::Some(7),
33133            Self::UnknownValue(u) => u.0.value(),
33134        }
33135    }
33136
33137    /// Gets the enum value as a string.
33138    ///
33139    /// Returns `None` if the enum contains an unknown value deserialized from
33140    /// the integer representation of enums.
33141    pub fn name(&self) -> std::option::Option<&str> {
33142        match self {
33143            Self::Unspecified => std::option::Option::Some("SQL_FLAG_TYPE_UNSPECIFIED"),
33144            Self::Boolean => std::option::Option::Some("BOOLEAN"),
33145            Self::String => std::option::Option::Some("STRING"),
33146            Self::Integer => std::option::Option::Some("INTEGER"),
33147            Self::None => std::option::Option::Some("NONE"),
33148            Self::MysqlTimezoneOffset => std::option::Option::Some("MYSQL_TIMEZONE_OFFSET"),
33149            Self::Float => std::option::Option::Some("FLOAT"),
33150            Self::RepeatedString => std::option::Option::Some("REPEATED_STRING"),
33151            Self::UnknownValue(u) => u.0.name(),
33152        }
33153    }
33154}
33155
33156impl std::default::Default for SqlFlagType {
33157    fn default() -> Self {
33158        use std::convert::From;
33159        Self::from(0)
33160    }
33161}
33162
33163impl std::fmt::Display for SqlFlagType {
33164    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33165        wkt::internal::display_enum(f, self.name(), self.value())
33166    }
33167}
33168
33169impl std::convert::From<i32> for SqlFlagType {
33170    fn from(value: i32) -> Self {
33171        match value {
33172            0 => Self::Unspecified,
33173            1 => Self::Boolean,
33174            2 => Self::String,
33175            3 => Self::Integer,
33176            4 => Self::None,
33177            5 => Self::MysqlTimezoneOffset,
33178            6 => Self::Float,
33179            7 => Self::RepeatedString,
33180            _ => Self::UnknownValue(sql_flag_type::UnknownValue(
33181                wkt::internal::UnknownEnumValue::Integer(value),
33182            )),
33183        }
33184    }
33185}
33186
33187impl std::convert::From<&str> for SqlFlagType {
33188    fn from(value: &str) -> Self {
33189        use std::string::ToString;
33190        match value {
33191            "SQL_FLAG_TYPE_UNSPECIFIED" => Self::Unspecified,
33192            "BOOLEAN" => Self::Boolean,
33193            "STRING" => Self::String,
33194            "INTEGER" => Self::Integer,
33195            "NONE" => Self::None,
33196            "MYSQL_TIMEZONE_OFFSET" => Self::MysqlTimezoneOffset,
33197            "FLOAT" => Self::Float,
33198            "REPEATED_STRING" => Self::RepeatedString,
33199            _ => Self::UnknownValue(sql_flag_type::UnknownValue(
33200                wkt::internal::UnknownEnumValue::String(value.to_string()),
33201            )),
33202        }
33203    }
33204}
33205
33206impl serde::ser::Serialize for SqlFlagType {
33207    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33208    where
33209        S: serde::Serializer,
33210    {
33211        match self {
33212            Self::Unspecified => serializer.serialize_i32(0),
33213            Self::Boolean => serializer.serialize_i32(1),
33214            Self::String => serializer.serialize_i32(2),
33215            Self::Integer => serializer.serialize_i32(3),
33216            Self::None => serializer.serialize_i32(4),
33217            Self::MysqlTimezoneOffset => serializer.serialize_i32(5),
33218            Self::Float => serializer.serialize_i32(6),
33219            Self::RepeatedString => serializer.serialize_i32(7),
33220            Self::UnknownValue(u) => u.0.serialize(serializer),
33221        }
33222    }
33223}
33224
33225impl<'de> serde::de::Deserialize<'de> for SqlFlagType {
33226    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33227    where
33228        D: serde::Deserializer<'de>,
33229    {
33230        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagType>::new(
33231            ".google.cloud.sql.v1.SqlFlagType",
33232        ))
33233    }
33234}
33235
33236/// Scopes of a flag describe where the flag is used.
33237///
33238/// # Working with unknown values
33239///
33240/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33241/// additional enum variants at any time. Adding new variants is not considered
33242/// a breaking change. Applications should write their code in anticipation of:
33243///
33244/// - New values appearing in future releases of the client library, **and**
33245/// - New values received dynamically, without application changes.
33246///
33247/// Please consult the [Working with enums] section in the user guide for some
33248/// guidelines.
33249///
33250/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33251#[derive(Clone, Debug, PartialEq)]
33252#[non_exhaustive]
33253pub enum SqlFlagScope {
33254    /// Assume database flags if unspecified
33255    Unspecified,
33256    /// database flags
33257    Database,
33258    /// connection pool configuration flags
33259    ConnectionPool,
33260    /// If set, the enum was initialized with an unknown value.
33261    ///
33262    /// Applications can examine the value using [SqlFlagScope::value] or
33263    /// [SqlFlagScope::name].
33264    UnknownValue(sql_flag_scope::UnknownValue),
33265}
33266
33267#[doc(hidden)]
33268pub mod sql_flag_scope {
33269    #[allow(unused_imports)]
33270    use super::*;
33271    #[derive(Clone, Debug, PartialEq)]
33272    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33273}
33274
33275impl SqlFlagScope {
33276    /// Gets the enum value.
33277    ///
33278    /// Returns `None` if the enum contains an unknown value deserialized from
33279    /// the string representation of enums.
33280    pub fn value(&self) -> std::option::Option<i32> {
33281        match self {
33282            Self::Unspecified => std::option::Option::Some(0),
33283            Self::Database => std::option::Option::Some(1),
33284            Self::ConnectionPool => std::option::Option::Some(2),
33285            Self::UnknownValue(u) => u.0.value(),
33286        }
33287    }
33288
33289    /// Gets the enum value as a string.
33290    ///
33291    /// Returns `None` if the enum contains an unknown value deserialized from
33292    /// the integer representation of enums.
33293    pub fn name(&self) -> std::option::Option<&str> {
33294        match self {
33295            Self::Unspecified => std::option::Option::Some("SQL_FLAG_SCOPE_UNSPECIFIED"),
33296            Self::Database => std::option::Option::Some("SQL_FLAG_SCOPE_DATABASE"),
33297            Self::ConnectionPool => std::option::Option::Some("SQL_FLAG_SCOPE_CONNECTION_POOL"),
33298            Self::UnknownValue(u) => u.0.name(),
33299        }
33300    }
33301}
33302
33303impl std::default::Default for SqlFlagScope {
33304    fn default() -> Self {
33305        use std::convert::From;
33306        Self::from(0)
33307    }
33308}
33309
33310impl std::fmt::Display for SqlFlagScope {
33311    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33312        wkt::internal::display_enum(f, self.name(), self.value())
33313    }
33314}
33315
33316impl std::convert::From<i32> for SqlFlagScope {
33317    fn from(value: i32) -> Self {
33318        match value {
33319            0 => Self::Unspecified,
33320            1 => Self::Database,
33321            2 => Self::ConnectionPool,
33322            _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
33323                wkt::internal::UnknownEnumValue::Integer(value),
33324            )),
33325        }
33326    }
33327}
33328
33329impl std::convert::From<&str> for SqlFlagScope {
33330    fn from(value: &str) -> Self {
33331        use std::string::ToString;
33332        match value {
33333            "SQL_FLAG_SCOPE_UNSPECIFIED" => Self::Unspecified,
33334            "SQL_FLAG_SCOPE_DATABASE" => Self::Database,
33335            "SQL_FLAG_SCOPE_CONNECTION_POOL" => Self::ConnectionPool,
33336            _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
33337                wkt::internal::UnknownEnumValue::String(value.to_string()),
33338            )),
33339        }
33340    }
33341}
33342
33343impl serde::ser::Serialize for SqlFlagScope {
33344    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33345    where
33346        S: serde::Serializer,
33347    {
33348        match self {
33349            Self::Unspecified => serializer.serialize_i32(0),
33350            Self::Database => serializer.serialize_i32(1),
33351            Self::ConnectionPool => serializer.serialize_i32(2),
33352            Self::UnknownValue(u) => u.0.serialize(serializer),
33353        }
33354    }
33355}
33356
33357impl<'de> serde::de::Deserialize<'de> for SqlFlagScope {
33358    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33359    where
33360        D: serde::Deserializer<'de>,
33361    {
33362        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagScope>::new(
33363            ".google.cloud.sql.v1.SqlFlagScope",
33364        ))
33365    }
33366}
33367
33368/// External Sync parallel level.
33369///
33370/// # Working with unknown values
33371///
33372/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33373/// additional enum variants at any time. Adding new variants is not considered
33374/// a breaking change. Applications should write their code in anticipation of:
33375///
33376/// - New values appearing in future releases of the client library, **and**
33377/// - New values received dynamically, without application changes.
33378///
33379/// Please consult the [Working with enums] section in the user guide for some
33380/// guidelines.
33381///
33382/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33383#[derive(Clone, Debug, PartialEq)]
33384#[non_exhaustive]
33385pub enum ExternalSyncParallelLevel {
33386    /// Unknown sync parallel level. Will be defaulted to OPTIMAL.
33387    Unspecified,
33388    /// Minimal parallel level.
33389    Min,
33390    /// Optimal parallel level.
33391    Optimal,
33392    /// Maximum parallel level.
33393    Max,
33394    /// If set, the enum was initialized with an unknown value.
33395    ///
33396    /// Applications can examine the value using [ExternalSyncParallelLevel::value] or
33397    /// [ExternalSyncParallelLevel::name].
33398    UnknownValue(external_sync_parallel_level::UnknownValue),
33399}
33400
33401#[doc(hidden)]
33402pub mod external_sync_parallel_level {
33403    #[allow(unused_imports)]
33404    use super::*;
33405    #[derive(Clone, Debug, PartialEq)]
33406    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33407}
33408
33409impl ExternalSyncParallelLevel {
33410    /// Gets the enum value.
33411    ///
33412    /// Returns `None` if the enum contains an unknown value deserialized from
33413    /// the string representation of enums.
33414    pub fn value(&self) -> std::option::Option<i32> {
33415        match self {
33416            Self::Unspecified => std::option::Option::Some(0),
33417            Self::Min => std::option::Option::Some(1),
33418            Self::Optimal => std::option::Option::Some(2),
33419            Self::Max => std::option::Option::Some(3),
33420            Self::UnknownValue(u) => u.0.value(),
33421        }
33422    }
33423
33424    /// Gets the enum value as a string.
33425    ///
33426    /// Returns `None` if the enum contains an unknown value deserialized from
33427    /// the integer representation of enums.
33428    pub fn name(&self) -> std::option::Option<&str> {
33429        match self {
33430            Self::Unspecified => {
33431                std::option::Option::Some("EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED")
33432            }
33433            Self::Min => std::option::Option::Some("MIN"),
33434            Self::Optimal => std::option::Option::Some("OPTIMAL"),
33435            Self::Max => std::option::Option::Some("MAX"),
33436            Self::UnknownValue(u) => u.0.name(),
33437        }
33438    }
33439}
33440
33441impl std::default::Default for ExternalSyncParallelLevel {
33442    fn default() -> Self {
33443        use std::convert::From;
33444        Self::from(0)
33445    }
33446}
33447
33448impl std::fmt::Display for ExternalSyncParallelLevel {
33449    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33450        wkt::internal::display_enum(f, self.name(), self.value())
33451    }
33452}
33453
33454impl std::convert::From<i32> for ExternalSyncParallelLevel {
33455    fn from(value: i32) -> Self {
33456        match value {
33457            0 => Self::Unspecified,
33458            1 => Self::Min,
33459            2 => Self::Optimal,
33460            3 => Self::Max,
33461            _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
33462                wkt::internal::UnknownEnumValue::Integer(value),
33463            )),
33464        }
33465    }
33466}
33467
33468impl std::convert::From<&str> for ExternalSyncParallelLevel {
33469    fn from(value: &str) -> Self {
33470        use std::string::ToString;
33471        match value {
33472            "EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
33473            "MIN" => Self::Min,
33474            "OPTIMAL" => Self::Optimal,
33475            "MAX" => Self::Max,
33476            _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
33477                wkt::internal::UnknownEnumValue::String(value.to_string()),
33478            )),
33479        }
33480    }
33481}
33482
33483impl serde::ser::Serialize for ExternalSyncParallelLevel {
33484    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33485    where
33486        S: serde::Serializer,
33487    {
33488        match self {
33489            Self::Unspecified => serializer.serialize_i32(0),
33490            Self::Min => serializer.serialize_i32(1),
33491            Self::Optimal => serializer.serialize_i32(2),
33492            Self::Max => serializer.serialize_i32(3),
33493            Self::UnknownValue(u) => u.0.serialize(serializer),
33494        }
33495    }
33496}
33497
33498impl<'de> serde::de::Deserialize<'de> for ExternalSyncParallelLevel {
33499    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33500    where
33501        D: serde::Deserializer<'de>,
33502    {
33503        deserializer.deserialize_any(
33504            wkt::internal::EnumVisitor::<ExternalSyncParallelLevel>::new(
33505                ".google.cloud.sql.v1.ExternalSyncParallelLevel",
33506            ),
33507        )
33508    }
33509}
33510
33511/// Enum for [SqlInstanceType].
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://googleapis.github.io/google-cloud-rust/working_with_enums.html
33526#[derive(Clone, Debug, PartialEq)]
33527#[non_exhaustive]
33528pub enum SqlInstanceType {
33529    /// This is an unknown Cloud SQL instance type.
33530    Unspecified,
33531    /// A regular Cloud SQL instance that is not replicating from a primary
33532    /// instance.
33533    CloudSqlInstance,
33534    /// An instance running on the customer's premises that is not managed by
33535    /// Cloud SQL.
33536    OnPremisesInstance,
33537    /// A Cloud SQL instance acting as a read-replica.
33538    ReadReplicaInstance,
33539    /// A Cloud SQL read pool.
33540    ReadPoolInstance,
33541    /// If set, the enum was initialized with an unknown value.
33542    ///
33543    /// Applications can examine the value using [SqlInstanceType::value] or
33544    /// [SqlInstanceType::name].
33545    UnknownValue(sql_instance_type::UnknownValue),
33546}
33547
33548#[doc(hidden)]
33549pub mod sql_instance_type {
33550    #[allow(unused_imports)]
33551    use super::*;
33552    #[derive(Clone, Debug, PartialEq)]
33553    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33554}
33555
33556impl SqlInstanceType {
33557    /// Gets the enum value.
33558    ///
33559    /// Returns `None` if the enum contains an unknown value deserialized from
33560    /// the string representation of enums.
33561    pub fn value(&self) -> std::option::Option<i32> {
33562        match self {
33563            Self::Unspecified => std::option::Option::Some(0),
33564            Self::CloudSqlInstance => std::option::Option::Some(1),
33565            Self::OnPremisesInstance => std::option::Option::Some(2),
33566            Self::ReadReplicaInstance => std::option::Option::Some(3),
33567            Self::ReadPoolInstance => std::option::Option::Some(5),
33568            Self::UnknownValue(u) => u.0.value(),
33569        }
33570    }
33571
33572    /// Gets the enum value as a string.
33573    ///
33574    /// Returns `None` if the enum contains an unknown value deserialized from
33575    /// the integer representation of enums.
33576    pub fn name(&self) -> std::option::Option<&str> {
33577        match self {
33578            Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_TYPE_UNSPECIFIED"),
33579            Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
33580            Self::OnPremisesInstance => std::option::Option::Some("ON_PREMISES_INSTANCE"),
33581            Self::ReadReplicaInstance => std::option::Option::Some("READ_REPLICA_INSTANCE"),
33582            Self::ReadPoolInstance => std::option::Option::Some("READ_POOL_INSTANCE"),
33583            Self::UnknownValue(u) => u.0.name(),
33584        }
33585    }
33586}
33587
33588impl std::default::Default for SqlInstanceType {
33589    fn default() -> Self {
33590        use std::convert::From;
33591        Self::from(0)
33592    }
33593}
33594
33595impl std::fmt::Display for SqlInstanceType {
33596    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33597        wkt::internal::display_enum(f, self.name(), self.value())
33598    }
33599}
33600
33601impl std::convert::From<i32> for SqlInstanceType {
33602    fn from(value: i32) -> Self {
33603        match value {
33604            0 => Self::Unspecified,
33605            1 => Self::CloudSqlInstance,
33606            2 => Self::OnPremisesInstance,
33607            3 => Self::ReadReplicaInstance,
33608            5 => Self::ReadPoolInstance,
33609            _ => Self::UnknownValue(sql_instance_type::UnknownValue(
33610                wkt::internal::UnknownEnumValue::Integer(value),
33611            )),
33612        }
33613    }
33614}
33615
33616impl std::convert::From<&str> for SqlInstanceType {
33617    fn from(value: &str) -> Self {
33618        use std::string::ToString;
33619        match value {
33620            "SQL_INSTANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
33621            "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
33622            "ON_PREMISES_INSTANCE" => Self::OnPremisesInstance,
33623            "READ_REPLICA_INSTANCE" => Self::ReadReplicaInstance,
33624            "READ_POOL_INSTANCE" => Self::ReadPoolInstance,
33625            _ => Self::UnknownValue(sql_instance_type::UnknownValue(
33626                wkt::internal::UnknownEnumValue::String(value.to_string()),
33627            )),
33628        }
33629    }
33630}
33631
33632impl serde::ser::Serialize for SqlInstanceType {
33633    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33634    where
33635        S: serde::Serializer,
33636    {
33637        match self {
33638            Self::Unspecified => serializer.serialize_i32(0),
33639            Self::CloudSqlInstance => serializer.serialize_i32(1),
33640            Self::OnPremisesInstance => serializer.serialize_i32(2),
33641            Self::ReadReplicaInstance => serializer.serialize_i32(3),
33642            Self::ReadPoolInstance => serializer.serialize_i32(5),
33643            Self::UnknownValue(u) => u.0.serialize(serializer),
33644        }
33645    }
33646}
33647
33648impl<'de> serde::de::Deserialize<'de> for SqlInstanceType {
33649    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33650    where
33651        D: serde::Deserializer<'de>,
33652    {
33653        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceType>::new(
33654            ".google.cloud.sql.v1.SqlInstanceType",
33655        ))
33656    }
33657}
33658
33659/// The suspension reason of the database instance if the state is SUSPENDED.
33660///
33661/// # Working with unknown values
33662///
33663/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33664/// additional enum variants at any time. Adding new variants is not considered
33665/// a breaking change. Applications should write their code in anticipation of:
33666///
33667/// - New values appearing in future releases of the client library, **and**
33668/// - New values received dynamically, without application changes.
33669///
33670/// Please consult the [Working with enums] section in the user guide for some
33671/// guidelines.
33672///
33673/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33674#[derive(Clone, Debug, PartialEq)]
33675#[non_exhaustive]
33676pub enum SqlSuspensionReason {
33677    /// This is an unknown suspension reason.
33678    Unspecified,
33679    /// The instance is suspended due to billing issues (for example:, account
33680    /// issue)
33681    BillingIssue,
33682    /// The instance is suspended due to illegal content (for example:, child
33683    /// pornography, copyrighted material, etc.).
33684    LegalIssue,
33685    /// The instance is causing operational issues (for example:, causing the
33686    /// database to crash).
33687    OperationalIssue,
33688    /// The KMS key used by the instance is either revoked or denied access to
33689    KmsKeyIssue,
33690    /// If set, the enum was initialized with an unknown value.
33691    ///
33692    /// Applications can examine the value using [SqlSuspensionReason::value] or
33693    /// [SqlSuspensionReason::name].
33694    UnknownValue(sql_suspension_reason::UnknownValue),
33695}
33696
33697#[doc(hidden)]
33698pub mod sql_suspension_reason {
33699    #[allow(unused_imports)]
33700    use super::*;
33701    #[derive(Clone, Debug, PartialEq)]
33702    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33703}
33704
33705impl SqlSuspensionReason {
33706    /// Gets the enum value.
33707    ///
33708    /// Returns `None` if the enum contains an unknown value deserialized from
33709    /// the string representation of enums.
33710    pub fn value(&self) -> std::option::Option<i32> {
33711        match self {
33712            Self::Unspecified => std::option::Option::Some(0),
33713            Self::BillingIssue => std::option::Option::Some(2),
33714            Self::LegalIssue => std::option::Option::Some(3),
33715            Self::OperationalIssue => std::option::Option::Some(4),
33716            Self::KmsKeyIssue => std::option::Option::Some(5),
33717            Self::UnknownValue(u) => u.0.value(),
33718        }
33719    }
33720
33721    /// Gets the enum value as a string.
33722    ///
33723    /// Returns `None` if the enum contains an unknown value deserialized from
33724    /// the integer representation of enums.
33725    pub fn name(&self) -> std::option::Option<&str> {
33726        match self {
33727            Self::Unspecified => std::option::Option::Some("SQL_SUSPENSION_REASON_UNSPECIFIED"),
33728            Self::BillingIssue => std::option::Option::Some("BILLING_ISSUE"),
33729            Self::LegalIssue => std::option::Option::Some("LEGAL_ISSUE"),
33730            Self::OperationalIssue => std::option::Option::Some("OPERATIONAL_ISSUE"),
33731            Self::KmsKeyIssue => std::option::Option::Some("KMS_KEY_ISSUE"),
33732            Self::UnknownValue(u) => u.0.name(),
33733        }
33734    }
33735}
33736
33737impl std::default::Default for SqlSuspensionReason {
33738    fn default() -> Self {
33739        use std::convert::From;
33740        Self::from(0)
33741    }
33742}
33743
33744impl std::fmt::Display for SqlSuspensionReason {
33745    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33746        wkt::internal::display_enum(f, self.name(), self.value())
33747    }
33748}
33749
33750impl std::convert::From<i32> for SqlSuspensionReason {
33751    fn from(value: i32) -> Self {
33752        match value {
33753            0 => Self::Unspecified,
33754            2 => Self::BillingIssue,
33755            3 => Self::LegalIssue,
33756            4 => Self::OperationalIssue,
33757            5 => Self::KmsKeyIssue,
33758            _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
33759                wkt::internal::UnknownEnumValue::Integer(value),
33760            )),
33761        }
33762    }
33763}
33764
33765impl std::convert::From<&str> for SqlSuspensionReason {
33766    fn from(value: &str) -> Self {
33767        use std::string::ToString;
33768        match value {
33769            "SQL_SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
33770            "BILLING_ISSUE" => Self::BillingIssue,
33771            "LEGAL_ISSUE" => Self::LegalIssue,
33772            "OPERATIONAL_ISSUE" => Self::OperationalIssue,
33773            "KMS_KEY_ISSUE" => Self::KmsKeyIssue,
33774            _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
33775                wkt::internal::UnknownEnumValue::String(value.to_string()),
33776            )),
33777        }
33778    }
33779}
33780
33781impl serde::ser::Serialize for SqlSuspensionReason {
33782    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33783    where
33784        S: serde::Serializer,
33785    {
33786        match self {
33787            Self::Unspecified => serializer.serialize_i32(0),
33788            Self::BillingIssue => serializer.serialize_i32(2),
33789            Self::LegalIssue => serializer.serialize_i32(3),
33790            Self::OperationalIssue => serializer.serialize_i32(4),
33791            Self::KmsKeyIssue => serializer.serialize_i32(5),
33792            Self::UnknownValue(u) => u.0.serialize(serializer),
33793        }
33794    }
33795}
33796
33797impl<'de> serde::de::Deserialize<'de> for SqlSuspensionReason {
33798    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33799    where
33800        D: serde::Deserializer<'de>,
33801    {
33802        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlSuspensionReason>::new(
33803            ".google.cloud.sql.v1.SqlSuspensionReason",
33804        ))
33805    }
33806}
33807
33808/// Enum for [SqlFileType].
33809///
33810/// # Working with unknown values
33811///
33812/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33813/// additional enum variants at any time. Adding new variants is not considered
33814/// a breaking change. Applications should write their code in anticipation of:
33815///
33816/// - New values appearing in future releases of the client library, **and**
33817/// - New values received dynamically, without application changes.
33818///
33819/// Please consult the [Working with enums] section in the user guide for some
33820/// guidelines.
33821///
33822/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33823#[derive(Clone, Debug, PartialEq)]
33824#[non_exhaustive]
33825pub enum SqlFileType {
33826    /// Unknown file type.
33827    Unspecified,
33828    /// File containing SQL statements.
33829    Sql,
33830    /// File in CSV format.
33831    Csv,
33832    #[allow(missing_docs)]
33833    Bak,
33834    /// TDE certificate.
33835    Tde,
33836    /// If set, the enum was initialized with an unknown value.
33837    ///
33838    /// Applications can examine the value using [SqlFileType::value] or
33839    /// [SqlFileType::name].
33840    UnknownValue(sql_file_type::UnknownValue),
33841}
33842
33843#[doc(hidden)]
33844pub mod sql_file_type {
33845    #[allow(unused_imports)]
33846    use super::*;
33847    #[derive(Clone, Debug, PartialEq)]
33848    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33849}
33850
33851impl SqlFileType {
33852    /// Gets the enum value.
33853    ///
33854    /// Returns `None` if the enum contains an unknown value deserialized from
33855    /// the string representation of enums.
33856    pub fn value(&self) -> std::option::Option<i32> {
33857        match self {
33858            Self::Unspecified => std::option::Option::Some(0),
33859            Self::Sql => std::option::Option::Some(1),
33860            Self::Csv => std::option::Option::Some(2),
33861            Self::Bak => std::option::Option::Some(4),
33862            Self::Tde => std::option::Option::Some(8),
33863            Self::UnknownValue(u) => u.0.value(),
33864        }
33865    }
33866
33867    /// Gets the enum value as a string.
33868    ///
33869    /// Returns `None` if the enum contains an unknown value deserialized from
33870    /// the integer representation of enums.
33871    pub fn name(&self) -> std::option::Option<&str> {
33872        match self {
33873            Self::Unspecified => std::option::Option::Some("SQL_FILE_TYPE_UNSPECIFIED"),
33874            Self::Sql => std::option::Option::Some("SQL"),
33875            Self::Csv => std::option::Option::Some("CSV"),
33876            Self::Bak => std::option::Option::Some("BAK"),
33877            Self::Tde => std::option::Option::Some("TDE"),
33878            Self::UnknownValue(u) => u.0.name(),
33879        }
33880    }
33881}
33882
33883impl std::default::Default for SqlFileType {
33884    fn default() -> Self {
33885        use std::convert::From;
33886        Self::from(0)
33887    }
33888}
33889
33890impl std::fmt::Display for SqlFileType {
33891    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33892        wkt::internal::display_enum(f, self.name(), self.value())
33893    }
33894}
33895
33896impl std::convert::From<i32> for SqlFileType {
33897    fn from(value: i32) -> Self {
33898        match value {
33899            0 => Self::Unspecified,
33900            1 => Self::Sql,
33901            2 => Self::Csv,
33902            4 => Self::Bak,
33903            8 => Self::Tde,
33904            _ => Self::UnknownValue(sql_file_type::UnknownValue(
33905                wkt::internal::UnknownEnumValue::Integer(value),
33906            )),
33907        }
33908    }
33909}
33910
33911impl std::convert::From<&str> for SqlFileType {
33912    fn from(value: &str) -> Self {
33913        use std::string::ToString;
33914        match value {
33915            "SQL_FILE_TYPE_UNSPECIFIED" => Self::Unspecified,
33916            "SQL" => Self::Sql,
33917            "CSV" => Self::Csv,
33918            "BAK" => Self::Bak,
33919            "TDE" => Self::Tde,
33920            _ => Self::UnknownValue(sql_file_type::UnknownValue(
33921                wkt::internal::UnknownEnumValue::String(value.to_string()),
33922            )),
33923        }
33924    }
33925}
33926
33927impl serde::ser::Serialize for SqlFileType {
33928    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33929    where
33930        S: serde::Serializer,
33931    {
33932        match self {
33933            Self::Unspecified => serializer.serialize_i32(0),
33934            Self::Sql => serializer.serialize_i32(1),
33935            Self::Csv => serializer.serialize_i32(2),
33936            Self::Bak => serializer.serialize_i32(4),
33937            Self::Tde => serializer.serialize_i32(8),
33938            Self::UnknownValue(u) => u.0.serialize(serializer),
33939        }
33940    }
33941}
33942
33943impl<'de> serde::de::Deserialize<'de> for SqlFileType {
33944    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33945    where
33946        D: serde::Deserializer<'de>,
33947    {
33948        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFileType>::new(
33949            ".google.cloud.sql.v1.SqlFileType",
33950        ))
33951    }
33952}
33953
33954/// Enum for [BakType].
33955///
33956/// # Working with unknown values
33957///
33958/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33959/// additional enum variants at any time. Adding new variants is not considered
33960/// a breaking change. Applications should write their code in anticipation of:
33961///
33962/// - New values appearing in future releases of the client library, **and**
33963/// - New values received dynamically, without application changes.
33964///
33965/// Please consult the [Working with enums] section in the user guide for some
33966/// guidelines.
33967///
33968/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33969#[derive(Clone, Debug, PartialEq)]
33970#[non_exhaustive]
33971pub enum BakType {
33972    /// Default type.
33973    Unspecified,
33974    /// Full backup.
33975    Full,
33976    /// Differential backup.
33977    Diff,
33978    /// Transaction Log backup
33979    Tlog,
33980    /// If set, the enum was initialized with an unknown value.
33981    ///
33982    /// Applications can examine the value using [BakType::value] or
33983    /// [BakType::name].
33984    UnknownValue(bak_type::UnknownValue),
33985}
33986
33987#[doc(hidden)]
33988pub mod bak_type {
33989    #[allow(unused_imports)]
33990    use super::*;
33991    #[derive(Clone, Debug, PartialEq)]
33992    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33993}
33994
33995impl BakType {
33996    /// Gets the enum value.
33997    ///
33998    /// Returns `None` if the enum contains an unknown value deserialized from
33999    /// the string representation of enums.
34000    pub fn value(&self) -> std::option::Option<i32> {
34001        match self {
34002            Self::Unspecified => std::option::Option::Some(0),
34003            Self::Full => std::option::Option::Some(1),
34004            Self::Diff => std::option::Option::Some(2),
34005            Self::Tlog => std::option::Option::Some(3),
34006            Self::UnknownValue(u) => u.0.value(),
34007        }
34008    }
34009
34010    /// Gets the enum value as a string.
34011    ///
34012    /// Returns `None` if the enum contains an unknown value deserialized from
34013    /// the integer representation of enums.
34014    pub fn name(&self) -> std::option::Option<&str> {
34015        match self {
34016            Self::Unspecified => std::option::Option::Some("BAK_TYPE_UNSPECIFIED"),
34017            Self::Full => std::option::Option::Some("FULL"),
34018            Self::Diff => std::option::Option::Some("DIFF"),
34019            Self::Tlog => std::option::Option::Some("TLOG"),
34020            Self::UnknownValue(u) => u.0.name(),
34021        }
34022    }
34023}
34024
34025impl std::default::Default for BakType {
34026    fn default() -> Self {
34027        use std::convert::From;
34028        Self::from(0)
34029    }
34030}
34031
34032impl std::fmt::Display for BakType {
34033    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34034        wkt::internal::display_enum(f, self.name(), self.value())
34035    }
34036}
34037
34038impl std::convert::From<i32> for BakType {
34039    fn from(value: i32) -> Self {
34040        match value {
34041            0 => Self::Unspecified,
34042            1 => Self::Full,
34043            2 => Self::Diff,
34044            3 => Self::Tlog,
34045            _ => Self::UnknownValue(bak_type::UnknownValue(
34046                wkt::internal::UnknownEnumValue::Integer(value),
34047            )),
34048        }
34049    }
34050}
34051
34052impl std::convert::From<&str> for BakType {
34053    fn from(value: &str) -> Self {
34054        use std::string::ToString;
34055        match value {
34056            "BAK_TYPE_UNSPECIFIED" => Self::Unspecified,
34057            "FULL" => Self::Full,
34058            "DIFF" => Self::Diff,
34059            "TLOG" => Self::Tlog,
34060            _ => Self::UnknownValue(bak_type::UnknownValue(
34061                wkt::internal::UnknownEnumValue::String(value.to_string()),
34062            )),
34063        }
34064    }
34065}
34066
34067impl serde::ser::Serialize for BakType {
34068    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34069    where
34070        S: serde::Serializer,
34071    {
34072        match self {
34073            Self::Unspecified => serializer.serialize_i32(0),
34074            Self::Full => serializer.serialize_i32(1),
34075            Self::Diff => serializer.serialize_i32(2),
34076            Self::Tlog => serializer.serialize_i32(3),
34077            Self::UnknownValue(u) => u.0.serialize(serializer),
34078        }
34079    }
34080}
34081
34082impl<'de> serde::de::Deserialize<'de> for BakType {
34083    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34084    where
34085        D: serde::Deserializer<'de>,
34086    {
34087        deserializer.deserialize_any(wkt::internal::EnumVisitor::<BakType>::new(
34088            ".google.cloud.sql.v1.BakType",
34089        ))
34090    }
34091}
34092
34093/// The type of maintenance to be performed on the instance.
34094///
34095/// # Working with unknown values
34096///
34097/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34098/// additional enum variants at any time. Adding new variants is not considered
34099/// a breaking change. Applications should write their code in anticipation of:
34100///
34101/// - New values appearing in future releases of the client library, **and**
34102/// - New values received dynamically, without application changes.
34103///
34104/// Please consult the [Working with enums] section in the user guide for some
34105/// guidelines.
34106///
34107/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34108#[derive(Clone, Debug, PartialEq)]
34109#[non_exhaustive]
34110pub enum SqlMaintenanceType {
34111    /// Maintenance type is unspecified.
34112    Unspecified,
34113    /// Indicates that a standalone instance is undergoing maintenance. The
34114    /// instance can be either a primary instance or a replica.
34115    InstanceMaintenance,
34116    /// Indicates that the primary instance and all of its replicas, including
34117    /// cascading replicas, are undergoing maintenance. Maintenance is performed on
34118    /// groups of replicas first, followed by the primary instance.
34119    ReplicaIncludedMaintenance,
34120    /// Indicates that the standalone instance is undergoing maintenance, initiated
34121    /// by self-service. The instance can be either a primary instance or a
34122    /// replica.
34123    InstanceSelfServiceMaintenance,
34124    /// Indicates that the primary instance and all of its replicas are undergoing
34125    /// maintenance, initiated by self-service. Maintenance is performed on groups
34126    /// of replicas first, followed by the primary instance.
34127    ReplicaIncludedSelfServiceMaintenance,
34128    /// If set, the enum was initialized with an unknown value.
34129    ///
34130    /// Applications can examine the value using [SqlMaintenanceType::value] or
34131    /// [SqlMaintenanceType::name].
34132    UnknownValue(sql_maintenance_type::UnknownValue),
34133}
34134
34135#[doc(hidden)]
34136pub mod sql_maintenance_type {
34137    #[allow(unused_imports)]
34138    use super::*;
34139    #[derive(Clone, Debug, PartialEq)]
34140    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34141}
34142
34143impl SqlMaintenanceType {
34144    /// Gets the enum value.
34145    ///
34146    /// Returns `None` if the enum contains an unknown value deserialized from
34147    /// the string representation of enums.
34148    pub fn value(&self) -> std::option::Option<i32> {
34149        match self {
34150            Self::Unspecified => std::option::Option::Some(0),
34151            Self::InstanceMaintenance => std::option::Option::Some(1),
34152            Self::ReplicaIncludedMaintenance => std::option::Option::Some(2),
34153            Self::InstanceSelfServiceMaintenance => std::option::Option::Some(3),
34154            Self::ReplicaIncludedSelfServiceMaintenance => std::option::Option::Some(4),
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_MAINTENANCE_TYPE_UNSPECIFIED"),
34166            Self::InstanceMaintenance => std::option::Option::Some("INSTANCE_MAINTENANCE"),
34167            Self::ReplicaIncludedMaintenance => {
34168                std::option::Option::Some("REPLICA_INCLUDED_MAINTENANCE")
34169            }
34170            Self::InstanceSelfServiceMaintenance => {
34171                std::option::Option::Some("INSTANCE_SELF_SERVICE_MAINTENANCE")
34172            }
34173            Self::ReplicaIncludedSelfServiceMaintenance => {
34174                std::option::Option::Some("REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE")
34175            }
34176            Self::UnknownValue(u) => u.0.name(),
34177        }
34178    }
34179}
34180
34181impl std::default::Default for SqlMaintenanceType {
34182    fn default() -> Self {
34183        use std::convert::From;
34184        Self::from(0)
34185    }
34186}
34187
34188impl std::fmt::Display for SqlMaintenanceType {
34189    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34190        wkt::internal::display_enum(f, self.name(), self.value())
34191    }
34192}
34193
34194impl std::convert::From<i32> for SqlMaintenanceType {
34195    fn from(value: i32) -> Self {
34196        match value {
34197            0 => Self::Unspecified,
34198            1 => Self::InstanceMaintenance,
34199            2 => Self::ReplicaIncludedMaintenance,
34200            3 => Self::InstanceSelfServiceMaintenance,
34201            4 => Self::ReplicaIncludedSelfServiceMaintenance,
34202            _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
34203                wkt::internal::UnknownEnumValue::Integer(value),
34204            )),
34205        }
34206    }
34207}
34208
34209impl std::convert::From<&str> for SqlMaintenanceType {
34210    fn from(value: &str) -> Self {
34211        use std::string::ToString;
34212        match value {
34213            "SQL_MAINTENANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
34214            "INSTANCE_MAINTENANCE" => Self::InstanceMaintenance,
34215            "REPLICA_INCLUDED_MAINTENANCE" => Self::ReplicaIncludedMaintenance,
34216            "INSTANCE_SELF_SERVICE_MAINTENANCE" => Self::InstanceSelfServiceMaintenance,
34217            "REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE" => {
34218                Self::ReplicaIncludedSelfServiceMaintenance
34219            }
34220            _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
34221                wkt::internal::UnknownEnumValue::String(value.to_string()),
34222            )),
34223        }
34224    }
34225}
34226
34227impl serde::ser::Serialize for SqlMaintenanceType {
34228    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34229    where
34230        S: serde::Serializer,
34231    {
34232        match self {
34233            Self::Unspecified => serializer.serialize_i32(0),
34234            Self::InstanceMaintenance => serializer.serialize_i32(1),
34235            Self::ReplicaIncludedMaintenance => serializer.serialize_i32(2),
34236            Self::InstanceSelfServiceMaintenance => serializer.serialize_i32(3),
34237            Self::ReplicaIncludedSelfServiceMaintenance => serializer.serialize_i32(4),
34238            Self::UnknownValue(u) => u.0.serialize(serializer),
34239        }
34240    }
34241}
34242
34243impl<'de> serde::de::Deserialize<'de> for SqlMaintenanceType {
34244    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34245    where
34246        D: serde::Deserializer<'de>,
34247    {
34248        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlMaintenanceType>::new(
34249            ".google.cloud.sql.v1.SqlMaintenanceType",
34250        ))
34251    }
34252}
34253
34254/// Enum for [SqlBackendType].
34255///
34256/// # Working with unknown values
34257///
34258/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34259/// additional enum variants at any time. Adding new variants is not considered
34260/// a breaking change. Applications should write their code in anticipation of:
34261///
34262/// - New values appearing in future releases of the client library, **and**
34263/// - New values received dynamically, without application changes.
34264///
34265/// Please consult the [Working with enums] section in the user guide for some
34266/// guidelines.
34267///
34268/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34269#[derive(Clone, Debug, PartialEq)]
34270#[non_exhaustive]
34271pub enum SqlBackendType {
34272    /// This is an unknown backend type for instance.
34273    Unspecified,
34274    /// V1 speckle instance.
34275    #[deprecated]
34276    FirstGen,
34277    /// V2 speckle instance.
34278    SecondGen,
34279    /// On premises instance.
34280    External,
34281    /// If set, the enum was initialized with an unknown value.
34282    ///
34283    /// Applications can examine the value using [SqlBackendType::value] or
34284    /// [SqlBackendType::name].
34285    UnknownValue(sql_backend_type::UnknownValue),
34286}
34287
34288#[doc(hidden)]
34289pub mod sql_backend_type {
34290    #[allow(unused_imports)]
34291    use super::*;
34292    #[derive(Clone, Debug, PartialEq)]
34293    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34294}
34295
34296impl SqlBackendType {
34297    /// Gets the enum value.
34298    ///
34299    /// Returns `None` if the enum contains an unknown value deserialized from
34300    /// the string representation of enums.
34301    pub fn value(&self) -> std::option::Option<i32> {
34302        match self {
34303            Self::Unspecified => std::option::Option::Some(0),
34304            Self::FirstGen => std::option::Option::Some(1),
34305            Self::SecondGen => std::option::Option::Some(2),
34306            Self::External => std::option::Option::Some(3),
34307            Self::UnknownValue(u) => u.0.value(),
34308        }
34309    }
34310
34311    /// Gets the enum value as a string.
34312    ///
34313    /// Returns `None` if the enum contains an unknown value deserialized from
34314    /// the integer representation of enums.
34315    pub fn name(&self) -> std::option::Option<&str> {
34316        match self {
34317            Self::Unspecified => std::option::Option::Some("SQL_BACKEND_TYPE_UNSPECIFIED"),
34318            Self::FirstGen => std::option::Option::Some("FIRST_GEN"),
34319            Self::SecondGen => std::option::Option::Some("SECOND_GEN"),
34320            Self::External => std::option::Option::Some("EXTERNAL"),
34321            Self::UnknownValue(u) => u.0.name(),
34322        }
34323    }
34324}
34325
34326impl std::default::Default for SqlBackendType {
34327    fn default() -> Self {
34328        use std::convert::From;
34329        Self::from(0)
34330    }
34331}
34332
34333impl std::fmt::Display for SqlBackendType {
34334    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34335        wkt::internal::display_enum(f, self.name(), self.value())
34336    }
34337}
34338
34339impl std::convert::From<i32> for SqlBackendType {
34340    fn from(value: i32) -> Self {
34341        match value {
34342            0 => Self::Unspecified,
34343            1 => Self::FirstGen,
34344            2 => Self::SecondGen,
34345            3 => Self::External,
34346            _ => Self::UnknownValue(sql_backend_type::UnknownValue(
34347                wkt::internal::UnknownEnumValue::Integer(value),
34348            )),
34349        }
34350    }
34351}
34352
34353impl std::convert::From<&str> for SqlBackendType {
34354    fn from(value: &str) -> Self {
34355        use std::string::ToString;
34356        match value {
34357            "SQL_BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
34358            "FIRST_GEN" => Self::FirstGen,
34359            "SECOND_GEN" => Self::SecondGen,
34360            "EXTERNAL" => Self::External,
34361            _ => Self::UnknownValue(sql_backend_type::UnknownValue(
34362                wkt::internal::UnknownEnumValue::String(value.to_string()),
34363            )),
34364        }
34365    }
34366}
34367
34368impl serde::ser::Serialize for SqlBackendType {
34369    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34370    where
34371        S: serde::Serializer,
34372    {
34373        match self {
34374            Self::Unspecified => serializer.serialize_i32(0),
34375            Self::FirstGen => serializer.serialize_i32(1),
34376            Self::SecondGen => serializer.serialize_i32(2),
34377            Self::External => serializer.serialize_i32(3),
34378            Self::UnknownValue(u) => u.0.serialize(serializer),
34379        }
34380    }
34381}
34382
34383impl<'de> serde::de::Deserialize<'de> for SqlBackendType {
34384    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34385    where
34386        D: serde::Deserializer<'de>,
34387    {
34388        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackendType>::new(
34389            ".google.cloud.sql.v1.SqlBackendType",
34390        ))
34391    }
34392}
34393
34394/// Enum for [SqlIpAddressType].
34395///
34396/// # Working with unknown values
34397///
34398/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34399/// additional enum variants at any time. Adding new variants is not considered
34400/// a breaking change. Applications should write their code in anticipation of:
34401///
34402/// - New values appearing in future releases of the client library, **and**
34403/// - New values received dynamically, without application changes.
34404///
34405/// Please consult the [Working with enums] section in the user guide for some
34406/// guidelines.
34407///
34408/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34409#[derive(Clone, Debug, PartialEq)]
34410#[non_exhaustive]
34411pub enum SqlIpAddressType {
34412    /// This is an unknown IP address type.
34413    Unspecified,
34414    /// IP address the customer is supposed to connect to. Usually this is the
34415    /// load balancer's IP address
34416    Primary,
34417    /// Source IP address of the connection a read replica establishes to its
34418    /// external primary instance. This IP address can be allowlisted by the
34419    /// customer in case it has a firewall that filters incoming connection to its
34420    /// on premises primary instance.
34421    Outgoing,
34422    /// Private IP used when using private IPs and network peering.
34423    Private,
34424    /// V1 IP of a migrated instance. We want the user to
34425    /// decommission this IP as soon as the migration is complete.
34426    /// Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
34427    Migrated1StGen,
34428    /// If set, the enum was initialized with an unknown value.
34429    ///
34430    /// Applications can examine the value using [SqlIpAddressType::value] or
34431    /// [SqlIpAddressType::name].
34432    UnknownValue(sql_ip_address_type::UnknownValue),
34433}
34434
34435#[doc(hidden)]
34436pub mod sql_ip_address_type {
34437    #[allow(unused_imports)]
34438    use super::*;
34439    #[derive(Clone, Debug, PartialEq)]
34440    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34441}
34442
34443impl SqlIpAddressType {
34444    /// Gets the enum value.
34445    ///
34446    /// Returns `None` if the enum contains an unknown value deserialized from
34447    /// the string representation of enums.
34448    pub fn value(&self) -> std::option::Option<i32> {
34449        match self {
34450            Self::Unspecified => std::option::Option::Some(0),
34451            Self::Primary => std::option::Option::Some(1),
34452            Self::Outgoing => std::option::Option::Some(2),
34453            Self::Private => std::option::Option::Some(3),
34454            Self::Migrated1StGen => std::option::Option::Some(4),
34455            Self::UnknownValue(u) => u.0.value(),
34456        }
34457    }
34458
34459    /// Gets the enum value as a string.
34460    ///
34461    /// Returns `None` if the enum contains an unknown value deserialized from
34462    /// the integer representation of enums.
34463    pub fn name(&self) -> std::option::Option<&str> {
34464        match self {
34465            Self::Unspecified => std::option::Option::Some("SQL_IP_ADDRESS_TYPE_UNSPECIFIED"),
34466            Self::Primary => std::option::Option::Some("PRIMARY"),
34467            Self::Outgoing => std::option::Option::Some("OUTGOING"),
34468            Self::Private => std::option::Option::Some("PRIVATE"),
34469            Self::Migrated1StGen => std::option::Option::Some("MIGRATED_1ST_GEN"),
34470            Self::UnknownValue(u) => u.0.name(),
34471        }
34472    }
34473}
34474
34475impl std::default::Default for SqlIpAddressType {
34476    fn default() -> Self {
34477        use std::convert::From;
34478        Self::from(0)
34479    }
34480}
34481
34482impl std::fmt::Display for SqlIpAddressType {
34483    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34484        wkt::internal::display_enum(f, self.name(), self.value())
34485    }
34486}
34487
34488impl std::convert::From<i32> for SqlIpAddressType {
34489    fn from(value: i32) -> Self {
34490        match value {
34491            0 => Self::Unspecified,
34492            1 => Self::Primary,
34493            2 => Self::Outgoing,
34494            3 => Self::Private,
34495            4 => Self::Migrated1StGen,
34496            _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
34497                wkt::internal::UnknownEnumValue::Integer(value),
34498            )),
34499        }
34500    }
34501}
34502
34503impl std::convert::From<&str> for SqlIpAddressType {
34504    fn from(value: &str) -> Self {
34505        use std::string::ToString;
34506        match value {
34507            "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" => Self::Unspecified,
34508            "PRIMARY" => Self::Primary,
34509            "OUTGOING" => Self::Outgoing,
34510            "PRIVATE" => Self::Private,
34511            "MIGRATED_1ST_GEN" => Self::Migrated1StGen,
34512            _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
34513                wkt::internal::UnknownEnumValue::String(value.to_string()),
34514            )),
34515        }
34516    }
34517}
34518
34519impl serde::ser::Serialize for SqlIpAddressType {
34520    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34521    where
34522        S: serde::Serializer,
34523    {
34524        match self {
34525            Self::Unspecified => serializer.serialize_i32(0),
34526            Self::Primary => serializer.serialize_i32(1),
34527            Self::Outgoing => serializer.serialize_i32(2),
34528            Self::Private => serializer.serialize_i32(3),
34529            Self::Migrated1StGen => serializer.serialize_i32(4),
34530            Self::UnknownValue(u) => u.0.serialize(serializer),
34531        }
34532    }
34533}
34534
34535impl<'de> serde::de::Deserialize<'de> for SqlIpAddressType {
34536    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34537    where
34538        D: serde::Deserializer<'de>,
34539    {
34540        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlIpAddressType>::new(
34541            ".google.cloud.sql.v1.SqlIpAddressType",
34542        ))
34543    }
34544}
34545
34546/// The database engine type and version.
34547///
34548/// # Working with unknown values
34549///
34550/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34551/// additional enum variants at any time. Adding new variants is not considered
34552/// a breaking change. Applications should write their code in anticipation of:
34553///
34554/// - New values appearing in future releases of the client library, **and**
34555/// - New values received dynamically, without application changes.
34556///
34557/// Please consult the [Working with enums] section in the user guide for some
34558/// guidelines.
34559///
34560/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34561#[derive(Clone, Debug, PartialEq)]
34562#[non_exhaustive]
34563pub enum SqlDatabaseVersion {
34564    /// This is an unknown database version.
34565    Unspecified,
34566    /// The database version is MySQL 5.1.
34567    #[deprecated]
34568    Mysql51,
34569    /// The database version is MySQL 5.5.
34570    #[deprecated]
34571    Mysql55,
34572    /// The database version is MySQL 5.6.
34573    Mysql56,
34574    /// The database version is MySQL 5.7.
34575    Mysql57,
34576    /// The database version is MySQL 8.
34577    Mysql80,
34578    /// The database major version is MySQL 8.0 and the minor version is 18.
34579    Mysql8018,
34580    /// The database major version is MySQL 8.0 and the minor version is 26.
34581    Mysql8026,
34582    /// The database major version is MySQL 8.0 and the minor version is 27.
34583    Mysql8027,
34584    /// The database major version is MySQL 8.0 and the minor version is 28.
34585    Mysql8028,
34586    /// The database major version is MySQL 8.0 and the minor version is 29.
34587    #[deprecated]
34588    Mysql8029,
34589    /// The database major version is MySQL 8.0 and the minor version is 30.
34590    Mysql8030,
34591    /// The database major version is MySQL 8.0 and the minor version is 31.
34592    Mysql8031,
34593    /// The database major version is MySQL 8.0 and the minor version is 32.
34594    Mysql8032,
34595    /// The database major version is MySQL 8.0 and the minor version is 33.
34596    Mysql8033,
34597    /// The database major version is MySQL 8.0 and the minor version is 34.
34598    Mysql8034,
34599    /// The database major version is MySQL 8.0 and the minor version is 35.
34600    Mysql8035,
34601    /// The database major version is MySQL 8.0 and the minor version is 36.
34602    Mysql8036,
34603    /// The database major version is MySQL 8.0 and the minor version is 37.
34604    Mysql8037,
34605    /// The database major version is MySQL 8.0 and the minor version is 39.
34606    Mysql8039,
34607    /// The database major version is MySQL 8.0 and the minor version is 40.
34608    Mysql8040,
34609    /// The database major version is MySQL 8.0 and the minor version is 41.
34610    Mysql8041,
34611    /// The database major version is MySQL 8.0 and the minor version is 42.
34612    Mysql8042,
34613    /// The database major version is MySQL 8.0 and the minor version is 43.
34614    Mysql8043,
34615    /// The database major version is MySQL 8.0 and the minor version is 44.
34616    Mysql8044,
34617    /// The database major version is MySQL 8.0 and the minor version is 45.
34618    Mysql8045,
34619    /// The database major version is MySQL 8.0 and the minor version is 46.
34620    Mysql8046,
34621    /// The database version is MySQL 8.4.
34622    Mysql84,
34623    /// The database version is MySQL 9.7.
34624    Mysql97,
34625    /// The database version is SQL Server 2017 Standard.
34626    Sqlserver2017Standard,
34627    /// The database version is SQL Server 2017 Enterprise.
34628    Sqlserver2017Enterprise,
34629    /// The database version is SQL Server 2017 Express.
34630    Sqlserver2017Express,
34631    /// The database version is SQL Server 2017 Web.
34632    Sqlserver2017Web,
34633    /// The database version is PostgreSQL 9.6.
34634    Postgres96,
34635    /// The database version is PostgreSQL 10.
34636    Postgres10,
34637    /// The database version is PostgreSQL 11.
34638    Postgres11,
34639    /// The database version is PostgreSQL 12.
34640    Postgres12,
34641    /// The database version is PostgreSQL 13.
34642    Postgres13,
34643    /// The database version is PostgreSQL 14.
34644    Postgres14,
34645    /// The database version is PostgreSQL 15.
34646    Postgres15,
34647    /// The database version is PostgreSQL 16.
34648    Postgres16,
34649    /// The database version is PostgreSQL 17.
34650    Postgres17,
34651    /// The database version is PostgreSQL 18.
34652    Postgres18,
34653    /// The database version is SQL Server 2019 Standard.
34654    Sqlserver2019Standard,
34655    /// The database version is SQL Server 2019 Enterprise.
34656    Sqlserver2019Enterprise,
34657    /// The database version is SQL Server 2019 Express.
34658    Sqlserver2019Express,
34659    /// The database version is SQL Server 2019 Web.
34660    Sqlserver2019Web,
34661    /// The database version is SQL Server 2022 Standard.
34662    Sqlserver2022Standard,
34663    /// The database version is SQL Server 2022 Enterprise.
34664    Sqlserver2022Enterprise,
34665    /// The database version is SQL Server 2022 Express.
34666    Sqlserver2022Express,
34667    /// The database version is SQL Server 2022 Web.
34668    Sqlserver2022Web,
34669    /// If set, the enum was initialized with an unknown value.
34670    ///
34671    /// Applications can examine the value using [SqlDatabaseVersion::value] or
34672    /// [SqlDatabaseVersion::name].
34673    UnknownValue(sql_database_version::UnknownValue),
34674}
34675
34676#[doc(hidden)]
34677pub mod sql_database_version {
34678    #[allow(unused_imports)]
34679    use super::*;
34680    #[derive(Clone, Debug, PartialEq)]
34681    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34682}
34683
34684impl SqlDatabaseVersion {
34685    /// Gets the enum value.
34686    ///
34687    /// Returns `None` if the enum contains an unknown value deserialized from
34688    /// the string representation of enums.
34689    pub fn value(&self) -> std::option::Option<i32> {
34690        match self {
34691            Self::Unspecified => std::option::Option::Some(0),
34692            Self::Mysql51 => std::option::Option::Some(2),
34693            Self::Mysql55 => std::option::Option::Some(3),
34694            Self::Mysql56 => std::option::Option::Some(5),
34695            Self::Mysql57 => std::option::Option::Some(6),
34696            Self::Mysql80 => std::option::Option::Some(20),
34697            Self::Mysql8018 => std::option::Option::Some(41),
34698            Self::Mysql8026 => std::option::Option::Some(85),
34699            Self::Mysql8027 => std::option::Option::Some(111),
34700            Self::Mysql8028 => std::option::Option::Some(132),
34701            Self::Mysql8029 => std::option::Option::Some(148),
34702            Self::Mysql8030 => std::option::Option::Some(174),
34703            Self::Mysql8031 => std::option::Option::Some(197),
34704            Self::Mysql8032 => std::option::Option::Some(213),
34705            Self::Mysql8033 => std::option::Option::Some(238),
34706            Self::Mysql8034 => std::option::Option::Some(239),
34707            Self::Mysql8035 => std::option::Option::Some(240),
34708            Self::Mysql8036 => std::option::Option::Some(241),
34709            Self::Mysql8037 => std::option::Option::Some(355),
34710            Self::Mysql8039 => std::option::Option::Some(357),
34711            Self::Mysql8040 => std::option::Option::Some(358),
34712            Self::Mysql8041 => std::option::Option::Some(488),
34713            Self::Mysql8042 => std::option::Option::Some(489),
34714            Self::Mysql8043 => std::option::Option::Some(553),
34715            Self::Mysql8044 => std::option::Option::Some(554),
34716            Self::Mysql8045 => std::option::Option::Some(555),
34717            Self::Mysql8046 => std::option::Option::Some(556),
34718            Self::Mysql84 => std::option::Option::Some(398),
34719            Self::Mysql97 => std::option::Option::Some(654),
34720            Self::Sqlserver2017Standard => std::option::Option::Some(11),
34721            Self::Sqlserver2017Enterprise => std::option::Option::Some(14),
34722            Self::Sqlserver2017Express => std::option::Option::Some(15),
34723            Self::Sqlserver2017Web => std::option::Option::Some(16),
34724            Self::Postgres96 => std::option::Option::Some(9),
34725            Self::Postgres10 => std::option::Option::Some(18),
34726            Self::Postgres11 => std::option::Option::Some(10),
34727            Self::Postgres12 => std::option::Option::Some(19),
34728            Self::Postgres13 => std::option::Option::Some(23),
34729            Self::Postgres14 => std::option::Option::Some(110),
34730            Self::Postgres15 => std::option::Option::Some(172),
34731            Self::Postgres16 => std::option::Option::Some(272),
34732            Self::Postgres17 => std::option::Option::Some(408),
34733            Self::Postgres18 => std::option::Option::Some(557),
34734            Self::Sqlserver2019Standard => std::option::Option::Some(26),
34735            Self::Sqlserver2019Enterprise => std::option::Option::Some(27),
34736            Self::Sqlserver2019Express => std::option::Option::Some(28),
34737            Self::Sqlserver2019Web => std::option::Option::Some(29),
34738            Self::Sqlserver2022Standard => std::option::Option::Some(199),
34739            Self::Sqlserver2022Enterprise => std::option::Option::Some(200),
34740            Self::Sqlserver2022Express => std::option::Option::Some(201),
34741            Self::Sqlserver2022Web => std::option::Option::Some(202),
34742            Self::UnknownValue(u) => u.0.value(),
34743        }
34744    }
34745
34746    /// Gets the enum value as a string.
34747    ///
34748    /// Returns `None` if the enum contains an unknown value deserialized from
34749    /// the integer representation of enums.
34750    pub fn name(&self) -> std::option::Option<&str> {
34751        match self {
34752            Self::Unspecified => std::option::Option::Some("SQL_DATABASE_VERSION_UNSPECIFIED"),
34753            Self::Mysql51 => std::option::Option::Some("MYSQL_5_1"),
34754            Self::Mysql55 => std::option::Option::Some("MYSQL_5_5"),
34755            Self::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
34756            Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
34757            Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
34758            Self::Mysql8018 => std::option::Option::Some("MYSQL_8_0_18"),
34759            Self::Mysql8026 => std::option::Option::Some("MYSQL_8_0_26"),
34760            Self::Mysql8027 => std::option::Option::Some("MYSQL_8_0_27"),
34761            Self::Mysql8028 => std::option::Option::Some("MYSQL_8_0_28"),
34762            Self::Mysql8029 => std::option::Option::Some("MYSQL_8_0_29"),
34763            Self::Mysql8030 => std::option::Option::Some("MYSQL_8_0_30"),
34764            Self::Mysql8031 => std::option::Option::Some("MYSQL_8_0_31"),
34765            Self::Mysql8032 => std::option::Option::Some("MYSQL_8_0_32"),
34766            Self::Mysql8033 => std::option::Option::Some("MYSQL_8_0_33"),
34767            Self::Mysql8034 => std::option::Option::Some("MYSQL_8_0_34"),
34768            Self::Mysql8035 => std::option::Option::Some("MYSQL_8_0_35"),
34769            Self::Mysql8036 => std::option::Option::Some("MYSQL_8_0_36"),
34770            Self::Mysql8037 => std::option::Option::Some("MYSQL_8_0_37"),
34771            Self::Mysql8039 => std::option::Option::Some("MYSQL_8_0_39"),
34772            Self::Mysql8040 => std::option::Option::Some("MYSQL_8_0_40"),
34773            Self::Mysql8041 => std::option::Option::Some("MYSQL_8_0_41"),
34774            Self::Mysql8042 => std::option::Option::Some("MYSQL_8_0_42"),
34775            Self::Mysql8043 => std::option::Option::Some("MYSQL_8_0_43"),
34776            Self::Mysql8044 => std::option::Option::Some("MYSQL_8_0_44"),
34777            Self::Mysql8045 => std::option::Option::Some("MYSQL_8_0_45"),
34778            Self::Mysql8046 => std::option::Option::Some("MYSQL_8_0_46"),
34779            Self::Mysql84 => std::option::Option::Some("MYSQL_8_4"),
34780            Self::Mysql97 => std::option::Option::Some("MYSQL_9_7"),
34781            Self::Sqlserver2017Standard => std::option::Option::Some("SQLSERVER_2017_STANDARD"),
34782            Self::Sqlserver2017Enterprise => std::option::Option::Some("SQLSERVER_2017_ENTERPRISE"),
34783            Self::Sqlserver2017Express => std::option::Option::Some("SQLSERVER_2017_EXPRESS"),
34784            Self::Sqlserver2017Web => std::option::Option::Some("SQLSERVER_2017_WEB"),
34785            Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
34786            Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
34787            Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
34788            Self::Postgres12 => std::option::Option::Some("POSTGRES_12"),
34789            Self::Postgres13 => std::option::Option::Some("POSTGRES_13"),
34790            Self::Postgres14 => std::option::Option::Some("POSTGRES_14"),
34791            Self::Postgres15 => std::option::Option::Some("POSTGRES_15"),
34792            Self::Postgres16 => std::option::Option::Some("POSTGRES_16"),
34793            Self::Postgres17 => std::option::Option::Some("POSTGRES_17"),
34794            Self::Postgres18 => std::option::Option::Some("POSTGRES_18"),
34795            Self::Sqlserver2019Standard => std::option::Option::Some("SQLSERVER_2019_STANDARD"),
34796            Self::Sqlserver2019Enterprise => std::option::Option::Some("SQLSERVER_2019_ENTERPRISE"),
34797            Self::Sqlserver2019Express => std::option::Option::Some("SQLSERVER_2019_EXPRESS"),
34798            Self::Sqlserver2019Web => std::option::Option::Some("SQLSERVER_2019_WEB"),
34799            Self::Sqlserver2022Standard => std::option::Option::Some("SQLSERVER_2022_STANDARD"),
34800            Self::Sqlserver2022Enterprise => std::option::Option::Some("SQLSERVER_2022_ENTERPRISE"),
34801            Self::Sqlserver2022Express => std::option::Option::Some("SQLSERVER_2022_EXPRESS"),
34802            Self::Sqlserver2022Web => std::option::Option::Some("SQLSERVER_2022_WEB"),
34803            Self::UnknownValue(u) => u.0.name(),
34804        }
34805    }
34806}
34807
34808impl std::default::Default for SqlDatabaseVersion {
34809    fn default() -> Self {
34810        use std::convert::From;
34811        Self::from(0)
34812    }
34813}
34814
34815impl std::fmt::Display for SqlDatabaseVersion {
34816    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34817        wkt::internal::display_enum(f, self.name(), self.value())
34818    }
34819}
34820
34821impl std::convert::From<i32> for SqlDatabaseVersion {
34822    fn from(value: i32) -> Self {
34823        match value {
34824            0 => Self::Unspecified,
34825            2 => Self::Mysql51,
34826            3 => Self::Mysql55,
34827            5 => Self::Mysql56,
34828            6 => Self::Mysql57,
34829            9 => Self::Postgres96,
34830            10 => Self::Postgres11,
34831            11 => Self::Sqlserver2017Standard,
34832            14 => Self::Sqlserver2017Enterprise,
34833            15 => Self::Sqlserver2017Express,
34834            16 => Self::Sqlserver2017Web,
34835            18 => Self::Postgres10,
34836            19 => Self::Postgres12,
34837            20 => Self::Mysql80,
34838            23 => Self::Postgres13,
34839            26 => Self::Sqlserver2019Standard,
34840            27 => Self::Sqlserver2019Enterprise,
34841            28 => Self::Sqlserver2019Express,
34842            29 => Self::Sqlserver2019Web,
34843            41 => Self::Mysql8018,
34844            85 => Self::Mysql8026,
34845            110 => Self::Postgres14,
34846            111 => Self::Mysql8027,
34847            132 => Self::Mysql8028,
34848            148 => Self::Mysql8029,
34849            172 => Self::Postgres15,
34850            174 => Self::Mysql8030,
34851            197 => Self::Mysql8031,
34852            199 => Self::Sqlserver2022Standard,
34853            200 => Self::Sqlserver2022Enterprise,
34854            201 => Self::Sqlserver2022Express,
34855            202 => Self::Sqlserver2022Web,
34856            213 => Self::Mysql8032,
34857            238 => Self::Mysql8033,
34858            239 => Self::Mysql8034,
34859            240 => Self::Mysql8035,
34860            241 => Self::Mysql8036,
34861            272 => Self::Postgres16,
34862            355 => Self::Mysql8037,
34863            357 => Self::Mysql8039,
34864            358 => Self::Mysql8040,
34865            398 => Self::Mysql84,
34866            408 => Self::Postgres17,
34867            488 => Self::Mysql8041,
34868            489 => Self::Mysql8042,
34869            553 => Self::Mysql8043,
34870            554 => Self::Mysql8044,
34871            555 => Self::Mysql8045,
34872            556 => Self::Mysql8046,
34873            557 => Self::Postgres18,
34874            654 => Self::Mysql97,
34875            _ => Self::UnknownValue(sql_database_version::UnknownValue(
34876                wkt::internal::UnknownEnumValue::Integer(value),
34877            )),
34878        }
34879    }
34880}
34881
34882impl std::convert::From<&str> for SqlDatabaseVersion {
34883    fn from(value: &str) -> Self {
34884        use std::string::ToString;
34885        match value {
34886            "SQL_DATABASE_VERSION_UNSPECIFIED" => Self::Unspecified,
34887            "MYSQL_5_1" => Self::Mysql51,
34888            "MYSQL_5_5" => Self::Mysql55,
34889            "MYSQL_5_6" => Self::Mysql56,
34890            "MYSQL_5_7" => Self::Mysql57,
34891            "MYSQL_8_0" => Self::Mysql80,
34892            "MYSQL_8_0_18" => Self::Mysql8018,
34893            "MYSQL_8_0_26" => Self::Mysql8026,
34894            "MYSQL_8_0_27" => Self::Mysql8027,
34895            "MYSQL_8_0_28" => Self::Mysql8028,
34896            "MYSQL_8_0_29" => Self::Mysql8029,
34897            "MYSQL_8_0_30" => Self::Mysql8030,
34898            "MYSQL_8_0_31" => Self::Mysql8031,
34899            "MYSQL_8_0_32" => Self::Mysql8032,
34900            "MYSQL_8_0_33" => Self::Mysql8033,
34901            "MYSQL_8_0_34" => Self::Mysql8034,
34902            "MYSQL_8_0_35" => Self::Mysql8035,
34903            "MYSQL_8_0_36" => Self::Mysql8036,
34904            "MYSQL_8_0_37" => Self::Mysql8037,
34905            "MYSQL_8_0_39" => Self::Mysql8039,
34906            "MYSQL_8_0_40" => Self::Mysql8040,
34907            "MYSQL_8_0_41" => Self::Mysql8041,
34908            "MYSQL_8_0_42" => Self::Mysql8042,
34909            "MYSQL_8_0_43" => Self::Mysql8043,
34910            "MYSQL_8_0_44" => Self::Mysql8044,
34911            "MYSQL_8_0_45" => Self::Mysql8045,
34912            "MYSQL_8_0_46" => Self::Mysql8046,
34913            "MYSQL_8_4" => Self::Mysql84,
34914            "MYSQL_9_7" => Self::Mysql97,
34915            "SQLSERVER_2017_STANDARD" => Self::Sqlserver2017Standard,
34916            "SQLSERVER_2017_ENTERPRISE" => Self::Sqlserver2017Enterprise,
34917            "SQLSERVER_2017_EXPRESS" => Self::Sqlserver2017Express,
34918            "SQLSERVER_2017_WEB" => Self::Sqlserver2017Web,
34919            "POSTGRES_9_6" => Self::Postgres96,
34920            "POSTGRES_10" => Self::Postgres10,
34921            "POSTGRES_11" => Self::Postgres11,
34922            "POSTGRES_12" => Self::Postgres12,
34923            "POSTGRES_13" => Self::Postgres13,
34924            "POSTGRES_14" => Self::Postgres14,
34925            "POSTGRES_15" => Self::Postgres15,
34926            "POSTGRES_16" => Self::Postgres16,
34927            "POSTGRES_17" => Self::Postgres17,
34928            "POSTGRES_18" => Self::Postgres18,
34929            "SQLSERVER_2019_STANDARD" => Self::Sqlserver2019Standard,
34930            "SQLSERVER_2019_ENTERPRISE" => Self::Sqlserver2019Enterprise,
34931            "SQLSERVER_2019_EXPRESS" => Self::Sqlserver2019Express,
34932            "SQLSERVER_2019_WEB" => Self::Sqlserver2019Web,
34933            "SQLSERVER_2022_STANDARD" => Self::Sqlserver2022Standard,
34934            "SQLSERVER_2022_ENTERPRISE" => Self::Sqlserver2022Enterprise,
34935            "SQLSERVER_2022_EXPRESS" => Self::Sqlserver2022Express,
34936            "SQLSERVER_2022_WEB" => Self::Sqlserver2022Web,
34937            _ => Self::UnknownValue(sql_database_version::UnknownValue(
34938                wkt::internal::UnknownEnumValue::String(value.to_string()),
34939            )),
34940        }
34941    }
34942}
34943
34944impl serde::ser::Serialize for SqlDatabaseVersion {
34945    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34946    where
34947        S: serde::Serializer,
34948    {
34949        match self {
34950            Self::Unspecified => serializer.serialize_i32(0),
34951            Self::Mysql51 => serializer.serialize_i32(2),
34952            Self::Mysql55 => serializer.serialize_i32(3),
34953            Self::Mysql56 => serializer.serialize_i32(5),
34954            Self::Mysql57 => serializer.serialize_i32(6),
34955            Self::Mysql80 => serializer.serialize_i32(20),
34956            Self::Mysql8018 => serializer.serialize_i32(41),
34957            Self::Mysql8026 => serializer.serialize_i32(85),
34958            Self::Mysql8027 => serializer.serialize_i32(111),
34959            Self::Mysql8028 => serializer.serialize_i32(132),
34960            Self::Mysql8029 => serializer.serialize_i32(148),
34961            Self::Mysql8030 => serializer.serialize_i32(174),
34962            Self::Mysql8031 => serializer.serialize_i32(197),
34963            Self::Mysql8032 => serializer.serialize_i32(213),
34964            Self::Mysql8033 => serializer.serialize_i32(238),
34965            Self::Mysql8034 => serializer.serialize_i32(239),
34966            Self::Mysql8035 => serializer.serialize_i32(240),
34967            Self::Mysql8036 => serializer.serialize_i32(241),
34968            Self::Mysql8037 => serializer.serialize_i32(355),
34969            Self::Mysql8039 => serializer.serialize_i32(357),
34970            Self::Mysql8040 => serializer.serialize_i32(358),
34971            Self::Mysql8041 => serializer.serialize_i32(488),
34972            Self::Mysql8042 => serializer.serialize_i32(489),
34973            Self::Mysql8043 => serializer.serialize_i32(553),
34974            Self::Mysql8044 => serializer.serialize_i32(554),
34975            Self::Mysql8045 => serializer.serialize_i32(555),
34976            Self::Mysql8046 => serializer.serialize_i32(556),
34977            Self::Mysql84 => serializer.serialize_i32(398),
34978            Self::Mysql97 => serializer.serialize_i32(654),
34979            Self::Sqlserver2017Standard => serializer.serialize_i32(11),
34980            Self::Sqlserver2017Enterprise => serializer.serialize_i32(14),
34981            Self::Sqlserver2017Express => serializer.serialize_i32(15),
34982            Self::Sqlserver2017Web => serializer.serialize_i32(16),
34983            Self::Postgres96 => serializer.serialize_i32(9),
34984            Self::Postgres10 => serializer.serialize_i32(18),
34985            Self::Postgres11 => serializer.serialize_i32(10),
34986            Self::Postgres12 => serializer.serialize_i32(19),
34987            Self::Postgres13 => serializer.serialize_i32(23),
34988            Self::Postgres14 => serializer.serialize_i32(110),
34989            Self::Postgres15 => serializer.serialize_i32(172),
34990            Self::Postgres16 => serializer.serialize_i32(272),
34991            Self::Postgres17 => serializer.serialize_i32(408),
34992            Self::Postgres18 => serializer.serialize_i32(557),
34993            Self::Sqlserver2019Standard => serializer.serialize_i32(26),
34994            Self::Sqlserver2019Enterprise => serializer.serialize_i32(27),
34995            Self::Sqlserver2019Express => serializer.serialize_i32(28),
34996            Self::Sqlserver2019Web => serializer.serialize_i32(29),
34997            Self::Sqlserver2022Standard => serializer.serialize_i32(199),
34998            Self::Sqlserver2022Enterprise => serializer.serialize_i32(200),
34999            Self::Sqlserver2022Express => serializer.serialize_i32(201),
35000            Self::Sqlserver2022Web => serializer.serialize_i32(202),
35001            Self::UnknownValue(u) => u.0.serialize(serializer),
35002        }
35003    }
35004}
35005
35006impl<'de> serde::de::Deserialize<'de> for SqlDatabaseVersion {
35007    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35008    where
35009        D: serde::Deserializer<'de>,
35010    {
35011        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDatabaseVersion>::new(
35012            ".google.cloud.sql.v1.SqlDatabaseVersion",
35013        ))
35014    }
35015}
35016
35017/// The pricing plan for this instance.
35018///
35019/// # Working with unknown values
35020///
35021/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35022/// additional enum variants at any time. Adding new variants is not considered
35023/// a breaking change. Applications should write their code in anticipation of:
35024///
35025/// - New values appearing in future releases of the client library, **and**
35026/// - New values received dynamically, without application changes.
35027///
35028/// Please consult the [Working with enums] section in the user guide for some
35029/// guidelines.
35030///
35031/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35032#[derive(Clone, Debug, PartialEq)]
35033#[non_exhaustive]
35034pub enum SqlPricingPlan {
35035    /// This is an unknown pricing plan for this instance.
35036    Unspecified,
35037    /// The instance is billed at a monthly flat rate.
35038    Package,
35039    /// The instance is billed per usage.
35040    PerUse,
35041    /// If set, the enum was initialized with an unknown value.
35042    ///
35043    /// Applications can examine the value using [SqlPricingPlan::value] or
35044    /// [SqlPricingPlan::name].
35045    UnknownValue(sql_pricing_plan::UnknownValue),
35046}
35047
35048#[doc(hidden)]
35049pub mod sql_pricing_plan {
35050    #[allow(unused_imports)]
35051    use super::*;
35052    #[derive(Clone, Debug, PartialEq)]
35053    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35054}
35055
35056impl SqlPricingPlan {
35057    /// Gets the enum value.
35058    ///
35059    /// Returns `None` if the enum contains an unknown value deserialized from
35060    /// the string representation of enums.
35061    pub fn value(&self) -> std::option::Option<i32> {
35062        match self {
35063            Self::Unspecified => std::option::Option::Some(0),
35064            Self::Package => std::option::Option::Some(1),
35065            Self::PerUse => std::option::Option::Some(2),
35066            Self::UnknownValue(u) => u.0.value(),
35067        }
35068    }
35069
35070    /// Gets the enum value as a string.
35071    ///
35072    /// Returns `None` if the enum contains an unknown value deserialized from
35073    /// the integer representation of enums.
35074    pub fn name(&self) -> std::option::Option<&str> {
35075        match self {
35076            Self::Unspecified => std::option::Option::Some("SQL_PRICING_PLAN_UNSPECIFIED"),
35077            Self::Package => std::option::Option::Some("PACKAGE"),
35078            Self::PerUse => std::option::Option::Some("PER_USE"),
35079            Self::UnknownValue(u) => u.0.name(),
35080        }
35081    }
35082}
35083
35084impl std::default::Default for SqlPricingPlan {
35085    fn default() -> Self {
35086        use std::convert::From;
35087        Self::from(0)
35088    }
35089}
35090
35091impl std::fmt::Display for SqlPricingPlan {
35092    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35093        wkt::internal::display_enum(f, self.name(), self.value())
35094    }
35095}
35096
35097impl std::convert::From<i32> for SqlPricingPlan {
35098    fn from(value: i32) -> Self {
35099        match value {
35100            0 => Self::Unspecified,
35101            1 => Self::Package,
35102            2 => Self::PerUse,
35103            _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
35104                wkt::internal::UnknownEnumValue::Integer(value),
35105            )),
35106        }
35107    }
35108}
35109
35110impl std::convert::From<&str> for SqlPricingPlan {
35111    fn from(value: &str) -> Self {
35112        use std::string::ToString;
35113        match value {
35114            "SQL_PRICING_PLAN_UNSPECIFIED" => Self::Unspecified,
35115            "PACKAGE" => Self::Package,
35116            "PER_USE" => Self::PerUse,
35117            _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
35118                wkt::internal::UnknownEnumValue::String(value.to_string()),
35119            )),
35120        }
35121    }
35122}
35123
35124impl serde::ser::Serialize for SqlPricingPlan {
35125    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35126    where
35127        S: serde::Serializer,
35128    {
35129        match self {
35130            Self::Unspecified => serializer.serialize_i32(0),
35131            Self::Package => serializer.serialize_i32(1),
35132            Self::PerUse => serializer.serialize_i32(2),
35133            Self::UnknownValue(u) => u.0.serialize(serializer),
35134        }
35135    }
35136}
35137
35138impl<'de> serde::de::Deserialize<'de> for SqlPricingPlan {
35139    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35140    where
35141        D: serde::Deserializer<'de>,
35142    {
35143        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlPricingPlan>::new(
35144            ".google.cloud.sql.v1.SqlPricingPlan",
35145        ))
35146    }
35147}
35148
35149/// Enum for [SqlReplicationType].
35150///
35151/// # Working with unknown values
35152///
35153/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35154/// additional enum variants at any time. Adding new variants is not considered
35155/// a breaking change. Applications should write their code in anticipation of:
35156///
35157/// - New values appearing in future releases of the client library, **and**
35158/// - New values received dynamically, without application changes.
35159///
35160/// Please consult the [Working with enums] section in the user guide for some
35161/// guidelines.
35162///
35163/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35164#[derive(Clone, Debug, PartialEq)]
35165#[non_exhaustive]
35166pub enum SqlReplicationType {
35167    /// This is an unknown replication type for a Cloud SQL instance.
35168    Unspecified,
35169    /// The synchronous replication mode for First Generation instances. It is the
35170    /// default value.
35171    Synchronous,
35172    /// The asynchronous replication mode for First Generation instances. It
35173    /// provides a slight performance gain, but if an outage occurs while this
35174    /// option is set to asynchronous, you can lose up to a few seconds of updates
35175    /// to your data.
35176    Asynchronous,
35177    /// If set, the enum was initialized with an unknown value.
35178    ///
35179    /// Applications can examine the value using [SqlReplicationType::value] or
35180    /// [SqlReplicationType::name].
35181    UnknownValue(sql_replication_type::UnknownValue),
35182}
35183
35184#[doc(hidden)]
35185pub mod sql_replication_type {
35186    #[allow(unused_imports)]
35187    use super::*;
35188    #[derive(Clone, Debug, PartialEq)]
35189    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35190}
35191
35192impl SqlReplicationType {
35193    /// Gets the enum value.
35194    ///
35195    /// Returns `None` if the enum contains an unknown value deserialized from
35196    /// the string representation of enums.
35197    pub fn value(&self) -> std::option::Option<i32> {
35198        match self {
35199            Self::Unspecified => std::option::Option::Some(0),
35200            Self::Synchronous => std::option::Option::Some(1),
35201            Self::Asynchronous => std::option::Option::Some(2),
35202            Self::UnknownValue(u) => u.0.value(),
35203        }
35204    }
35205
35206    /// Gets the enum value as a string.
35207    ///
35208    /// Returns `None` if the enum contains an unknown value deserialized from
35209    /// the integer representation of enums.
35210    pub fn name(&self) -> std::option::Option<&str> {
35211        match self {
35212            Self::Unspecified => std::option::Option::Some("SQL_REPLICATION_TYPE_UNSPECIFIED"),
35213            Self::Synchronous => std::option::Option::Some("SYNCHRONOUS"),
35214            Self::Asynchronous => std::option::Option::Some("ASYNCHRONOUS"),
35215            Self::UnknownValue(u) => u.0.name(),
35216        }
35217    }
35218}
35219
35220impl std::default::Default for SqlReplicationType {
35221    fn default() -> Self {
35222        use std::convert::From;
35223        Self::from(0)
35224    }
35225}
35226
35227impl std::fmt::Display for SqlReplicationType {
35228    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35229        wkt::internal::display_enum(f, self.name(), self.value())
35230    }
35231}
35232
35233impl std::convert::From<i32> for SqlReplicationType {
35234    fn from(value: i32) -> Self {
35235        match value {
35236            0 => Self::Unspecified,
35237            1 => Self::Synchronous,
35238            2 => Self::Asynchronous,
35239            _ => Self::UnknownValue(sql_replication_type::UnknownValue(
35240                wkt::internal::UnknownEnumValue::Integer(value),
35241            )),
35242        }
35243    }
35244}
35245
35246impl std::convert::From<&str> for SqlReplicationType {
35247    fn from(value: &str) -> Self {
35248        use std::string::ToString;
35249        match value {
35250            "SQL_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
35251            "SYNCHRONOUS" => Self::Synchronous,
35252            "ASYNCHRONOUS" => Self::Asynchronous,
35253            _ => Self::UnknownValue(sql_replication_type::UnknownValue(
35254                wkt::internal::UnknownEnumValue::String(value.to_string()),
35255            )),
35256        }
35257    }
35258}
35259
35260impl serde::ser::Serialize for SqlReplicationType {
35261    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35262    where
35263        S: serde::Serializer,
35264    {
35265        match self {
35266            Self::Unspecified => serializer.serialize_i32(0),
35267            Self::Synchronous => serializer.serialize_i32(1),
35268            Self::Asynchronous => serializer.serialize_i32(2),
35269            Self::UnknownValue(u) => u.0.serialize(serializer),
35270        }
35271    }
35272}
35273
35274impl<'de> serde::de::Deserialize<'de> for SqlReplicationType {
35275    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35276    where
35277        D: serde::Deserializer<'de>,
35278    {
35279        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlReplicationType>::new(
35280            ".google.cloud.sql.v1.SqlReplicationType",
35281        ))
35282    }
35283}
35284
35285/// The type of disk that is used for a v2 instance to use.
35286///
35287/// # Working with unknown values
35288///
35289/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35290/// additional enum variants at any time. Adding new variants is not considered
35291/// a breaking change. Applications should write their code in anticipation of:
35292///
35293/// - New values appearing in future releases of the client library, **and**
35294/// - New values received dynamically, without application changes.
35295///
35296/// Please consult the [Working with enums] section in the user guide for some
35297/// guidelines.
35298///
35299/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35300#[derive(Clone, Debug, PartialEq)]
35301#[non_exhaustive]
35302pub enum SqlDataDiskType {
35303    /// This is an unknown data disk type.
35304    Unspecified,
35305    /// An SSD data disk.
35306    PdSsd,
35307    /// An HDD data disk.
35308    PdHdd,
35309    /// This field is deprecated and will be removed from a future version of the
35310    /// API.
35311    #[deprecated]
35312    ObsoleteLocalSsd,
35313    /// A Hyperdisk Balanced data disk.
35314    HyperdiskBalanced,
35315    /// If set, the enum was initialized with an unknown value.
35316    ///
35317    /// Applications can examine the value using [SqlDataDiskType::value] or
35318    /// [SqlDataDiskType::name].
35319    UnknownValue(sql_data_disk_type::UnknownValue),
35320}
35321
35322#[doc(hidden)]
35323pub mod sql_data_disk_type {
35324    #[allow(unused_imports)]
35325    use super::*;
35326    #[derive(Clone, Debug, PartialEq)]
35327    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35328}
35329
35330impl SqlDataDiskType {
35331    /// Gets the enum value.
35332    ///
35333    /// Returns `None` if the enum contains an unknown value deserialized from
35334    /// the string representation of enums.
35335    pub fn value(&self) -> std::option::Option<i32> {
35336        match self {
35337            Self::Unspecified => std::option::Option::Some(0),
35338            Self::PdSsd => std::option::Option::Some(1),
35339            Self::PdHdd => std::option::Option::Some(2),
35340            Self::ObsoleteLocalSsd => std::option::Option::Some(3),
35341            Self::HyperdiskBalanced => std::option::Option::Some(4),
35342            Self::UnknownValue(u) => u.0.value(),
35343        }
35344    }
35345
35346    /// Gets the enum value as a string.
35347    ///
35348    /// Returns `None` if the enum contains an unknown value deserialized from
35349    /// the integer representation of enums.
35350    pub fn name(&self) -> std::option::Option<&str> {
35351        match self {
35352            Self::Unspecified => std::option::Option::Some("SQL_DATA_DISK_TYPE_UNSPECIFIED"),
35353            Self::PdSsd => std::option::Option::Some("PD_SSD"),
35354            Self::PdHdd => std::option::Option::Some("PD_HDD"),
35355            Self::ObsoleteLocalSsd => std::option::Option::Some("OBSOLETE_LOCAL_SSD"),
35356            Self::HyperdiskBalanced => std::option::Option::Some("HYPERDISK_BALANCED"),
35357            Self::UnknownValue(u) => u.0.name(),
35358        }
35359    }
35360}
35361
35362impl std::default::Default for SqlDataDiskType {
35363    fn default() -> Self {
35364        use std::convert::From;
35365        Self::from(0)
35366    }
35367}
35368
35369impl std::fmt::Display for SqlDataDiskType {
35370    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35371        wkt::internal::display_enum(f, self.name(), self.value())
35372    }
35373}
35374
35375impl std::convert::From<i32> for SqlDataDiskType {
35376    fn from(value: i32) -> Self {
35377        match value {
35378            0 => Self::Unspecified,
35379            1 => Self::PdSsd,
35380            2 => Self::PdHdd,
35381            3 => Self::ObsoleteLocalSsd,
35382            4 => Self::HyperdiskBalanced,
35383            _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
35384                wkt::internal::UnknownEnumValue::Integer(value),
35385            )),
35386        }
35387    }
35388}
35389
35390impl std::convert::From<&str> for SqlDataDiskType {
35391    fn from(value: &str) -> Self {
35392        use std::string::ToString;
35393        match value {
35394            "SQL_DATA_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
35395            "PD_SSD" => Self::PdSsd,
35396            "PD_HDD" => Self::PdHdd,
35397            "OBSOLETE_LOCAL_SSD" => Self::ObsoleteLocalSsd,
35398            "HYPERDISK_BALANCED" => Self::HyperdiskBalanced,
35399            _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
35400                wkt::internal::UnknownEnumValue::String(value.to_string()),
35401            )),
35402        }
35403    }
35404}
35405
35406impl serde::ser::Serialize for SqlDataDiskType {
35407    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35408    where
35409        S: serde::Serializer,
35410    {
35411        match self {
35412            Self::Unspecified => serializer.serialize_i32(0),
35413            Self::PdSsd => serializer.serialize_i32(1),
35414            Self::PdHdd => serializer.serialize_i32(2),
35415            Self::ObsoleteLocalSsd => serializer.serialize_i32(3),
35416            Self::HyperdiskBalanced => serializer.serialize_i32(4),
35417            Self::UnknownValue(u) => u.0.serialize(serializer),
35418        }
35419    }
35420}
35421
35422impl<'de> serde::de::Deserialize<'de> for SqlDataDiskType {
35423    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35424    where
35425        D: serde::Deserializer<'de>,
35426    {
35427        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDataDiskType>::new(
35428            ".google.cloud.sql.v1.SqlDataDiskType",
35429        ))
35430    }
35431}
35432
35433/// The availability type of the given Cloud SQL instance.
35434///
35435/// # Working with unknown values
35436///
35437/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35438/// additional enum variants at any time. Adding new variants is not considered
35439/// a breaking change. Applications should write their code in anticipation of:
35440///
35441/// - New values appearing in future releases of the client library, **and**
35442/// - New values received dynamically, without application changes.
35443///
35444/// Please consult the [Working with enums] section in the user guide for some
35445/// guidelines.
35446///
35447/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35448#[derive(Clone, Debug, PartialEq)]
35449#[non_exhaustive]
35450pub enum SqlAvailabilityType {
35451    /// This is an unknown Availability type.
35452    Unspecified,
35453    /// Zonal available instance.
35454    Zonal,
35455    /// Regional available instance.
35456    Regional,
35457    /// If set, the enum was initialized with an unknown value.
35458    ///
35459    /// Applications can examine the value using [SqlAvailabilityType::value] or
35460    /// [SqlAvailabilityType::name].
35461    UnknownValue(sql_availability_type::UnknownValue),
35462}
35463
35464#[doc(hidden)]
35465pub mod sql_availability_type {
35466    #[allow(unused_imports)]
35467    use super::*;
35468    #[derive(Clone, Debug, PartialEq)]
35469    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35470}
35471
35472impl SqlAvailabilityType {
35473    /// Gets the enum value.
35474    ///
35475    /// Returns `None` if the enum contains an unknown value deserialized from
35476    /// the string representation of enums.
35477    pub fn value(&self) -> std::option::Option<i32> {
35478        match self {
35479            Self::Unspecified => std::option::Option::Some(0),
35480            Self::Zonal => std::option::Option::Some(1),
35481            Self::Regional => std::option::Option::Some(2),
35482            Self::UnknownValue(u) => u.0.value(),
35483        }
35484    }
35485
35486    /// Gets the enum value as a string.
35487    ///
35488    /// Returns `None` if the enum contains an unknown value deserialized from
35489    /// the integer representation of enums.
35490    pub fn name(&self) -> std::option::Option<&str> {
35491        match self {
35492            Self::Unspecified => std::option::Option::Some("SQL_AVAILABILITY_TYPE_UNSPECIFIED"),
35493            Self::Zonal => std::option::Option::Some("ZONAL"),
35494            Self::Regional => std::option::Option::Some("REGIONAL"),
35495            Self::UnknownValue(u) => u.0.name(),
35496        }
35497    }
35498}
35499
35500impl std::default::Default for SqlAvailabilityType {
35501    fn default() -> Self {
35502        use std::convert::From;
35503        Self::from(0)
35504    }
35505}
35506
35507impl std::fmt::Display for SqlAvailabilityType {
35508    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35509        wkt::internal::display_enum(f, self.name(), self.value())
35510    }
35511}
35512
35513impl std::convert::From<i32> for SqlAvailabilityType {
35514    fn from(value: i32) -> Self {
35515        match value {
35516            0 => Self::Unspecified,
35517            1 => Self::Zonal,
35518            2 => Self::Regional,
35519            _ => Self::UnknownValue(sql_availability_type::UnknownValue(
35520                wkt::internal::UnknownEnumValue::Integer(value),
35521            )),
35522        }
35523    }
35524}
35525
35526impl std::convert::From<&str> for SqlAvailabilityType {
35527    fn from(value: &str) -> Self {
35528        use std::string::ToString;
35529        match value {
35530            "SQL_AVAILABILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
35531            "ZONAL" => Self::Zonal,
35532            "REGIONAL" => Self::Regional,
35533            _ => Self::UnknownValue(sql_availability_type::UnknownValue(
35534                wkt::internal::UnknownEnumValue::String(value.to_string()),
35535            )),
35536        }
35537    }
35538}
35539
35540impl serde::ser::Serialize for SqlAvailabilityType {
35541    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35542    where
35543        S: serde::Serializer,
35544    {
35545        match self {
35546            Self::Unspecified => serializer.serialize_i32(0),
35547            Self::Zonal => serializer.serialize_i32(1),
35548            Self::Regional => serializer.serialize_i32(2),
35549            Self::UnknownValue(u) => u.0.serialize(serializer),
35550        }
35551    }
35552}
35553
35554impl<'de> serde::de::Deserialize<'de> for SqlAvailabilityType {
35555    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35556    where
35557        D: serde::Deserializer<'de>,
35558    {
35559        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlAvailabilityType>::new(
35560            ".google.cloud.sql.v1.SqlAvailabilityType",
35561        ))
35562    }
35563}
35564
35565/// Enum for [SqlUpdateTrack].
35566///
35567/// # Working with unknown values
35568///
35569/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35570/// additional enum variants at any time. Adding new variants is not considered
35571/// a breaking change. Applications should write their code in anticipation of:
35572///
35573/// - New values appearing in future releases of the client library, **and**
35574/// - New values received dynamically, without application changes.
35575///
35576/// Please consult the [Working with enums] section in the user guide for some
35577/// guidelines.
35578///
35579/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35580#[derive(Clone, Debug, PartialEq)]
35581#[non_exhaustive]
35582pub enum SqlUpdateTrack {
35583    /// This is an unknown maintenance timing preference.
35584    Unspecified,
35585    /// For an instance with a scheduled maintenance window, this maintenance
35586    /// timing indicates that the maintenance update is scheduled 7 to 14 days
35587    /// after the notification is sent out. Also referred to as `Week 1` (Console)
35588    /// and `preview` (gcloud CLI).
35589    Canary,
35590    /// For an instance with a scheduled maintenance window, this maintenance
35591    /// timing indicates that the maintenance update is scheduled 15 to 21 days
35592    /// after the notification is sent out. Also referred to as `Week 2` (Console)
35593    /// and `production` (gcloud CLI).
35594    Stable,
35595    /// For instance with a scheduled maintenance window, this maintenance
35596    /// timing indicates that the maintenance update is scheduled 35 to 42 days
35597    /// after the notification is sent out.
35598    Week5,
35599    /// If set, the enum was initialized with an unknown value.
35600    ///
35601    /// Applications can examine the value using [SqlUpdateTrack::value] or
35602    /// [SqlUpdateTrack::name].
35603    UnknownValue(sql_update_track::UnknownValue),
35604}
35605
35606#[doc(hidden)]
35607pub mod sql_update_track {
35608    #[allow(unused_imports)]
35609    use super::*;
35610    #[derive(Clone, Debug, PartialEq)]
35611    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35612}
35613
35614impl SqlUpdateTrack {
35615    /// Gets the enum value.
35616    ///
35617    /// Returns `None` if the enum contains an unknown value deserialized from
35618    /// the string representation of enums.
35619    pub fn value(&self) -> std::option::Option<i32> {
35620        match self {
35621            Self::Unspecified => std::option::Option::Some(0),
35622            Self::Canary => std::option::Option::Some(1),
35623            Self::Stable => std::option::Option::Some(2),
35624            Self::Week5 => std::option::Option::Some(3),
35625            Self::UnknownValue(u) => u.0.value(),
35626        }
35627    }
35628
35629    /// Gets the enum value as a string.
35630    ///
35631    /// Returns `None` if the enum contains an unknown value deserialized from
35632    /// the integer representation of enums.
35633    pub fn name(&self) -> std::option::Option<&str> {
35634        match self {
35635            Self::Unspecified => std::option::Option::Some("SQL_UPDATE_TRACK_UNSPECIFIED"),
35636            Self::Canary => std::option::Option::Some("canary"),
35637            Self::Stable => std::option::Option::Some("stable"),
35638            Self::Week5 => std::option::Option::Some("week5"),
35639            Self::UnknownValue(u) => u.0.name(),
35640        }
35641    }
35642}
35643
35644impl std::default::Default for SqlUpdateTrack {
35645    fn default() -> Self {
35646        use std::convert::From;
35647        Self::from(0)
35648    }
35649}
35650
35651impl std::fmt::Display for SqlUpdateTrack {
35652    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35653        wkt::internal::display_enum(f, self.name(), self.value())
35654    }
35655}
35656
35657impl std::convert::From<i32> for SqlUpdateTrack {
35658    fn from(value: i32) -> Self {
35659        match value {
35660            0 => Self::Unspecified,
35661            1 => Self::Canary,
35662            2 => Self::Stable,
35663            3 => Self::Week5,
35664            _ => Self::UnknownValue(sql_update_track::UnknownValue(
35665                wkt::internal::UnknownEnumValue::Integer(value),
35666            )),
35667        }
35668    }
35669}
35670
35671impl std::convert::From<&str> for SqlUpdateTrack {
35672    fn from(value: &str) -> Self {
35673        use std::string::ToString;
35674        match value {
35675            "SQL_UPDATE_TRACK_UNSPECIFIED" => Self::Unspecified,
35676            "canary" => Self::Canary,
35677            "stable" => Self::Stable,
35678            "week5" => Self::Week5,
35679            _ => Self::UnknownValue(sql_update_track::UnknownValue(
35680                wkt::internal::UnknownEnumValue::String(value.to_string()),
35681            )),
35682        }
35683    }
35684}
35685
35686impl serde::ser::Serialize for SqlUpdateTrack {
35687    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35688    where
35689        S: serde::Serializer,
35690    {
35691        match self {
35692            Self::Unspecified => serializer.serialize_i32(0),
35693            Self::Canary => serializer.serialize_i32(1),
35694            Self::Stable => serializer.serialize_i32(2),
35695            Self::Week5 => serializer.serialize_i32(3),
35696            Self::UnknownValue(u) => u.0.serialize(serializer),
35697        }
35698    }
35699}
35700
35701impl<'de> serde::de::Deserialize<'de> for SqlUpdateTrack {
35702    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35703    where
35704        D: serde::Deserializer<'de>,
35705    {
35706        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUpdateTrack>::new(
35707            ".google.cloud.sql.v1.SqlUpdateTrack",
35708        ))
35709    }
35710}