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 project_id = "project_id";
961    /// let x = CreateBackupRequest::new().set_parent(format!("projects/{project_id}"));
962    /// ```
963    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
964        self.parent = v.into();
965        self
966    }
967
968    /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
969    ///
970    /// # Example
971    /// ```ignore,no_run
972    /// # use google_cloud_sql_v1::model::CreateBackupRequest;
973    /// use google_cloud_sql_v1::model::Backup;
974    /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
975    /// ```
976    pub fn set_backup<T>(mut self, v: T) -> Self
977    where
978        T: std::convert::Into<crate::model::Backup>,
979    {
980        self.backup = std::option::Option::Some(v.into());
981        self
982    }
983
984    /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
985    ///
986    /// # Example
987    /// ```ignore,no_run
988    /// # use google_cloud_sql_v1::model::CreateBackupRequest;
989    /// use google_cloud_sql_v1::model::Backup;
990    /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
991    /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
992    /// ```
993    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
994    where
995        T: std::convert::Into<crate::model::Backup>,
996    {
997        self.backup = v.map(|x| x.into());
998        self
999    }
1000}
1001
1002impl wkt::message::Message for CreateBackupRequest {
1003    fn typename() -> &'static str {
1004        "type.googleapis.com/google.cloud.sql.v1.CreateBackupRequest"
1005    }
1006}
1007
1008/// The request payload to get the backup.
1009#[derive(Clone, Default, PartialEq)]
1010#[non_exhaustive]
1011pub struct GetBackupRequest {
1012    /// Required. The name of the backup to retrieve.
1013    /// Format: projects/{project}/backups/{backup}
1014    pub name: std::string::String,
1015
1016    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1017}
1018
1019impl GetBackupRequest {
1020    /// Creates a new default instance.
1021    pub fn new() -> Self {
1022        std::default::Default::default()
1023    }
1024
1025    /// Sets the value of [name][crate::model::GetBackupRequest::name].
1026    ///
1027    /// # Example
1028    /// ```ignore,no_run
1029    /// # use google_cloud_sql_v1::model::GetBackupRequest;
1030    /// # let project_id = "project_id";
1031    /// # let backup_id = "backup_id";
1032    /// let x = GetBackupRequest::new().set_name(format!("projects/{project_id}/backups/{backup_id}"));
1033    /// ```
1034    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1035        self.name = v.into();
1036        self
1037    }
1038}
1039
1040impl wkt::message::Message for GetBackupRequest {
1041    fn typename() -> &'static str {
1042        "type.googleapis.com/google.cloud.sql.v1.GetBackupRequest"
1043    }
1044}
1045
1046/// The request payload to list the backups.
1047#[derive(Clone, Default, PartialEq)]
1048#[non_exhaustive]
1049pub struct ListBackupsRequest {
1050    /// Required. The parent that owns this collection of backups.
1051    /// Format: projects/{project}
1052    pub parent: std::string::String,
1053
1054    /// The maximum number of backups to return per response. The service might
1055    /// return fewer backups than this value. If a value for this parameter isn't
1056    /// specified, then, at most, 500 backups are returned. The maximum value is
1057    /// 2,000. Any values that you set, which are greater than 2,000, are changed
1058    /// to 2,000.
1059    pub page_size: i32,
1060
1061    /// A page token, received from a previous `ListBackups` call.
1062    /// Provide this to retrieve the subsequent page.
1063    ///
1064    /// When paginating, all other parameters provided to `ListBackups` must match
1065    /// the call that provided the page token.
1066    pub page_token: std::string::String,
1067
1068    /// Multiple filter queries are separated by spaces. For example,
1069    /// 'instance:abc AND type:FINAL, 'location:us',
1070    /// 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
1071    /// type, instance, backupInterval.startTime (creation time), or location.
1072    pub filter: std::string::String,
1073
1074    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1075}
1076
1077impl ListBackupsRequest {
1078    /// Creates a new default instance.
1079    pub fn new() -> Self {
1080        std::default::Default::default()
1081    }
1082
1083    /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1084    ///
1085    /// # Example
1086    /// ```ignore,no_run
1087    /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1088    /// # let project_id = "project_id";
1089    /// let x = ListBackupsRequest::new().set_parent(format!("projects/{project_id}"));
1090    /// ```
1091    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1092        self.parent = v.into();
1093        self
1094    }
1095
1096    /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1097    ///
1098    /// # Example
1099    /// ```ignore,no_run
1100    /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1101    /// let x = ListBackupsRequest::new().set_page_size(42);
1102    /// ```
1103    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1104        self.page_size = v.into();
1105        self
1106    }
1107
1108    /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1109    ///
1110    /// # Example
1111    /// ```ignore,no_run
1112    /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1113    /// let x = ListBackupsRequest::new().set_page_token("example");
1114    /// ```
1115    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1116        self.page_token = v.into();
1117        self
1118    }
1119
1120    /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1121    ///
1122    /// # Example
1123    /// ```ignore,no_run
1124    /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1125    /// let x = ListBackupsRequest::new().set_filter("example");
1126    /// ```
1127    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1128        self.filter = v.into();
1129        self
1130    }
1131}
1132
1133impl wkt::message::Message for ListBackupsRequest {
1134    fn typename() -> &'static str {
1135        "type.googleapis.com/google.cloud.sql.v1.ListBackupsRequest"
1136    }
1137}
1138
1139/// The response payload containing a list of the backups.
1140#[derive(Clone, Default, PartialEq)]
1141#[non_exhaustive]
1142pub struct ListBackupsResponse {
1143    /// A list of backups.
1144    pub backups: std::vec::Vec<crate::model::Backup>,
1145
1146    /// A token, which can be sent as `page_token` to retrieve the next page.
1147    /// If this field is omitted, then there aren't subsequent pages.
1148    pub next_page_token: std::string::String,
1149
1150    /// If a region isn't unavailable or if an unknown error occurs, then a warning
1151    /// message is returned.
1152    pub warnings: std::vec::Vec<crate::model::ApiWarning>,
1153
1154    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1155}
1156
1157impl ListBackupsResponse {
1158    /// Creates a new default instance.
1159    pub fn new() -> Self {
1160        std::default::Default::default()
1161    }
1162
1163    /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
1164    ///
1165    /// # Example
1166    /// ```ignore,no_run
1167    /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1168    /// use google_cloud_sql_v1::model::Backup;
1169    /// let x = ListBackupsResponse::new()
1170    ///     .set_backups([
1171    ///         Backup::default()/* use setters */,
1172    ///         Backup::default()/* use (different) setters */,
1173    ///     ]);
1174    /// ```
1175    pub fn set_backups<T, V>(mut self, v: T) -> Self
1176    where
1177        T: std::iter::IntoIterator<Item = V>,
1178        V: std::convert::Into<crate::model::Backup>,
1179    {
1180        use std::iter::Iterator;
1181        self.backups = v.into_iter().map(|i| i.into()).collect();
1182        self
1183    }
1184
1185    /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
1186    ///
1187    /// # Example
1188    /// ```ignore,no_run
1189    /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1190    /// let x = ListBackupsResponse::new().set_next_page_token("example");
1191    /// ```
1192    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1193        self.next_page_token = v.into();
1194        self
1195    }
1196
1197    /// Sets the value of [warnings][crate::model::ListBackupsResponse::warnings].
1198    ///
1199    /// # Example
1200    /// ```ignore,no_run
1201    /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1202    /// use google_cloud_sql_v1::model::ApiWarning;
1203    /// let x = ListBackupsResponse::new()
1204    ///     .set_warnings([
1205    ///         ApiWarning::default()/* use setters */,
1206    ///         ApiWarning::default()/* use (different) setters */,
1207    ///     ]);
1208    /// ```
1209    pub fn set_warnings<T, V>(mut self, v: T) -> Self
1210    where
1211        T: std::iter::IntoIterator<Item = V>,
1212        V: std::convert::Into<crate::model::ApiWarning>,
1213    {
1214        use std::iter::Iterator;
1215        self.warnings = v.into_iter().map(|i| i.into()).collect();
1216        self
1217    }
1218}
1219
1220impl wkt::message::Message for ListBackupsResponse {
1221    fn typename() -> &'static str {
1222        "type.googleapis.com/google.cloud.sql.v1.ListBackupsResponse"
1223    }
1224}
1225
1226#[doc(hidden)]
1227impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
1228    type PageItem = crate::model::Backup;
1229
1230    fn items(self) -> std::vec::Vec<Self::PageItem> {
1231        self.backups
1232    }
1233
1234    fn next_page_token(&self) -> std::string::String {
1235        use std::clone::Clone;
1236        self.next_page_token.clone()
1237    }
1238}
1239
1240/// The request payload to update the backup.
1241#[derive(Clone, Default, PartialEq)]
1242#[non_exhaustive]
1243pub struct UpdateBackupRequest {
1244    /// Required. The backup to update.
1245    /// The backup’s `name` field is used to identify the backup to update.
1246    /// Format: projects/{project}/backups/{backup}
1247    pub backup: std::option::Option<crate::model::Backup>,
1248
1249    /// The list of fields that you can update. You can update only the description
1250    /// and retention period of the final backup.
1251    pub update_mask: std::option::Option<wkt::FieldMask>,
1252
1253    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1254}
1255
1256impl UpdateBackupRequest {
1257    /// Creates a new default instance.
1258    pub fn new() -> Self {
1259        std::default::Default::default()
1260    }
1261
1262    /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
1263    ///
1264    /// # Example
1265    /// ```ignore,no_run
1266    /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1267    /// use google_cloud_sql_v1::model::Backup;
1268    /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
1269    /// ```
1270    pub fn set_backup<T>(mut self, v: T) -> Self
1271    where
1272        T: std::convert::Into<crate::model::Backup>,
1273    {
1274        self.backup = std::option::Option::Some(v.into());
1275        self
1276    }
1277
1278    /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
1279    ///
1280    /// # Example
1281    /// ```ignore,no_run
1282    /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1283    /// use google_cloud_sql_v1::model::Backup;
1284    /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
1285    /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
1286    /// ```
1287    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
1288    where
1289        T: std::convert::Into<crate::model::Backup>,
1290    {
1291        self.backup = v.map(|x| x.into());
1292        self
1293    }
1294
1295    /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
1296    ///
1297    /// # Example
1298    /// ```ignore,no_run
1299    /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1300    /// use wkt::FieldMask;
1301    /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1302    /// ```
1303    pub fn set_update_mask<T>(mut self, v: T) -> Self
1304    where
1305        T: std::convert::Into<wkt::FieldMask>,
1306    {
1307        self.update_mask = std::option::Option::Some(v.into());
1308        self
1309    }
1310
1311    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
1312    ///
1313    /// # Example
1314    /// ```ignore,no_run
1315    /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1316    /// use wkt::FieldMask;
1317    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1318    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1319    /// ```
1320    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1321    where
1322        T: std::convert::Into<wkt::FieldMask>,
1323    {
1324        self.update_mask = v.map(|x| x.into());
1325        self
1326    }
1327}
1328
1329impl wkt::message::Message for UpdateBackupRequest {
1330    fn typename() -> &'static str {
1331        "type.googleapis.com/google.cloud.sql.v1.UpdateBackupRequest"
1332    }
1333}
1334
1335/// The request payload to delete the backup.
1336#[derive(Clone, Default, PartialEq)]
1337#[non_exhaustive]
1338pub struct DeleteBackupRequest {
1339    /// Required. The name of the backup to delete.
1340    /// Format: projects/{project}/backups/{backup}
1341    pub name: std::string::String,
1342
1343    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1344}
1345
1346impl DeleteBackupRequest {
1347    /// Creates a new default instance.
1348    pub fn new() -> Self {
1349        std::default::Default::default()
1350    }
1351
1352    /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
1353    ///
1354    /// # Example
1355    /// ```ignore,no_run
1356    /// # use google_cloud_sql_v1::model::DeleteBackupRequest;
1357    /// # let project_id = "project_id";
1358    /// # let backup_id = "backup_id";
1359    /// let x = DeleteBackupRequest::new().set_name(format!("projects/{project_id}/backups/{backup_id}"));
1360    /// ```
1361    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1362        self.name = v.into();
1363        self
1364    }
1365}
1366
1367impl wkt::message::Message for DeleteBackupRequest {
1368    fn typename() -> &'static str {
1369        "type.googleapis.com/google.cloud.sql.v1.DeleteBackupRequest"
1370    }
1371}
1372
1373/// A backup resource.
1374#[derive(Clone, Default, PartialEq)]
1375#[non_exhaustive]
1376pub struct Backup {
1377    /// Output only. The resource name of the backup.
1378    /// Format: projects/{project}/backups/{backup}.
1379    pub name: std::string::String,
1380
1381    /// Output only. This is always `sql#backup`.
1382    pub kind: std::string::String,
1383
1384    /// Output only. The URI of this resource.
1385    pub self_link: std::string::String,
1386
1387    /// Output only. The type of this backup. The type can be "AUTOMATED",
1388    /// "ON_DEMAND" or “FINAL”.
1389    pub r#type: crate::model::backup::SqlBackupType,
1390
1391    /// The description of this backup.
1392    pub description: std::string::String,
1393
1394    /// The name of the source database instance.
1395    pub instance: std::string::String,
1396
1397    /// The storage location of the backups. The location can be multi-regional.
1398    pub location: std::string::String,
1399
1400    /// Output only. This output contains the following values:
1401    /// start_time: All database writes up to this time are available.
1402    /// end_time: Any database writes after this time aren't available.
1403    pub backup_interval: std::option::Option<google_cloud_type::model::Interval>,
1404
1405    /// Output only. The status of this backup.
1406    pub state: crate::model::backup::SqlBackupState,
1407
1408    /// Output only. Information about why the backup operation fails (for example,
1409    /// when the backup state fails).
1410    pub error: std::option::Option<crate::model::OperationError>,
1411
1412    /// Output only. This output contains the encryption configuration for a backup
1413    /// and the resource name of the KMS key for disk encryption.
1414    pub kms_key: std::string::String,
1415
1416    /// Output only. This output contains the encryption status for a backup and
1417    /// the version of the KMS key that's used to encrypt the Cloud SQL instance.
1418    pub kms_key_version: std::string::String,
1419
1420    /// Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
1421    pub backup_kind: crate::model::SqlBackupKind,
1422
1423    /// Output only. This output contains a backup time zone. If a Cloud SQL for
1424    /// SQL Server instance has a different time zone from the backup's time zone,
1425    /// then the restore to the instance doesn't happen.
1426    pub time_zone: std::string::String,
1427
1428    /// Output only. The database version of the instance of at the time this
1429    /// backup was made.
1430    pub database_version: crate::model::SqlDatabaseVersion,
1431
1432    /// Output only. The maximum chargeable bytes for the backup.
1433    pub max_chargeable_bytes: std::option::Option<i64>,
1434
1435    /// Optional. Output only. Timestamp in UTC of when the instance associated
1436    /// with this backup is deleted.
1437    pub instance_deletion_time: std::option::Option<wkt::Timestamp>,
1438
1439    /// Optional. Output only. The instance setting of the source instance that's
1440    /// associated with this backup.
1441    pub instance_settings: std::option::Option<crate::model::DatabaseInstance>,
1442
1443    /// Output only. The mapping to backup run resource used for IAM validations.
1444    pub backup_run: std::string::String,
1445
1446    /// Output only. This status indicates whether the backup satisfies PZS.
1447    ///
1448    /// The status is reserved for future use.
1449    pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
1450
1451    /// Output only. This status indicates whether the backup satisfies PZI.
1452    ///
1453    /// The status is reserved for future use.
1454    pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
1455
1456    #[allow(missing_docs)]
1457    pub expiration: std::option::Option<crate::model::backup::Expiration>,
1458
1459    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1460}
1461
1462impl Backup {
1463    /// Creates a new default instance.
1464    pub fn new() -> Self {
1465        std::default::Default::default()
1466    }
1467
1468    /// Sets the value of [name][crate::model::Backup::name].
1469    ///
1470    /// # Example
1471    /// ```ignore,no_run
1472    /// # use google_cloud_sql_v1::model::Backup;
1473    /// # let project_id = "project_id";
1474    /// # let backup_id = "backup_id";
1475    /// let x = Backup::new().set_name(format!("projects/{project_id}/backups/{backup_id}"));
1476    /// ```
1477    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1478        self.name = v.into();
1479        self
1480    }
1481
1482    /// Sets the value of [kind][crate::model::Backup::kind].
1483    ///
1484    /// # Example
1485    /// ```ignore,no_run
1486    /// # use google_cloud_sql_v1::model::Backup;
1487    /// let x = Backup::new().set_kind("example");
1488    /// ```
1489    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1490        self.kind = v.into();
1491        self
1492    }
1493
1494    /// Sets the value of [self_link][crate::model::Backup::self_link].
1495    ///
1496    /// # Example
1497    /// ```ignore,no_run
1498    /// # use google_cloud_sql_v1::model::Backup;
1499    /// let x = Backup::new().set_self_link("example");
1500    /// ```
1501    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1502        self.self_link = v.into();
1503        self
1504    }
1505
1506    /// Sets the value of [r#type][crate::model::Backup::type].
1507    ///
1508    /// # Example
1509    /// ```ignore,no_run
1510    /// # use google_cloud_sql_v1::model::Backup;
1511    /// use google_cloud_sql_v1::model::backup::SqlBackupType;
1512    /// let x0 = Backup::new().set_type(SqlBackupType::Automated);
1513    /// let x1 = Backup::new().set_type(SqlBackupType::OnDemand);
1514    /// let x2 = Backup::new().set_type(SqlBackupType::Final);
1515    /// ```
1516    pub fn set_type<T: std::convert::Into<crate::model::backup::SqlBackupType>>(
1517        mut self,
1518        v: T,
1519    ) -> Self {
1520        self.r#type = v.into();
1521        self
1522    }
1523
1524    /// Sets the value of [description][crate::model::Backup::description].
1525    ///
1526    /// # Example
1527    /// ```ignore,no_run
1528    /// # use google_cloud_sql_v1::model::Backup;
1529    /// let x = Backup::new().set_description("example");
1530    /// ```
1531    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1532        self.description = v.into();
1533        self
1534    }
1535
1536    /// Sets the value of [instance][crate::model::Backup::instance].
1537    ///
1538    /// # Example
1539    /// ```ignore,no_run
1540    /// # use google_cloud_sql_v1::model::Backup;
1541    /// let x = Backup::new().set_instance("example");
1542    /// ```
1543    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1544        self.instance = v.into();
1545        self
1546    }
1547
1548    /// Sets the value of [location][crate::model::Backup::location].
1549    ///
1550    /// # Example
1551    /// ```ignore,no_run
1552    /// # use google_cloud_sql_v1::model::Backup;
1553    /// let x = Backup::new().set_location("example");
1554    /// ```
1555    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1556        self.location = v.into();
1557        self
1558    }
1559
1560    /// Sets the value of [backup_interval][crate::model::Backup::backup_interval].
1561    ///
1562    /// # Example
1563    /// ```ignore,no_run
1564    /// # use google_cloud_sql_v1::model::Backup;
1565    /// use google_cloud_type::model::Interval;
1566    /// let x = Backup::new().set_backup_interval(Interval::default()/* use setters */);
1567    /// ```
1568    pub fn set_backup_interval<T>(mut self, v: T) -> Self
1569    where
1570        T: std::convert::Into<google_cloud_type::model::Interval>,
1571    {
1572        self.backup_interval = std::option::Option::Some(v.into());
1573        self
1574    }
1575
1576    /// Sets or clears the value of [backup_interval][crate::model::Backup::backup_interval].
1577    ///
1578    /// # Example
1579    /// ```ignore,no_run
1580    /// # use google_cloud_sql_v1::model::Backup;
1581    /// use google_cloud_type::model::Interval;
1582    /// let x = Backup::new().set_or_clear_backup_interval(Some(Interval::default()/* use setters */));
1583    /// let x = Backup::new().set_or_clear_backup_interval(None::<Interval>);
1584    /// ```
1585    pub fn set_or_clear_backup_interval<T>(mut self, v: std::option::Option<T>) -> Self
1586    where
1587        T: std::convert::Into<google_cloud_type::model::Interval>,
1588    {
1589        self.backup_interval = v.map(|x| x.into());
1590        self
1591    }
1592
1593    /// Sets the value of [state][crate::model::Backup::state].
1594    ///
1595    /// # Example
1596    /// ```ignore,no_run
1597    /// # use google_cloud_sql_v1::model::Backup;
1598    /// use google_cloud_sql_v1::model::backup::SqlBackupState;
1599    /// let x0 = Backup::new().set_state(SqlBackupState::Enqueued);
1600    /// let x1 = Backup::new().set_state(SqlBackupState::Running);
1601    /// let x2 = Backup::new().set_state(SqlBackupState::Failed);
1602    /// ```
1603    pub fn set_state<T: std::convert::Into<crate::model::backup::SqlBackupState>>(
1604        mut self,
1605        v: T,
1606    ) -> Self {
1607        self.state = v.into();
1608        self
1609    }
1610
1611    /// Sets the value of [error][crate::model::Backup::error].
1612    ///
1613    /// # Example
1614    /// ```ignore,no_run
1615    /// # use google_cloud_sql_v1::model::Backup;
1616    /// use google_cloud_sql_v1::model::OperationError;
1617    /// let x = Backup::new().set_error(OperationError::default()/* use setters */);
1618    /// ```
1619    pub fn set_error<T>(mut self, v: T) -> Self
1620    where
1621        T: std::convert::Into<crate::model::OperationError>,
1622    {
1623        self.error = std::option::Option::Some(v.into());
1624        self
1625    }
1626
1627    /// Sets or clears the value of [error][crate::model::Backup::error].
1628    ///
1629    /// # Example
1630    /// ```ignore,no_run
1631    /// # use google_cloud_sql_v1::model::Backup;
1632    /// use google_cloud_sql_v1::model::OperationError;
1633    /// let x = Backup::new().set_or_clear_error(Some(OperationError::default()/* use setters */));
1634    /// let x = Backup::new().set_or_clear_error(None::<OperationError>);
1635    /// ```
1636    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1637    where
1638        T: std::convert::Into<crate::model::OperationError>,
1639    {
1640        self.error = v.map(|x| x.into());
1641        self
1642    }
1643
1644    /// Sets the value of [kms_key][crate::model::Backup::kms_key].
1645    ///
1646    /// # Example
1647    /// ```ignore,no_run
1648    /// # use google_cloud_sql_v1::model::Backup;
1649    /// let x = Backup::new().set_kms_key("example");
1650    /// ```
1651    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1652        self.kms_key = v.into();
1653        self
1654    }
1655
1656    /// Sets the value of [kms_key_version][crate::model::Backup::kms_key_version].
1657    ///
1658    /// # Example
1659    /// ```ignore,no_run
1660    /// # use google_cloud_sql_v1::model::Backup;
1661    /// let x = Backup::new().set_kms_key_version("example");
1662    /// ```
1663    pub fn set_kms_key_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1664        self.kms_key_version = v.into();
1665        self
1666    }
1667
1668    /// Sets the value of [backup_kind][crate::model::Backup::backup_kind].
1669    ///
1670    /// # Example
1671    /// ```ignore,no_run
1672    /// # use google_cloud_sql_v1::model::Backup;
1673    /// use google_cloud_sql_v1::model::SqlBackupKind;
1674    /// let x0 = Backup::new().set_backup_kind(SqlBackupKind::Snapshot);
1675    /// let x1 = Backup::new().set_backup_kind(SqlBackupKind::Physical);
1676    /// ```
1677    pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
1678        mut self,
1679        v: T,
1680    ) -> Self {
1681        self.backup_kind = v.into();
1682        self
1683    }
1684
1685    /// Sets the value of [time_zone][crate::model::Backup::time_zone].
1686    ///
1687    /// # Example
1688    /// ```ignore,no_run
1689    /// # use google_cloud_sql_v1::model::Backup;
1690    /// let x = Backup::new().set_time_zone("example");
1691    /// ```
1692    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1693        self.time_zone = v.into();
1694        self
1695    }
1696
1697    /// Sets the value of [database_version][crate::model::Backup::database_version].
1698    ///
1699    /// # Example
1700    /// ```ignore,no_run
1701    /// # use google_cloud_sql_v1::model::Backup;
1702    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
1703    /// let x0 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql56);
1704    /// let x1 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql57);
1705    /// let x2 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql80);
1706    /// ```
1707    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
1708        mut self,
1709        v: T,
1710    ) -> Self {
1711        self.database_version = v.into();
1712        self
1713    }
1714
1715    /// Sets the value of [max_chargeable_bytes][crate::model::Backup::max_chargeable_bytes].
1716    ///
1717    /// # Example
1718    /// ```ignore,no_run
1719    /// # use google_cloud_sql_v1::model::Backup;
1720    /// let x = Backup::new().set_max_chargeable_bytes(42);
1721    /// ```
1722    pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
1723    where
1724        T: std::convert::Into<i64>,
1725    {
1726        self.max_chargeable_bytes = std::option::Option::Some(v.into());
1727        self
1728    }
1729
1730    /// Sets or clears the value of [max_chargeable_bytes][crate::model::Backup::max_chargeable_bytes].
1731    ///
1732    /// # Example
1733    /// ```ignore,no_run
1734    /// # use google_cloud_sql_v1::model::Backup;
1735    /// let x = Backup::new().set_or_clear_max_chargeable_bytes(Some(42));
1736    /// let x = Backup::new().set_or_clear_max_chargeable_bytes(None::<i32>);
1737    /// ```
1738    pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
1739    where
1740        T: std::convert::Into<i64>,
1741    {
1742        self.max_chargeable_bytes = v.map(|x| x.into());
1743        self
1744    }
1745
1746    /// Sets the value of [instance_deletion_time][crate::model::Backup::instance_deletion_time].
1747    ///
1748    /// # Example
1749    /// ```ignore,no_run
1750    /// # use google_cloud_sql_v1::model::Backup;
1751    /// use wkt::Timestamp;
1752    /// let x = Backup::new().set_instance_deletion_time(Timestamp::default()/* use setters */);
1753    /// ```
1754    pub fn set_instance_deletion_time<T>(mut self, v: T) -> Self
1755    where
1756        T: std::convert::Into<wkt::Timestamp>,
1757    {
1758        self.instance_deletion_time = std::option::Option::Some(v.into());
1759        self
1760    }
1761
1762    /// Sets or clears the value of [instance_deletion_time][crate::model::Backup::instance_deletion_time].
1763    ///
1764    /// # Example
1765    /// ```ignore,no_run
1766    /// # use google_cloud_sql_v1::model::Backup;
1767    /// use wkt::Timestamp;
1768    /// let x = Backup::new().set_or_clear_instance_deletion_time(Some(Timestamp::default()/* use setters */));
1769    /// let x = Backup::new().set_or_clear_instance_deletion_time(None::<Timestamp>);
1770    /// ```
1771    pub fn set_or_clear_instance_deletion_time<T>(mut self, v: std::option::Option<T>) -> Self
1772    where
1773        T: std::convert::Into<wkt::Timestamp>,
1774    {
1775        self.instance_deletion_time = v.map(|x| x.into());
1776        self
1777    }
1778
1779    /// Sets the value of [instance_settings][crate::model::Backup::instance_settings].
1780    ///
1781    /// # Example
1782    /// ```ignore,no_run
1783    /// # use google_cloud_sql_v1::model::Backup;
1784    /// use google_cloud_sql_v1::model::DatabaseInstance;
1785    /// let x = Backup::new().set_instance_settings(DatabaseInstance::default()/* use setters */);
1786    /// ```
1787    pub fn set_instance_settings<T>(mut self, v: T) -> Self
1788    where
1789        T: std::convert::Into<crate::model::DatabaseInstance>,
1790    {
1791        self.instance_settings = std::option::Option::Some(v.into());
1792        self
1793    }
1794
1795    /// Sets or clears the value of [instance_settings][crate::model::Backup::instance_settings].
1796    ///
1797    /// # Example
1798    /// ```ignore,no_run
1799    /// # use google_cloud_sql_v1::model::Backup;
1800    /// use google_cloud_sql_v1::model::DatabaseInstance;
1801    /// let x = Backup::new().set_or_clear_instance_settings(Some(DatabaseInstance::default()/* use setters */));
1802    /// let x = Backup::new().set_or_clear_instance_settings(None::<DatabaseInstance>);
1803    /// ```
1804    pub fn set_or_clear_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
1805    where
1806        T: std::convert::Into<crate::model::DatabaseInstance>,
1807    {
1808        self.instance_settings = v.map(|x| x.into());
1809        self
1810    }
1811
1812    /// Sets the value of [backup_run][crate::model::Backup::backup_run].
1813    ///
1814    /// # Example
1815    /// ```ignore,no_run
1816    /// # use google_cloud_sql_v1::model::Backup;
1817    /// let x = Backup::new().set_backup_run("example");
1818    /// ```
1819    pub fn set_backup_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1820        self.backup_run = v.into();
1821        self
1822    }
1823
1824    /// Sets the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1825    ///
1826    /// # Example
1827    /// ```ignore,no_run
1828    /// # use google_cloud_sql_v1::model::Backup;
1829    /// use wkt::BoolValue;
1830    /// let x = Backup::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
1831    /// ```
1832    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
1833    where
1834        T: std::convert::Into<wkt::BoolValue>,
1835    {
1836        self.satisfies_pzs = std::option::Option::Some(v.into());
1837        self
1838    }
1839
1840    /// Sets or clears the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1841    ///
1842    /// # Example
1843    /// ```ignore,no_run
1844    /// # use google_cloud_sql_v1::model::Backup;
1845    /// use wkt::BoolValue;
1846    /// let x = Backup::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
1847    /// let x = Backup::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
1848    /// ```
1849    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
1850    where
1851        T: std::convert::Into<wkt::BoolValue>,
1852    {
1853        self.satisfies_pzs = v.map(|x| x.into());
1854        self
1855    }
1856
1857    /// Sets the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1858    ///
1859    /// # Example
1860    /// ```ignore,no_run
1861    /// # use google_cloud_sql_v1::model::Backup;
1862    /// use wkt::BoolValue;
1863    /// let x = Backup::new().set_satisfies_pzi(BoolValue::default()/* use setters */);
1864    /// ```
1865    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
1866    where
1867        T: std::convert::Into<wkt::BoolValue>,
1868    {
1869        self.satisfies_pzi = std::option::Option::Some(v.into());
1870        self
1871    }
1872
1873    /// Sets or clears the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1874    ///
1875    /// # Example
1876    /// ```ignore,no_run
1877    /// # use google_cloud_sql_v1::model::Backup;
1878    /// use wkt::BoolValue;
1879    /// let x = Backup::new().set_or_clear_satisfies_pzi(Some(BoolValue::default()/* use setters */));
1880    /// let x = Backup::new().set_or_clear_satisfies_pzi(None::<BoolValue>);
1881    /// ```
1882    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
1883    where
1884        T: std::convert::Into<wkt::BoolValue>,
1885    {
1886        self.satisfies_pzi = v.map(|x| x.into());
1887        self
1888    }
1889
1890    /// Sets the value of [expiration][crate::model::Backup::expiration].
1891    ///
1892    /// Note that all the setters affecting `expiration` are mutually
1893    /// exclusive.
1894    ///
1895    /// # Example
1896    /// ```ignore,no_run
1897    /// # use google_cloud_sql_v1::model::Backup;
1898    /// use google_cloud_sql_v1::model::backup::Expiration;
1899    /// let x = Backup::new().set_expiration(Some(Expiration::TtlDays(42)));
1900    /// ```
1901    pub fn set_expiration<
1902        T: std::convert::Into<std::option::Option<crate::model::backup::Expiration>>,
1903    >(
1904        mut self,
1905        v: T,
1906    ) -> Self {
1907        self.expiration = v.into();
1908        self
1909    }
1910
1911    /// The value of [expiration][crate::model::Backup::expiration]
1912    /// if it holds a `TtlDays`, `None` if the field is not set or
1913    /// holds a different branch.
1914    pub fn ttl_days(&self) -> std::option::Option<&i64> {
1915        #[allow(unreachable_patterns)]
1916        self.expiration.as_ref().and_then(|v| match v {
1917            crate::model::backup::Expiration::TtlDays(v) => std::option::Option::Some(v),
1918            _ => std::option::Option::None,
1919        })
1920    }
1921
1922    /// Sets the value of [expiration][crate::model::Backup::expiration]
1923    /// to hold a `TtlDays`.
1924    ///
1925    /// Note that all the setters affecting `expiration` are
1926    /// mutually exclusive.
1927    ///
1928    /// # Example
1929    /// ```ignore,no_run
1930    /// # use google_cloud_sql_v1::model::Backup;
1931    /// let x = Backup::new().set_ttl_days(42);
1932    /// assert!(x.ttl_days().is_some());
1933    /// assert!(x.expiry_time().is_none());
1934    /// ```
1935    pub fn set_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1936        self.expiration =
1937            std::option::Option::Some(crate::model::backup::Expiration::TtlDays(v.into()));
1938        self
1939    }
1940
1941    /// The value of [expiration][crate::model::Backup::expiration]
1942    /// if it holds a `ExpiryTime`, `None` if the field is not set or
1943    /// holds a different branch.
1944    pub fn expiry_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
1945        #[allow(unreachable_patterns)]
1946        self.expiration.as_ref().and_then(|v| match v {
1947            crate::model::backup::Expiration::ExpiryTime(v) => std::option::Option::Some(v),
1948            _ => std::option::Option::None,
1949        })
1950    }
1951
1952    /// Sets the value of [expiration][crate::model::Backup::expiration]
1953    /// to hold a `ExpiryTime`.
1954    ///
1955    /// Note that all the setters affecting `expiration` are
1956    /// mutually exclusive.
1957    ///
1958    /// # Example
1959    /// ```ignore,no_run
1960    /// # use google_cloud_sql_v1::model::Backup;
1961    /// use wkt::Timestamp;
1962    /// let x = Backup::new().set_expiry_time(Timestamp::default()/* use setters */);
1963    /// assert!(x.expiry_time().is_some());
1964    /// assert!(x.ttl_days().is_none());
1965    /// ```
1966    pub fn set_expiry_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
1967        mut self,
1968        v: T,
1969    ) -> Self {
1970        self.expiration =
1971            std::option::Option::Some(crate::model::backup::Expiration::ExpiryTime(v.into()));
1972        self
1973    }
1974}
1975
1976impl wkt::message::Message for Backup {
1977    fn typename() -> &'static str {
1978        "type.googleapis.com/google.cloud.sql.v1.Backup"
1979    }
1980}
1981
1982/// Defines additional types related to [Backup].
1983pub mod backup {
1984    #[allow(unused_imports)]
1985    use super::*;
1986
1987    /// The backup type.
1988    ///
1989    /// # Working with unknown values
1990    ///
1991    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1992    /// additional enum variants at any time. Adding new variants is not considered
1993    /// a breaking change. Applications should write their code in anticipation of:
1994    ///
1995    /// - New values appearing in future releases of the client library, **and**
1996    /// - New values received dynamically, without application changes.
1997    ///
1998    /// Please consult the [Working with enums] section in the user guide for some
1999    /// guidelines.
2000    ///
2001    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2002    #[derive(Clone, Debug, PartialEq)]
2003    #[non_exhaustive]
2004    pub enum SqlBackupType {
2005        /// This is an unknown backup type.
2006        Unspecified,
2007        /// The backup schedule triggers a backup automatically.
2008        Automated,
2009        /// The user triggers a backup manually.
2010        OnDemand,
2011        /// The backup created when instance is deleted.
2012        Final,
2013        /// If set, the enum was initialized with an unknown value.
2014        ///
2015        /// Applications can examine the value using [SqlBackupType::value] or
2016        /// [SqlBackupType::name].
2017        UnknownValue(sql_backup_type::UnknownValue),
2018    }
2019
2020    #[doc(hidden)]
2021    pub mod sql_backup_type {
2022        #[allow(unused_imports)]
2023        use super::*;
2024        #[derive(Clone, Debug, PartialEq)]
2025        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2026    }
2027
2028    impl SqlBackupType {
2029        /// Gets the enum value.
2030        ///
2031        /// Returns `None` if the enum contains an unknown value deserialized from
2032        /// the string representation of enums.
2033        pub fn value(&self) -> std::option::Option<i32> {
2034            match self {
2035                Self::Unspecified => std::option::Option::Some(0),
2036                Self::Automated => std::option::Option::Some(1),
2037                Self::OnDemand => std::option::Option::Some(2),
2038                Self::Final => std::option::Option::Some(3),
2039                Self::UnknownValue(u) => u.0.value(),
2040            }
2041        }
2042
2043        /// Gets the enum value as a string.
2044        ///
2045        /// Returns `None` if the enum contains an unknown value deserialized from
2046        /// the integer representation of enums.
2047        pub fn name(&self) -> std::option::Option<&str> {
2048            match self {
2049                Self::Unspecified => std::option::Option::Some("SQL_BACKUP_TYPE_UNSPECIFIED"),
2050                Self::Automated => std::option::Option::Some("AUTOMATED"),
2051                Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
2052                Self::Final => std::option::Option::Some("FINAL"),
2053                Self::UnknownValue(u) => u.0.name(),
2054            }
2055        }
2056    }
2057
2058    impl std::default::Default for SqlBackupType {
2059        fn default() -> Self {
2060            use std::convert::From;
2061            Self::from(0)
2062        }
2063    }
2064
2065    impl std::fmt::Display for SqlBackupType {
2066        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2067            wkt::internal::display_enum(f, self.name(), self.value())
2068        }
2069    }
2070
2071    impl std::convert::From<i32> for SqlBackupType {
2072        fn from(value: i32) -> Self {
2073            match value {
2074                0 => Self::Unspecified,
2075                1 => Self::Automated,
2076                2 => Self::OnDemand,
2077                3 => Self::Final,
2078                _ => Self::UnknownValue(sql_backup_type::UnknownValue(
2079                    wkt::internal::UnknownEnumValue::Integer(value),
2080                )),
2081            }
2082        }
2083    }
2084
2085    impl std::convert::From<&str> for SqlBackupType {
2086        fn from(value: &str) -> Self {
2087            use std::string::ToString;
2088            match value {
2089                "SQL_BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
2090                "AUTOMATED" => Self::Automated,
2091                "ON_DEMAND" => Self::OnDemand,
2092                "FINAL" => Self::Final,
2093                _ => Self::UnknownValue(sql_backup_type::UnknownValue(
2094                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2095                )),
2096            }
2097        }
2098    }
2099
2100    impl serde::ser::Serialize for SqlBackupType {
2101        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2102        where
2103            S: serde::Serializer,
2104        {
2105            match self {
2106                Self::Unspecified => serializer.serialize_i32(0),
2107                Self::Automated => serializer.serialize_i32(1),
2108                Self::OnDemand => serializer.serialize_i32(2),
2109                Self::Final => serializer.serialize_i32(3),
2110                Self::UnknownValue(u) => u.0.serialize(serializer),
2111            }
2112        }
2113    }
2114
2115    impl<'de> serde::de::Deserialize<'de> for SqlBackupType {
2116        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2117        where
2118            D: serde::Deserializer<'de>,
2119        {
2120            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupType>::new(
2121                ".google.cloud.sql.v1.Backup.SqlBackupType",
2122            ))
2123        }
2124    }
2125
2126    /// The backup's state
2127    ///
2128    /// # Working with unknown values
2129    ///
2130    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2131    /// additional enum variants at any time. Adding new variants is not considered
2132    /// a breaking change. Applications should write their code in anticipation of:
2133    ///
2134    /// - New values appearing in future releases of the client library, **and**
2135    /// - New values received dynamically, without application changes.
2136    ///
2137    /// Please consult the [Working with enums] section in the user guide for some
2138    /// guidelines.
2139    ///
2140    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2141    #[derive(Clone, Debug, PartialEq)]
2142    #[non_exhaustive]
2143    pub enum SqlBackupState {
2144        /// The state of the backup is unknown.
2145        Unspecified,
2146        /// The backup that's added to a queue.
2147        Enqueued,
2148        /// The backup is in progress.
2149        Running,
2150        /// The backup failed.
2151        Failed,
2152        /// The backup is successful.
2153        Successful,
2154        /// The backup is being deleted.
2155        Deleting,
2156        /// Deletion of the backup failed.
2157        DeletionFailed,
2158        /// If set, the enum was initialized with an unknown value.
2159        ///
2160        /// Applications can examine the value using [SqlBackupState::value] or
2161        /// [SqlBackupState::name].
2162        UnknownValue(sql_backup_state::UnknownValue),
2163    }
2164
2165    #[doc(hidden)]
2166    pub mod sql_backup_state {
2167        #[allow(unused_imports)]
2168        use super::*;
2169        #[derive(Clone, Debug, PartialEq)]
2170        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2171    }
2172
2173    impl SqlBackupState {
2174        /// Gets the enum value.
2175        ///
2176        /// Returns `None` if the enum contains an unknown value deserialized from
2177        /// the string representation of enums.
2178        pub fn value(&self) -> std::option::Option<i32> {
2179            match self {
2180                Self::Unspecified => std::option::Option::Some(0),
2181                Self::Enqueued => std::option::Option::Some(1),
2182                Self::Running => std::option::Option::Some(2),
2183                Self::Failed => std::option::Option::Some(3),
2184                Self::Successful => std::option::Option::Some(4),
2185                Self::Deleting => std::option::Option::Some(5),
2186                Self::DeletionFailed => std::option::Option::Some(6),
2187                Self::UnknownValue(u) => u.0.value(),
2188            }
2189        }
2190
2191        /// Gets the enum value as a string.
2192        ///
2193        /// Returns `None` if the enum contains an unknown value deserialized from
2194        /// the integer representation of enums.
2195        pub fn name(&self) -> std::option::Option<&str> {
2196            match self {
2197                Self::Unspecified => std::option::Option::Some("SQL_BACKUP_STATE_UNSPECIFIED"),
2198                Self::Enqueued => std::option::Option::Some("ENQUEUED"),
2199                Self::Running => std::option::Option::Some("RUNNING"),
2200                Self::Failed => std::option::Option::Some("FAILED"),
2201                Self::Successful => std::option::Option::Some("SUCCESSFUL"),
2202                Self::Deleting => std::option::Option::Some("DELETING"),
2203                Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
2204                Self::UnknownValue(u) => u.0.name(),
2205            }
2206        }
2207    }
2208
2209    impl std::default::Default for SqlBackupState {
2210        fn default() -> Self {
2211            use std::convert::From;
2212            Self::from(0)
2213        }
2214    }
2215
2216    impl std::fmt::Display for SqlBackupState {
2217        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2218            wkt::internal::display_enum(f, self.name(), self.value())
2219        }
2220    }
2221
2222    impl std::convert::From<i32> for SqlBackupState {
2223        fn from(value: i32) -> Self {
2224            match value {
2225                0 => Self::Unspecified,
2226                1 => Self::Enqueued,
2227                2 => Self::Running,
2228                3 => Self::Failed,
2229                4 => Self::Successful,
2230                5 => Self::Deleting,
2231                6 => Self::DeletionFailed,
2232                _ => Self::UnknownValue(sql_backup_state::UnknownValue(
2233                    wkt::internal::UnknownEnumValue::Integer(value),
2234                )),
2235            }
2236        }
2237    }
2238
2239    impl std::convert::From<&str> for SqlBackupState {
2240        fn from(value: &str) -> Self {
2241            use std::string::ToString;
2242            match value {
2243                "SQL_BACKUP_STATE_UNSPECIFIED" => Self::Unspecified,
2244                "ENQUEUED" => Self::Enqueued,
2245                "RUNNING" => Self::Running,
2246                "FAILED" => Self::Failed,
2247                "SUCCESSFUL" => Self::Successful,
2248                "DELETING" => Self::Deleting,
2249                "DELETION_FAILED" => Self::DeletionFailed,
2250                _ => Self::UnknownValue(sql_backup_state::UnknownValue(
2251                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2252                )),
2253            }
2254        }
2255    }
2256
2257    impl serde::ser::Serialize for SqlBackupState {
2258        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2259        where
2260            S: serde::Serializer,
2261        {
2262            match self {
2263                Self::Unspecified => serializer.serialize_i32(0),
2264                Self::Enqueued => serializer.serialize_i32(1),
2265                Self::Running => serializer.serialize_i32(2),
2266                Self::Failed => serializer.serialize_i32(3),
2267                Self::Successful => serializer.serialize_i32(4),
2268                Self::Deleting => serializer.serialize_i32(5),
2269                Self::DeletionFailed => serializer.serialize_i32(6),
2270                Self::UnknownValue(u) => u.0.serialize(serializer),
2271            }
2272        }
2273    }
2274
2275    impl<'de> serde::de::Deserialize<'de> for SqlBackupState {
2276        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2277        where
2278            D: serde::Deserializer<'de>,
2279        {
2280            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupState>::new(
2281                ".google.cloud.sql.v1.Backup.SqlBackupState",
2282            ))
2283        }
2284    }
2285
2286    #[allow(missing_docs)]
2287    #[derive(Clone, Debug, PartialEq)]
2288    #[non_exhaustive]
2289    pub enum Expiration {
2290        /// Input only. The time-to-live (TTL) interval for this resource (in days).
2291        /// For example: ttlDays:7, means 7 days from the current time. The
2292        /// expiration time can't exceed 365 days from the time that the backup is
2293        /// created.
2294        TtlDays(i64),
2295        /// Backup expiration time.
2296        /// A UTC timestamp of when this backup expired.
2297        ExpiryTime(std::boxed::Box<wkt::Timestamp>),
2298    }
2299}
2300
2301/// Connect settings retrieval request.
2302#[derive(Clone, Default, PartialEq)]
2303#[non_exhaustive]
2304pub struct GetConnectSettingsRequest {
2305    /// Cloud SQL instance ID. This does not include the project ID.
2306    pub instance: std::string::String,
2307
2308    /// Project ID of the project that contains the instance.
2309    pub project: std::string::String,
2310
2311    /// Optional. Optional snapshot read timestamp to trade freshness for
2312    /// performance.
2313    pub read_time: std::option::Option<wkt::Timestamp>,
2314
2315    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2316}
2317
2318impl GetConnectSettingsRequest {
2319    /// Creates a new default instance.
2320    pub fn new() -> Self {
2321        std::default::Default::default()
2322    }
2323
2324    /// Sets the value of [instance][crate::model::GetConnectSettingsRequest::instance].
2325    ///
2326    /// # Example
2327    /// ```ignore,no_run
2328    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2329    /// let x = GetConnectSettingsRequest::new().set_instance("example");
2330    /// ```
2331    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2332        self.instance = v.into();
2333        self
2334    }
2335
2336    /// Sets the value of [project][crate::model::GetConnectSettingsRequest::project].
2337    ///
2338    /// # Example
2339    /// ```ignore,no_run
2340    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2341    /// let x = GetConnectSettingsRequest::new().set_project("example");
2342    /// ```
2343    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2344        self.project = v.into();
2345        self
2346    }
2347
2348    /// Sets the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
2349    ///
2350    /// # Example
2351    /// ```ignore,no_run
2352    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2353    /// use wkt::Timestamp;
2354    /// let x = GetConnectSettingsRequest::new().set_read_time(Timestamp::default()/* use setters */);
2355    /// ```
2356    pub fn set_read_time<T>(mut self, v: T) -> Self
2357    where
2358        T: std::convert::Into<wkt::Timestamp>,
2359    {
2360        self.read_time = std::option::Option::Some(v.into());
2361        self
2362    }
2363
2364    /// Sets or clears the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
2365    ///
2366    /// # Example
2367    /// ```ignore,no_run
2368    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2369    /// use wkt::Timestamp;
2370    /// let x = GetConnectSettingsRequest::new().set_or_clear_read_time(Some(Timestamp::default()/* use setters */));
2371    /// let x = GetConnectSettingsRequest::new().set_or_clear_read_time(None::<Timestamp>);
2372    /// ```
2373    pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
2374    where
2375        T: std::convert::Into<wkt::Timestamp>,
2376    {
2377        self.read_time = v.map(|x| x.into());
2378        self
2379    }
2380}
2381
2382impl wkt::message::Message for GetConnectSettingsRequest {
2383    fn typename() -> &'static str {
2384        "type.googleapis.com/google.cloud.sql.v1.GetConnectSettingsRequest"
2385    }
2386}
2387
2388/// Connect settings retrieval response.
2389#[derive(Clone, Default, PartialEq)]
2390#[non_exhaustive]
2391pub struct ConnectSettings {
2392    /// This is always `sql#connectSettings`.
2393    pub kind: std::string::String,
2394
2395    /// SSL configuration.
2396    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
2397
2398    /// The assigned IP addresses for the instance.
2399    pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
2400
2401    /// The cloud region for the instance. For example, `us-central1`,
2402    /// `europe-west1`. The region cannot be changed after instance creation.
2403    pub region: std::string::String,
2404
2405    /// The database engine type and version. The `databaseVersion`
2406    /// field cannot be changed after instance creation.
2407    /// MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
2408    /// or `MYSQL_5_6`.
2409    /// PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
2410    /// `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
2411    /// SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
2412    /// `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
2413    /// `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
2414    /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
2415    /// `SQLSERVER_2019_WEB`.
2416    pub database_version: crate::model::SqlDatabaseVersion,
2417
2418    /// `SECOND_GEN`: Cloud SQL database instance.
2419    /// `EXTERNAL`: A database server that is not managed by Google.
2420    /// This property is read-only; use the `tier` property in the `settings`
2421    /// object to determine the database type.
2422    pub backend_type: crate::model::SqlBackendType,
2423
2424    /// Whether PSC connectivity is enabled for this instance.
2425    pub psc_enabled: bool,
2426
2427    /// The dns name of the instance.
2428    pub dns_name: std::string::String,
2429
2430    /// Specify what type of CA is used for the server certificate.
2431    pub server_ca_mode: crate::model::connect_settings::CaMode,
2432
2433    /// Custom subject alternative names for the server certificate.
2434    pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
2435
2436    /// Output only. The list of DNS names used by this instance.
2437    pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
2438
2439    /// The number of read pool nodes in a read pool.
2440    pub node_count: std::option::Option<i32>,
2441
2442    /// Output only. Entries containing information about each read pool node of
2443    /// the read pool.
2444    pub nodes: std::vec::Vec<crate::model::connect_settings::ConnectPoolNodeConfig>,
2445
2446    /// Optional. Output only. mdx_protocol_support controls how the client uses
2447    /// metadata exchange when connecting to the instance. The values in the list
2448    /// representing parts of the MDX protocol that are supported by this instance.
2449    /// When the list is empty, the instance does not support MDX, so the client
2450    /// must not send an MDX request. The default is empty.
2451    pub mdx_protocol_support: std::vec::Vec<crate::model::connect_settings::MdxProtocolSupport>,
2452
2453    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2454}
2455
2456impl ConnectSettings {
2457    /// Creates a new default instance.
2458    pub fn new() -> Self {
2459        std::default::Default::default()
2460    }
2461
2462    /// Sets the value of [kind][crate::model::ConnectSettings::kind].
2463    ///
2464    /// # Example
2465    /// ```ignore,no_run
2466    /// # use google_cloud_sql_v1::model::ConnectSettings;
2467    /// let x = ConnectSettings::new().set_kind("example");
2468    /// ```
2469    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2470        self.kind = v.into();
2471        self
2472    }
2473
2474    /// Sets the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
2475    ///
2476    /// # Example
2477    /// ```ignore,no_run
2478    /// # use google_cloud_sql_v1::model::ConnectSettings;
2479    /// use google_cloud_sql_v1::model::SslCert;
2480    /// let x = ConnectSettings::new().set_server_ca_cert(SslCert::default()/* use setters */);
2481    /// ```
2482    pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
2483    where
2484        T: std::convert::Into<crate::model::SslCert>,
2485    {
2486        self.server_ca_cert = std::option::Option::Some(v.into());
2487        self
2488    }
2489
2490    /// Sets or clears the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
2491    ///
2492    /// # Example
2493    /// ```ignore,no_run
2494    /// # use google_cloud_sql_v1::model::ConnectSettings;
2495    /// use google_cloud_sql_v1::model::SslCert;
2496    /// let x = ConnectSettings::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
2497    /// let x = ConnectSettings::new().set_or_clear_server_ca_cert(None::<SslCert>);
2498    /// ```
2499    pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
2500    where
2501        T: std::convert::Into<crate::model::SslCert>,
2502    {
2503        self.server_ca_cert = v.map(|x| x.into());
2504        self
2505    }
2506
2507    /// Sets the value of [ip_addresses][crate::model::ConnectSettings::ip_addresses].
2508    ///
2509    /// # Example
2510    /// ```ignore,no_run
2511    /// # use google_cloud_sql_v1::model::ConnectSettings;
2512    /// use google_cloud_sql_v1::model::IpMapping;
2513    /// let x = ConnectSettings::new()
2514    ///     .set_ip_addresses([
2515    ///         IpMapping::default()/* use setters */,
2516    ///         IpMapping::default()/* use (different) setters */,
2517    ///     ]);
2518    /// ```
2519    pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
2520    where
2521        T: std::iter::IntoIterator<Item = V>,
2522        V: std::convert::Into<crate::model::IpMapping>,
2523    {
2524        use std::iter::Iterator;
2525        self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
2526        self
2527    }
2528
2529    /// Sets the value of [region][crate::model::ConnectSettings::region].
2530    ///
2531    /// # Example
2532    /// ```ignore,no_run
2533    /// # use google_cloud_sql_v1::model::ConnectSettings;
2534    /// let x = ConnectSettings::new().set_region("example");
2535    /// ```
2536    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2537        self.region = v.into();
2538        self
2539    }
2540
2541    /// Sets the value of [database_version][crate::model::ConnectSettings::database_version].
2542    ///
2543    /// # Example
2544    /// ```ignore,no_run
2545    /// # use google_cloud_sql_v1::model::ConnectSettings;
2546    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
2547    /// let x0 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql56);
2548    /// let x1 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql57);
2549    /// let x2 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql80);
2550    /// ```
2551    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
2552        mut self,
2553        v: T,
2554    ) -> Self {
2555        self.database_version = v.into();
2556        self
2557    }
2558
2559    /// Sets the value of [backend_type][crate::model::ConnectSettings::backend_type].
2560    ///
2561    /// # Example
2562    /// ```ignore,no_run
2563    /// # use google_cloud_sql_v1::model::ConnectSettings;
2564    /// use google_cloud_sql_v1::model::SqlBackendType;
2565    /// let x0 = ConnectSettings::new().set_backend_type(SqlBackendType::SecondGen);
2566    /// let x1 = ConnectSettings::new().set_backend_type(SqlBackendType::External);
2567    /// ```
2568    pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
2569        mut self,
2570        v: T,
2571    ) -> Self {
2572        self.backend_type = v.into();
2573        self
2574    }
2575
2576    /// Sets the value of [psc_enabled][crate::model::ConnectSettings::psc_enabled].
2577    ///
2578    /// # Example
2579    /// ```ignore,no_run
2580    /// # use google_cloud_sql_v1::model::ConnectSettings;
2581    /// let x = ConnectSettings::new().set_psc_enabled(true);
2582    /// ```
2583    pub fn set_psc_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2584        self.psc_enabled = v.into();
2585        self
2586    }
2587
2588    /// Sets the value of [dns_name][crate::model::ConnectSettings::dns_name].
2589    ///
2590    /// # Example
2591    /// ```ignore,no_run
2592    /// # use google_cloud_sql_v1::model::ConnectSettings;
2593    /// let x = ConnectSettings::new().set_dns_name("example");
2594    /// ```
2595    pub fn set_dns_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2596        self.dns_name = v.into();
2597        self
2598    }
2599
2600    /// Sets the value of [server_ca_mode][crate::model::ConnectSettings::server_ca_mode].
2601    ///
2602    /// # Example
2603    /// ```ignore,no_run
2604    /// # use google_cloud_sql_v1::model::ConnectSettings;
2605    /// use google_cloud_sql_v1::model::connect_settings::CaMode;
2606    /// let x0 = ConnectSettings::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
2607    /// let x1 = ConnectSettings::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
2608    /// let x2 = ConnectSettings::new().set_server_ca_mode(CaMode::CustomerManagedCasCa);
2609    /// ```
2610    pub fn set_server_ca_mode<T: std::convert::Into<crate::model::connect_settings::CaMode>>(
2611        mut self,
2612        v: T,
2613    ) -> Self {
2614        self.server_ca_mode = v.into();
2615        self
2616    }
2617
2618    /// Sets the value of [custom_subject_alternative_names][crate::model::ConnectSettings::custom_subject_alternative_names].
2619    ///
2620    /// # Example
2621    /// ```ignore,no_run
2622    /// # use google_cloud_sql_v1::model::ConnectSettings;
2623    /// let x = ConnectSettings::new().set_custom_subject_alternative_names(["a", "b", "c"]);
2624    /// ```
2625    pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
2626    where
2627        T: std::iter::IntoIterator<Item = V>,
2628        V: std::convert::Into<std::string::String>,
2629    {
2630        use std::iter::Iterator;
2631        self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
2632        self
2633    }
2634
2635    /// Sets the value of [dns_names][crate::model::ConnectSettings::dns_names].
2636    ///
2637    /// # Example
2638    /// ```ignore,no_run
2639    /// # use google_cloud_sql_v1::model::ConnectSettings;
2640    /// use google_cloud_sql_v1::model::DnsNameMapping;
2641    /// let x = ConnectSettings::new()
2642    ///     .set_dns_names([
2643    ///         DnsNameMapping::default()/* use setters */,
2644    ///         DnsNameMapping::default()/* use (different) setters */,
2645    ///     ]);
2646    /// ```
2647    pub fn set_dns_names<T, V>(mut self, v: T) -> Self
2648    where
2649        T: std::iter::IntoIterator<Item = V>,
2650        V: std::convert::Into<crate::model::DnsNameMapping>,
2651    {
2652        use std::iter::Iterator;
2653        self.dns_names = v.into_iter().map(|i| i.into()).collect();
2654        self
2655    }
2656
2657    /// Sets the value of [node_count][crate::model::ConnectSettings::node_count].
2658    ///
2659    /// # Example
2660    /// ```ignore,no_run
2661    /// # use google_cloud_sql_v1::model::ConnectSettings;
2662    /// let x = ConnectSettings::new().set_node_count(42);
2663    /// ```
2664    pub fn set_node_count<T>(mut self, v: T) -> Self
2665    where
2666        T: std::convert::Into<i32>,
2667    {
2668        self.node_count = std::option::Option::Some(v.into());
2669        self
2670    }
2671
2672    /// Sets or clears the value of [node_count][crate::model::ConnectSettings::node_count].
2673    ///
2674    /// # Example
2675    /// ```ignore,no_run
2676    /// # use google_cloud_sql_v1::model::ConnectSettings;
2677    /// let x = ConnectSettings::new().set_or_clear_node_count(Some(42));
2678    /// let x = ConnectSettings::new().set_or_clear_node_count(None::<i32>);
2679    /// ```
2680    pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
2681    where
2682        T: std::convert::Into<i32>,
2683    {
2684        self.node_count = v.map(|x| x.into());
2685        self
2686    }
2687
2688    /// Sets the value of [nodes][crate::model::ConnectSettings::nodes].
2689    ///
2690    /// # Example
2691    /// ```ignore,no_run
2692    /// # use google_cloud_sql_v1::model::ConnectSettings;
2693    /// use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2694    /// let x = ConnectSettings::new()
2695    ///     .set_nodes([
2696    ///         ConnectPoolNodeConfig::default()/* use setters */,
2697    ///         ConnectPoolNodeConfig::default()/* use (different) setters */,
2698    ///     ]);
2699    /// ```
2700    pub fn set_nodes<T, V>(mut self, v: T) -> Self
2701    where
2702        T: std::iter::IntoIterator<Item = V>,
2703        V: std::convert::Into<crate::model::connect_settings::ConnectPoolNodeConfig>,
2704    {
2705        use std::iter::Iterator;
2706        self.nodes = v.into_iter().map(|i| i.into()).collect();
2707        self
2708    }
2709
2710    /// Sets the value of [mdx_protocol_support][crate::model::ConnectSettings::mdx_protocol_support].
2711    ///
2712    /// # Example
2713    /// ```ignore,no_run
2714    /// # use google_cloud_sql_v1::model::ConnectSettings;
2715    /// use google_cloud_sql_v1::model::connect_settings::MdxProtocolSupport;
2716    /// let x = ConnectSettings::new().set_mdx_protocol_support([
2717    ///     MdxProtocolSupport::ClientProtocolType,
2718    /// ]);
2719    /// ```
2720    pub fn set_mdx_protocol_support<T, V>(mut self, v: T) -> Self
2721    where
2722        T: std::iter::IntoIterator<Item = V>,
2723        V: std::convert::Into<crate::model::connect_settings::MdxProtocolSupport>,
2724    {
2725        use std::iter::Iterator;
2726        self.mdx_protocol_support = v.into_iter().map(|i| i.into()).collect();
2727        self
2728    }
2729}
2730
2731impl wkt::message::Message for ConnectSettings {
2732    fn typename() -> &'static str {
2733        "type.googleapis.com/google.cloud.sql.v1.ConnectSettings"
2734    }
2735}
2736
2737/// Defines additional types related to [ConnectSettings].
2738pub mod connect_settings {
2739    #[allow(unused_imports)]
2740    use super::*;
2741
2742    /// Details of a single read pool node of a read pool.
2743    #[derive(Clone, Default, PartialEq)]
2744    #[non_exhaustive]
2745    pub struct ConnectPoolNodeConfig {
2746        /// Output only. The name of the read pool node. Doesn't include the project
2747        /// ID.
2748        pub name: std::option::Option<std::string::String>,
2749
2750        /// Output only. Mappings containing IP addresses that can be used to connect
2751        /// to the read pool node.
2752        pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
2753
2754        /// Output only. The DNS name of the read pool node.
2755        pub dns_name: std::option::Option<std::string::String>,
2756
2757        /// Output only. The list of DNS names used by this read pool node.
2758        pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
2759
2760        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2761    }
2762
2763    impl ConnectPoolNodeConfig {
2764        /// Creates a new default instance.
2765        pub fn new() -> Self {
2766            std::default::Default::default()
2767        }
2768
2769        /// Sets the value of [name][crate::model::connect_settings::ConnectPoolNodeConfig::name].
2770        ///
2771        /// # Example
2772        /// ```ignore,no_run
2773        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2774        /// let x = ConnectPoolNodeConfig::new().set_name("example");
2775        /// ```
2776        pub fn set_name<T>(mut self, v: T) -> Self
2777        where
2778            T: std::convert::Into<std::string::String>,
2779        {
2780            self.name = std::option::Option::Some(v.into());
2781            self
2782        }
2783
2784        /// Sets or clears the value of [name][crate::model::connect_settings::ConnectPoolNodeConfig::name].
2785        ///
2786        /// # Example
2787        /// ```ignore,no_run
2788        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2789        /// let x = ConnectPoolNodeConfig::new().set_or_clear_name(Some("example"));
2790        /// let x = ConnectPoolNodeConfig::new().set_or_clear_name(None::<String>);
2791        /// ```
2792        pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
2793        where
2794            T: std::convert::Into<std::string::String>,
2795        {
2796            self.name = v.map(|x| x.into());
2797            self
2798        }
2799
2800        /// Sets the value of [ip_addresses][crate::model::connect_settings::ConnectPoolNodeConfig::ip_addresses].
2801        ///
2802        /// # Example
2803        /// ```ignore,no_run
2804        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2805        /// use google_cloud_sql_v1::model::IpMapping;
2806        /// let x = ConnectPoolNodeConfig::new()
2807        ///     .set_ip_addresses([
2808        ///         IpMapping::default()/* use setters */,
2809        ///         IpMapping::default()/* use (different) setters */,
2810        ///     ]);
2811        /// ```
2812        pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
2813        where
2814            T: std::iter::IntoIterator<Item = V>,
2815            V: std::convert::Into<crate::model::IpMapping>,
2816        {
2817            use std::iter::Iterator;
2818            self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
2819            self
2820        }
2821
2822        /// Sets the value of [dns_name][crate::model::connect_settings::ConnectPoolNodeConfig::dns_name].
2823        ///
2824        /// # Example
2825        /// ```ignore,no_run
2826        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2827        /// let x = ConnectPoolNodeConfig::new().set_dns_name("example");
2828        /// ```
2829        pub fn set_dns_name<T>(mut self, v: T) -> Self
2830        where
2831            T: std::convert::Into<std::string::String>,
2832        {
2833            self.dns_name = std::option::Option::Some(v.into());
2834            self
2835        }
2836
2837        /// Sets or clears the value of [dns_name][crate::model::connect_settings::ConnectPoolNodeConfig::dns_name].
2838        ///
2839        /// # Example
2840        /// ```ignore,no_run
2841        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2842        /// let x = ConnectPoolNodeConfig::new().set_or_clear_dns_name(Some("example"));
2843        /// let x = ConnectPoolNodeConfig::new().set_or_clear_dns_name(None::<String>);
2844        /// ```
2845        pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
2846        where
2847            T: std::convert::Into<std::string::String>,
2848        {
2849            self.dns_name = v.map(|x| x.into());
2850            self
2851        }
2852
2853        /// Sets the value of [dns_names][crate::model::connect_settings::ConnectPoolNodeConfig::dns_names].
2854        ///
2855        /// # Example
2856        /// ```ignore,no_run
2857        /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2858        /// use google_cloud_sql_v1::model::DnsNameMapping;
2859        /// let x = ConnectPoolNodeConfig::new()
2860        ///     .set_dns_names([
2861        ///         DnsNameMapping::default()/* use setters */,
2862        ///         DnsNameMapping::default()/* use (different) setters */,
2863        ///     ]);
2864        /// ```
2865        pub fn set_dns_names<T, V>(mut self, v: T) -> Self
2866        where
2867            T: std::iter::IntoIterator<Item = V>,
2868            V: std::convert::Into<crate::model::DnsNameMapping>,
2869        {
2870            use std::iter::Iterator;
2871            self.dns_names = v.into_iter().map(|i| i.into()).collect();
2872            self
2873        }
2874    }
2875
2876    impl wkt::message::Message for ConnectPoolNodeConfig {
2877        fn typename() -> &'static str {
2878            "type.googleapis.com/google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig"
2879        }
2880    }
2881
2882    /// Various Certificate Authority (CA) modes for certificate signing.
2883    ///
2884    /// # Working with unknown values
2885    ///
2886    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2887    /// additional enum variants at any time. Adding new variants is not considered
2888    /// a breaking change. Applications should write their code in anticipation of:
2889    ///
2890    /// - New values appearing in future releases of the client library, **and**
2891    /// - New values received dynamically, without application changes.
2892    ///
2893    /// Please consult the [Working with enums] section in the user guide for some
2894    /// guidelines.
2895    ///
2896    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2897    #[derive(Clone, Debug, PartialEq)]
2898    #[non_exhaustive]
2899    pub enum CaMode {
2900        /// CA mode is unknown.
2901        Unspecified,
2902        /// Google-managed self-signed internal CA.
2903        GoogleManagedInternalCa,
2904        /// Google-managed regional CA part of root CA hierarchy hosted on Google
2905        /// Cloud's Certificate Authority Service (CAS).
2906        GoogleManagedCasCa,
2907        /// Customer-managed CA hosted on Google Cloud's Certificate Authority
2908        /// Service (CAS).
2909        CustomerManagedCasCa,
2910        /// If set, the enum was initialized with an unknown value.
2911        ///
2912        /// Applications can examine the value using [CaMode::value] or
2913        /// [CaMode::name].
2914        UnknownValue(ca_mode::UnknownValue),
2915    }
2916
2917    #[doc(hidden)]
2918    pub mod ca_mode {
2919        #[allow(unused_imports)]
2920        use super::*;
2921        #[derive(Clone, Debug, PartialEq)]
2922        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2923    }
2924
2925    impl CaMode {
2926        /// Gets the enum value.
2927        ///
2928        /// Returns `None` if the enum contains an unknown value deserialized from
2929        /// the string representation of enums.
2930        pub fn value(&self) -> std::option::Option<i32> {
2931            match self {
2932                Self::Unspecified => std::option::Option::Some(0),
2933                Self::GoogleManagedInternalCa => std::option::Option::Some(1),
2934                Self::GoogleManagedCasCa => std::option::Option::Some(2),
2935                Self::CustomerManagedCasCa => std::option::Option::Some(3),
2936                Self::UnknownValue(u) => u.0.value(),
2937            }
2938        }
2939
2940        /// Gets the enum value as a string.
2941        ///
2942        /// Returns `None` if the enum contains an unknown value deserialized from
2943        /// the integer representation of enums.
2944        pub fn name(&self) -> std::option::Option<&str> {
2945            match self {
2946                Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
2947                Self::GoogleManagedInternalCa => {
2948                    std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
2949                }
2950                Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
2951                Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
2952                Self::UnknownValue(u) => u.0.name(),
2953            }
2954        }
2955    }
2956
2957    impl std::default::Default for CaMode {
2958        fn default() -> Self {
2959            use std::convert::From;
2960            Self::from(0)
2961        }
2962    }
2963
2964    impl std::fmt::Display for CaMode {
2965        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2966            wkt::internal::display_enum(f, self.name(), self.value())
2967        }
2968    }
2969
2970    impl std::convert::From<i32> for CaMode {
2971        fn from(value: i32) -> Self {
2972            match value {
2973                0 => Self::Unspecified,
2974                1 => Self::GoogleManagedInternalCa,
2975                2 => Self::GoogleManagedCasCa,
2976                3 => Self::CustomerManagedCasCa,
2977                _ => Self::UnknownValue(ca_mode::UnknownValue(
2978                    wkt::internal::UnknownEnumValue::Integer(value),
2979                )),
2980            }
2981        }
2982    }
2983
2984    impl std::convert::From<&str> for CaMode {
2985        fn from(value: &str) -> Self {
2986            use std::string::ToString;
2987            match value {
2988                "CA_MODE_UNSPECIFIED" => Self::Unspecified,
2989                "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
2990                "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
2991                "CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
2992                _ => Self::UnknownValue(ca_mode::UnknownValue(
2993                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2994                )),
2995            }
2996        }
2997    }
2998
2999    impl serde::ser::Serialize for CaMode {
3000        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3001        where
3002            S: serde::Serializer,
3003        {
3004            match self {
3005                Self::Unspecified => serializer.serialize_i32(0),
3006                Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
3007                Self::GoogleManagedCasCa => serializer.serialize_i32(2),
3008                Self::CustomerManagedCasCa => serializer.serialize_i32(3),
3009                Self::UnknownValue(u) => u.0.serialize(serializer),
3010            }
3011        }
3012    }
3013
3014    impl<'de> serde::de::Deserialize<'de> for CaMode {
3015        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3016        where
3017            D: serde::Deserializer<'de>,
3018        {
3019            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
3020                ".google.cloud.sql.v1.ConnectSettings.CaMode",
3021            ))
3022        }
3023    }
3024
3025    /// MdxProtocolSupport describes parts of the MDX protocol supported by this
3026    /// instance.
3027    ///
3028    /// # Working with unknown values
3029    ///
3030    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3031    /// additional enum variants at any time. Adding new variants is not considered
3032    /// a breaking change. Applications should write their code in anticipation of:
3033    ///
3034    /// - New values appearing in future releases of the client library, **and**
3035    /// - New values received dynamically, without application changes.
3036    ///
3037    /// Please consult the [Working with enums] section in the user guide for some
3038    /// guidelines.
3039    ///
3040    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3041    #[derive(Clone, Debug, PartialEq)]
3042    #[non_exhaustive]
3043    pub enum MdxProtocolSupport {
3044        /// Not specified.
3045        Unspecified,
3046        /// Client should send the client protocol type in the MDX request.
3047        ClientProtocolType,
3048        /// If set, the enum was initialized with an unknown value.
3049        ///
3050        /// Applications can examine the value using [MdxProtocolSupport::value] or
3051        /// [MdxProtocolSupport::name].
3052        UnknownValue(mdx_protocol_support::UnknownValue),
3053    }
3054
3055    #[doc(hidden)]
3056    pub mod mdx_protocol_support {
3057        #[allow(unused_imports)]
3058        use super::*;
3059        #[derive(Clone, Debug, PartialEq)]
3060        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3061    }
3062
3063    impl MdxProtocolSupport {
3064        /// Gets the enum value.
3065        ///
3066        /// Returns `None` if the enum contains an unknown value deserialized from
3067        /// the string representation of enums.
3068        pub fn value(&self) -> std::option::Option<i32> {
3069            match self {
3070                Self::Unspecified => std::option::Option::Some(0),
3071                Self::ClientProtocolType => std::option::Option::Some(1),
3072                Self::UnknownValue(u) => u.0.value(),
3073            }
3074        }
3075
3076        /// Gets the enum value as a string.
3077        ///
3078        /// Returns `None` if the enum contains an unknown value deserialized from
3079        /// the integer representation of enums.
3080        pub fn name(&self) -> std::option::Option<&str> {
3081            match self {
3082                Self::Unspecified => std::option::Option::Some("MDX_PROTOCOL_SUPPORT_UNSPECIFIED"),
3083                Self::ClientProtocolType => std::option::Option::Some("CLIENT_PROTOCOL_TYPE"),
3084                Self::UnknownValue(u) => u.0.name(),
3085            }
3086        }
3087    }
3088
3089    impl std::default::Default for MdxProtocolSupport {
3090        fn default() -> Self {
3091            use std::convert::From;
3092            Self::from(0)
3093        }
3094    }
3095
3096    impl std::fmt::Display for MdxProtocolSupport {
3097        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3098            wkt::internal::display_enum(f, self.name(), self.value())
3099        }
3100    }
3101
3102    impl std::convert::From<i32> for MdxProtocolSupport {
3103        fn from(value: i32) -> Self {
3104            match value {
3105                0 => Self::Unspecified,
3106                1 => Self::ClientProtocolType,
3107                _ => Self::UnknownValue(mdx_protocol_support::UnknownValue(
3108                    wkt::internal::UnknownEnumValue::Integer(value),
3109                )),
3110            }
3111        }
3112    }
3113
3114    impl std::convert::From<&str> for MdxProtocolSupport {
3115        fn from(value: &str) -> Self {
3116            use std::string::ToString;
3117            match value {
3118                "MDX_PROTOCOL_SUPPORT_UNSPECIFIED" => Self::Unspecified,
3119                "CLIENT_PROTOCOL_TYPE" => Self::ClientProtocolType,
3120                _ => Self::UnknownValue(mdx_protocol_support::UnknownValue(
3121                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3122                )),
3123            }
3124        }
3125    }
3126
3127    impl serde::ser::Serialize for MdxProtocolSupport {
3128        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3129        where
3130            S: serde::Serializer,
3131        {
3132            match self {
3133                Self::Unspecified => serializer.serialize_i32(0),
3134                Self::ClientProtocolType => serializer.serialize_i32(1),
3135                Self::UnknownValue(u) => u.0.serialize(serializer),
3136            }
3137        }
3138    }
3139
3140    impl<'de> serde::de::Deserialize<'de> for MdxProtocolSupport {
3141        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3142        where
3143            D: serde::Deserializer<'de>,
3144        {
3145            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MdxProtocolSupport>::new(
3146                ".google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport",
3147            ))
3148        }
3149    }
3150}
3151
3152/// Ephemeral certificate creation request.
3153#[derive(Clone, Default, PartialEq)]
3154#[non_exhaustive]
3155pub struct GenerateEphemeralCertRequest {
3156    /// Cloud SQL instance ID. This does not include the project ID.
3157    pub instance: std::string::String,
3158
3159    /// Project ID of the project that contains the instance.
3160    pub project: std::string::String,
3161
3162    /// PEM encoded public key to include in the signed certificate.
3163    pub public_key: std::string::String,
3164
3165    /// Optional. Access token to include in the signed certificate.
3166    pub access_token: std::string::String,
3167
3168    /// Optional. Optional snapshot read timestamp to trade freshness for
3169    /// performance.
3170    pub read_time: std::option::Option<wkt::Timestamp>,
3171
3172    /// Optional. If set, it will contain the cert valid duration.
3173    pub valid_duration: std::option::Option<wkt::Duration>,
3174
3175    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3176}
3177
3178impl GenerateEphemeralCertRequest {
3179    /// Creates a new default instance.
3180    pub fn new() -> Self {
3181        std::default::Default::default()
3182    }
3183
3184    /// Sets the value of [instance][crate::model::GenerateEphemeralCertRequest::instance].
3185    ///
3186    /// # Example
3187    /// ```ignore,no_run
3188    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3189    /// let x = GenerateEphemeralCertRequest::new().set_instance("example");
3190    /// ```
3191    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3192        self.instance = v.into();
3193        self
3194    }
3195
3196    /// Sets the value of [project][crate::model::GenerateEphemeralCertRequest::project].
3197    ///
3198    /// # Example
3199    /// ```ignore,no_run
3200    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3201    /// let x = GenerateEphemeralCertRequest::new().set_project("example");
3202    /// ```
3203    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3204        self.project = v.into();
3205        self
3206    }
3207
3208    /// Sets the value of [public_key][crate::model::GenerateEphemeralCertRequest::public_key].
3209    ///
3210    /// # Example
3211    /// ```ignore,no_run
3212    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3213    /// let x = GenerateEphemeralCertRequest::new().set_public_key("example");
3214    /// ```
3215    pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3216        self.public_key = v.into();
3217        self
3218    }
3219
3220    /// Sets the value of [access_token][crate::model::GenerateEphemeralCertRequest::access_token].
3221    ///
3222    /// # Example
3223    /// ```ignore,no_run
3224    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3225    /// let x = GenerateEphemeralCertRequest::new().set_access_token("example");
3226    /// ```
3227    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3228        self.access_token = v.into();
3229        self
3230    }
3231
3232    /// Sets the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
3233    ///
3234    /// # Example
3235    /// ```ignore,no_run
3236    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3237    /// use wkt::Timestamp;
3238    /// let x = GenerateEphemeralCertRequest::new().set_read_time(Timestamp::default()/* use setters */);
3239    /// ```
3240    pub fn set_read_time<T>(mut self, v: T) -> Self
3241    where
3242        T: std::convert::Into<wkt::Timestamp>,
3243    {
3244        self.read_time = std::option::Option::Some(v.into());
3245        self
3246    }
3247
3248    /// Sets or clears the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
3249    ///
3250    /// # Example
3251    /// ```ignore,no_run
3252    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3253    /// use wkt::Timestamp;
3254    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_read_time(Some(Timestamp::default()/* use setters */));
3255    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_read_time(None::<Timestamp>);
3256    /// ```
3257    pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
3258    where
3259        T: std::convert::Into<wkt::Timestamp>,
3260    {
3261        self.read_time = v.map(|x| x.into());
3262        self
3263    }
3264
3265    /// Sets the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
3266    ///
3267    /// # Example
3268    /// ```ignore,no_run
3269    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3270    /// use wkt::Duration;
3271    /// let x = GenerateEphemeralCertRequest::new().set_valid_duration(Duration::default()/* use setters */);
3272    /// ```
3273    pub fn set_valid_duration<T>(mut self, v: T) -> Self
3274    where
3275        T: std::convert::Into<wkt::Duration>,
3276    {
3277        self.valid_duration = std::option::Option::Some(v.into());
3278        self
3279    }
3280
3281    /// Sets or clears the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
3282    ///
3283    /// # Example
3284    /// ```ignore,no_run
3285    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3286    /// use wkt::Duration;
3287    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_valid_duration(Some(Duration::default()/* use setters */));
3288    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_valid_duration(None::<Duration>);
3289    /// ```
3290    pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
3291    where
3292        T: std::convert::Into<wkt::Duration>,
3293    {
3294        self.valid_duration = v.map(|x| x.into());
3295        self
3296    }
3297}
3298
3299impl wkt::message::Message for GenerateEphemeralCertRequest {
3300    fn typename() -> &'static str {
3301        "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertRequest"
3302    }
3303}
3304
3305/// Ephemeral certificate creation request.
3306#[derive(Clone, Default, PartialEq)]
3307#[non_exhaustive]
3308pub struct GenerateEphemeralCertResponse {
3309    /// Generated cert
3310    pub ephemeral_cert: std::option::Option<crate::model::SslCert>,
3311
3312    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3313}
3314
3315impl GenerateEphemeralCertResponse {
3316    /// Creates a new default instance.
3317    pub fn new() -> Self {
3318        std::default::Default::default()
3319    }
3320
3321    /// Sets the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
3322    ///
3323    /// # Example
3324    /// ```ignore,no_run
3325    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertResponse;
3326    /// use google_cloud_sql_v1::model::SslCert;
3327    /// let x = GenerateEphemeralCertResponse::new().set_ephemeral_cert(SslCert::default()/* use setters */);
3328    /// ```
3329    pub fn set_ephemeral_cert<T>(mut self, v: T) -> Self
3330    where
3331        T: std::convert::Into<crate::model::SslCert>,
3332    {
3333        self.ephemeral_cert = std::option::Option::Some(v.into());
3334        self
3335    }
3336
3337    /// Sets or clears the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
3338    ///
3339    /// # Example
3340    /// ```ignore,no_run
3341    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertResponse;
3342    /// use google_cloud_sql_v1::model::SslCert;
3343    /// let x = GenerateEphemeralCertResponse::new().set_or_clear_ephemeral_cert(Some(SslCert::default()/* use setters */));
3344    /// let x = GenerateEphemeralCertResponse::new().set_or_clear_ephemeral_cert(None::<SslCert>);
3345    /// ```
3346    pub fn set_or_clear_ephemeral_cert<T>(mut self, v: std::option::Option<T>) -> Self
3347    where
3348        T: std::convert::Into<crate::model::SslCert>,
3349    {
3350        self.ephemeral_cert = v.map(|x| x.into());
3351        self
3352    }
3353}
3354
3355impl wkt::message::Message for GenerateEphemeralCertResponse {
3356    fn typename() -> &'static str {
3357        "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertResponse"
3358    }
3359}
3360
3361/// Database delete request.
3362#[derive(Clone, Default, PartialEq)]
3363#[non_exhaustive]
3364pub struct SqlDatabasesDeleteRequest {
3365    /// Name of the database to be deleted in the instance.
3366    pub database: std::string::String,
3367
3368    /// Database instance ID. This does not include the project ID.
3369    pub instance: std::string::String,
3370
3371    /// Project ID of the project that contains the instance.
3372    pub project: std::string::String,
3373
3374    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3375}
3376
3377impl SqlDatabasesDeleteRequest {
3378    /// Creates a new default instance.
3379    pub fn new() -> Self {
3380        std::default::Default::default()
3381    }
3382
3383    /// Sets the value of [database][crate::model::SqlDatabasesDeleteRequest::database].
3384    ///
3385    /// # Example
3386    /// ```ignore,no_run
3387    /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3388    /// let x = SqlDatabasesDeleteRequest::new().set_database("example");
3389    /// ```
3390    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3391        self.database = v.into();
3392        self
3393    }
3394
3395    /// Sets the value of [instance][crate::model::SqlDatabasesDeleteRequest::instance].
3396    ///
3397    /// # Example
3398    /// ```ignore,no_run
3399    /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3400    /// let x = SqlDatabasesDeleteRequest::new().set_instance("example");
3401    /// ```
3402    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3403        self.instance = v.into();
3404        self
3405    }
3406
3407    /// Sets the value of [project][crate::model::SqlDatabasesDeleteRequest::project].
3408    ///
3409    /// # Example
3410    /// ```ignore,no_run
3411    /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3412    /// let x = SqlDatabasesDeleteRequest::new().set_project("example");
3413    /// ```
3414    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3415        self.project = v.into();
3416        self
3417    }
3418}
3419
3420impl wkt::message::Message for SqlDatabasesDeleteRequest {
3421    fn typename() -> &'static str {
3422        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesDeleteRequest"
3423    }
3424}
3425
3426/// Database get request.
3427#[derive(Clone, Default, PartialEq)]
3428#[non_exhaustive]
3429pub struct SqlDatabasesGetRequest {
3430    /// Name of the database in the instance.
3431    pub database: std::string::String,
3432
3433    /// Database instance ID. This does not include the project ID.
3434    pub instance: std::string::String,
3435
3436    /// Project ID of the project that contains the instance.
3437    pub project: std::string::String,
3438
3439    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3440}
3441
3442impl SqlDatabasesGetRequest {
3443    /// Creates a new default instance.
3444    pub fn new() -> Self {
3445        std::default::Default::default()
3446    }
3447
3448    /// Sets the value of [database][crate::model::SqlDatabasesGetRequest::database].
3449    ///
3450    /// # Example
3451    /// ```ignore,no_run
3452    /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3453    /// let x = SqlDatabasesGetRequest::new().set_database("example");
3454    /// ```
3455    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3456        self.database = v.into();
3457        self
3458    }
3459
3460    /// Sets the value of [instance][crate::model::SqlDatabasesGetRequest::instance].
3461    ///
3462    /// # Example
3463    /// ```ignore,no_run
3464    /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3465    /// let x = SqlDatabasesGetRequest::new().set_instance("example");
3466    /// ```
3467    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3468        self.instance = v.into();
3469        self
3470    }
3471
3472    /// Sets the value of [project][crate::model::SqlDatabasesGetRequest::project].
3473    ///
3474    /// # Example
3475    /// ```ignore,no_run
3476    /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3477    /// let x = SqlDatabasesGetRequest::new().set_project("example");
3478    /// ```
3479    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3480        self.project = v.into();
3481        self
3482    }
3483}
3484
3485impl wkt::message::Message for SqlDatabasesGetRequest {
3486    fn typename() -> &'static str {
3487        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesGetRequest"
3488    }
3489}
3490
3491/// Database insert request.
3492#[derive(Clone, Default, PartialEq)]
3493#[non_exhaustive]
3494pub struct SqlDatabasesInsertRequest {
3495    /// Database instance ID. This does not include the project ID.
3496    pub instance: std::string::String,
3497
3498    /// Project ID of the project that contains the instance.
3499    pub project: std::string::String,
3500
3501    #[allow(missing_docs)]
3502    pub body: std::option::Option<crate::model::Database>,
3503
3504    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3505}
3506
3507impl SqlDatabasesInsertRequest {
3508    /// Creates a new default instance.
3509    pub fn new() -> Self {
3510        std::default::Default::default()
3511    }
3512
3513    /// Sets the value of [instance][crate::model::SqlDatabasesInsertRequest::instance].
3514    ///
3515    /// # Example
3516    /// ```ignore,no_run
3517    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3518    /// let x = SqlDatabasesInsertRequest::new().set_instance("example");
3519    /// ```
3520    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3521        self.instance = v.into();
3522        self
3523    }
3524
3525    /// Sets the value of [project][crate::model::SqlDatabasesInsertRequest::project].
3526    ///
3527    /// # Example
3528    /// ```ignore,no_run
3529    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3530    /// let x = SqlDatabasesInsertRequest::new().set_project("example");
3531    /// ```
3532    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3533        self.project = v.into();
3534        self
3535    }
3536
3537    /// Sets the value of [body][crate::model::SqlDatabasesInsertRequest::body].
3538    ///
3539    /// # Example
3540    /// ```ignore,no_run
3541    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3542    /// use google_cloud_sql_v1::model::Database;
3543    /// let x = SqlDatabasesInsertRequest::new().set_body(Database::default()/* use setters */);
3544    /// ```
3545    pub fn set_body<T>(mut self, v: T) -> Self
3546    where
3547        T: std::convert::Into<crate::model::Database>,
3548    {
3549        self.body = std::option::Option::Some(v.into());
3550        self
3551    }
3552
3553    /// Sets or clears the value of [body][crate::model::SqlDatabasesInsertRequest::body].
3554    ///
3555    /// # Example
3556    /// ```ignore,no_run
3557    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3558    /// use google_cloud_sql_v1::model::Database;
3559    /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
3560    /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(None::<Database>);
3561    /// ```
3562    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3563    where
3564        T: std::convert::Into<crate::model::Database>,
3565    {
3566        self.body = v.map(|x| x.into());
3567        self
3568    }
3569}
3570
3571impl wkt::message::Message for SqlDatabasesInsertRequest {
3572    fn typename() -> &'static str {
3573        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesInsertRequest"
3574    }
3575}
3576
3577/// Database list request.
3578#[derive(Clone, Default, PartialEq)]
3579#[non_exhaustive]
3580pub struct SqlDatabasesListRequest {
3581    /// Cloud SQL instance ID. This does not include the project ID.
3582    pub instance: std::string::String,
3583
3584    /// Project ID of the project that contains the instance.
3585    pub project: std::string::String,
3586
3587    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3588}
3589
3590impl SqlDatabasesListRequest {
3591    /// Creates a new default instance.
3592    pub fn new() -> Self {
3593        std::default::Default::default()
3594    }
3595
3596    /// Sets the value of [instance][crate::model::SqlDatabasesListRequest::instance].
3597    ///
3598    /// # Example
3599    /// ```ignore,no_run
3600    /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
3601    /// let x = SqlDatabasesListRequest::new().set_instance("example");
3602    /// ```
3603    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3604        self.instance = v.into();
3605        self
3606    }
3607
3608    /// Sets the value of [project][crate::model::SqlDatabasesListRequest::project].
3609    ///
3610    /// # Example
3611    /// ```ignore,no_run
3612    /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
3613    /// let x = SqlDatabasesListRequest::new().set_project("example");
3614    /// ```
3615    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3616        self.project = v.into();
3617        self
3618    }
3619}
3620
3621impl wkt::message::Message for SqlDatabasesListRequest {
3622    fn typename() -> &'static str {
3623        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesListRequest"
3624    }
3625}
3626
3627/// Database update request.
3628#[derive(Clone, Default, PartialEq)]
3629#[non_exhaustive]
3630pub struct SqlDatabasesUpdateRequest {
3631    /// Name of the database to be updated in the instance.
3632    pub database: std::string::String,
3633
3634    /// Database instance ID. This does not include the project ID.
3635    pub instance: std::string::String,
3636
3637    /// Project ID of the project that contains the instance.
3638    pub project: std::string::String,
3639
3640    #[allow(missing_docs)]
3641    pub body: std::option::Option<crate::model::Database>,
3642
3643    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3644}
3645
3646impl SqlDatabasesUpdateRequest {
3647    /// Creates a new default instance.
3648    pub fn new() -> Self {
3649        std::default::Default::default()
3650    }
3651
3652    /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
3653    ///
3654    /// # Example
3655    /// ```ignore,no_run
3656    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3657    /// let x = SqlDatabasesUpdateRequest::new().set_database("example");
3658    /// ```
3659    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3660        self.database = v.into();
3661        self
3662    }
3663
3664    /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
3665    ///
3666    /// # Example
3667    /// ```ignore,no_run
3668    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3669    /// let x = SqlDatabasesUpdateRequest::new().set_instance("example");
3670    /// ```
3671    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3672        self.instance = v.into();
3673        self
3674    }
3675
3676    /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
3677    ///
3678    /// # Example
3679    /// ```ignore,no_run
3680    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3681    /// let x = SqlDatabasesUpdateRequest::new().set_project("example");
3682    /// ```
3683    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3684        self.project = v.into();
3685        self
3686    }
3687
3688    /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
3689    ///
3690    /// # Example
3691    /// ```ignore,no_run
3692    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3693    /// use google_cloud_sql_v1::model::Database;
3694    /// let x = SqlDatabasesUpdateRequest::new().set_body(Database::default()/* use setters */);
3695    /// ```
3696    pub fn set_body<T>(mut self, v: T) -> Self
3697    where
3698        T: std::convert::Into<crate::model::Database>,
3699    {
3700        self.body = std::option::Option::Some(v.into());
3701        self
3702    }
3703
3704    /// Sets or clears the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
3705    ///
3706    /// # Example
3707    /// ```ignore,no_run
3708    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3709    /// use google_cloud_sql_v1::model::Database;
3710    /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
3711    /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(None::<Database>);
3712    /// ```
3713    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3714    where
3715        T: std::convert::Into<crate::model::Database>,
3716    {
3717        self.body = v.map(|x| x.into());
3718        self
3719    }
3720}
3721
3722impl wkt::message::Message for SqlDatabasesUpdateRequest {
3723    fn typename() -> &'static str {
3724        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesUpdateRequest"
3725    }
3726}
3727
3728/// Database list response.
3729#[derive(Clone, Default, PartialEq)]
3730#[non_exhaustive]
3731pub struct DatabasesListResponse {
3732    /// This is always `sql#databasesList`.
3733    pub kind: std::string::String,
3734
3735    /// List of database resources in the instance.
3736    pub items: std::vec::Vec<crate::model::Database>,
3737
3738    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3739}
3740
3741impl DatabasesListResponse {
3742    /// Creates a new default instance.
3743    pub fn new() -> Self {
3744        std::default::Default::default()
3745    }
3746
3747    /// Sets the value of [kind][crate::model::DatabasesListResponse::kind].
3748    ///
3749    /// # Example
3750    /// ```ignore,no_run
3751    /// # use google_cloud_sql_v1::model::DatabasesListResponse;
3752    /// let x = DatabasesListResponse::new().set_kind("example");
3753    /// ```
3754    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3755        self.kind = v.into();
3756        self
3757    }
3758
3759    /// Sets the value of [items][crate::model::DatabasesListResponse::items].
3760    ///
3761    /// # Example
3762    /// ```ignore,no_run
3763    /// # use google_cloud_sql_v1::model::DatabasesListResponse;
3764    /// use google_cloud_sql_v1::model::Database;
3765    /// let x = DatabasesListResponse::new()
3766    ///     .set_items([
3767    ///         Database::default()/* use setters */,
3768    ///         Database::default()/* use (different) setters */,
3769    ///     ]);
3770    /// ```
3771    pub fn set_items<T, V>(mut self, v: T) -> Self
3772    where
3773        T: std::iter::IntoIterator<Item = V>,
3774        V: std::convert::Into<crate::model::Database>,
3775    {
3776        use std::iter::Iterator;
3777        self.items = v.into_iter().map(|i| i.into()).collect();
3778        self
3779    }
3780}
3781
3782impl wkt::message::Message for DatabasesListResponse {
3783    fn typename() -> &'static str {
3784        "type.googleapis.com/google.cloud.sql.v1.DatabasesListResponse"
3785    }
3786}
3787
3788/// Flags list request.
3789#[derive(Clone, Default, PartialEq)]
3790#[non_exhaustive]
3791pub struct SqlFlagsListRequest {
3792    /// Database type and version you want to retrieve flags for. By default, this
3793    /// method returns flags for all database types and versions.
3794    pub database_version: std::string::String,
3795
3796    /// Optional. Specify the scope of flags to be returned by SqlFlagsListService.
3797    /// Return list of database flags if unspecified.
3798    pub flag_scope: std::option::Option<crate::model::SqlFlagScope>,
3799
3800    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3801}
3802
3803impl SqlFlagsListRequest {
3804    /// Creates a new default instance.
3805    pub fn new() -> Self {
3806        std::default::Default::default()
3807    }
3808
3809    /// Sets the value of [database_version][crate::model::SqlFlagsListRequest::database_version].
3810    ///
3811    /// # Example
3812    /// ```ignore,no_run
3813    /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3814    /// let x = SqlFlagsListRequest::new().set_database_version("example");
3815    /// ```
3816    pub fn set_database_version<T: std::convert::Into<std::string::String>>(
3817        mut self,
3818        v: T,
3819    ) -> Self {
3820        self.database_version = v.into();
3821        self
3822    }
3823
3824    /// Sets the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
3825    ///
3826    /// # Example
3827    /// ```ignore,no_run
3828    /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3829    /// use google_cloud_sql_v1::model::SqlFlagScope;
3830    /// let x0 = SqlFlagsListRequest::new().set_flag_scope(SqlFlagScope::Database);
3831    /// let x1 = SqlFlagsListRequest::new().set_flag_scope(SqlFlagScope::ConnectionPool);
3832    /// ```
3833    pub fn set_flag_scope<T>(mut self, v: T) -> Self
3834    where
3835        T: std::convert::Into<crate::model::SqlFlagScope>,
3836    {
3837        self.flag_scope = std::option::Option::Some(v.into());
3838        self
3839    }
3840
3841    /// Sets or clears the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
3842    ///
3843    /// # Example
3844    /// ```ignore,no_run
3845    /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3846    /// use google_cloud_sql_v1::model::SqlFlagScope;
3847    /// let x0 = SqlFlagsListRequest::new().set_or_clear_flag_scope(Some(SqlFlagScope::Database));
3848    /// let x1 = SqlFlagsListRequest::new().set_or_clear_flag_scope(Some(SqlFlagScope::ConnectionPool));
3849    /// let x_none = SqlFlagsListRequest::new().set_or_clear_flag_scope(None::<SqlFlagScope>);
3850    /// ```
3851    pub fn set_or_clear_flag_scope<T>(mut self, v: std::option::Option<T>) -> Self
3852    where
3853        T: std::convert::Into<crate::model::SqlFlagScope>,
3854    {
3855        self.flag_scope = v.map(|x| x.into());
3856        self
3857    }
3858}
3859
3860impl wkt::message::Message for SqlFlagsListRequest {
3861    fn typename() -> &'static str {
3862        "type.googleapis.com/google.cloud.sql.v1.SqlFlagsListRequest"
3863    }
3864}
3865
3866/// Flags list response.
3867#[derive(Clone, Default, PartialEq)]
3868#[non_exhaustive]
3869pub struct FlagsListResponse {
3870    /// This is always `sql#flagsList`.
3871    pub kind: std::string::String,
3872
3873    /// List of flags.
3874    pub items: std::vec::Vec<crate::model::Flag>,
3875
3876    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3877}
3878
3879impl FlagsListResponse {
3880    /// Creates a new default instance.
3881    pub fn new() -> Self {
3882        std::default::Default::default()
3883    }
3884
3885    /// Sets the value of [kind][crate::model::FlagsListResponse::kind].
3886    ///
3887    /// # Example
3888    /// ```ignore,no_run
3889    /// # use google_cloud_sql_v1::model::FlagsListResponse;
3890    /// let x = FlagsListResponse::new().set_kind("example");
3891    /// ```
3892    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3893        self.kind = v.into();
3894        self
3895    }
3896
3897    /// Sets the value of [items][crate::model::FlagsListResponse::items].
3898    ///
3899    /// # Example
3900    /// ```ignore,no_run
3901    /// # use google_cloud_sql_v1::model::FlagsListResponse;
3902    /// use google_cloud_sql_v1::model::Flag;
3903    /// let x = FlagsListResponse::new()
3904    ///     .set_items([
3905    ///         Flag::default()/* use setters */,
3906    ///         Flag::default()/* use (different) setters */,
3907    ///     ]);
3908    /// ```
3909    pub fn set_items<T, V>(mut self, v: T) -> Self
3910    where
3911        T: std::iter::IntoIterator<Item = V>,
3912        V: std::convert::Into<crate::model::Flag>,
3913    {
3914        use std::iter::Iterator;
3915        self.items = v.into_iter().map(|i| i.into()).collect();
3916        self
3917    }
3918}
3919
3920impl wkt::message::Message for FlagsListResponse {
3921    fn typename() -> &'static str {
3922        "type.googleapis.com/google.cloud.sql.v1.FlagsListResponse"
3923    }
3924}
3925
3926/// A flag resource.
3927#[derive(Clone, Default, PartialEq)]
3928#[non_exhaustive]
3929pub struct Flag {
3930    /// This is the name of the flag. Flag names always use underscores, not
3931    /// hyphens, for example: `max_allowed_packet`
3932    pub name: std::string::String,
3933
3934    /// The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
3935    /// `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
3936    /// value, such as `skip_grant_tables`.
3937    pub r#type: crate::model::SqlFlagType,
3938
3939    /// The database version this flag applies to. Can be
3940    /// MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
3941    /// or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
3942    /// `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
3943    /// `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
3944    /// `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
3945    /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
3946    /// `SQLSERVER_2019_WEB`.
3947    /// See [the complete
3948    /// list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
3949    pub applies_to: std::vec::Vec<crate::model::SqlDatabaseVersion>,
3950
3951    /// For `STRING` flags, a list of strings that the value can be set to.
3952    pub allowed_string_values: std::vec::Vec<std::string::String>,
3953
3954    /// For `INTEGER` flags, the minimum allowed value.
3955    pub min_value: std::option::Option<wkt::Int64Value>,
3956
3957    /// For `INTEGER` flags, the maximum allowed value.
3958    pub max_value: std::option::Option<wkt::Int64Value>,
3959
3960    /// Indicates whether changing this flag will trigger a database restart. Only
3961    /// applicable to Second Generation instances.
3962    pub requires_restart: std::option::Option<wkt::BoolValue>,
3963
3964    /// This is always `sql#flag`.
3965    pub kind: std::string::String,
3966
3967    /// Whether or not the flag is considered in beta.
3968    pub in_beta: std::option::Option<wkt::BoolValue>,
3969
3970    /// Use this field if only certain integers are accepted. Can be combined
3971    /// with min_value and max_value to add additional values.
3972    pub allowed_int_values: std::vec::Vec<i64>,
3973
3974    /// Scope of flag.
3975    pub flag_scope: crate::model::SqlFlagScope,
3976
3977    /// Recommended flag value for UI display.
3978    pub recommended_value: std::option::Option<crate::model::flag::RecommendedValue>,
3979
3980    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3981}
3982
3983impl Flag {
3984    /// Creates a new default instance.
3985    pub fn new() -> Self {
3986        std::default::Default::default()
3987    }
3988
3989    /// Sets the value of [name][crate::model::Flag::name].
3990    ///
3991    /// # Example
3992    /// ```ignore,no_run
3993    /// # use google_cloud_sql_v1::model::Flag;
3994    /// let x = Flag::new().set_name("example");
3995    /// ```
3996    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3997        self.name = v.into();
3998        self
3999    }
4000
4001    /// Sets the value of [r#type][crate::model::Flag::type].
4002    ///
4003    /// # Example
4004    /// ```ignore,no_run
4005    /// # use google_cloud_sql_v1::model::Flag;
4006    /// use google_cloud_sql_v1::model::SqlFlagType;
4007    /// let x0 = Flag::new().set_type(SqlFlagType::Boolean);
4008    /// let x1 = Flag::new().set_type(SqlFlagType::String);
4009    /// let x2 = Flag::new().set_type(SqlFlagType::Integer);
4010    /// ```
4011    pub fn set_type<T: std::convert::Into<crate::model::SqlFlagType>>(mut self, v: T) -> Self {
4012        self.r#type = v.into();
4013        self
4014    }
4015
4016    /// Sets the value of [applies_to][crate::model::Flag::applies_to].
4017    ///
4018    /// # Example
4019    /// ```ignore,no_run
4020    /// # use google_cloud_sql_v1::model::Flag;
4021    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
4022    /// let x = Flag::new().set_applies_to([
4023    ///     SqlDatabaseVersion::Mysql56,
4024    ///     SqlDatabaseVersion::Mysql57,
4025    ///     SqlDatabaseVersion::Mysql80,
4026    /// ]);
4027    /// ```
4028    pub fn set_applies_to<T, V>(mut self, v: T) -> Self
4029    where
4030        T: std::iter::IntoIterator<Item = V>,
4031        V: std::convert::Into<crate::model::SqlDatabaseVersion>,
4032    {
4033        use std::iter::Iterator;
4034        self.applies_to = v.into_iter().map(|i| i.into()).collect();
4035        self
4036    }
4037
4038    /// Sets the value of [allowed_string_values][crate::model::Flag::allowed_string_values].
4039    ///
4040    /// # Example
4041    /// ```ignore,no_run
4042    /// # use google_cloud_sql_v1::model::Flag;
4043    /// let x = Flag::new().set_allowed_string_values(["a", "b", "c"]);
4044    /// ```
4045    pub fn set_allowed_string_values<T, V>(mut self, v: T) -> Self
4046    where
4047        T: std::iter::IntoIterator<Item = V>,
4048        V: std::convert::Into<std::string::String>,
4049    {
4050        use std::iter::Iterator;
4051        self.allowed_string_values = v.into_iter().map(|i| i.into()).collect();
4052        self
4053    }
4054
4055    /// Sets the value of [min_value][crate::model::Flag::min_value].
4056    ///
4057    /// # Example
4058    /// ```ignore,no_run
4059    /// # use google_cloud_sql_v1::model::Flag;
4060    /// use wkt::Int64Value;
4061    /// let x = Flag::new().set_min_value(Int64Value::default()/* use setters */);
4062    /// ```
4063    pub fn set_min_value<T>(mut self, v: T) -> Self
4064    where
4065        T: std::convert::Into<wkt::Int64Value>,
4066    {
4067        self.min_value = std::option::Option::Some(v.into());
4068        self
4069    }
4070
4071    /// Sets or clears the value of [min_value][crate::model::Flag::min_value].
4072    ///
4073    /// # Example
4074    /// ```ignore,no_run
4075    /// # use google_cloud_sql_v1::model::Flag;
4076    /// use wkt::Int64Value;
4077    /// let x = Flag::new().set_or_clear_min_value(Some(Int64Value::default()/* use setters */));
4078    /// let x = Flag::new().set_or_clear_min_value(None::<Int64Value>);
4079    /// ```
4080    pub fn set_or_clear_min_value<T>(mut self, v: std::option::Option<T>) -> Self
4081    where
4082        T: std::convert::Into<wkt::Int64Value>,
4083    {
4084        self.min_value = v.map(|x| x.into());
4085        self
4086    }
4087
4088    /// Sets the value of [max_value][crate::model::Flag::max_value].
4089    ///
4090    /// # Example
4091    /// ```ignore,no_run
4092    /// # use google_cloud_sql_v1::model::Flag;
4093    /// use wkt::Int64Value;
4094    /// let x = Flag::new().set_max_value(Int64Value::default()/* use setters */);
4095    /// ```
4096    pub fn set_max_value<T>(mut self, v: T) -> Self
4097    where
4098        T: std::convert::Into<wkt::Int64Value>,
4099    {
4100        self.max_value = std::option::Option::Some(v.into());
4101        self
4102    }
4103
4104    /// Sets or clears the value of [max_value][crate::model::Flag::max_value].
4105    ///
4106    /// # Example
4107    /// ```ignore,no_run
4108    /// # use google_cloud_sql_v1::model::Flag;
4109    /// use wkt::Int64Value;
4110    /// let x = Flag::new().set_or_clear_max_value(Some(Int64Value::default()/* use setters */));
4111    /// let x = Flag::new().set_or_clear_max_value(None::<Int64Value>);
4112    /// ```
4113    pub fn set_or_clear_max_value<T>(mut self, v: std::option::Option<T>) -> Self
4114    where
4115        T: std::convert::Into<wkt::Int64Value>,
4116    {
4117        self.max_value = v.map(|x| x.into());
4118        self
4119    }
4120
4121    /// Sets the value of [requires_restart][crate::model::Flag::requires_restart].
4122    ///
4123    /// # Example
4124    /// ```ignore,no_run
4125    /// # use google_cloud_sql_v1::model::Flag;
4126    /// use wkt::BoolValue;
4127    /// let x = Flag::new().set_requires_restart(BoolValue::default()/* use setters */);
4128    /// ```
4129    pub fn set_requires_restart<T>(mut self, v: T) -> Self
4130    where
4131        T: std::convert::Into<wkt::BoolValue>,
4132    {
4133        self.requires_restart = std::option::Option::Some(v.into());
4134        self
4135    }
4136
4137    /// Sets or clears the value of [requires_restart][crate::model::Flag::requires_restart].
4138    ///
4139    /// # Example
4140    /// ```ignore,no_run
4141    /// # use google_cloud_sql_v1::model::Flag;
4142    /// use wkt::BoolValue;
4143    /// let x = Flag::new().set_or_clear_requires_restart(Some(BoolValue::default()/* use setters */));
4144    /// let x = Flag::new().set_or_clear_requires_restart(None::<BoolValue>);
4145    /// ```
4146    pub fn set_or_clear_requires_restart<T>(mut self, v: std::option::Option<T>) -> Self
4147    where
4148        T: std::convert::Into<wkt::BoolValue>,
4149    {
4150        self.requires_restart = v.map(|x| x.into());
4151        self
4152    }
4153
4154    /// Sets the value of [kind][crate::model::Flag::kind].
4155    ///
4156    /// # Example
4157    /// ```ignore,no_run
4158    /// # use google_cloud_sql_v1::model::Flag;
4159    /// let x = Flag::new().set_kind("example");
4160    /// ```
4161    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4162        self.kind = v.into();
4163        self
4164    }
4165
4166    /// Sets the value of [in_beta][crate::model::Flag::in_beta].
4167    ///
4168    /// # Example
4169    /// ```ignore,no_run
4170    /// # use google_cloud_sql_v1::model::Flag;
4171    /// use wkt::BoolValue;
4172    /// let x = Flag::new().set_in_beta(BoolValue::default()/* use setters */);
4173    /// ```
4174    pub fn set_in_beta<T>(mut self, v: T) -> Self
4175    where
4176        T: std::convert::Into<wkt::BoolValue>,
4177    {
4178        self.in_beta = std::option::Option::Some(v.into());
4179        self
4180    }
4181
4182    /// Sets or clears the value of [in_beta][crate::model::Flag::in_beta].
4183    ///
4184    /// # Example
4185    /// ```ignore,no_run
4186    /// # use google_cloud_sql_v1::model::Flag;
4187    /// use wkt::BoolValue;
4188    /// let x = Flag::new().set_or_clear_in_beta(Some(BoolValue::default()/* use setters */));
4189    /// let x = Flag::new().set_or_clear_in_beta(None::<BoolValue>);
4190    /// ```
4191    pub fn set_or_clear_in_beta<T>(mut self, v: std::option::Option<T>) -> Self
4192    where
4193        T: std::convert::Into<wkt::BoolValue>,
4194    {
4195        self.in_beta = v.map(|x| x.into());
4196        self
4197    }
4198
4199    /// Sets the value of [allowed_int_values][crate::model::Flag::allowed_int_values].
4200    ///
4201    /// # Example
4202    /// ```ignore,no_run
4203    /// # use google_cloud_sql_v1::model::Flag;
4204    /// let x = Flag::new().set_allowed_int_values([1, 2, 3]);
4205    /// ```
4206    pub fn set_allowed_int_values<T, V>(mut self, v: T) -> Self
4207    where
4208        T: std::iter::IntoIterator<Item = V>,
4209        V: std::convert::Into<i64>,
4210    {
4211        use std::iter::Iterator;
4212        self.allowed_int_values = v.into_iter().map(|i| i.into()).collect();
4213        self
4214    }
4215
4216    /// Sets the value of [flag_scope][crate::model::Flag::flag_scope].
4217    ///
4218    /// # Example
4219    /// ```ignore,no_run
4220    /// # use google_cloud_sql_v1::model::Flag;
4221    /// use google_cloud_sql_v1::model::SqlFlagScope;
4222    /// let x0 = Flag::new().set_flag_scope(SqlFlagScope::Database);
4223    /// let x1 = Flag::new().set_flag_scope(SqlFlagScope::ConnectionPool);
4224    /// ```
4225    pub fn set_flag_scope<T: std::convert::Into<crate::model::SqlFlagScope>>(
4226        mut self,
4227        v: T,
4228    ) -> Self {
4229        self.flag_scope = v.into();
4230        self
4231    }
4232
4233    /// Sets the value of [recommended_value][crate::model::Flag::recommended_value].
4234    ///
4235    /// Note that all the setters affecting `recommended_value` are mutually
4236    /// exclusive.
4237    ///
4238    /// # Example
4239    /// ```ignore,no_run
4240    /// # use google_cloud_sql_v1::model::Flag;
4241    /// use google_cloud_sql_v1::model::flag::RecommendedValue;
4242    /// let x = Flag::new().set_recommended_value(Some(RecommendedValue::RecommendedStringValue("example".to_string())));
4243    /// ```
4244    pub fn set_recommended_value<
4245        T: std::convert::Into<std::option::Option<crate::model::flag::RecommendedValue>>,
4246    >(
4247        mut self,
4248        v: T,
4249    ) -> Self {
4250        self.recommended_value = v.into();
4251        self
4252    }
4253
4254    /// The value of [recommended_value][crate::model::Flag::recommended_value]
4255    /// if it holds a `RecommendedStringValue`, `None` if the field is not set or
4256    /// holds a different branch.
4257    pub fn recommended_string_value(&self) -> std::option::Option<&std::string::String> {
4258        #[allow(unreachable_patterns)]
4259        self.recommended_value.as_ref().and_then(|v| match v {
4260            crate::model::flag::RecommendedValue::RecommendedStringValue(v) => {
4261                std::option::Option::Some(v)
4262            }
4263            _ => std::option::Option::None,
4264        })
4265    }
4266
4267    /// Sets the value of [recommended_value][crate::model::Flag::recommended_value]
4268    /// to hold a `RecommendedStringValue`.
4269    ///
4270    /// Note that all the setters affecting `recommended_value` are
4271    /// mutually exclusive.
4272    ///
4273    /// # Example
4274    /// ```ignore,no_run
4275    /// # use google_cloud_sql_v1::model::Flag;
4276    /// let x = Flag::new().set_recommended_string_value("example");
4277    /// assert!(x.recommended_string_value().is_some());
4278    /// assert!(x.recommended_int_value().is_none());
4279    /// ```
4280    pub fn set_recommended_string_value<T: std::convert::Into<std::string::String>>(
4281        mut self,
4282        v: T,
4283    ) -> Self {
4284        self.recommended_value = std::option::Option::Some(
4285            crate::model::flag::RecommendedValue::RecommendedStringValue(v.into()),
4286        );
4287        self
4288    }
4289
4290    /// The value of [recommended_value][crate::model::Flag::recommended_value]
4291    /// if it holds a `RecommendedIntValue`, `None` if the field is not set or
4292    /// holds a different branch.
4293    pub fn recommended_int_value(&self) -> std::option::Option<&std::boxed::Box<wkt::Int64Value>> {
4294        #[allow(unreachable_patterns)]
4295        self.recommended_value.as_ref().and_then(|v| match v {
4296            crate::model::flag::RecommendedValue::RecommendedIntValue(v) => {
4297                std::option::Option::Some(v)
4298            }
4299            _ => std::option::Option::None,
4300        })
4301    }
4302
4303    /// Sets the value of [recommended_value][crate::model::Flag::recommended_value]
4304    /// to hold a `RecommendedIntValue`.
4305    ///
4306    /// Note that all the setters affecting `recommended_value` are
4307    /// mutually exclusive.
4308    ///
4309    /// # Example
4310    /// ```ignore,no_run
4311    /// # use google_cloud_sql_v1::model::Flag;
4312    /// use wkt::Int64Value;
4313    /// let x = Flag::new().set_recommended_int_value(Int64Value::default()/* use setters */);
4314    /// assert!(x.recommended_int_value().is_some());
4315    /// assert!(x.recommended_string_value().is_none());
4316    /// ```
4317    pub fn set_recommended_int_value<T: std::convert::Into<std::boxed::Box<wkt::Int64Value>>>(
4318        mut self,
4319        v: T,
4320    ) -> Self {
4321        self.recommended_value = std::option::Option::Some(
4322            crate::model::flag::RecommendedValue::RecommendedIntValue(v.into()),
4323        );
4324        self
4325    }
4326}
4327
4328impl wkt::message::Message for Flag {
4329    fn typename() -> &'static str {
4330        "type.googleapis.com/google.cloud.sql.v1.Flag"
4331    }
4332}
4333
4334/// Defines additional types related to [Flag].
4335pub mod flag {
4336    #[allow(unused_imports)]
4337    use super::*;
4338
4339    /// Recommended flag value for UI display.
4340    #[derive(Clone, Debug, PartialEq)]
4341    #[non_exhaustive]
4342    pub enum RecommendedValue {
4343        /// Recommended string value in string format for UI display.
4344        RecommendedStringValue(std::string::String),
4345        /// Recommended int value in integer format for UI display.
4346        RecommendedIntValue(std::boxed::Box<wkt::Int64Value>),
4347    }
4348}
4349
4350/// Instance add server CA request.
4351#[derive(Clone, Default, PartialEq)]
4352#[non_exhaustive]
4353pub struct SqlInstancesAddServerCaRequest {
4354    /// Cloud SQL instance ID. This does not include the project ID.
4355    pub instance: std::string::String,
4356
4357    /// Project ID of the project that contains the instance.
4358    pub project: std::string::String,
4359
4360    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4361}
4362
4363impl SqlInstancesAddServerCaRequest {
4364    /// Creates a new default instance.
4365    pub fn new() -> Self {
4366        std::default::Default::default()
4367    }
4368
4369    /// Sets the value of [instance][crate::model::SqlInstancesAddServerCaRequest::instance].
4370    ///
4371    /// # Example
4372    /// ```ignore,no_run
4373    /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
4374    /// let x = SqlInstancesAddServerCaRequest::new().set_instance("example");
4375    /// ```
4376    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4377        self.instance = v.into();
4378        self
4379    }
4380
4381    /// Sets the value of [project][crate::model::SqlInstancesAddServerCaRequest::project].
4382    ///
4383    /// # Example
4384    /// ```ignore,no_run
4385    /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
4386    /// let x = SqlInstancesAddServerCaRequest::new().set_project("example");
4387    /// ```
4388    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4389        self.project = v.into();
4390        self
4391    }
4392}
4393
4394impl wkt::message::Message for SqlInstancesAddServerCaRequest {
4395    fn typename() -> &'static str {
4396        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCaRequest"
4397    }
4398}
4399
4400/// Instance add server certificate request.
4401#[derive(Clone, Default, PartialEq)]
4402#[non_exhaustive]
4403pub struct SqlInstancesAddServerCertificateRequest {
4404    /// Cloud SQL instance ID. This does not include the project ID.
4405    pub instance: std::string::String,
4406
4407    /// Project ID of the project that contains the instance.
4408    pub project: std::string::String,
4409
4410    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4411}
4412
4413impl SqlInstancesAddServerCertificateRequest {
4414    /// Creates a new default instance.
4415    pub fn new() -> Self {
4416        std::default::Default::default()
4417    }
4418
4419    /// Sets the value of [instance][crate::model::SqlInstancesAddServerCertificateRequest::instance].
4420    ///
4421    /// # Example
4422    /// ```ignore,no_run
4423    /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCertificateRequest;
4424    /// let x = SqlInstancesAddServerCertificateRequest::new().set_instance("example");
4425    /// ```
4426    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4427        self.instance = v.into();
4428        self
4429    }
4430
4431    /// Sets the value of [project][crate::model::SqlInstancesAddServerCertificateRequest::project].
4432    ///
4433    /// # Example
4434    /// ```ignore,no_run
4435    /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCertificateRequest;
4436    /// let x = SqlInstancesAddServerCertificateRequest::new().set_project("example");
4437    /// ```
4438    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4439        self.project = v.into();
4440        self
4441    }
4442}
4443
4444impl wkt::message::Message for SqlInstancesAddServerCertificateRequest {
4445    fn typename() -> &'static str {
4446        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest"
4447    }
4448}
4449
4450/// Instance add Entra ID certificate request.
4451#[derive(Clone, Default, PartialEq)]
4452#[non_exhaustive]
4453pub struct SqlInstancesAddEntraIdCertificateRequest {
4454    /// Required. Cloud SQL instance ID. This does not include the project ID.
4455    pub instance: std::string::String,
4456
4457    /// Required. Project ID of the project that contains the instance.
4458    pub project: std::string::String,
4459
4460    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4461}
4462
4463impl SqlInstancesAddEntraIdCertificateRequest {
4464    /// Creates a new default instance.
4465    pub fn new() -> Self {
4466        std::default::Default::default()
4467    }
4468
4469    /// Sets the value of [instance][crate::model::SqlInstancesAddEntraIdCertificateRequest::instance].
4470    ///
4471    /// # Example
4472    /// ```ignore,no_run
4473    /// # use google_cloud_sql_v1::model::SqlInstancesAddEntraIdCertificateRequest;
4474    /// let x = SqlInstancesAddEntraIdCertificateRequest::new().set_instance("example");
4475    /// ```
4476    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4477        self.instance = v.into();
4478        self
4479    }
4480
4481    /// Sets the value of [project][crate::model::SqlInstancesAddEntraIdCertificateRequest::project].
4482    ///
4483    /// # Example
4484    /// ```ignore,no_run
4485    /// # use google_cloud_sql_v1::model::SqlInstancesAddEntraIdCertificateRequest;
4486    /// let x = SqlInstancesAddEntraIdCertificateRequest::new().set_project("example");
4487    /// ```
4488    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4489        self.project = v.into();
4490        self
4491    }
4492}
4493
4494impl wkt::message::Message for SqlInstancesAddEntraIdCertificateRequest {
4495    fn typename() -> &'static str {
4496        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest"
4497    }
4498}
4499
4500/// Instance clone request.
4501#[derive(Clone, Default, PartialEq)]
4502#[non_exhaustive]
4503pub struct SqlInstancesCloneRequest {
4504    /// Required. The ID of the Cloud SQL instance to be cloned (source). This does
4505    /// not include the project ID.
4506    pub instance: std::string::String,
4507
4508    /// Required. Project ID of the source Cloud SQL instance.
4509    pub project: std::string::String,
4510
4511    #[allow(missing_docs)]
4512    pub body: std::option::Option<crate::model::InstancesCloneRequest>,
4513
4514    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4515}
4516
4517impl SqlInstancesCloneRequest {
4518    /// Creates a new default instance.
4519    pub fn new() -> Self {
4520        std::default::Default::default()
4521    }
4522
4523    /// Sets the value of [instance][crate::model::SqlInstancesCloneRequest::instance].
4524    ///
4525    /// # Example
4526    /// ```ignore,no_run
4527    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4528    /// let x = SqlInstancesCloneRequest::new().set_instance("example");
4529    /// ```
4530    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4531        self.instance = v.into();
4532        self
4533    }
4534
4535    /// Sets the value of [project][crate::model::SqlInstancesCloneRequest::project].
4536    ///
4537    /// # Example
4538    /// ```ignore,no_run
4539    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4540    /// let x = SqlInstancesCloneRequest::new().set_project("example");
4541    /// ```
4542    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4543        self.project = v.into();
4544        self
4545    }
4546
4547    /// Sets the value of [body][crate::model::SqlInstancesCloneRequest::body].
4548    ///
4549    /// # Example
4550    /// ```ignore,no_run
4551    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4552    /// use google_cloud_sql_v1::model::InstancesCloneRequest;
4553    /// let x = SqlInstancesCloneRequest::new().set_body(InstancesCloneRequest::default()/* use setters */);
4554    /// ```
4555    pub fn set_body<T>(mut self, v: T) -> Self
4556    where
4557        T: std::convert::Into<crate::model::InstancesCloneRequest>,
4558    {
4559        self.body = std::option::Option::Some(v.into());
4560        self
4561    }
4562
4563    /// Sets or clears the value of [body][crate::model::SqlInstancesCloneRequest::body].
4564    ///
4565    /// # Example
4566    /// ```ignore,no_run
4567    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4568    /// use google_cloud_sql_v1::model::InstancesCloneRequest;
4569    /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(Some(InstancesCloneRequest::default()/* use setters */));
4570    /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(None::<InstancesCloneRequest>);
4571    /// ```
4572    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4573    where
4574        T: std::convert::Into<crate::model::InstancesCloneRequest>,
4575    {
4576        self.body = v.map(|x| x.into());
4577        self
4578    }
4579}
4580
4581impl wkt::message::Message for SqlInstancesCloneRequest {
4582    fn typename() -> &'static str {
4583        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCloneRequest"
4584    }
4585}
4586
4587/// Instance delete request.
4588#[derive(Clone, Default, PartialEq)]
4589#[non_exhaustive]
4590pub struct SqlInstancesDeleteRequest {
4591    /// Cloud SQL instance ID. This does not include the project ID.
4592    pub instance: std::string::String,
4593
4594    /// Project ID of the project that contains the instance to be deleted.
4595    pub project: std::string::String,
4596
4597    /// Flag to opt-in for final backup. By default, it is turned off.
4598    pub enable_final_backup: std::option::Option<bool>,
4599
4600    /// Optional. The description of the final backup.
4601    pub final_backup_description: std::string::String,
4602
4603    #[allow(missing_docs)]
4604    pub expiration: std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
4605
4606    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4607}
4608
4609impl SqlInstancesDeleteRequest {
4610    /// Creates a new default instance.
4611    pub fn new() -> Self {
4612        std::default::Default::default()
4613    }
4614
4615    /// Sets the value of [instance][crate::model::SqlInstancesDeleteRequest::instance].
4616    ///
4617    /// # Example
4618    /// ```ignore,no_run
4619    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4620    /// let x = SqlInstancesDeleteRequest::new().set_instance("example");
4621    /// ```
4622    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4623        self.instance = v.into();
4624        self
4625    }
4626
4627    /// Sets the value of [project][crate::model::SqlInstancesDeleteRequest::project].
4628    ///
4629    /// # Example
4630    /// ```ignore,no_run
4631    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4632    /// let x = SqlInstancesDeleteRequest::new().set_project("example");
4633    /// ```
4634    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4635        self.project = v.into();
4636        self
4637    }
4638
4639    /// Sets the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
4640    ///
4641    /// # Example
4642    /// ```ignore,no_run
4643    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4644    /// let x = SqlInstancesDeleteRequest::new().set_enable_final_backup(true);
4645    /// ```
4646    pub fn set_enable_final_backup<T>(mut self, v: T) -> Self
4647    where
4648        T: std::convert::Into<bool>,
4649    {
4650        self.enable_final_backup = std::option::Option::Some(v.into());
4651        self
4652    }
4653
4654    /// Sets or clears the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
4655    ///
4656    /// # Example
4657    /// ```ignore,no_run
4658    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4659    /// let x = SqlInstancesDeleteRequest::new().set_or_clear_enable_final_backup(Some(false));
4660    /// let x = SqlInstancesDeleteRequest::new().set_or_clear_enable_final_backup(None::<bool>);
4661    /// ```
4662    pub fn set_or_clear_enable_final_backup<T>(mut self, v: std::option::Option<T>) -> Self
4663    where
4664        T: std::convert::Into<bool>,
4665    {
4666        self.enable_final_backup = v.map(|x| x.into());
4667        self
4668    }
4669
4670    /// Sets the value of [final_backup_description][crate::model::SqlInstancesDeleteRequest::final_backup_description].
4671    ///
4672    /// # Example
4673    /// ```ignore,no_run
4674    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4675    /// let x = SqlInstancesDeleteRequest::new().set_final_backup_description("example");
4676    /// ```
4677    pub fn set_final_backup_description<T: std::convert::Into<std::string::String>>(
4678        mut self,
4679        v: T,
4680    ) -> Self {
4681        self.final_backup_description = v.into();
4682        self
4683    }
4684
4685    /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration].
4686    ///
4687    /// Note that all the setters affecting `expiration` are mutually
4688    /// exclusive.
4689    ///
4690    /// # Example
4691    /// ```ignore,no_run
4692    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4693    /// use google_cloud_sql_v1::model::sql_instances_delete_request::Expiration;
4694    /// let x = SqlInstancesDeleteRequest::new().set_expiration(Some(Expiration::FinalBackupTtlDays(42)));
4695    /// ```
4696    pub fn set_expiration<
4697        T: std::convert::Into<
4698                std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
4699            >,
4700    >(
4701        mut self,
4702        v: T,
4703    ) -> Self {
4704        self.expiration = v.into();
4705        self
4706    }
4707
4708    /// The value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4709    /// if it holds a `FinalBackupTtlDays`, `None` if the field is not set or
4710    /// holds a different branch.
4711    pub fn final_backup_ttl_days(&self) -> std::option::Option<&i64> {
4712        #[allow(unreachable_patterns)]
4713        self.expiration.as_ref().and_then(|v| match v {
4714            crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v) => {
4715                std::option::Option::Some(v)
4716            }
4717            _ => std::option::Option::None,
4718        })
4719    }
4720
4721    /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4722    /// to hold a `FinalBackupTtlDays`.
4723    ///
4724    /// Note that all the setters affecting `expiration` are
4725    /// mutually exclusive.
4726    ///
4727    /// # Example
4728    /// ```ignore,no_run
4729    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4730    /// let x = SqlInstancesDeleteRequest::new().set_final_backup_ttl_days(42);
4731    /// assert!(x.final_backup_ttl_days().is_some());
4732    /// assert!(x.final_backup_expiry_time().is_none());
4733    /// ```
4734    pub fn set_final_backup_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4735        self.expiration = std::option::Option::Some(
4736            crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v.into()),
4737        );
4738        self
4739    }
4740
4741    /// The value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4742    /// if it holds a `FinalBackupExpiryTime`, `None` if the field is not set or
4743    /// holds a different branch.
4744    pub fn final_backup_expiry_time(
4745        &self,
4746    ) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
4747        #[allow(unreachable_patterns)]
4748        self.expiration.as_ref().and_then(|v| match v {
4749            crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v) => {
4750                std::option::Option::Some(v)
4751            }
4752            _ => std::option::Option::None,
4753        })
4754    }
4755
4756    /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4757    /// to hold a `FinalBackupExpiryTime`.
4758    ///
4759    /// Note that all the setters affecting `expiration` are
4760    /// mutually exclusive.
4761    ///
4762    /// # Example
4763    /// ```ignore,no_run
4764    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4765    /// use wkt::Timestamp;
4766    /// let x = SqlInstancesDeleteRequest::new().set_final_backup_expiry_time(Timestamp::default()/* use setters */);
4767    /// assert!(x.final_backup_expiry_time().is_some());
4768    /// assert!(x.final_backup_ttl_days().is_none());
4769    /// ```
4770    pub fn set_final_backup_expiry_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
4771        mut self,
4772        v: T,
4773    ) -> Self {
4774        self.expiration = std::option::Option::Some(
4775            crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v.into()),
4776        );
4777        self
4778    }
4779}
4780
4781impl wkt::message::Message for SqlInstancesDeleteRequest {
4782    fn typename() -> &'static str {
4783        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDeleteRequest"
4784    }
4785}
4786
4787/// Defines additional types related to [SqlInstancesDeleteRequest].
4788pub mod sql_instances_delete_request {
4789    #[allow(unused_imports)]
4790    use super::*;
4791
4792    #[allow(missing_docs)]
4793    #[derive(Clone, Debug, PartialEq)]
4794    #[non_exhaustive]
4795    pub enum Expiration {
4796        /// Optional. Retention period of the final backup.
4797        FinalBackupTtlDays(i64),
4798        /// Optional. Final Backup expiration time.
4799        /// Timestamp in UTC of when this resource is considered expired.
4800        FinalBackupExpiryTime(std::boxed::Box<wkt::Timestamp>),
4801    }
4802}
4803
4804/// Instance demote master request.
4805#[derive(Clone, Default, PartialEq)]
4806#[non_exhaustive]
4807pub struct SqlInstancesDemoteMasterRequest {
4808    /// Cloud SQL instance name.
4809    pub instance: std::string::String,
4810
4811    /// ID of the project that contains the instance.
4812    pub project: std::string::String,
4813
4814    #[allow(missing_docs)]
4815    pub body: std::option::Option<crate::model::InstancesDemoteMasterRequest>,
4816
4817    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4818}
4819
4820impl SqlInstancesDemoteMasterRequest {
4821    /// Creates a new default instance.
4822    pub fn new() -> Self {
4823        std::default::Default::default()
4824    }
4825
4826    /// Sets the value of [instance][crate::model::SqlInstancesDemoteMasterRequest::instance].
4827    ///
4828    /// # Example
4829    /// ```ignore,no_run
4830    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4831    /// let x = SqlInstancesDemoteMasterRequest::new().set_instance("example");
4832    /// ```
4833    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4834        self.instance = v.into();
4835        self
4836    }
4837
4838    /// Sets the value of [project][crate::model::SqlInstancesDemoteMasterRequest::project].
4839    ///
4840    /// # Example
4841    /// ```ignore,no_run
4842    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4843    /// let x = SqlInstancesDemoteMasterRequest::new().set_project("example");
4844    /// ```
4845    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4846        self.project = v.into();
4847        self
4848    }
4849
4850    /// Sets the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
4851    ///
4852    /// # Example
4853    /// ```ignore,no_run
4854    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4855    /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
4856    /// let x = SqlInstancesDemoteMasterRequest::new().set_body(InstancesDemoteMasterRequest::default()/* use setters */);
4857    /// ```
4858    pub fn set_body<T>(mut self, v: T) -> Self
4859    where
4860        T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
4861    {
4862        self.body = std::option::Option::Some(v.into());
4863        self
4864    }
4865
4866    /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
4867    ///
4868    /// # Example
4869    /// ```ignore,no_run
4870    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4871    /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
4872    /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(Some(InstancesDemoteMasterRequest::default()/* use setters */));
4873    /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(None::<InstancesDemoteMasterRequest>);
4874    /// ```
4875    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4876    where
4877        T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
4878    {
4879        self.body = v.map(|x| x.into());
4880        self
4881    }
4882}
4883
4884impl wkt::message::Message for SqlInstancesDemoteMasterRequest {
4885    fn typename() -> &'static str {
4886        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteMasterRequest"
4887    }
4888}
4889
4890/// Instance demote request.
4891#[derive(Clone, Default, PartialEq)]
4892#[non_exhaustive]
4893pub struct SqlInstancesDemoteRequest {
4894    /// Required. Cloud SQL instance name.
4895    pub instance: std::string::String,
4896
4897    /// Required. ID of the project that contains the instance.
4898    pub project: std::string::String,
4899
4900    /// Required. The request body.
4901    pub body: std::option::Option<crate::model::InstancesDemoteRequest>,
4902
4903    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4904}
4905
4906impl SqlInstancesDemoteRequest {
4907    /// Creates a new default instance.
4908    pub fn new() -> Self {
4909        std::default::Default::default()
4910    }
4911
4912    /// Sets the value of [instance][crate::model::SqlInstancesDemoteRequest::instance].
4913    ///
4914    /// # Example
4915    /// ```ignore,no_run
4916    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4917    /// let x = SqlInstancesDemoteRequest::new().set_instance("example");
4918    /// ```
4919    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4920        self.instance = v.into();
4921        self
4922    }
4923
4924    /// Sets the value of [project][crate::model::SqlInstancesDemoteRequest::project].
4925    ///
4926    /// # Example
4927    /// ```ignore,no_run
4928    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4929    /// let x = SqlInstancesDemoteRequest::new().set_project("example");
4930    /// ```
4931    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4932        self.project = v.into();
4933        self
4934    }
4935
4936    /// Sets the value of [body][crate::model::SqlInstancesDemoteRequest::body].
4937    ///
4938    /// # Example
4939    /// ```ignore,no_run
4940    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4941    /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
4942    /// let x = SqlInstancesDemoteRequest::new().set_body(InstancesDemoteRequest::default()/* use setters */);
4943    /// ```
4944    pub fn set_body<T>(mut self, v: T) -> Self
4945    where
4946        T: std::convert::Into<crate::model::InstancesDemoteRequest>,
4947    {
4948        self.body = std::option::Option::Some(v.into());
4949        self
4950    }
4951
4952    /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteRequest::body].
4953    ///
4954    /// # Example
4955    /// ```ignore,no_run
4956    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4957    /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
4958    /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(Some(InstancesDemoteRequest::default()/* use setters */));
4959    /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(None::<InstancesDemoteRequest>);
4960    /// ```
4961    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4962    where
4963        T: std::convert::Into<crate::model::InstancesDemoteRequest>,
4964    {
4965        self.body = v.map(|x| x.into());
4966        self
4967    }
4968}
4969
4970impl wkt::message::Message for SqlInstancesDemoteRequest {
4971    fn typename() -> &'static str {
4972        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteRequest"
4973    }
4974}
4975
4976/// Instance export request.
4977#[derive(Clone, Default, PartialEq)]
4978#[non_exhaustive]
4979pub struct SqlInstancesExportRequest {
4980    /// Cloud SQL instance ID. This does not include the project ID.
4981    pub instance: std::string::String,
4982
4983    /// Project ID of the project that contains the instance to be exported.
4984    pub project: std::string::String,
4985
4986    #[allow(missing_docs)]
4987    pub body: std::option::Option<crate::model::InstancesExportRequest>,
4988
4989    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4990}
4991
4992impl SqlInstancesExportRequest {
4993    /// Creates a new default instance.
4994    pub fn new() -> Self {
4995        std::default::Default::default()
4996    }
4997
4998    /// Sets the value of [instance][crate::model::SqlInstancesExportRequest::instance].
4999    ///
5000    /// # Example
5001    /// ```ignore,no_run
5002    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5003    /// let x = SqlInstancesExportRequest::new().set_instance("example");
5004    /// ```
5005    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5006        self.instance = v.into();
5007        self
5008    }
5009
5010    /// Sets the value of [project][crate::model::SqlInstancesExportRequest::project].
5011    ///
5012    /// # Example
5013    /// ```ignore,no_run
5014    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5015    /// let x = SqlInstancesExportRequest::new().set_project("example");
5016    /// ```
5017    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5018        self.project = v.into();
5019        self
5020    }
5021
5022    /// Sets the value of [body][crate::model::SqlInstancesExportRequest::body].
5023    ///
5024    /// # Example
5025    /// ```ignore,no_run
5026    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5027    /// use google_cloud_sql_v1::model::InstancesExportRequest;
5028    /// let x = SqlInstancesExportRequest::new().set_body(InstancesExportRequest::default()/* use setters */);
5029    /// ```
5030    pub fn set_body<T>(mut self, v: T) -> Self
5031    where
5032        T: std::convert::Into<crate::model::InstancesExportRequest>,
5033    {
5034        self.body = std::option::Option::Some(v.into());
5035        self
5036    }
5037
5038    /// Sets or clears the value of [body][crate::model::SqlInstancesExportRequest::body].
5039    ///
5040    /// # Example
5041    /// ```ignore,no_run
5042    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5043    /// use google_cloud_sql_v1::model::InstancesExportRequest;
5044    /// let x = SqlInstancesExportRequest::new().set_or_clear_body(Some(InstancesExportRequest::default()/* use setters */));
5045    /// let x = SqlInstancesExportRequest::new().set_or_clear_body(None::<InstancesExportRequest>);
5046    /// ```
5047    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5048    where
5049        T: std::convert::Into<crate::model::InstancesExportRequest>,
5050    {
5051        self.body = v.map(|x| x.into());
5052        self
5053    }
5054}
5055
5056impl wkt::message::Message for SqlInstancesExportRequest {
5057    fn typename() -> &'static str {
5058        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExportRequest"
5059    }
5060}
5061
5062/// Instance failover request.
5063#[derive(Clone, Default, PartialEq)]
5064#[non_exhaustive]
5065pub struct SqlInstancesFailoverRequest {
5066    /// Cloud SQL instance ID. This does not include the project ID.
5067    pub instance: std::string::String,
5068
5069    /// ID of the project that contains the read replica.
5070    pub project: std::string::String,
5071
5072    #[allow(missing_docs)]
5073    pub body: std::option::Option<crate::model::InstancesFailoverRequest>,
5074
5075    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5076}
5077
5078impl SqlInstancesFailoverRequest {
5079    /// Creates a new default instance.
5080    pub fn new() -> Self {
5081        std::default::Default::default()
5082    }
5083
5084    /// Sets the value of [instance][crate::model::SqlInstancesFailoverRequest::instance].
5085    ///
5086    /// # Example
5087    /// ```ignore,no_run
5088    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5089    /// let x = SqlInstancesFailoverRequest::new().set_instance("example");
5090    /// ```
5091    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5092        self.instance = v.into();
5093        self
5094    }
5095
5096    /// Sets the value of [project][crate::model::SqlInstancesFailoverRequest::project].
5097    ///
5098    /// # Example
5099    /// ```ignore,no_run
5100    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5101    /// let x = SqlInstancesFailoverRequest::new().set_project("example");
5102    /// ```
5103    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5104        self.project = v.into();
5105        self
5106    }
5107
5108    /// Sets the value of [body][crate::model::SqlInstancesFailoverRequest::body].
5109    ///
5110    /// # Example
5111    /// ```ignore,no_run
5112    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5113    /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
5114    /// let x = SqlInstancesFailoverRequest::new().set_body(InstancesFailoverRequest::default()/* use setters */);
5115    /// ```
5116    pub fn set_body<T>(mut self, v: T) -> Self
5117    where
5118        T: std::convert::Into<crate::model::InstancesFailoverRequest>,
5119    {
5120        self.body = std::option::Option::Some(v.into());
5121        self
5122    }
5123
5124    /// Sets or clears the value of [body][crate::model::SqlInstancesFailoverRequest::body].
5125    ///
5126    /// # Example
5127    /// ```ignore,no_run
5128    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5129    /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
5130    /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(Some(InstancesFailoverRequest::default()/* use setters */));
5131    /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(None::<InstancesFailoverRequest>);
5132    /// ```
5133    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5134    where
5135        T: std::convert::Into<crate::model::InstancesFailoverRequest>,
5136    {
5137        self.body = v.map(|x| x.into());
5138        self
5139    }
5140}
5141
5142impl wkt::message::Message for SqlInstancesFailoverRequest {
5143    fn typename() -> &'static str {
5144        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesFailoverRequest"
5145    }
5146}
5147
5148/// Instance get request.
5149#[derive(Clone, Default, PartialEq)]
5150#[non_exhaustive]
5151pub struct SqlInstancesGetRequest {
5152    /// Required. Database instance ID. This does not include the project ID.
5153    pub instance: std::string::String,
5154
5155    /// Required. Project ID of the project that contains the instance.
5156    pub project: std::string::String,
5157
5158    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5159}
5160
5161impl SqlInstancesGetRequest {
5162    /// Creates a new default instance.
5163    pub fn new() -> Self {
5164        std::default::Default::default()
5165    }
5166
5167    /// Sets the value of [instance][crate::model::SqlInstancesGetRequest::instance].
5168    ///
5169    /// # Example
5170    /// ```ignore,no_run
5171    /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
5172    /// let x = SqlInstancesGetRequest::new().set_instance("example");
5173    /// ```
5174    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5175        self.instance = v.into();
5176        self
5177    }
5178
5179    /// Sets the value of [project][crate::model::SqlInstancesGetRequest::project].
5180    ///
5181    /// # Example
5182    /// ```ignore,no_run
5183    /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
5184    /// let x = SqlInstancesGetRequest::new().set_project("example");
5185    /// ```
5186    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5187        self.project = v.into();
5188        self
5189    }
5190}
5191
5192impl wkt::message::Message for SqlInstancesGetRequest {
5193    fn typename() -> &'static str {
5194        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetRequest"
5195    }
5196}
5197
5198/// Instance import request.
5199#[derive(Clone, Default, PartialEq)]
5200#[non_exhaustive]
5201pub struct SqlInstancesImportRequest {
5202    /// Cloud SQL instance ID. This does not include the project ID.
5203    pub instance: std::string::String,
5204
5205    /// Project ID of the project that contains the instance.
5206    pub project: std::string::String,
5207
5208    #[allow(missing_docs)]
5209    pub body: std::option::Option<crate::model::InstancesImportRequest>,
5210
5211    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5212}
5213
5214impl SqlInstancesImportRequest {
5215    /// Creates a new default instance.
5216    pub fn new() -> Self {
5217        std::default::Default::default()
5218    }
5219
5220    /// Sets the value of [instance][crate::model::SqlInstancesImportRequest::instance].
5221    ///
5222    /// # Example
5223    /// ```ignore,no_run
5224    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5225    /// let x = SqlInstancesImportRequest::new().set_instance("example");
5226    /// ```
5227    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5228        self.instance = v.into();
5229        self
5230    }
5231
5232    /// Sets the value of [project][crate::model::SqlInstancesImportRequest::project].
5233    ///
5234    /// # Example
5235    /// ```ignore,no_run
5236    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5237    /// let x = SqlInstancesImportRequest::new().set_project("example");
5238    /// ```
5239    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5240        self.project = v.into();
5241        self
5242    }
5243
5244    /// Sets the value of [body][crate::model::SqlInstancesImportRequest::body].
5245    ///
5246    /// # Example
5247    /// ```ignore,no_run
5248    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5249    /// use google_cloud_sql_v1::model::InstancesImportRequest;
5250    /// let x = SqlInstancesImportRequest::new().set_body(InstancesImportRequest::default()/* use setters */);
5251    /// ```
5252    pub fn set_body<T>(mut self, v: T) -> Self
5253    where
5254        T: std::convert::Into<crate::model::InstancesImportRequest>,
5255    {
5256        self.body = std::option::Option::Some(v.into());
5257        self
5258    }
5259
5260    /// Sets or clears the value of [body][crate::model::SqlInstancesImportRequest::body].
5261    ///
5262    /// # Example
5263    /// ```ignore,no_run
5264    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5265    /// use google_cloud_sql_v1::model::InstancesImportRequest;
5266    /// let x = SqlInstancesImportRequest::new().set_or_clear_body(Some(InstancesImportRequest::default()/* use setters */));
5267    /// let x = SqlInstancesImportRequest::new().set_or_clear_body(None::<InstancesImportRequest>);
5268    /// ```
5269    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5270    where
5271        T: std::convert::Into<crate::model::InstancesImportRequest>,
5272    {
5273        self.body = v.map(|x| x.into());
5274        self
5275    }
5276}
5277
5278impl wkt::message::Message for SqlInstancesImportRequest {
5279    fn typename() -> &'static str {
5280        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesImportRequest"
5281    }
5282}
5283
5284/// Instance insert request.
5285#[derive(Clone, Default, PartialEq)]
5286#[non_exhaustive]
5287pub struct SqlInstancesInsertRequest {
5288    /// Project ID of the project to which the newly created Cloud SQL instances
5289    /// should belong.
5290    pub project: std::string::String,
5291
5292    #[allow(missing_docs)]
5293    pub body: std::option::Option<crate::model::DatabaseInstance>,
5294
5295    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5296}
5297
5298impl SqlInstancesInsertRequest {
5299    /// Creates a new default instance.
5300    pub fn new() -> Self {
5301        std::default::Default::default()
5302    }
5303
5304    /// Sets the value of [project][crate::model::SqlInstancesInsertRequest::project].
5305    ///
5306    /// # Example
5307    /// ```ignore,no_run
5308    /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5309    /// let x = SqlInstancesInsertRequest::new().set_project("example");
5310    /// ```
5311    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5312        self.project = v.into();
5313        self
5314    }
5315
5316    /// Sets the value of [body][crate::model::SqlInstancesInsertRequest::body].
5317    ///
5318    /// # Example
5319    /// ```ignore,no_run
5320    /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5321    /// use google_cloud_sql_v1::model::DatabaseInstance;
5322    /// let x = SqlInstancesInsertRequest::new().set_body(DatabaseInstance::default()/* use setters */);
5323    /// ```
5324    pub fn set_body<T>(mut self, v: T) -> Self
5325    where
5326        T: std::convert::Into<crate::model::DatabaseInstance>,
5327    {
5328        self.body = std::option::Option::Some(v.into());
5329        self
5330    }
5331
5332    /// Sets or clears the value of [body][crate::model::SqlInstancesInsertRequest::body].
5333    ///
5334    /// # Example
5335    /// ```ignore,no_run
5336    /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5337    /// use google_cloud_sql_v1::model::DatabaseInstance;
5338    /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
5339    /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(None::<DatabaseInstance>);
5340    /// ```
5341    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5342    where
5343        T: std::convert::Into<crate::model::DatabaseInstance>,
5344    {
5345        self.body = v.map(|x| x.into());
5346        self
5347    }
5348}
5349
5350impl wkt::message::Message for SqlInstancesInsertRequest {
5351    fn typename() -> &'static str {
5352        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesInsertRequest"
5353    }
5354}
5355
5356/// Instance list request.
5357#[derive(Clone, Default, PartialEq)]
5358#[non_exhaustive]
5359pub struct SqlInstancesListRequest {
5360    /// A filter expression that filters resources listed in the response.
5361    /// The expression is in the form of field:value. For example,
5362    /// 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
5363    /// their JSON representation, such as 'settings.userLabels.auto_start:true'.
5364    ///
5365    /// Multiple filter queries are space-separated. For example.
5366    /// 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
5367    /// expression is an AND expression. However, you can include AND and OR
5368    /// expressions explicitly.
5369    pub filter: std::string::String,
5370
5371    /// The maximum number of instances to return. The service may return fewer
5372    /// than this value.
5373    /// If unspecified, at most 500 instances are returned.
5374    /// The maximum value is 1000; values above 1000 are coerced to 1000.
5375    pub max_results: u32,
5376
5377    /// A previously-returned page token representing part of the larger set of
5378    /// results to view.
5379    pub page_token: std::string::String,
5380
5381    /// Project ID of the project for which to list Cloud SQL instances.
5382    pub project: std::string::String,
5383
5384    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5385}
5386
5387impl SqlInstancesListRequest {
5388    /// Creates a new default instance.
5389    pub fn new() -> Self {
5390        std::default::Default::default()
5391    }
5392
5393    /// Sets the value of [filter][crate::model::SqlInstancesListRequest::filter].
5394    ///
5395    /// # Example
5396    /// ```ignore,no_run
5397    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5398    /// let x = SqlInstancesListRequest::new().set_filter("example");
5399    /// ```
5400    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5401        self.filter = v.into();
5402        self
5403    }
5404
5405    /// Sets the value of [max_results][crate::model::SqlInstancesListRequest::max_results].
5406    ///
5407    /// # Example
5408    /// ```ignore,no_run
5409    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5410    /// let x = SqlInstancesListRequest::new().set_max_results(42_u32);
5411    /// ```
5412    pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
5413        self.max_results = v.into();
5414        self
5415    }
5416
5417    /// Sets the value of [page_token][crate::model::SqlInstancesListRequest::page_token].
5418    ///
5419    /// # Example
5420    /// ```ignore,no_run
5421    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5422    /// let x = SqlInstancesListRequest::new().set_page_token("example");
5423    /// ```
5424    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5425        self.page_token = v.into();
5426        self
5427    }
5428
5429    /// Sets the value of [project][crate::model::SqlInstancesListRequest::project].
5430    ///
5431    /// # Example
5432    /// ```ignore,no_run
5433    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5434    /// let x = SqlInstancesListRequest::new().set_project("example");
5435    /// ```
5436    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5437        self.project = v.into();
5438        self
5439    }
5440}
5441
5442impl wkt::message::Message for SqlInstancesListRequest {
5443    fn typename() -> &'static str {
5444        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListRequest"
5445    }
5446}
5447
5448/// Instance list server CAs request.
5449#[derive(Clone, Default, PartialEq)]
5450#[non_exhaustive]
5451pub struct SqlInstancesListServerCasRequest {
5452    /// Cloud SQL instance ID. This does not include the project ID.
5453    pub instance: std::string::String,
5454
5455    /// Project ID of the project that contains the instance.
5456    pub project: std::string::String,
5457
5458    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5459}
5460
5461impl SqlInstancesListServerCasRequest {
5462    /// Creates a new default instance.
5463    pub fn new() -> Self {
5464        std::default::Default::default()
5465    }
5466
5467    /// Sets the value of [instance][crate::model::SqlInstancesListServerCasRequest::instance].
5468    ///
5469    /// # Example
5470    /// ```ignore,no_run
5471    /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
5472    /// let x = SqlInstancesListServerCasRequest::new().set_instance("example");
5473    /// ```
5474    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5475        self.instance = v.into();
5476        self
5477    }
5478
5479    /// Sets the value of [project][crate::model::SqlInstancesListServerCasRequest::project].
5480    ///
5481    /// # Example
5482    /// ```ignore,no_run
5483    /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
5484    /// let x = SqlInstancesListServerCasRequest::new().set_project("example");
5485    /// ```
5486    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5487        self.project = v.into();
5488        self
5489    }
5490}
5491
5492impl wkt::message::Message for SqlInstancesListServerCasRequest {
5493    fn typename() -> &'static str {
5494        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCasRequest"
5495    }
5496}
5497
5498/// Instance list server certificates request.
5499#[derive(Clone, Default, PartialEq)]
5500#[non_exhaustive]
5501pub struct SqlInstancesListServerCertificatesRequest {
5502    /// Required. Cloud SQL instance ID. This does not include the project ID.
5503    pub instance: std::string::String,
5504
5505    /// Required. Project ID of the project that contains the instance.
5506    pub project: std::string::String,
5507
5508    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5509}
5510
5511impl SqlInstancesListServerCertificatesRequest {
5512    /// Creates a new default instance.
5513    pub fn new() -> Self {
5514        std::default::Default::default()
5515    }
5516
5517    /// Sets the value of [instance][crate::model::SqlInstancesListServerCertificatesRequest::instance].
5518    ///
5519    /// # Example
5520    /// ```ignore,no_run
5521    /// # use google_cloud_sql_v1::model::SqlInstancesListServerCertificatesRequest;
5522    /// let x = SqlInstancesListServerCertificatesRequest::new().set_instance("example");
5523    /// ```
5524    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5525        self.instance = v.into();
5526        self
5527    }
5528
5529    /// Sets the value of [project][crate::model::SqlInstancesListServerCertificatesRequest::project].
5530    ///
5531    /// # Example
5532    /// ```ignore,no_run
5533    /// # use google_cloud_sql_v1::model::SqlInstancesListServerCertificatesRequest;
5534    /// let x = SqlInstancesListServerCertificatesRequest::new().set_project("example");
5535    /// ```
5536    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5537        self.project = v.into();
5538        self
5539    }
5540}
5541
5542impl wkt::message::Message for SqlInstancesListServerCertificatesRequest {
5543    fn typename() -> &'static str {
5544        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest"
5545    }
5546}
5547
5548/// Instance list Entra ID certificates request.
5549#[derive(Clone, Default, PartialEq)]
5550#[non_exhaustive]
5551pub struct SqlInstancesListEntraIdCertificatesRequest {
5552    /// Required. Cloud SQL instance ID. This does not include the project ID.
5553    pub instance: std::string::String,
5554
5555    /// Required. Project ID of the project that contains the instance.
5556    pub project: std::string::String,
5557
5558    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5559}
5560
5561impl SqlInstancesListEntraIdCertificatesRequest {
5562    /// Creates a new default instance.
5563    pub fn new() -> Self {
5564        std::default::Default::default()
5565    }
5566
5567    /// Sets the value of [instance][crate::model::SqlInstancesListEntraIdCertificatesRequest::instance].
5568    ///
5569    /// # Example
5570    /// ```ignore,no_run
5571    /// # use google_cloud_sql_v1::model::SqlInstancesListEntraIdCertificatesRequest;
5572    /// let x = SqlInstancesListEntraIdCertificatesRequest::new().set_instance("example");
5573    /// ```
5574    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5575        self.instance = v.into();
5576        self
5577    }
5578
5579    /// Sets the value of [project][crate::model::SqlInstancesListEntraIdCertificatesRequest::project].
5580    ///
5581    /// # Example
5582    /// ```ignore,no_run
5583    /// # use google_cloud_sql_v1::model::SqlInstancesListEntraIdCertificatesRequest;
5584    /// let x = SqlInstancesListEntraIdCertificatesRequest::new().set_project("example");
5585    /// ```
5586    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5587        self.project = v.into();
5588        self
5589    }
5590}
5591
5592impl wkt::message::Message for SqlInstancesListEntraIdCertificatesRequest {
5593    fn typename() -> &'static str {
5594        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest"
5595    }
5596}
5597
5598/// Instance patch request.
5599#[derive(Clone, Default, PartialEq)]
5600#[non_exhaustive]
5601pub struct SqlInstancesPatchRequest {
5602    /// Cloud SQL instance ID. This does not include the project ID.
5603    pub instance: std::string::String,
5604
5605    /// Project ID of the project that contains the instance.
5606    pub project: std::string::String,
5607
5608    #[allow(missing_docs)]
5609    pub body: std::option::Option<crate::model::DatabaseInstance>,
5610
5611    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5612}
5613
5614impl SqlInstancesPatchRequest {
5615    /// Creates a new default instance.
5616    pub fn new() -> Self {
5617        std::default::Default::default()
5618    }
5619
5620    /// Sets the value of [instance][crate::model::SqlInstancesPatchRequest::instance].
5621    ///
5622    /// # Example
5623    /// ```ignore,no_run
5624    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5625    /// let x = SqlInstancesPatchRequest::new().set_instance("example");
5626    /// ```
5627    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5628        self.instance = v.into();
5629        self
5630    }
5631
5632    /// Sets the value of [project][crate::model::SqlInstancesPatchRequest::project].
5633    ///
5634    /// # Example
5635    /// ```ignore,no_run
5636    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5637    /// let x = SqlInstancesPatchRequest::new().set_project("example");
5638    /// ```
5639    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5640        self.project = v.into();
5641        self
5642    }
5643
5644    /// Sets the value of [body][crate::model::SqlInstancesPatchRequest::body].
5645    ///
5646    /// # Example
5647    /// ```ignore,no_run
5648    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5649    /// use google_cloud_sql_v1::model::DatabaseInstance;
5650    /// let x = SqlInstancesPatchRequest::new().set_body(DatabaseInstance::default()/* use setters */);
5651    /// ```
5652    pub fn set_body<T>(mut self, v: T) -> Self
5653    where
5654        T: std::convert::Into<crate::model::DatabaseInstance>,
5655    {
5656        self.body = std::option::Option::Some(v.into());
5657        self
5658    }
5659
5660    /// Sets or clears the value of [body][crate::model::SqlInstancesPatchRequest::body].
5661    ///
5662    /// # Example
5663    /// ```ignore,no_run
5664    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5665    /// use google_cloud_sql_v1::model::DatabaseInstance;
5666    /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
5667    /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(None::<DatabaseInstance>);
5668    /// ```
5669    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5670    where
5671        T: std::convert::Into<crate::model::DatabaseInstance>,
5672    {
5673        self.body = v.map(|x| x.into());
5674        self
5675    }
5676}
5677
5678impl wkt::message::Message for SqlInstancesPatchRequest {
5679    fn typename() -> &'static str {
5680        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPatchRequest"
5681    }
5682}
5683
5684/// Instance promote replica request.
5685#[derive(Clone, Default, PartialEq)]
5686#[non_exhaustive]
5687pub struct SqlInstancesPromoteReplicaRequest {
5688    /// Cloud SQL read replica instance name.
5689    pub instance: std::string::String,
5690
5691    /// ID of the project that contains the read replica.
5692    pub project: std::string::String,
5693
5694    /// Set to true to invoke a replica failover to the DR
5695    /// replica. As part of replica failover, the promote operation attempts
5696    /// to add the original primary instance as a replica of the promoted
5697    /// DR replica when the original primary instance comes back online.
5698    /// If set to false or not specified, then the original primary
5699    /// instance becomes an independent Cloud SQL primary instance.
5700    pub failover: bool,
5701
5702    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5703}
5704
5705impl SqlInstancesPromoteReplicaRequest {
5706    /// Creates a new default instance.
5707    pub fn new() -> Self {
5708        std::default::Default::default()
5709    }
5710
5711    /// Sets the value of [instance][crate::model::SqlInstancesPromoteReplicaRequest::instance].
5712    ///
5713    /// # Example
5714    /// ```ignore,no_run
5715    /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5716    /// let x = SqlInstancesPromoteReplicaRequest::new().set_instance("example");
5717    /// ```
5718    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5719        self.instance = v.into();
5720        self
5721    }
5722
5723    /// Sets the value of [project][crate::model::SqlInstancesPromoteReplicaRequest::project].
5724    ///
5725    /// # Example
5726    /// ```ignore,no_run
5727    /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5728    /// let x = SqlInstancesPromoteReplicaRequest::new().set_project("example");
5729    /// ```
5730    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5731        self.project = v.into();
5732        self
5733    }
5734
5735    /// Sets the value of [failover][crate::model::SqlInstancesPromoteReplicaRequest::failover].
5736    ///
5737    /// # Example
5738    /// ```ignore,no_run
5739    /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5740    /// let x = SqlInstancesPromoteReplicaRequest::new().set_failover(true);
5741    /// ```
5742    pub fn set_failover<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5743        self.failover = v.into();
5744        self
5745    }
5746}
5747
5748impl wkt::message::Message for SqlInstancesPromoteReplicaRequest {
5749    fn typename() -> &'static str {
5750        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest"
5751    }
5752}
5753
5754/// Instance switchover request.
5755#[derive(Clone, Default, PartialEq)]
5756#[non_exhaustive]
5757pub struct SqlInstancesSwitchoverRequest {
5758    /// Cloud SQL read replica instance name.
5759    pub instance: std::string::String,
5760
5761    /// ID of the project that contains the replica.
5762    pub project: std::string::String,
5763
5764    /// Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
5765    /// timeout, which is a sum of all database operations. Default value is 10
5766    /// minutes and can be modified to a maximum value of 24 hours.
5767    pub db_timeout: std::option::Option<wkt::Duration>,
5768
5769    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5770}
5771
5772impl SqlInstancesSwitchoverRequest {
5773    /// Creates a new default instance.
5774    pub fn new() -> Self {
5775        std::default::Default::default()
5776    }
5777
5778    /// Sets the value of [instance][crate::model::SqlInstancesSwitchoverRequest::instance].
5779    ///
5780    /// # Example
5781    /// ```ignore,no_run
5782    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5783    /// let x = SqlInstancesSwitchoverRequest::new().set_instance("example");
5784    /// ```
5785    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5786        self.instance = v.into();
5787        self
5788    }
5789
5790    /// Sets the value of [project][crate::model::SqlInstancesSwitchoverRequest::project].
5791    ///
5792    /// # Example
5793    /// ```ignore,no_run
5794    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5795    /// let x = SqlInstancesSwitchoverRequest::new().set_project("example");
5796    /// ```
5797    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5798        self.project = v.into();
5799        self
5800    }
5801
5802    /// Sets the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
5803    ///
5804    /// # Example
5805    /// ```ignore,no_run
5806    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5807    /// use wkt::Duration;
5808    /// let x = SqlInstancesSwitchoverRequest::new().set_db_timeout(Duration::default()/* use setters */);
5809    /// ```
5810    pub fn set_db_timeout<T>(mut self, v: T) -> Self
5811    where
5812        T: std::convert::Into<wkt::Duration>,
5813    {
5814        self.db_timeout = std::option::Option::Some(v.into());
5815        self
5816    }
5817
5818    /// Sets or clears the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
5819    ///
5820    /// # Example
5821    /// ```ignore,no_run
5822    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5823    /// use wkt::Duration;
5824    /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(Some(Duration::default()/* use setters */));
5825    /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(None::<Duration>);
5826    /// ```
5827    pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
5828    where
5829        T: std::convert::Into<wkt::Duration>,
5830    {
5831        self.db_timeout = v.map(|x| x.into());
5832        self
5833    }
5834}
5835
5836impl wkt::message::Message for SqlInstancesSwitchoverRequest {
5837    fn typename() -> &'static str {
5838        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesSwitchoverRequest"
5839    }
5840}
5841
5842/// Instance reset SSL config request.
5843#[derive(Clone, Default, PartialEq)]
5844#[non_exhaustive]
5845pub struct SqlInstancesResetSslConfigRequest {
5846    /// Cloud SQL instance ID. This does not include the project ID.
5847    pub instance: std::string::String,
5848
5849    /// Project ID of the project that contains the instance.
5850    pub project: std::string::String,
5851
5852    /// Optional. Reset SSL mode to use.
5853    pub mode: crate::model::sql_instances_reset_ssl_config_request::ResetSslMode,
5854
5855    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5856}
5857
5858impl SqlInstancesResetSslConfigRequest {
5859    /// Creates a new default instance.
5860    pub fn new() -> Self {
5861        std::default::Default::default()
5862    }
5863
5864    /// Sets the value of [instance][crate::model::SqlInstancesResetSslConfigRequest::instance].
5865    ///
5866    /// # Example
5867    /// ```ignore,no_run
5868    /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
5869    /// let x = SqlInstancesResetSslConfigRequest::new().set_instance("example");
5870    /// ```
5871    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5872        self.instance = v.into();
5873        self
5874    }
5875
5876    /// Sets the value of [project][crate::model::SqlInstancesResetSslConfigRequest::project].
5877    ///
5878    /// # Example
5879    /// ```ignore,no_run
5880    /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
5881    /// let x = SqlInstancesResetSslConfigRequest::new().set_project("example");
5882    /// ```
5883    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5884        self.project = v.into();
5885        self
5886    }
5887
5888    /// Sets the value of [mode][crate::model::SqlInstancesResetSslConfigRequest::mode].
5889    ///
5890    /// # Example
5891    /// ```ignore,no_run
5892    /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
5893    /// use google_cloud_sql_v1::model::sql_instances_reset_ssl_config_request::ResetSslMode;
5894    /// let x0 = SqlInstancesResetSslConfigRequest::new().set_mode(ResetSslMode::All);
5895    /// let x1 = SqlInstancesResetSslConfigRequest::new().set_mode(ResetSslMode::SyncFromPrimary);
5896    /// ```
5897    pub fn set_mode<
5898        T: std::convert::Into<crate::model::sql_instances_reset_ssl_config_request::ResetSslMode>,
5899    >(
5900        mut self,
5901        v: T,
5902    ) -> Self {
5903        self.mode = v.into();
5904        self
5905    }
5906}
5907
5908impl wkt::message::Message for SqlInstancesResetSslConfigRequest {
5909    fn typename() -> &'static str {
5910        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetSslConfigRequest"
5911    }
5912}
5913
5914/// Defines additional types related to [SqlInstancesResetSslConfigRequest].
5915pub mod sql_instances_reset_ssl_config_request {
5916    #[allow(unused_imports)]
5917    use super::*;
5918
5919    /// Reset SSL mode to selectively refresh the SSL materials.
5920    ///
5921    /// # Working with unknown values
5922    ///
5923    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5924    /// additional enum variants at any time. Adding new variants is not considered
5925    /// a breaking change. Applications should write their code in anticipation of:
5926    ///
5927    /// - New values appearing in future releases of the client library, **and**
5928    /// - New values received dynamically, without application changes.
5929    ///
5930    /// Please consult the [Working with enums] section in the user guide for some
5931    /// guidelines.
5932    ///
5933    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5934    #[derive(Clone, Debug, PartialEq)]
5935    #[non_exhaustive]
5936    pub enum ResetSslMode {
5937        /// Reset SSL mode is not specified.
5938        Unspecified,
5939        /// Refresh all TLS configs. This is the default behaviour.
5940        All,
5941        /// Refreshes the replication-related TLS configuration settings provided by
5942        /// the primary instance.
5943        /// Not applicable to on-premises replication instances.
5944        SyncFromPrimary,
5945        /// If set, the enum was initialized with an unknown value.
5946        ///
5947        /// Applications can examine the value using [ResetSslMode::value] or
5948        /// [ResetSslMode::name].
5949        UnknownValue(reset_ssl_mode::UnknownValue),
5950    }
5951
5952    #[doc(hidden)]
5953    pub mod reset_ssl_mode {
5954        #[allow(unused_imports)]
5955        use super::*;
5956        #[derive(Clone, Debug, PartialEq)]
5957        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5958    }
5959
5960    impl ResetSslMode {
5961        /// Gets the enum value.
5962        ///
5963        /// Returns `None` if the enum contains an unknown value deserialized from
5964        /// the string representation of enums.
5965        pub fn value(&self) -> std::option::Option<i32> {
5966            match self {
5967                Self::Unspecified => std::option::Option::Some(0),
5968                Self::All => std::option::Option::Some(1),
5969                Self::SyncFromPrimary => std::option::Option::Some(2),
5970                Self::UnknownValue(u) => u.0.value(),
5971            }
5972        }
5973
5974        /// Gets the enum value as a string.
5975        ///
5976        /// Returns `None` if the enum contains an unknown value deserialized from
5977        /// the integer representation of enums.
5978        pub fn name(&self) -> std::option::Option<&str> {
5979            match self {
5980                Self::Unspecified => std::option::Option::Some("RESET_SSL_MODE_UNSPECIFIED"),
5981                Self::All => std::option::Option::Some("ALL"),
5982                Self::SyncFromPrimary => std::option::Option::Some("SYNC_FROM_PRIMARY"),
5983                Self::UnknownValue(u) => u.0.name(),
5984            }
5985        }
5986    }
5987
5988    impl std::default::Default for ResetSslMode {
5989        fn default() -> Self {
5990            use std::convert::From;
5991            Self::from(0)
5992        }
5993    }
5994
5995    impl std::fmt::Display for ResetSslMode {
5996        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5997            wkt::internal::display_enum(f, self.name(), self.value())
5998        }
5999    }
6000
6001    impl std::convert::From<i32> for ResetSslMode {
6002        fn from(value: i32) -> Self {
6003            match value {
6004                0 => Self::Unspecified,
6005                1 => Self::All,
6006                2 => Self::SyncFromPrimary,
6007                _ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
6008                    wkt::internal::UnknownEnumValue::Integer(value),
6009                )),
6010            }
6011        }
6012    }
6013
6014    impl std::convert::From<&str> for ResetSslMode {
6015        fn from(value: &str) -> Self {
6016            use std::string::ToString;
6017            match value {
6018                "RESET_SSL_MODE_UNSPECIFIED" => Self::Unspecified,
6019                "ALL" => Self::All,
6020                "SYNC_FROM_PRIMARY" => Self::SyncFromPrimary,
6021                _ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
6022                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6023                )),
6024            }
6025        }
6026    }
6027
6028    impl serde::ser::Serialize for ResetSslMode {
6029        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6030        where
6031            S: serde::Serializer,
6032        {
6033            match self {
6034                Self::Unspecified => serializer.serialize_i32(0),
6035                Self::All => serializer.serialize_i32(1),
6036                Self::SyncFromPrimary => serializer.serialize_i32(2),
6037                Self::UnknownValue(u) => u.0.serialize(serializer),
6038            }
6039        }
6040    }
6041
6042    impl<'de> serde::de::Deserialize<'de> for ResetSslMode {
6043        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6044        where
6045            D: serde::Deserializer<'de>,
6046        {
6047            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResetSslMode>::new(
6048                ".google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode",
6049            ))
6050        }
6051    }
6052}
6053
6054/// Instance restart request.
6055#[derive(Clone, Default, PartialEq)]
6056#[non_exhaustive]
6057pub struct SqlInstancesRestartRequest {
6058    /// Cloud SQL instance ID. This does not include the project ID.
6059    pub instance: std::string::String,
6060
6061    /// Project ID of the project that contains the instance to be restarted.
6062    pub project: std::string::String,
6063
6064    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6065}
6066
6067impl SqlInstancesRestartRequest {
6068    /// Creates a new default instance.
6069    pub fn new() -> Self {
6070        std::default::Default::default()
6071    }
6072
6073    /// Sets the value of [instance][crate::model::SqlInstancesRestartRequest::instance].
6074    ///
6075    /// # Example
6076    /// ```ignore,no_run
6077    /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
6078    /// let x = SqlInstancesRestartRequest::new().set_instance("example");
6079    /// ```
6080    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6081        self.instance = v.into();
6082        self
6083    }
6084
6085    /// Sets the value of [project][crate::model::SqlInstancesRestartRequest::project].
6086    ///
6087    /// # Example
6088    /// ```ignore,no_run
6089    /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
6090    /// let x = SqlInstancesRestartRequest::new().set_project("example");
6091    /// ```
6092    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6093        self.project = v.into();
6094        self
6095    }
6096}
6097
6098impl wkt::message::Message for SqlInstancesRestartRequest {
6099    fn typename() -> &'static str {
6100        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestartRequest"
6101    }
6102}
6103
6104/// Instance restore backup request.
6105#[derive(Clone, Default, PartialEq)]
6106#[non_exhaustive]
6107pub struct SqlInstancesRestoreBackupRequest {
6108    /// Cloud SQL instance ID. This does not include the project ID.
6109    pub instance: std::string::String,
6110
6111    /// Project ID of the project that contains the instance.
6112    pub project: std::string::String,
6113
6114    #[allow(missing_docs)]
6115    pub body: std::option::Option<crate::model::InstancesRestoreBackupRequest>,
6116
6117    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6118}
6119
6120impl SqlInstancesRestoreBackupRequest {
6121    /// Creates a new default instance.
6122    pub fn new() -> Self {
6123        std::default::Default::default()
6124    }
6125
6126    /// Sets the value of [instance][crate::model::SqlInstancesRestoreBackupRequest::instance].
6127    ///
6128    /// # Example
6129    /// ```ignore,no_run
6130    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6131    /// let x = SqlInstancesRestoreBackupRequest::new().set_instance("example");
6132    /// ```
6133    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6134        self.instance = v.into();
6135        self
6136    }
6137
6138    /// Sets the value of [project][crate::model::SqlInstancesRestoreBackupRequest::project].
6139    ///
6140    /// # Example
6141    /// ```ignore,no_run
6142    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6143    /// let x = SqlInstancesRestoreBackupRequest::new().set_project("example");
6144    /// ```
6145    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6146        self.project = v.into();
6147        self
6148    }
6149
6150    /// Sets the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
6151    ///
6152    /// # Example
6153    /// ```ignore,no_run
6154    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6155    /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6156    /// let x = SqlInstancesRestoreBackupRequest::new().set_body(InstancesRestoreBackupRequest::default()/* use setters */);
6157    /// ```
6158    pub fn set_body<T>(mut self, v: T) -> Self
6159    where
6160        T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
6161    {
6162        self.body = std::option::Option::Some(v.into());
6163        self
6164    }
6165
6166    /// Sets or clears the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
6167    ///
6168    /// # Example
6169    /// ```ignore,no_run
6170    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6171    /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6172    /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(Some(InstancesRestoreBackupRequest::default()/* use setters */));
6173    /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(None::<InstancesRestoreBackupRequest>);
6174    /// ```
6175    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6176    where
6177        T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
6178    {
6179        self.body = v.map(|x| x.into());
6180        self
6181    }
6182}
6183
6184impl wkt::message::Message for SqlInstancesRestoreBackupRequest {
6185    fn typename() -> &'static str {
6186        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestoreBackupRequest"
6187    }
6188}
6189
6190/// Instance rotate server CA request.
6191#[derive(Clone, Default, PartialEq)]
6192#[non_exhaustive]
6193pub struct SqlInstancesRotateServerCaRequest {
6194    /// Cloud SQL instance ID. This does not include the project ID.
6195    pub instance: std::string::String,
6196
6197    /// Project ID of the project that contains the instance.
6198    pub project: std::string::String,
6199
6200    #[allow(missing_docs)]
6201    pub body: std::option::Option<crate::model::InstancesRotateServerCaRequest>,
6202
6203    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6204}
6205
6206impl SqlInstancesRotateServerCaRequest {
6207    /// Creates a new default instance.
6208    pub fn new() -> Self {
6209        std::default::Default::default()
6210    }
6211
6212    /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCaRequest::instance].
6213    ///
6214    /// # Example
6215    /// ```ignore,no_run
6216    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6217    /// let x = SqlInstancesRotateServerCaRequest::new().set_instance("example");
6218    /// ```
6219    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6220        self.instance = v.into();
6221        self
6222    }
6223
6224    /// Sets the value of [project][crate::model::SqlInstancesRotateServerCaRequest::project].
6225    ///
6226    /// # Example
6227    /// ```ignore,no_run
6228    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6229    /// let x = SqlInstancesRotateServerCaRequest::new().set_project("example");
6230    /// ```
6231    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6232        self.project = v.into();
6233        self
6234    }
6235
6236    /// Sets the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
6237    ///
6238    /// # Example
6239    /// ```ignore,no_run
6240    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6241    /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6242    /// let x = SqlInstancesRotateServerCaRequest::new().set_body(InstancesRotateServerCaRequest::default()/* use setters */);
6243    /// ```
6244    pub fn set_body<T>(mut self, v: T) -> Self
6245    where
6246        T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
6247    {
6248        self.body = std::option::Option::Some(v.into());
6249        self
6250    }
6251
6252    /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
6253    ///
6254    /// # Example
6255    /// ```ignore,no_run
6256    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6257    /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6258    /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(Some(InstancesRotateServerCaRequest::default()/* use setters */));
6259    /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(None::<InstancesRotateServerCaRequest>);
6260    /// ```
6261    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6262    where
6263        T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
6264    {
6265        self.body = v.map(|x| x.into());
6266        self
6267    }
6268}
6269
6270impl wkt::message::Message for SqlInstancesRotateServerCaRequest {
6271    fn typename() -> &'static str {
6272        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCaRequest"
6273    }
6274}
6275
6276/// Instance rotate server certificate request.
6277#[derive(Clone, Default, PartialEq)]
6278#[non_exhaustive]
6279pub struct SqlInstancesRotateServerCertificateRequest {
6280    /// Required. Cloud SQL instance ID. This does not include the project ID.
6281    pub instance: std::string::String,
6282
6283    /// Required. Project ID of the project that contains the instance.
6284    pub project: std::string::String,
6285
6286    /// Optional. Rotate server certificate request body.
6287    pub body: std::option::Option<crate::model::InstancesRotateServerCertificateRequest>,
6288
6289    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6290}
6291
6292impl SqlInstancesRotateServerCertificateRequest {
6293    /// Creates a new default instance.
6294    pub fn new() -> Self {
6295        std::default::Default::default()
6296    }
6297
6298    /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCertificateRequest::instance].
6299    ///
6300    /// # Example
6301    /// ```ignore,no_run
6302    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6303    /// let x = SqlInstancesRotateServerCertificateRequest::new().set_instance("example");
6304    /// ```
6305    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6306        self.instance = v.into();
6307        self
6308    }
6309
6310    /// Sets the value of [project][crate::model::SqlInstancesRotateServerCertificateRequest::project].
6311    ///
6312    /// # Example
6313    /// ```ignore,no_run
6314    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6315    /// let x = SqlInstancesRotateServerCertificateRequest::new().set_project("example");
6316    /// ```
6317    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6318        self.project = v.into();
6319        self
6320    }
6321
6322    /// Sets the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
6323    ///
6324    /// # Example
6325    /// ```ignore,no_run
6326    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6327    /// use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
6328    /// let x = SqlInstancesRotateServerCertificateRequest::new().set_body(InstancesRotateServerCertificateRequest::default()/* use setters */);
6329    /// ```
6330    pub fn set_body<T>(mut self, v: T) -> Self
6331    where
6332        T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
6333    {
6334        self.body = std::option::Option::Some(v.into());
6335        self
6336    }
6337
6338    /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
6339    ///
6340    /// # Example
6341    /// ```ignore,no_run
6342    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6343    /// use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
6344    /// let x = SqlInstancesRotateServerCertificateRequest::new().set_or_clear_body(Some(InstancesRotateServerCertificateRequest::default()/* use setters */));
6345    /// let x = SqlInstancesRotateServerCertificateRequest::new().set_or_clear_body(None::<InstancesRotateServerCertificateRequest>);
6346    /// ```
6347    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6348    where
6349        T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
6350    {
6351        self.body = v.map(|x| x.into());
6352        self
6353    }
6354}
6355
6356impl wkt::message::Message for SqlInstancesRotateServerCertificateRequest {
6357    fn typename() -> &'static str {
6358        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest"
6359    }
6360}
6361
6362/// Instance rotate server certificate request.
6363#[derive(Clone, Default, PartialEq)]
6364#[non_exhaustive]
6365pub struct SqlInstancesRotateEntraIdCertificateRequest {
6366    /// Required. Cloud SQL instance ID. This does not include the project ID.
6367    pub instance: std::string::String,
6368
6369    /// Required. Project ID of the project that contains the instance.
6370    pub project: std::string::String,
6371
6372    /// Optional. Rotate Entra ID certificate request body.
6373    pub body: std::option::Option<crate::model::InstancesRotateEntraIdCertificateRequest>,
6374
6375    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6376}
6377
6378impl SqlInstancesRotateEntraIdCertificateRequest {
6379    /// Creates a new default instance.
6380    pub fn new() -> Self {
6381        std::default::Default::default()
6382    }
6383
6384    /// Sets the value of [instance][crate::model::SqlInstancesRotateEntraIdCertificateRequest::instance].
6385    ///
6386    /// # Example
6387    /// ```ignore,no_run
6388    /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6389    /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_instance("example");
6390    /// ```
6391    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6392        self.instance = v.into();
6393        self
6394    }
6395
6396    /// Sets the value of [project][crate::model::SqlInstancesRotateEntraIdCertificateRequest::project].
6397    ///
6398    /// # Example
6399    /// ```ignore,no_run
6400    /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6401    /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_project("example");
6402    /// ```
6403    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6404        self.project = v.into();
6405        self
6406    }
6407
6408    /// Sets the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
6409    ///
6410    /// # Example
6411    /// ```ignore,no_run
6412    /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6413    /// use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
6414    /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_body(InstancesRotateEntraIdCertificateRequest::default()/* use setters */);
6415    /// ```
6416    pub fn set_body<T>(mut self, v: T) -> Self
6417    where
6418        T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
6419    {
6420        self.body = std::option::Option::Some(v.into());
6421        self
6422    }
6423
6424    /// Sets or clears the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
6425    ///
6426    /// # Example
6427    /// ```ignore,no_run
6428    /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6429    /// use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
6430    /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_or_clear_body(Some(InstancesRotateEntraIdCertificateRequest::default()/* use setters */));
6431    /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_or_clear_body(None::<InstancesRotateEntraIdCertificateRequest>);
6432    /// ```
6433    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6434    where
6435        T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
6436    {
6437        self.body = v.map(|x| x.into());
6438        self
6439    }
6440}
6441
6442impl wkt::message::Message for SqlInstancesRotateEntraIdCertificateRequest {
6443    fn typename() -> &'static str {
6444        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest"
6445    }
6446}
6447
6448/// Instance start replica request.
6449#[derive(Clone, Default, PartialEq)]
6450#[non_exhaustive]
6451pub struct SqlInstancesStartReplicaRequest {
6452    /// Cloud SQL read replica instance name.
6453    pub instance: std::string::String,
6454
6455    /// ID of the project that contains the read replica.
6456    pub project: std::string::String,
6457
6458    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6459}
6460
6461impl SqlInstancesStartReplicaRequest {
6462    /// Creates a new default instance.
6463    pub fn new() -> Self {
6464        std::default::Default::default()
6465    }
6466
6467    /// Sets the value of [instance][crate::model::SqlInstancesStartReplicaRequest::instance].
6468    ///
6469    /// # Example
6470    /// ```ignore,no_run
6471    /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
6472    /// let x = SqlInstancesStartReplicaRequest::new().set_instance("example");
6473    /// ```
6474    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6475        self.instance = v.into();
6476        self
6477    }
6478
6479    /// Sets the value of [project][crate::model::SqlInstancesStartReplicaRequest::project].
6480    ///
6481    /// # Example
6482    /// ```ignore,no_run
6483    /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
6484    /// let x = SqlInstancesStartReplicaRequest::new().set_project("example");
6485    /// ```
6486    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6487        self.project = v.into();
6488        self
6489    }
6490}
6491
6492impl wkt::message::Message for SqlInstancesStartReplicaRequest {
6493    fn typename() -> &'static str {
6494        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartReplicaRequest"
6495    }
6496}
6497
6498/// Instance stop replica request.
6499#[derive(Clone, Default, PartialEq)]
6500#[non_exhaustive]
6501pub struct SqlInstancesStopReplicaRequest {
6502    /// Cloud SQL read replica instance name.
6503    pub instance: std::string::String,
6504
6505    /// ID of the project that contains the read replica.
6506    pub project: std::string::String,
6507
6508    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6509}
6510
6511impl SqlInstancesStopReplicaRequest {
6512    /// Creates a new default instance.
6513    pub fn new() -> Self {
6514        std::default::Default::default()
6515    }
6516
6517    /// Sets the value of [instance][crate::model::SqlInstancesStopReplicaRequest::instance].
6518    ///
6519    /// # Example
6520    /// ```ignore,no_run
6521    /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
6522    /// let x = SqlInstancesStopReplicaRequest::new().set_instance("example");
6523    /// ```
6524    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6525        self.instance = v.into();
6526        self
6527    }
6528
6529    /// Sets the value of [project][crate::model::SqlInstancesStopReplicaRequest::project].
6530    ///
6531    /// # Example
6532    /// ```ignore,no_run
6533    /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
6534    /// let x = SqlInstancesStopReplicaRequest::new().set_project("example");
6535    /// ```
6536    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6537        self.project = v.into();
6538        self
6539    }
6540}
6541
6542impl wkt::message::Message for SqlInstancesStopReplicaRequest {
6543    fn typename() -> &'static str {
6544        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStopReplicaRequest"
6545    }
6546}
6547
6548/// Instance truncate log request.
6549#[derive(Clone, Default, PartialEq)]
6550#[non_exhaustive]
6551pub struct SqlInstancesTruncateLogRequest {
6552    /// Cloud SQL instance ID. This does not include the project ID.
6553    pub instance: std::string::String,
6554
6555    /// Project ID of the Cloud SQL project.
6556    pub project: std::string::String,
6557
6558    #[allow(missing_docs)]
6559    pub body: std::option::Option<crate::model::InstancesTruncateLogRequest>,
6560
6561    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6562}
6563
6564impl SqlInstancesTruncateLogRequest {
6565    /// Creates a new default instance.
6566    pub fn new() -> Self {
6567        std::default::Default::default()
6568    }
6569
6570    /// Sets the value of [instance][crate::model::SqlInstancesTruncateLogRequest::instance].
6571    ///
6572    /// # Example
6573    /// ```ignore,no_run
6574    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6575    /// let x = SqlInstancesTruncateLogRequest::new().set_instance("example");
6576    /// ```
6577    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6578        self.instance = v.into();
6579        self
6580    }
6581
6582    /// Sets the value of [project][crate::model::SqlInstancesTruncateLogRequest::project].
6583    ///
6584    /// # Example
6585    /// ```ignore,no_run
6586    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6587    /// let x = SqlInstancesTruncateLogRequest::new().set_project("example");
6588    /// ```
6589    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6590        self.project = v.into();
6591        self
6592    }
6593
6594    /// Sets the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
6595    ///
6596    /// # Example
6597    /// ```ignore,no_run
6598    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6599    /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
6600    /// let x = SqlInstancesTruncateLogRequest::new().set_body(InstancesTruncateLogRequest::default()/* use setters */);
6601    /// ```
6602    pub fn set_body<T>(mut self, v: T) -> Self
6603    where
6604        T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
6605    {
6606        self.body = std::option::Option::Some(v.into());
6607        self
6608    }
6609
6610    /// Sets or clears the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
6611    ///
6612    /// # Example
6613    /// ```ignore,no_run
6614    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6615    /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
6616    /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(Some(InstancesTruncateLogRequest::default()/* use setters */));
6617    /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(None::<InstancesTruncateLogRequest>);
6618    /// ```
6619    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6620    where
6621        T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
6622    {
6623        self.body = v.map(|x| x.into());
6624        self
6625    }
6626}
6627
6628impl wkt::message::Message for SqlInstancesTruncateLogRequest {
6629    fn typename() -> &'static str {
6630        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesTruncateLogRequest"
6631    }
6632}
6633
6634/// Instance perform disk shrink request.
6635#[derive(Clone, Default, PartialEq)]
6636#[non_exhaustive]
6637pub struct SqlInstancesPerformDiskShrinkRequest {
6638    /// Cloud SQL instance ID. This does not include the project ID.
6639    pub instance: std::string::String,
6640
6641    /// Project ID of the project that contains the instance.
6642    pub project: std::string::String,
6643
6644    /// Perform disk shrink context.
6645    pub body: std::option::Option<crate::model::PerformDiskShrinkContext>,
6646
6647    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6648}
6649
6650impl SqlInstancesPerformDiskShrinkRequest {
6651    /// Creates a new default instance.
6652    pub fn new() -> Self {
6653        std::default::Default::default()
6654    }
6655
6656    /// Sets the value of [instance][crate::model::SqlInstancesPerformDiskShrinkRequest::instance].
6657    ///
6658    /// # Example
6659    /// ```ignore,no_run
6660    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6661    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_instance("example");
6662    /// ```
6663    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6664        self.instance = v.into();
6665        self
6666    }
6667
6668    /// Sets the value of [project][crate::model::SqlInstancesPerformDiskShrinkRequest::project].
6669    ///
6670    /// # Example
6671    /// ```ignore,no_run
6672    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6673    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_project("example");
6674    /// ```
6675    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6676        self.project = v.into();
6677        self
6678    }
6679
6680    /// Sets the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
6681    ///
6682    /// # Example
6683    /// ```ignore,no_run
6684    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6685    /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
6686    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_body(PerformDiskShrinkContext::default()/* use setters */);
6687    /// ```
6688    pub fn set_body<T>(mut self, v: T) -> Self
6689    where
6690        T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
6691    {
6692        self.body = std::option::Option::Some(v.into());
6693        self
6694    }
6695
6696    /// Sets or clears the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
6697    ///
6698    /// # Example
6699    /// ```ignore,no_run
6700    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6701    /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
6702    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(Some(PerformDiskShrinkContext::default()/* use setters */));
6703    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(None::<PerformDiskShrinkContext>);
6704    /// ```
6705    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6706    where
6707        T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
6708    {
6709        self.body = v.map(|x| x.into());
6710        self
6711    }
6712}
6713
6714impl wkt::message::Message for SqlInstancesPerformDiskShrinkRequest {
6715    fn typename() -> &'static str {
6716        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest"
6717    }
6718}
6719
6720/// Instance update request.
6721#[derive(Clone, Default, PartialEq)]
6722#[non_exhaustive]
6723pub struct SqlInstancesUpdateRequest {
6724    /// Cloud SQL instance ID. This does not include the project ID.
6725    pub instance: std::string::String,
6726
6727    /// Project ID of the project that contains the instance.
6728    pub project: std::string::String,
6729
6730    #[allow(missing_docs)]
6731    pub body: std::option::Option<crate::model::DatabaseInstance>,
6732
6733    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6734}
6735
6736impl SqlInstancesUpdateRequest {
6737    /// Creates a new default instance.
6738    pub fn new() -> Self {
6739        std::default::Default::default()
6740    }
6741
6742    /// Sets the value of [instance][crate::model::SqlInstancesUpdateRequest::instance].
6743    ///
6744    /// # Example
6745    /// ```ignore,no_run
6746    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6747    /// let x = SqlInstancesUpdateRequest::new().set_instance("example");
6748    /// ```
6749    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6750        self.instance = v.into();
6751        self
6752    }
6753
6754    /// Sets the value of [project][crate::model::SqlInstancesUpdateRequest::project].
6755    ///
6756    /// # Example
6757    /// ```ignore,no_run
6758    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6759    /// let x = SqlInstancesUpdateRequest::new().set_project("example");
6760    /// ```
6761    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6762        self.project = v.into();
6763        self
6764    }
6765
6766    /// Sets the value of [body][crate::model::SqlInstancesUpdateRequest::body].
6767    ///
6768    /// # Example
6769    /// ```ignore,no_run
6770    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6771    /// use google_cloud_sql_v1::model::DatabaseInstance;
6772    /// let x = SqlInstancesUpdateRequest::new().set_body(DatabaseInstance::default()/* use setters */);
6773    /// ```
6774    pub fn set_body<T>(mut self, v: T) -> Self
6775    where
6776        T: std::convert::Into<crate::model::DatabaseInstance>,
6777    {
6778        self.body = std::option::Option::Some(v.into());
6779        self
6780    }
6781
6782    /// Sets or clears the value of [body][crate::model::SqlInstancesUpdateRequest::body].
6783    ///
6784    /// # Example
6785    /// ```ignore,no_run
6786    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6787    /// use google_cloud_sql_v1::model::DatabaseInstance;
6788    /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
6789    /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(None::<DatabaseInstance>);
6790    /// ```
6791    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6792    where
6793        T: std::convert::Into<crate::model::DatabaseInstance>,
6794    {
6795        self.body = v.map(|x| x.into());
6796        self
6797    }
6798}
6799
6800impl wkt::message::Message for SqlInstancesUpdateRequest {
6801    fn typename() -> &'static str {
6802        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesUpdateRequest"
6803    }
6804}
6805
6806/// Instance reschedule maintenance request.
6807#[derive(Clone, Default, PartialEq)]
6808#[non_exhaustive]
6809pub struct SqlInstancesRescheduleMaintenanceRequest {
6810    /// Cloud SQL instance ID. This does not include the project ID.
6811    pub instance: std::string::String,
6812
6813    /// ID of the project that contains the instance.
6814    pub project: std::string::String,
6815
6816    #[allow(missing_docs)]
6817    pub body: std::option::Option<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6818
6819    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6820}
6821
6822impl SqlInstancesRescheduleMaintenanceRequest {
6823    /// Creates a new default instance.
6824    pub fn new() -> Self {
6825        std::default::Default::default()
6826    }
6827
6828    /// Sets the value of [instance][crate::model::SqlInstancesRescheduleMaintenanceRequest::instance].
6829    ///
6830    /// # Example
6831    /// ```ignore,no_run
6832    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6833    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_instance("example");
6834    /// ```
6835    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6836        self.instance = v.into();
6837        self
6838    }
6839
6840    /// Sets the value of [project][crate::model::SqlInstancesRescheduleMaintenanceRequest::project].
6841    ///
6842    /// # Example
6843    /// ```ignore,no_run
6844    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6845    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_project("example");
6846    /// ```
6847    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6848        self.project = v.into();
6849        self
6850    }
6851
6852    /// Sets the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
6853    ///
6854    /// # Example
6855    /// ```ignore,no_run
6856    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6857    /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
6858    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_body(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */);
6859    /// ```
6860    pub fn set_body<T>(mut self, v: T) -> Self
6861    where
6862        T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6863    {
6864        self.body = std::option::Option::Some(v.into());
6865        self
6866    }
6867
6868    /// Sets or clears the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
6869    ///
6870    /// # Example
6871    /// ```ignore,no_run
6872    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6873    /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
6874    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(Some(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */));
6875    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(None::<SqlInstancesRescheduleMaintenanceRequestBody>);
6876    /// ```
6877    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6878    where
6879        T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6880    {
6881        self.body = v.map(|x| x.into());
6882        self
6883    }
6884}
6885
6886impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequest {
6887    fn typename() -> &'static str {
6888        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest"
6889    }
6890}
6891
6892/// Instance reencrypt request.
6893#[derive(Clone, Default, PartialEq)]
6894#[non_exhaustive]
6895pub struct SqlInstancesReencryptRequest {
6896    /// Cloud SQL instance ID. This does not include the project ID.
6897    pub instance: std::string::String,
6898
6899    /// ID of the project that contains the instance.
6900    pub project: std::string::String,
6901
6902    /// Reencrypt body that users request
6903    pub body: std::option::Option<crate::model::InstancesReencryptRequest>,
6904
6905    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6906}
6907
6908impl SqlInstancesReencryptRequest {
6909    /// Creates a new default instance.
6910    pub fn new() -> Self {
6911        std::default::Default::default()
6912    }
6913
6914    /// Sets the value of [instance][crate::model::SqlInstancesReencryptRequest::instance].
6915    ///
6916    /// # Example
6917    /// ```ignore,no_run
6918    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6919    /// let x = SqlInstancesReencryptRequest::new().set_instance("example");
6920    /// ```
6921    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6922        self.instance = v.into();
6923        self
6924    }
6925
6926    /// Sets the value of [project][crate::model::SqlInstancesReencryptRequest::project].
6927    ///
6928    /// # Example
6929    /// ```ignore,no_run
6930    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6931    /// let x = SqlInstancesReencryptRequest::new().set_project("example");
6932    /// ```
6933    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6934        self.project = v.into();
6935        self
6936    }
6937
6938    /// Sets the value of [body][crate::model::SqlInstancesReencryptRequest::body].
6939    ///
6940    /// # Example
6941    /// ```ignore,no_run
6942    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6943    /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
6944    /// let x = SqlInstancesReencryptRequest::new().set_body(InstancesReencryptRequest::default()/* use setters */);
6945    /// ```
6946    pub fn set_body<T>(mut self, v: T) -> Self
6947    where
6948        T: std::convert::Into<crate::model::InstancesReencryptRequest>,
6949    {
6950        self.body = std::option::Option::Some(v.into());
6951        self
6952    }
6953
6954    /// Sets or clears the value of [body][crate::model::SqlInstancesReencryptRequest::body].
6955    ///
6956    /// # Example
6957    /// ```ignore,no_run
6958    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6959    /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
6960    /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(Some(InstancesReencryptRequest::default()/* use setters */));
6961    /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(None::<InstancesReencryptRequest>);
6962    /// ```
6963    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6964    where
6965        T: std::convert::Into<crate::model::InstancesReencryptRequest>,
6966    {
6967        self.body = v.map(|x| x.into());
6968        self
6969    }
6970}
6971
6972impl wkt::message::Message for SqlInstancesReencryptRequest {
6973    fn typename() -> &'static str {
6974        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReencryptRequest"
6975    }
6976}
6977
6978/// Database Instance reencrypt request.
6979#[derive(Clone, Default, PartialEq)]
6980#[non_exhaustive]
6981pub struct InstancesReencryptRequest {
6982    /// Configuration specific to backup re-encryption
6983    pub backup_reencryption_config: std::option::Option<crate::model::BackupReencryptionConfig>,
6984
6985    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6986}
6987
6988impl InstancesReencryptRequest {
6989    /// Creates a new default instance.
6990    pub fn new() -> Self {
6991        std::default::Default::default()
6992    }
6993
6994    /// Sets the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
6995    ///
6996    /// # Example
6997    /// ```ignore,no_run
6998    /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
6999    /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
7000    /// let x = InstancesReencryptRequest::new().set_backup_reencryption_config(BackupReencryptionConfig::default()/* use setters */);
7001    /// ```
7002    pub fn set_backup_reencryption_config<T>(mut self, v: T) -> Self
7003    where
7004        T: std::convert::Into<crate::model::BackupReencryptionConfig>,
7005    {
7006        self.backup_reencryption_config = std::option::Option::Some(v.into());
7007        self
7008    }
7009
7010    /// Sets or clears the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
7011    ///
7012    /// # Example
7013    /// ```ignore,no_run
7014    /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
7015    /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
7016    /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(Some(BackupReencryptionConfig::default()/* use setters */));
7017    /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(None::<BackupReencryptionConfig>);
7018    /// ```
7019    pub fn set_or_clear_backup_reencryption_config<T>(mut self, v: std::option::Option<T>) -> Self
7020    where
7021        T: std::convert::Into<crate::model::BackupReencryptionConfig>,
7022    {
7023        self.backup_reencryption_config = v.map(|x| x.into());
7024        self
7025    }
7026}
7027
7028impl wkt::message::Message for InstancesReencryptRequest {
7029    fn typename() -> &'static str {
7030        "type.googleapis.com/google.cloud.sql.v1.InstancesReencryptRequest"
7031    }
7032}
7033
7034/// Backup Reencryption Config
7035#[derive(Clone, Default, PartialEq)]
7036#[non_exhaustive]
7037pub struct BackupReencryptionConfig {
7038    /// Backup re-encryption limit
7039    pub backup_limit: std::option::Option<i32>,
7040
7041    /// Type of backups users want to re-encrypt.
7042    pub backup_type: std::option::Option<crate::model::backup_reencryption_config::BackupType>,
7043
7044    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7045}
7046
7047impl BackupReencryptionConfig {
7048    /// Creates a new default instance.
7049    pub fn new() -> Self {
7050        std::default::Default::default()
7051    }
7052
7053    /// Sets the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
7054    ///
7055    /// # Example
7056    /// ```ignore,no_run
7057    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7058    /// let x = BackupReencryptionConfig::new().set_backup_limit(42);
7059    /// ```
7060    pub fn set_backup_limit<T>(mut self, v: T) -> Self
7061    where
7062        T: std::convert::Into<i32>,
7063    {
7064        self.backup_limit = std::option::Option::Some(v.into());
7065        self
7066    }
7067
7068    /// Sets or clears the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
7069    ///
7070    /// # Example
7071    /// ```ignore,no_run
7072    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7073    /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(Some(42));
7074    /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(None::<i32>);
7075    /// ```
7076    pub fn set_or_clear_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
7077    where
7078        T: std::convert::Into<i32>,
7079    {
7080        self.backup_limit = v.map(|x| x.into());
7081        self
7082    }
7083
7084    /// Sets the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
7085    ///
7086    /// # Example
7087    /// ```ignore,no_run
7088    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7089    /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
7090    /// let x0 = BackupReencryptionConfig::new().set_backup_type(BackupType::Automated);
7091    /// let x1 = BackupReencryptionConfig::new().set_backup_type(BackupType::OnDemand);
7092    /// ```
7093    pub fn set_backup_type<T>(mut self, v: T) -> Self
7094    where
7095        T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
7096    {
7097        self.backup_type = std::option::Option::Some(v.into());
7098        self
7099    }
7100
7101    /// Sets or clears the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
7102    ///
7103    /// # Example
7104    /// ```ignore,no_run
7105    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7106    /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
7107    /// let x0 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::Automated));
7108    /// let x1 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::OnDemand));
7109    /// let x_none = BackupReencryptionConfig::new().set_or_clear_backup_type(None::<BackupType>);
7110    /// ```
7111    pub fn set_or_clear_backup_type<T>(mut self, v: std::option::Option<T>) -> Self
7112    where
7113        T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
7114    {
7115        self.backup_type = v.map(|x| x.into());
7116        self
7117    }
7118}
7119
7120impl wkt::message::Message for BackupReencryptionConfig {
7121    fn typename() -> &'static str {
7122        "type.googleapis.com/google.cloud.sql.v1.BackupReencryptionConfig"
7123    }
7124}
7125
7126/// Defines additional types related to [BackupReencryptionConfig].
7127pub mod backup_reencryption_config {
7128    #[allow(unused_imports)]
7129    use super::*;
7130
7131    /// Backup type for re-encryption
7132    ///
7133    /// # Working with unknown values
7134    ///
7135    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7136    /// additional enum variants at any time. Adding new variants is not considered
7137    /// a breaking change. Applications should write their code in anticipation of:
7138    ///
7139    /// - New values appearing in future releases of the client library, **and**
7140    /// - New values received dynamically, without application changes.
7141    ///
7142    /// Please consult the [Working with enums] section in the user guide for some
7143    /// guidelines.
7144    ///
7145    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7146    #[derive(Clone, Debug, PartialEq)]
7147    #[non_exhaustive]
7148    pub enum BackupType {
7149        /// Unknown backup type, will be defaulted to AUTOMATIC backup type
7150        Unspecified,
7151        /// Reencrypt automatic backups
7152        Automated,
7153        /// Reencrypt on-demand backups
7154        OnDemand,
7155        /// If set, the enum was initialized with an unknown value.
7156        ///
7157        /// Applications can examine the value using [BackupType::value] or
7158        /// [BackupType::name].
7159        UnknownValue(backup_type::UnknownValue),
7160    }
7161
7162    #[doc(hidden)]
7163    pub mod backup_type {
7164        #[allow(unused_imports)]
7165        use super::*;
7166        #[derive(Clone, Debug, PartialEq)]
7167        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7168    }
7169
7170    impl BackupType {
7171        /// Gets the enum value.
7172        ///
7173        /// Returns `None` if the enum contains an unknown value deserialized from
7174        /// the string representation of enums.
7175        pub fn value(&self) -> std::option::Option<i32> {
7176            match self {
7177                Self::Unspecified => std::option::Option::Some(0),
7178                Self::Automated => std::option::Option::Some(1),
7179                Self::OnDemand => std::option::Option::Some(2),
7180                Self::UnknownValue(u) => u.0.value(),
7181            }
7182        }
7183
7184        /// Gets the enum value as a string.
7185        ///
7186        /// Returns `None` if the enum contains an unknown value deserialized from
7187        /// the integer representation of enums.
7188        pub fn name(&self) -> std::option::Option<&str> {
7189            match self {
7190                Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
7191                Self::Automated => std::option::Option::Some("AUTOMATED"),
7192                Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
7193                Self::UnknownValue(u) => u.0.name(),
7194            }
7195        }
7196    }
7197
7198    impl std::default::Default for BackupType {
7199        fn default() -> Self {
7200            use std::convert::From;
7201            Self::from(0)
7202        }
7203    }
7204
7205    impl std::fmt::Display for BackupType {
7206        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7207            wkt::internal::display_enum(f, self.name(), self.value())
7208        }
7209    }
7210
7211    impl std::convert::From<i32> for BackupType {
7212        fn from(value: i32) -> Self {
7213            match value {
7214                0 => Self::Unspecified,
7215                1 => Self::Automated,
7216                2 => Self::OnDemand,
7217                _ => Self::UnknownValue(backup_type::UnknownValue(
7218                    wkt::internal::UnknownEnumValue::Integer(value),
7219                )),
7220            }
7221        }
7222    }
7223
7224    impl std::convert::From<&str> for BackupType {
7225        fn from(value: &str) -> Self {
7226            use std::string::ToString;
7227            match value {
7228                "BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
7229                "AUTOMATED" => Self::Automated,
7230                "ON_DEMAND" => Self::OnDemand,
7231                _ => Self::UnknownValue(backup_type::UnknownValue(
7232                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7233                )),
7234            }
7235        }
7236    }
7237
7238    impl serde::ser::Serialize for BackupType {
7239        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7240        where
7241            S: serde::Serializer,
7242        {
7243            match self {
7244                Self::Unspecified => serializer.serialize_i32(0),
7245                Self::Automated => serializer.serialize_i32(1),
7246                Self::OnDemand => serializer.serialize_i32(2),
7247                Self::UnknownValue(u) => u.0.serialize(serializer),
7248            }
7249        }
7250    }
7251
7252    impl<'de> serde::de::Deserialize<'de> for BackupType {
7253        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7254        where
7255            D: serde::Deserializer<'de>,
7256        {
7257            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
7258                ".google.cloud.sql.v1.BackupReencryptionConfig.BackupType",
7259            ))
7260        }
7261    }
7262}
7263
7264/// The selected object that Cloud SQL migrates.
7265#[derive(Clone, Default, PartialEq)]
7266#[non_exhaustive]
7267pub struct ExternalSyncSelectedObject {
7268    /// The name of the database that Cloud SQL migrates.
7269    pub database: std::string::String,
7270
7271    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7272}
7273
7274impl ExternalSyncSelectedObject {
7275    /// Creates a new default instance.
7276    pub fn new() -> Self {
7277        std::default::Default::default()
7278    }
7279
7280    /// Sets the value of [database][crate::model::ExternalSyncSelectedObject::database].
7281    ///
7282    /// # Example
7283    /// ```ignore,no_run
7284    /// # use google_cloud_sql_v1::model::ExternalSyncSelectedObject;
7285    /// let x = ExternalSyncSelectedObject::new().set_database("example");
7286    /// ```
7287    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7288        self.database = v.into();
7289        self
7290    }
7291}
7292
7293impl wkt::message::Message for ExternalSyncSelectedObject {
7294    fn typename() -> &'static str {
7295        "type.googleapis.com/google.cloud.sql.v1.ExternalSyncSelectedObject"
7296    }
7297}
7298
7299/// Instance get disk shrink config request.
7300#[derive(Clone, Default, PartialEq)]
7301#[non_exhaustive]
7302pub struct SqlInstancesGetDiskShrinkConfigRequest {
7303    /// Cloud SQL instance ID. This does not include the project ID.
7304    pub instance: std::string::String,
7305
7306    /// Project ID of the project that contains the instance.
7307    pub project: std::string::String,
7308
7309    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7310}
7311
7312impl SqlInstancesGetDiskShrinkConfigRequest {
7313    /// Creates a new default instance.
7314    pub fn new() -> Self {
7315        std::default::Default::default()
7316    }
7317
7318    /// Sets the value of [instance][crate::model::SqlInstancesGetDiskShrinkConfigRequest::instance].
7319    ///
7320    /// # Example
7321    /// ```ignore,no_run
7322    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
7323    /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_instance("example");
7324    /// ```
7325    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7326        self.instance = v.into();
7327        self
7328    }
7329
7330    /// Sets the value of [project][crate::model::SqlInstancesGetDiskShrinkConfigRequest::project].
7331    ///
7332    /// # Example
7333    /// ```ignore,no_run
7334    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
7335    /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_project("example");
7336    /// ```
7337    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7338        self.project = v.into();
7339        self
7340    }
7341}
7342
7343impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigRequest {
7344    fn typename() -> &'static str {
7345        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest"
7346    }
7347}
7348
7349/// Instance verify external sync settings request.
7350#[derive(Clone, Default, PartialEq)]
7351#[non_exhaustive]
7352pub struct SqlInstancesVerifyExternalSyncSettingsRequest {
7353    /// Cloud SQL instance ID. This does not include the project ID.
7354    pub instance: std::string::String,
7355
7356    /// Project ID of the project that contains the instance.
7357    pub project: std::string::String,
7358
7359    /// Flag to enable verifying connection only
7360    pub verify_connection_only: bool,
7361
7362    /// External sync mode
7363    pub sync_mode:
7364        crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7365
7366    /// Optional. Flag to verify settings required by replication setup only
7367    pub verify_replication_only: bool,
7368
7369    /// Optional. MigrationType configures the migration to use physical files or
7370    /// logical dump files. If not set, then the logical dump file configuration is
7371    /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
7372    pub migration_type:
7373        crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7374
7375    /// Optional. Parallel level for initial data sync. Only applicable for
7376    /// PostgreSQL.
7377    pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
7378
7379    /// Optional. Migrate only the specified objects from the source instance. If
7380    /// this field is empty, then migrate all objects.
7381    pub selected_objects: std::vec::Vec<crate::model::ExternalSyncSelectedObject>,
7382
7383    #[allow(missing_docs)]
7384    pub sync_config: std::option::Option<
7385        crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
7386    >,
7387
7388    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7389}
7390
7391impl SqlInstancesVerifyExternalSyncSettingsRequest {
7392    /// Creates a new default instance.
7393    pub fn new() -> Self {
7394        std::default::Default::default()
7395    }
7396
7397    /// Sets the value of [instance][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::instance].
7398    ///
7399    /// # Example
7400    /// ```ignore,no_run
7401    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7402    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_instance("example");
7403    /// ```
7404    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7405        self.instance = v.into();
7406        self
7407    }
7408
7409    /// Sets the value of [project][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::project].
7410    ///
7411    /// # Example
7412    /// ```ignore,no_run
7413    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7414    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_project("example");
7415    /// ```
7416    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7417        self.project = v.into();
7418        self
7419    }
7420
7421    /// Sets the value of [verify_connection_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_connection_only].
7422    ///
7423    /// # Example
7424    /// ```ignore,no_run
7425    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7426    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_connection_only(true);
7427    /// ```
7428    pub fn set_verify_connection_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7429        self.verify_connection_only = v.into();
7430        self
7431    }
7432
7433    /// Sets the value of [sync_mode][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_mode].
7434    ///
7435    /// # Example
7436    /// ```ignore,no_run
7437    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7438    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
7439    /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Online);
7440    /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Offline);
7441    /// ```
7442    pub fn set_sync_mode<
7443        T: std::convert::Into<
7444                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7445            >,
7446    >(
7447        mut self,
7448        v: T,
7449    ) -> Self {
7450        self.sync_mode = v.into();
7451        self
7452    }
7453
7454    /// Sets the value of [verify_replication_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_replication_only].
7455    ///
7456    /// # Example
7457    /// ```ignore,no_run
7458    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7459    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_replication_only(true);
7460    /// ```
7461    pub fn set_verify_replication_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7462        self.verify_replication_only = v.into();
7463        self
7464    }
7465
7466    /// Sets the value of [migration_type][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::migration_type].
7467    ///
7468    /// # Example
7469    /// ```ignore,no_run
7470    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7471    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
7472    /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Logical);
7473    /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Physical);
7474    /// ```
7475    pub fn set_migration_type<
7476        T: std::convert::Into<
7477                crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7478            >,
7479    >(
7480        mut self,
7481        v: T,
7482    ) -> Self {
7483        self.migration_type = v.into();
7484        self
7485    }
7486
7487    /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_parallel_level].
7488    ///
7489    /// # Example
7490    /// ```ignore,no_run
7491    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7492    /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
7493    /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
7494    /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
7495    /// let x2 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
7496    /// ```
7497    pub fn set_sync_parallel_level<
7498        T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
7499    >(
7500        mut self,
7501        v: T,
7502    ) -> Self {
7503        self.sync_parallel_level = v.into();
7504        self
7505    }
7506
7507    /// Sets the value of [selected_objects][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::selected_objects].
7508    ///
7509    /// # Example
7510    /// ```ignore,no_run
7511    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7512    /// use google_cloud_sql_v1::model::ExternalSyncSelectedObject;
7513    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new()
7514    ///     .set_selected_objects([
7515    ///         ExternalSyncSelectedObject::default()/* use setters */,
7516    ///         ExternalSyncSelectedObject::default()/* use (different) setters */,
7517    ///     ]);
7518    /// ```
7519    pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
7520    where
7521        T: std::iter::IntoIterator<Item = V>,
7522        V: std::convert::Into<crate::model::ExternalSyncSelectedObject>,
7523    {
7524        use std::iter::Iterator;
7525        self.selected_objects = v.into_iter().map(|i| i.into()).collect();
7526        self
7527    }
7528
7529    /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config].
7530    ///
7531    /// Note that all the setters affecting `sync_config` are mutually
7532    /// exclusive.
7533    ///
7534    /// # Example
7535    /// ```ignore,no_run
7536    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7537    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7538    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_config(Some(
7539    ///     google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
7540    /// ```
7541    pub fn set_sync_config<
7542        T: std::convert::Into<
7543                std::option::Option<
7544                    crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
7545                >,
7546            >,
7547    >(
7548        mut self,
7549        v: T,
7550    ) -> Self {
7551        self.sync_config = v.into();
7552        self
7553    }
7554
7555    /// The value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
7556    /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
7557    /// holds a different branch.
7558    pub fn mysql_sync_config(
7559        &self,
7560    ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
7561        #[allow(unreachable_patterns)]
7562        self.sync_config.as_ref().and_then(|v| match v {
7563            crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
7564            _ => std::option::Option::None,
7565        })
7566    }
7567
7568    /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
7569    /// to hold a `MysqlSyncConfig`.
7570    ///
7571    /// Note that all the setters affecting `sync_config` are
7572    /// mutually exclusive.
7573    ///
7574    /// # Example
7575    /// ```ignore,no_run
7576    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7577    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7578    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
7579    /// assert!(x.mysql_sync_config().is_some());
7580    /// ```
7581    pub fn set_mysql_sync_config<
7582        T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
7583    >(
7584        mut self,
7585        v: T,
7586    ) -> Self {
7587        self.sync_config = std::option::Option::Some(
7588            crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(
7589                v.into()
7590            )
7591        );
7592        self
7593    }
7594}
7595
7596impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsRequest {
7597    fn typename() -> &'static str {
7598        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest"
7599    }
7600}
7601
7602/// Defines additional types related to [SqlInstancesVerifyExternalSyncSettingsRequest].
7603pub mod sql_instances_verify_external_sync_settings_request {
7604    #[allow(unused_imports)]
7605    use super::*;
7606
7607    /// Enum for [ExternalSyncMode].
7608    ///
7609    /// # Working with unknown values
7610    ///
7611    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7612    /// additional enum variants at any time. Adding new variants is not considered
7613    /// a breaking change. Applications should write their code in anticipation of:
7614    ///
7615    /// - New values appearing in future releases of the client library, **and**
7616    /// - New values received dynamically, without application changes.
7617    ///
7618    /// Please consult the [Working with enums] section in the user guide for some
7619    /// guidelines.
7620    ///
7621    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7622    #[derive(Clone, Debug, PartialEq)]
7623    #[non_exhaustive]
7624    pub enum ExternalSyncMode {
7625        /// Unknown external sync mode, will be defaulted to ONLINE mode
7626        Unspecified,
7627        /// Online external sync will set up replication after initial data external
7628        /// sync
7629        Online,
7630        /// Offline external sync only dumps and loads a one-time snapshot of
7631        /// the primary instance's data
7632        Offline,
7633        /// If set, the enum was initialized with an unknown value.
7634        ///
7635        /// Applications can examine the value using [ExternalSyncMode::value] or
7636        /// [ExternalSyncMode::name].
7637        UnknownValue(external_sync_mode::UnknownValue),
7638    }
7639
7640    #[doc(hidden)]
7641    pub mod external_sync_mode {
7642        #[allow(unused_imports)]
7643        use super::*;
7644        #[derive(Clone, Debug, PartialEq)]
7645        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7646    }
7647
7648    impl ExternalSyncMode {
7649        /// Gets the enum value.
7650        ///
7651        /// Returns `None` if the enum contains an unknown value deserialized from
7652        /// the string representation of enums.
7653        pub fn value(&self) -> std::option::Option<i32> {
7654            match self {
7655                Self::Unspecified => std::option::Option::Some(0),
7656                Self::Online => std::option::Option::Some(1),
7657                Self::Offline => std::option::Option::Some(2),
7658                Self::UnknownValue(u) => u.0.value(),
7659            }
7660        }
7661
7662        /// Gets the enum value as a string.
7663        ///
7664        /// Returns `None` if the enum contains an unknown value deserialized from
7665        /// the integer representation of enums.
7666        pub fn name(&self) -> std::option::Option<&str> {
7667            match self {
7668                Self::Unspecified => std::option::Option::Some("EXTERNAL_SYNC_MODE_UNSPECIFIED"),
7669                Self::Online => std::option::Option::Some("ONLINE"),
7670                Self::Offline => std::option::Option::Some("OFFLINE"),
7671                Self::UnknownValue(u) => u.0.name(),
7672            }
7673        }
7674    }
7675
7676    impl std::default::Default for ExternalSyncMode {
7677        fn default() -> Self {
7678            use std::convert::From;
7679            Self::from(0)
7680        }
7681    }
7682
7683    impl std::fmt::Display for ExternalSyncMode {
7684        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7685            wkt::internal::display_enum(f, self.name(), self.value())
7686        }
7687    }
7688
7689    impl std::convert::From<i32> for ExternalSyncMode {
7690        fn from(value: i32) -> Self {
7691            match value {
7692                0 => Self::Unspecified,
7693                1 => Self::Online,
7694                2 => Self::Offline,
7695                _ => Self::UnknownValue(external_sync_mode::UnknownValue(
7696                    wkt::internal::UnknownEnumValue::Integer(value),
7697                )),
7698            }
7699        }
7700    }
7701
7702    impl std::convert::From<&str> for ExternalSyncMode {
7703        fn from(value: &str) -> Self {
7704            use std::string::ToString;
7705            match value {
7706                "EXTERNAL_SYNC_MODE_UNSPECIFIED" => Self::Unspecified,
7707                "ONLINE" => Self::Online,
7708                "OFFLINE" => Self::Offline,
7709                _ => Self::UnknownValue(external_sync_mode::UnknownValue(
7710                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7711                )),
7712            }
7713        }
7714    }
7715
7716    impl serde::ser::Serialize for ExternalSyncMode {
7717        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7718        where
7719            S: serde::Serializer,
7720        {
7721            match self {
7722                Self::Unspecified => serializer.serialize_i32(0),
7723                Self::Online => serializer.serialize_i32(1),
7724                Self::Offline => serializer.serialize_i32(2),
7725                Self::UnknownValue(u) => u.0.serialize(serializer),
7726            }
7727        }
7728    }
7729
7730    impl<'de> serde::de::Deserialize<'de> for ExternalSyncMode {
7731        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7732        where
7733            D: serde::Deserializer<'de>,
7734        {
7735            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExternalSyncMode>::new(
7736                ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode"))
7737        }
7738    }
7739
7740    /// MigrationType determines whether the migration is a physical file-based
7741    /// migration or a logical dump file-based migration.
7742    ///
7743    /// # Working with unknown values
7744    ///
7745    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7746    /// additional enum variants at any time. Adding new variants is not considered
7747    /// a breaking change. Applications should write their code in anticipation of:
7748    ///
7749    /// - New values appearing in future releases of the client library, **and**
7750    /// - New values received dynamically, without application changes.
7751    ///
7752    /// Please consult the [Working with enums] section in the user guide for some
7753    /// guidelines.
7754    ///
7755    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7756    #[derive(Clone, Debug, PartialEq)]
7757    #[non_exhaustive]
7758    pub enum MigrationType {
7759        /// Default value is a logical dump file-based migration
7760        Unspecified,
7761        /// Logical dump file-based migration
7762        Logical,
7763        /// Physical file-based migration
7764        Physical,
7765        /// If set, the enum was initialized with an unknown value.
7766        ///
7767        /// Applications can examine the value using [MigrationType::value] or
7768        /// [MigrationType::name].
7769        UnknownValue(migration_type::UnknownValue),
7770    }
7771
7772    #[doc(hidden)]
7773    pub mod migration_type {
7774        #[allow(unused_imports)]
7775        use super::*;
7776        #[derive(Clone, Debug, PartialEq)]
7777        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7778    }
7779
7780    impl MigrationType {
7781        /// Gets the enum value.
7782        ///
7783        /// Returns `None` if the enum contains an unknown value deserialized from
7784        /// the string representation of enums.
7785        pub fn value(&self) -> std::option::Option<i32> {
7786            match self {
7787                Self::Unspecified => std::option::Option::Some(0),
7788                Self::Logical => std::option::Option::Some(1),
7789                Self::Physical => std::option::Option::Some(2),
7790                Self::UnknownValue(u) => u.0.value(),
7791            }
7792        }
7793
7794        /// Gets the enum value as a string.
7795        ///
7796        /// Returns `None` if the enum contains an unknown value deserialized from
7797        /// the integer representation of enums.
7798        pub fn name(&self) -> std::option::Option<&str> {
7799            match self {
7800                Self::Unspecified => std::option::Option::Some("MIGRATION_TYPE_UNSPECIFIED"),
7801                Self::Logical => std::option::Option::Some("LOGICAL"),
7802                Self::Physical => std::option::Option::Some("PHYSICAL"),
7803                Self::UnknownValue(u) => u.0.name(),
7804            }
7805        }
7806    }
7807
7808    impl std::default::Default for MigrationType {
7809        fn default() -> Self {
7810            use std::convert::From;
7811            Self::from(0)
7812        }
7813    }
7814
7815    impl std::fmt::Display for MigrationType {
7816        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7817            wkt::internal::display_enum(f, self.name(), self.value())
7818        }
7819    }
7820
7821    impl std::convert::From<i32> for MigrationType {
7822        fn from(value: i32) -> Self {
7823            match value {
7824                0 => Self::Unspecified,
7825                1 => Self::Logical,
7826                2 => Self::Physical,
7827                _ => Self::UnknownValue(migration_type::UnknownValue(
7828                    wkt::internal::UnknownEnumValue::Integer(value),
7829                )),
7830            }
7831        }
7832    }
7833
7834    impl std::convert::From<&str> for MigrationType {
7835        fn from(value: &str) -> Self {
7836            use std::string::ToString;
7837            match value {
7838                "MIGRATION_TYPE_UNSPECIFIED" => Self::Unspecified,
7839                "LOGICAL" => Self::Logical,
7840                "PHYSICAL" => Self::Physical,
7841                _ => Self::UnknownValue(migration_type::UnknownValue(
7842                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7843                )),
7844            }
7845        }
7846    }
7847
7848    impl serde::ser::Serialize for MigrationType {
7849        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7850        where
7851            S: serde::Serializer,
7852        {
7853            match self {
7854                Self::Unspecified => serializer.serialize_i32(0),
7855                Self::Logical => serializer.serialize_i32(1),
7856                Self::Physical => serializer.serialize_i32(2),
7857                Self::UnknownValue(u) => u.0.serialize(serializer),
7858            }
7859        }
7860    }
7861
7862    impl<'de> serde::de::Deserialize<'de> for MigrationType {
7863        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7864        where
7865            D: serde::Deserializer<'de>,
7866        {
7867            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationType>::new(
7868                ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType",
7869            ))
7870        }
7871    }
7872
7873    #[allow(missing_docs)]
7874    #[derive(Clone, Debug, PartialEq)]
7875    #[non_exhaustive]
7876    pub enum SyncConfig {
7877        /// Optional. MySQL-specific settings for start external sync.
7878        MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
7879    }
7880}
7881
7882/// Instance start external sync request.
7883#[derive(Clone, Default, PartialEq)]
7884#[non_exhaustive]
7885pub struct SqlInstancesStartExternalSyncRequest {
7886    /// Cloud SQL instance ID. This does not include the project ID.
7887    pub instance: std::string::String,
7888
7889    /// ID of the project that contains the instance.
7890    pub project: std::string::String,
7891
7892    /// External sync mode.
7893    pub sync_mode:
7894        crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7895
7896    /// Whether to skip the verification step (VESS).
7897    pub skip_verification: bool,
7898
7899    /// Optional. Parallel level for initial data sync. Currently only applicable
7900    /// for MySQL.
7901    pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
7902
7903    /// Optional. MigrationType configures the migration to use physical files or
7904    /// logical dump files. If not set, then the logical dump file configuration is
7905    /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
7906    pub migration_type:
7907        crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7908
7909    /// Optional. MySQL only. True if end-user has confirmed that this SES call
7910    /// will wipe replica databases overlapping with the proposed selected_objects.
7911    /// If this field is not set and there are both overlapping and additional
7912    /// databases proposed, an error will be returned.
7913    pub replica_overwrite_enabled: bool,
7914
7915    #[allow(missing_docs)]
7916    pub sync_config:
7917        std::option::Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>,
7918
7919    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7920}
7921
7922impl SqlInstancesStartExternalSyncRequest {
7923    /// Creates a new default instance.
7924    pub fn new() -> Self {
7925        std::default::Default::default()
7926    }
7927
7928    /// Sets the value of [instance][crate::model::SqlInstancesStartExternalSyncRequest::instance].
7929    ///
7930    /// # Example
7931    /// ```ignore,no_run
7932    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7933    /// let x = SqlInstancesStartExternalSyncRequest::new().set_instance("example");
7934    /// ```
7935    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7936        self.instance = v.into();
7937        self
7938    }
7939
7940    /// Sets the value of [project][crate::model::SqlInstancesStartExternalSyncRequest::project].
7941    ///
7942    /// # Example
7943    /// ```ignore,no_run
7944    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7945    /// let x = SqlInstancesStartExternalSyncRequest::new().set_project("example");
7946    /// ```
7947    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7948        self.project = v.into();
7949        self
7950    }
7951
7952    /// Sets the value of [sync_mode][crate::model::SqlInstancesStartExternalSyncRequest::sync_mode].
7953    ///
7954    /// # Example
7955    /// ```ignore,no_run
7956    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7957    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
7958    /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Online);
7959    /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Offline);
7960    /// ```
7961    pub fn set_sync_mode<
7962        T: std::convert::Into<
7963                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7964            >,
7965    >(
7966        mut self,
7967        v: T,
7968    ) -> Self {
7969        self.sync_mode = v.into();
7970        self
7971    }
7972
7973    /// Sets the value of [skip_verification][crate::model::SqlInstancesStartExternalSyncRequest::skip_verification].
7974    ///
7975    /// # Example
7976    /// ```ignore,no_run
7977    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7978    /// let x = SqlInstancesStartExternalSyncRequest::new().set_skip_verification(true);
7979    /// ```
7980    pub fn set_skip_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7981        self.skip_verification = v.into();
7982        self
7983    }
7984
7985    /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesStartExternalSyncRequest::sync_parallel_level].
7986    ///
7987    /// # Example
7988    /// ```ignore,no_run
7989    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7990    /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
7991    /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
7992    /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
7993    /// let x2 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
7994    /// ```
7995    pub fn set_sync_parallel_level<
7996        T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
7997    >(
7998        mut self,
7999        v: T,
8000    ) -> Self {
8001        self.sync_parallel_level = v.into();
8002        self
8003    }
8004
8005    /// Sets the value of [migration_type][crate::model::SqlInstancesStartExternalSyncRequest::migration_type].
8006    ///
8007    /// # Example
8008    /// ```ignore,no_run
8009    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8010    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
8011    /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Logical);
8012    /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Physical);
8013    /// ```
8014    pub fn set_migration_type<
8015        T: std::convert::Into<
8016                crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
8017            >,
8018    >(
8019        mut self,
8020        v: T,
8021    ) -> Self {
8022        self.migration_type = v.into();
8023        self
8024    }
8025
8026    /// Sets the value of [replica_overwrite_enabled][crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled].
8027    ///
8028    /// # Example
8029    /// ```ignore,no_run
8030    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8031    /// let x = SqlInstancesStartExternalSyncRequest::new().set_replica_overwrite_enabled(true);
8032    /// ```
8033    pub fn set_replica_overwrite_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8034        self.replica_overwrite_enabled = v.into();
8035        self
8036    }
8037
8038    /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config].
8039    ///
8040    /// Note that all the setters affecting `sync_config` are mutually
8041    /// exclusive.
8042    ///
8043    /// # Example
8044    /// ```ignore,no_run
8045    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8046    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
8047    /// let x = SqlInstancesStartExternalSyncRequest::new().set_sync_config(Some(
8048    ///     google_cloud_sql_v1::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
8049    /// ```
8050    pub fn set_sync_config<
8051        T: std::convert::Into<
8052                std::option::Option<
8053                    crate::model::sql_instances_start_external_sync_request::SyncConfig,
8054                >,
8055            >,
8056    >(
8057        mut self,
8058        v: T,
8059    ) -> Self {
8060        self.sync_config = v.into();
8061        self
8062    }
8063
8064    /// The value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
8065    /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
8066    /// holds a different branch.
8067    pub fn mysql_sync_config(
8068        &self,
8069    ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
8070        #[allow(unreachable_patterns)]
8071        self.sync_config.as_ref().and_then(|v| match v {
8072            crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
8073            _ => std::option::Option::None,
8074        })
8075    }
8076
8077    /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
8078    /// to hold a `MysqlSyncConfig`.
8079    ///
8080    /// Note that all the setters affecting `sync_config` are
8081    /// mutually exclusive.
8082    ///
8083    /// # Example
8084    /// ```ignore,no_run
8085    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8086    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
8087    /// let x = SqlInstancesStartExternalSyncRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
8088    /// assert!(x.mysql_sync_config().is_some());
8089    /// ```
8090    pub fn set_mysql_sync_config<
8091        T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
8092    >(
8093        mut self,
8094        v: T,
8095    ) -> Self {
8096        self.sync_config = std::option::Option::Some(
8097            crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(
8098                v.into(),
8099            ),
8100        );
8101        self
8102    }
8103}
8104
8105impl wkt::message::Message for SqlInstancesStartExternalSyncRequest {
8106    fn typename() -> &'static str {
8107        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest"
8108    }
8109}
8110
8111/// Defines additional types related to [SqlInstancesStartExternalSyncRequest].
8112pub mod sql_instances_start_external_sync_request {
8113    #[allow(unused_imports)]
8114    use super::*;
8115
8116    #[allow(missing_docs)]
8117    #[derive(Clone, Debug, PartialEq)]
8118    #[non_exhaustive]
8119    pub enum SyncConfig {
8120        /// MySQL-specific settings for start external sync.
8121        MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
8122    }
8123}
8124
8125/// Instance reset replica size request.
8126#[derive(Clone, Default, PartialEq)]
8127#[non_exhaustive]
8128pub struct SqlInstancesResetReplicaSizeRequest {
8129    /// Cloud SQL read replica instance name.
8130    pub instance: std::string::String,
8131
8132    /// ID of the project that contains the read replica.
8133    pub project: std::string::String,
8134
8135    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8136}
8137
8138impl SqlInstancesResetReplicaSizeRequest {
8139    /// Creates a new default instance.
8140    pub fn new() -> Self {
8141        std::default::Default::default()
8142    }
8143
8144    /// Sets the value of [instance][crate::model::SqlInstancesResetReplicaSizeRequest::instance].
8145    ///
8146    /// # Example
8147    /// ```ignore,no_run
8148    /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
8149    /// let x = SqlInstancesResetReplicaSizeRequest::new().set_instance("example");
8150    /// ```
8151    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8152        self.instance = v.into();
8153        self
8154    }
8155
8156    /// Sets the value of [project][crate::model::SqlInstancesResetReplicaSizeRequest::project].
8157    ///
8158    /// # Example
8159    /// ```ignore,no_run
8160    /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
8161    /// let x = SqlInstancesResetReplicaSizeRequest::new().set_project("example");
8162    /// ```
8163    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8164        self.project = v.into();
8165        self
8166    }
8167}
8168
8169impl wkt::message::Message for SqlInstancesResetReplicaSizeRequest {
8170    fn typename() -> &'static str {
8171        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest"
8172    }
8173}
8174
8175/// Instance create ephemeral certificate request.
8176#[derive(Clone, Default, PartialEq)]
8177#[non_exhaustive]
8178pub struct SqlInstancesCreateEphemeralCertRequest {
8179    /// Cloud SQL instance ID. This does not include the project ID.
8180    pub instance: std::string::String,
8181
8182    /// Project ID of the Cloud SQL project.
8183    pub project: std::string::String,
8184
8185    #[allow(missing_docs)]
8186    pub body: std::option::Option<crate::model::SslCertsCreateEphemeralRequest>,
8187
8188    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8189}
8190
8191impl SqlInstancesCreateEphemeralCertRequest {
8192    /// Creates a new default instance.
8193    pub fn new() -> Self {
8194        std::default::Default::default()
8195    }
8196
8197    /// Sets the value of [instance][crate::model::SqlInstancesCreateEphemeralCertRequest::instance].
8198    ///
8199    /// # Example
8200    /// ```ignore,no_run
8201    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8202    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_instance("example");
8203    /// ```
8204    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8205        self.instance = v.into();
8206        self
8207    }
8208
8209    /// Sets the value of [project][crate::model::SqlInstancesCreateEphemeralCertRequest::project].
8210    ///
8211    /// # Example
8212    /// ```ignore,no_run
8213    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8214    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_project("example");
8215    /// ```
8216    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8217        self.project = v.into();
8218        self
8219    }
8220
8221    /// Sets the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
8222    ///
8223    /// # Example
8224    /// ```ignore,no_run
8225    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8226    /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8227    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_body(SslCertsCreateEphemeralRequest::default()/* use setters */);
8228    /// ```
8229    pub fn set_body<T>(mut self, v: T) -> Self
8230    where
8231        T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
8232    {
8233        self.body = std::option::Option::Some(v.into());
8234        self
8235    }
8236
8237    /// Sets or clears the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
8238    ///
8239    /// # Example
8240    /// ```ignore,no_run
8241    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8242    /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8243    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(Some(SslCertsCreateEphemeralRequest::default()/* use setters */));
8244    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(None::<SslCertsCreateEphemeralRequest>);
8245    /// ```
8246    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
8247    where
8248        T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
8249    {
8250        self.body = v.map(|x| x.into());
8251        self
8252    }
8253}
8254
8255impl wkt::message::Message for SqlInstancesCreateEphemeralCertRequest {
8256    fn typename() -> &'static str {
8257        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest"
8258    }
8259}
8260
8261/// Database instance clone request.
8262#[derive(Clone, Default, PartialEq)]
8263#[non_exhaustive]
8264pub struct InstancesCloneRequest {
8265    /// Required. Contains details about the clone operation.
8266    pub clone_context: std::option::Option<crate::model::CloneContext>,
8267
8268    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8269}
8270
8271impl InstancesCloneRequest {
8272    /// Creates a new default instance.
8273    pub fn new() -> Self {
8274        std::default::Default::default()
8275    }
8276
8277    /// Sets the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
8278    ///
8279    /// # Example
8280    /// ```ignore,no_run
8281    /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
8282    /// use google_cloud_sql_v1::model::CloneContext;
8283    /// let x = InstancesCloneRequest::new().set_clone_context(CloneContext::default()/* use setters */);
8284    /// ```
8285    pub fn set_clone_context<T>(mut self, v: T) -> Self
8286    where
8287        T: std::convert::Into<crate::model::CloneContext>,
8288    {
8289        self.clone_context = std::option::Option::Some(v.into());
8290        self
8291    }
8292
8293    /// Sets or clears the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
8294    ///
8295    /// # Example
8296    /// ```ignore,no_run
8297    /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
8298    /// use google_cloud_sql_v1::model::CloneContext;
8299    /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(Some(CloneContext::default()/* use setters */));
8300    /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(None::<CloneContext>);
8301    /// ```
8302    pub fn set_or_clear_clone_context<T>(mut self, v: std::option::Option<T>) -> Self
8303    where
8304        T: std::convert::Into<crate::model::CloneContext>,
8305    {
8306        self.clone_context = v.map(|x| x.into());
8307        self
8308    }
8309}
8310
8311impl wkt::message::Message for InstancesCloneRequest {
8312    fn typename() -> &'static str {
8313        "type.googleapis.com/google.cloud.sql.v1.InstancesCloneRequest"
8314    }
8315}
8316
8317/// Database demote primary instance request.
8318#[derive(Clone, Default, PartialEq)]
8319#[non_exhaustive]
8320pub struct InstancesDemoteMasterRequest {
8321    /// Contains details about the demoteMaster operation.
8322    pub demote_master_context: std::option::Option<crate::model::DemoteMasterContext>,
8323
8324    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8325}
8326
8327impl InstancesDemoteMasterRequest {
8328    /// Creates a new default instance.
8329    pub fn new() -> Self {
8330        std::default::Default::default()
8331    }
8332
8333    /// Sets the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
8334    ///
8335    /// # Example
8336    /// ```ignore,no_run
8337    /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
8338    /// use google_cloud_sql_v1::model::DemoteMasterContext;
8339    /// let x = InstancesDemoteMasterRequest::new().set_demote_master_context(DemoteMasterContext::default()/* use setters */);
8340    /// ```
8341    pub fn set_demote_master_context<T>(mut self, v: T) -> Self
8342    where
8343        T: std::convert::Into<crate::model::DemoteMasterContext>,
8344    {
8345        self.demote_master_context = std::option::Option::Some(v.into());
8346        self
8347    }
8348
8349    /// Sets or clears the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
8350    ///
8351    /// # Example
8352    /// ```ignore,no_run
8353    /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
8354    /// use google_cloud_sql_v1::model::DemoteMasterContext;
8355    /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(Some(DemoteMasterContext::default()/* use setters */));
8356    /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(None::<DemoteMasterContext>);
8357    /// ```
8358    pub fn set_or_clear_demote_master_context<T>(mut self, v: std::option::Option<T>) -> Self
8359    where
8360        T: std::convert::Into<crate::model::DemoteMasterContext>,
8361    {
8362        self.demote_master_context = v.map(|x| x.into());
8363        self
8364    }
8365}
8366
8367impl wkt::message::Message for InstancesDemoteMasterRequest {
8368    fn typename() -> &'static str {
8369        "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteMasterRequest"
8370    }
8371}
8372
8373/// This request is used to demote an existing standalone instance to be a
8374/// Cloud SQL read replica for an external database server.
8375#[derive(Clone, Default, PartialEq)]
8376#[non_exhaustive]
8377pub struct InstancesDemoteRequest {
8378    /// Required. Contains details about the demote operation.
8379    pub demote_context: std::option::Option<crate::model::DemoteContext>,
8380
8381    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8382}
8383
8384impl InstancesDemoteRequest {
8385    /// Creates a new default instance.
8386    pub fn new() -> Self {
8387        std::default::Default::default()
8388    }
8389
8390    /// Sets the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
8391    ///
8392    /// # Example
8393    /// ```ignore,no_run
8394    /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
8395    /// use google_cloud_sql_v1::model::DemoteContext;
8396    /// let x = InstancesDemoteRequest::new().set_demote_context(DemoteContext::default()/* use setters */);
8397    /// ```
8398    pub fn set_demote_context<T>(mut self, v: T) -> Self
8399    where
8400        T: std::convert::Into<crate::model::DemoteContext>,
8401    {
8402        self.demote_context = std::option::Option::Some(v.into());
8403        self
8404    }
8405
8406    /// Sets or clears the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
8407    ///
8408    /// # Example
8409    /// ```ignore,no_run
8410    /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
8411    /// use google_cloud_sql_v1::model::DemoteContext;
8412    /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(Some(DemoteContext::default()/* use setters */));
8413    /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(None::<DemoteContext>);
8414    /// ```
8415    pub fn set_or_clear_demote_context<T>(mut self, v: std::option::Option<T>) -> Self
8416    where
8417        T: std::convert::Into<crate::model::DemoteContext>,
8418    {
8419        self.demote_context = v.map(|x| x.into());
8420        self
8421    }
8422}
8423
8424impl wkt::message::Message for InstancesDemoteRequest {
8425    fn typename() -> &'static str {
8426        "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteRequest"
8427    }
8428}
8429
8430/// Database instance export request.
8431#[derive(Clone, Default, PartialEq)]
8432#[non_exhaustive]
8433pub struct InstancesExportRequest {
8434    /// Contains details about the export operation.
8435    pub export_context: std::option::Option<crate::model::ExportContext>,
8436
8437    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8438}
8439
8440impl InstancesExportRequest {
8441    /// Creates a new default instance.
8442    pub fn new() -> Self {
8443        std::default::Default::default()
8444    }
8445
8446    /// Sets the value of [export_context][crate::model::InstancesExportRequest::export_context].
8447    ///
8448    /// # Example
8449    /// ```ignore,no_run
8450    /// # use google_cloud_sql_v1::model::InstancesExportRequest;
8451    /// use google_cloud_sql_v1::model::ExportContext;
8452    /// let x = InstancesExportRequest::new().set_export_context(ExportContext::default()/* use setters */);
8453    /// ```
8454    pub fn set_export_context<T>(mut self, v: T) -> Self
8455    where
8456        T: std::convert::Into<crate::model::ExportContext>,
8457    {
8458        self.export_context = std::option::Option::Some(v.into());
8459        self
8460    }
8461
8462    /// Sets or clears the value of [export_context][crate::model::InstancesExportRequest::export_context].
8463    ///
8464    /// # Example
8465    /// ```ignore,no_run
8466    /// # use google_cloud_sql_v1::model::InstancesExportRequest;
8467    /// use google_cloud_sql_v1::model::ExportContext;
8468    /// let x = InstancesExportRequest::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
8469    /// let x = InstancesExportRequest::new().set_or_clear_export_context(None::<ExportContext>);
8470    /// ```
8471    pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
8472    where
8473        T: std::convert::Into<crate::model::ExportContext>,
8474    {
8475        self.export_context = v.map(|x| x.into());
8476        self
8477    }
8478}
8479
8480impl wkt::message::Message for InstancesExportRequest {
8481    fn typename() -> &'static str {
8482        "type.googleapis.com/google.cloud.sql.v1.InstancesExportRequest"
8483    }
8484}
8485
8486/// Instance failover request.
8487#[derive(Clone, Default, PartialEq)]
8488#[non_exhaustive]
8489pub struct InstancesFailoverRequest {
8490    /// Failover Context.
8491    pub failover_context: std::option::Option<crate::model::FailoverContext>,
8492
8493    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8494}
8495
8496impl InstancesFailoverRequest {
8497    /// Creates a new default instance.
8498    pub fn new() -> Self {
8499        std::default::Default::default()
8500    }
8501
8502    /// Sets the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
8503    ///
8504    /// # Example
8505    /// ```ignore,no_run
8506    /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
8507    /// use google_cloud_sql_v1::model::FailoverContext;
8508    /// let x = InstancesFailoverRequest::new().set_failover_context(FailoverContext::default()/* use setters */);
8509    /// ```
8510    pub fn set_failover_context<T>(mut self, v: T) -> Self
8511    where
8512        T: std::convert::Into<crate::model::FailoverContext>,
8513    {
8514        self.failover_context = std::option::Option::Some(v.into());
8515        self
8516    }
8517
8518    /// Sets or clears the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
8519    ///
8520    /// # Example
8521    /// ```ignore,no_run
8522    /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
8523    /// use google_cloud_sql_v1::model::FailoverContext;
8524    /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(Some(FailoverContext::default()/* use setters */));
8525    /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(None::<FailoverContext>);
8526    /// ```
8527    pub fn set_or_clear_failover_context<T>(mut self, v: std::option::Option<T>) -> Self
8528    where
8529        T: std::convert::Into<crate::model::FailoverContext>,
8530    {
8531        self.failover_context = v.map(|x| x.into());
8532        self
8533    }
8534}
8535
8536impl wkt::message::Message for InstancesFailoverRequest {
8537    fn typename() -> &'static str {
8538        "type.googleapis.com/google.cloud.sql.v1.InstancesFailoverRequest"
8539    }
8540}
8541
8542/// SslCerts create ephemeral certificate request.
8543#[derive(Clone, Default, PartialEq)]
8544#[non_exhaustive]
8545pub struct SslCertsCreateEphemeralRequest {
8546    /// PEM encoded public key to include in the signed certificate.
8547    pub public_key: std::string::String,
8548
8549    /// Access token to include in the signed certificate.
8550    pub access_token: std::string::String,
8551
8552    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8553}
8554
8555impl SslCertsCreateEphemeralRequest {
8556    /// Creates a new default instance.
8557    pub fn new() -> Self {
8558        std::default::Default::default()
8559    }
8560
8561    /// Sets the value of [public_key][crate::model::SslCertsCreateEphemeralRequest::public_key].
8562    ///
8563    /// # Example
8564    /// ```ignore,no_run
8565    /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8566    /// let x = SslCertsCreateEphemeralRequest::new().set_public_key("example");
8567    /// ```
8568    pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8569        self.public_key = v.into();
8570        self
8571    }
8572
8573    /// Sets the value of [access_token][crate::model::SslCertsCreateEphemeralRequest::access_token].
8574    ///
8575    /// # Example
8576    /// ```ignore,no_run
8577    /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8578    /// let x = SslCertsCreateEphemeralRequest::new().set_access_token("example");
8579    /// ```
8580    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8581        self.access_token = v.into();
8582        self
8583    }
8584}
8585
8586impl wkt::message::Message for SslCertsCreateEphemeralRequest {
8587    fn typename() -> &'static str {
8588        "type.googleapis.com/google.cloud.sql.v1.SslCertsCreateEphemeralRequest"
8589    }
8590}
8591
8592/// Database instance import request.
8593#[derive(Clone, Default, PartialEq)]
8594#[non_exhaustive]
8595pub struct InstancesImportRequest {
8596    /// Contains details about the import operation.
8597    pub import_context: std::option::Option<crate::model::ImportContext>,
8598
8599    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8600}
8601
8602impl InstancesImportRequest {
8603    /// Creates a new default instance.
8604    pub fn new() -> Self {
8605        std::default::Default::default()
8606    }
8607
8608    /// Sets the value of [import_context][crate::model::InstancesImportRequest::import_context].
8609    ///
8610    /// # Example
8611    /// ```ignore,no_run
8612    /// # use google_cloud_sql_v1::model::InstancesImportRequest;
8613    /// use google_cloud_sql_v1::model::ImportContext;
8614    /// let x = InstancesImportRequest::new().set_import_context(ImportContext::default()/* use setters */);
8615    /// ```
8616    pub fn set_import_context<T>(mut self, v: T) -> Self
8617    where
8618        T: std::convert::Into<crate::model::ImportContext>,
8619    {
8620        self.import_context = std::option::Option::Some(v.into());
8621        self
8622    }
8623
8624    /// Sets or clears the value of [import_context][crate::model::InstancesImportRequest::import_context].
8625    ///
8626    /// # Example
8627    /// ```ignore,no_run
8628    /// # use google_cloud_sql_v1::model::InstancesImportRequest;
8629    /// use google_cloud_sql_v1::model::ImportContext;
8630    /// let x = InstancesImportRequest::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
8631    /// let x = InstancesImportRequest::new().set_or_clear_import_context(None::<ImportContext>);
8632    /// ```
8633    pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
8634    where
8635        T: std::convert::Into<crate::model::ImportContext>,
8636    {
8637        self.import_context = v.map(|x| x.into());
8638        self
8639    }
8640}
8641
8642impl wkt::message::Message for InstancesImportRequest {
8643    fn typename() -> &'static str {
8644        "type.googleapis.com/google.cloud.sql.v1.InstancesImportRequest"
8645    }
8646}
8647
8648/// Request for Pre-checks for MVU
8649#[derive(Clone, Default, PartialEq)]
8650#[non_exhaustive]
8651pub struct InstancesPreCheckMajorVersionUpgradeRequest {
8652    /// Required. Contains details about the pre-check major version upgrade
8653    /// operation.
8654    pub pre_check_major_version_upgrade_context:
8655        std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
8656
8657    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8658}
8659
8660impl InstancesPreCheckMajorVersionUpgradeRequest {
8661    /// Creates a new default instance.
8662    pub fn new() -> Self {
8663        std::default::Default::default()
8664    }
8665
8666    /// Sets the value of [pre_check_major_version_upgrade_context][crate::model::InstancesPreCheckMajorVersionUpgradeRequest::pre_check_major_version_upgrade_context].
8667    ///
8668    /// # Example
8669    /// ```ignore,no_run
8670    /// # use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
8671    /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
8672    /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_pre_check_major_version_upgrade_context(PreCheckMajorVersionUpgradeContext::default()/* use setters */);
8673    /// ```
8674    pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
8675    where
8676        T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
8677    {
8678        self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
8679        self
8680    }
8681
8682    /// Sets or clears the value of [pre_check_major_version_upgrade_context][crate::model::InstancesPreCheckMajorVersionUpgradeRequest::pre_check_major_version_upgrade_context].
8683    ///
8684    /// # Example
8685    /// ```ignore,no_run
8686    /// # use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
8687    /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
8688    /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_pre_check_major_version_upgrade_context(Some(PreCheckMajorVersionUpgradeContext::default()/* use setters */));
8689    /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_pre_check_major_version_upgrade_context(None::<PreCheckMajorVersionUpgradeContext>);
8690    /// ```
8691    pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
8692        mut self,
8693        v: std::option::Option<T>,
8694    ) -> Self
8695    where
8696        T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
8697    {
8698        self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
8699        self
8700    }
8701}
8702
8703impl wkt::message::Message for InstancesPreCheckMajorVersionUpgradeRequest {
8704    fn typename() -> &'static str {
8705        "type.googleapis.com/google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest"
8706    }
8707}
8708
8709/// Database instances list response.
8710#[derive(Clone, Default, PartialEq)]
8711#[non_exhaustive]
8712pub struct InstancesListResponse {
8713    /// This is always `sql#instancesList`.
8714    pub kind: std::string::String,
8715
8716    /// List of warnings that occurred while handling the request.
8717    pub warnings: std::vec::Vec<crate::model::ApiWarning>,
8718
8719    /// List of database instance resources.
8720    pub items: std::vec::Vec<crate::model::DatabaseInstance>,
8721
8722    /// The continuation token, used to page through large result sets. Provide
8723    /// this value in a subsequent request to return the next page of results.
8724    pub next_page_token: std::string::String,
8725
8726    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8727}
8728
8729impl InstancesListResponse {
8730    /// Creates a new default instance.
8731    pub fn new() -> Self {
8732        std::default::Default::default()
8733    }
8734
8735    /// Sets the value of [kind][crate::model::InstancesListResponse::kind].
8736    ///
8737    /// # Example
8738    /// ```ignore,no_run
8739    /// # use google_cloud_sql_v1::model::InstancesListResponse;
8740    /// let x = InstancesListResponse::new().set_kind("example");
8741    /// ```
8742    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8743        self.kind = v.into();
8744        self
8745    }
8746
8747    /// Sets the value of [warnings][crate::model::InstancesListResponse::warnings].
8748    ///
8749    /// # Example
8750    /// ```ignore,no_run
8751    /// # use google_cloud_sql_v1::model::InstancesListResponse;
8752    /// use google_cloud_sql_v1::model::ApiWarning;
8753    /// let x = InstancesListResponse::new()
8754    ///     .set_warnings([
8755    ///         ApiWarning::default()/* use setters */,
8756    ///         ApiWarning::default()/* use (different) setters */,
8757    ///     ]);
8758    /// ```
8759    pub fn set_warnings<T, V>(mut self, v: T) -> Self
8760    where
8761        T: std::iter::IntoIterator<Item = V>,
8762        V: std::convert::Into<crate::model::ApiWarning>,
8763    {
8764        use std::iter::Iterator;
8765        self.warnings = v.into_iter().map(|i| i.into()).collect();
8766        self
8767    }
8768
8769    /// Sets the value of [items][crate::model::InstancesListResponse::items].
8770    ///
8771    /// # Example
8772    /// ```ignore,no_run
8773    /// # use google_cloud_sql_v1::model::InstancesListResponse;
8774    /// use google_cloud_sql_v1::model::DatabaseInstance;
8775    /// let x = InstancesListResponse::new()
8776    ///     .set_items([
8777    ///         DatabaseInstance::default()/* use setters */,
8778    ///         DatabaseInstance::default()/* use (different) setters */,
8779    ///     ]);
8780    /// ```
8781    pub fn set_items<T, V>(mut self, v: T) -> Self
8782    where
8783        T: std::iter::IntoIterator<Item = V>,
8784        V: std::convert::Into<crate::model::DatabaseInstance>,
8785    {
8786        use std::iter::Iterator;
8787        self.items = v.into_iter().map(|i| i.into()).collect();
8788        self
8789    }
8790
8791    /// Sets the value of [next_page_token][crate::model::InstancesListResponse::next_page_token].
8792    ///
8793    /// # Example
8794    /// ```ignore,no_run
8795    /// # use google_cloud_sql_v1::model::InstancesListResponse;
8796    /// let x = InstancesListResponse::new().set_next_page_token("example");
8797    /// ```
8798    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8799        self.next_page_token = v.into();
8800        self
8801    }
8802}
8803
8804impl wkt::message::Message for InstancesListResponse {
8805    fn typename() -> &'static str {
8806        "type.googleapis.com/google.cloud.sql.v1.InstancesListResponse"
8807    }
8808}
8809
8810#[doc(hidden)]
8811impl google_cloud_gax::paginator::internal::PageableResponse for InstancesListResponse {
8812    type PageItem = crate::model::DatabaseInstance;
8813
8814    fn items(self) -> std::vec::Vec<Self::PageItem> {
8815        self.items
8816    }
8817
8818    fn next_page_token(&self) -> std::string::String {
8819        use std::clone::Clone;
8820        self.next_page_token.clone()
8821    }
8822}
8823
8824/// Instances ListServerCas response.
8825#[derive(Clone, Default, PartialEq)]
8826#[non_exhaustive]
8827pub struct InstancesListServerCasResponse {
8828    /// List of server CA certificates for the instance.
8829    pub certs: std::vec::Vec<crate::model::SslCert>,
8830
8831    #[allow(missing_docs)]
8832    pub active_version: std::string::String,
8833
8834    /// This is always `sql#instancesListServerCas`.
8835    pub kind: std::string::String,
8836
8837    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8838}
8839
8840impl InstancesListServerCasResponse {
8841    /// Creates a new default instance.
8842    pub fn new() -> Self {
8843        std::default::Default::default()
8844    }
8845
8846    /// Sets the value of [certs][crate::model::InstancesListServerCasResponse::certs].
8847    ///
8848    /// # Example
8849    /// ```ignore,no_run
8850    /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8851    /// use google_cloud_sql_v1::model::SslCert;
8852    /// let x = InstancesListServerCasResponse::new()
8853    ///     .set_certs([
8854    ///         SslCert::default()/* use setters */,
8855    ///         SslCert::default()/* use (different) setters */,
8856    ///     ]);
8857    /// ```
8858    pub fn set_certs<T, V>(mut self, v: T) -> Self
8859    where
8860        T: std::iter::IntoIterator<Item = V>,
8861        V: std::convert::Into<crate::model::SslCert>,
8862    {
8863        use std::iter::Iterator;
8864        self.certs = v.into_iter().map(|i| i.into()).collect();
8865        self
8866    }
8867
8868    /// Sets the value of [active_version][crate::model::InstancesListServerCasResponse::active_version].
8869    ///
8870    /// # Example
8871    /// ```ignore,no_run
8872    /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8873    /// let x = InstancesListServerCasResponse::new().set_active_version("example");
8874    /// ```
8875    pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8876        self.active_version = v.into();
8877        self
8878    }
8879
8880    /// Sets the value of [kind][crate::model::InstancesListServerCasResponse::kind].
8881    ///
8882    /// # Example
8883    /// ```ignore,no_run
8884    /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8885    /// let x = InstancesListServerCasResponse::new().set_kind("example");
8886    /// ```
8887    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8888        self.kind = v.into();
8889        self
8890    }
8891}
8892
8893impl wkt::message::Message for InstancesListServerCasResponse {
8894    fn typename() -> &'static str {
8895        "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCasResponse"
8896    }
8897}
8898
8899/// Instances ListServerCertificates response.
8900#[derive(Clone, Default, PartialEq)]
8901#[non_exhaustive]
8902pub struct InstancesListServerCertificatesResponse {
8903    /// List of server CA certificates for the instance.
8904    pub ca_certs: std::vec::Vec<crate::model::SslCert>,
8905
8906    /// List of server certificates for the instance, signed by the corresponding
8907    /// CA from the `ca_certs` list.
8908    pub server_certs: std::vec::Vec<crate::model::SslCert>,
8909
8910    /// The `sha1_fingerprint` of the active certificate from `server_certs`.
8911    pub active_version: std::string::String,
8912
8913    /// This is always `sql#instancesListServerCertificates`.
8914    pub kind: std::string::String,
8915
8916    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8917}
8918
8919impl InstancesListServerCertificatesResponse {
8920    /// Creates a new default instance.
8921    pub fn new() -> Self {
8922        std::default::Default::default()
8923    }
8924
8925    /// Sets the value of [ca_certs][crate::model::InstancesListServerCertificatesResponse::ca_certs].
8926    ///
8927    /// # Example
8928    /// ```ignore,no_run
8929    /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8930    /// use google_cloud_sql_v1::model::SslCert;
8931    /// let x = InstancesListServerCertificatesResponse::new()
8932    ///     .set_ca_certs([
8933    ///         SslCert::default()/* use setters */,
8934    ///         SslCert::default()/* use (different) setters */,
8935    ///     ]);
8936    /// ```
8937    pub fn set_ca_certs<T, V>(mut self, v: T) -> Self
8938    where
8939        T: std::iter::IntoIterator<Item = V>,
8940        V: std::convert::Into<crate::model::SslCert>,
8941    {
8942        use std::iter::Iterator;
8943        self.ca_certs = v.into_iter().map(|i| i.into()).collect();
8944        self
8945    }
8946
8947    /// Sets the value of [server_certs][crate::model::InstancesListServerCertificatesResponse::server_certs].
8948    ///
8949    /// # Example
8950    /// ```ignore,no_run
8951    /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8952    /// use google_cloud_sql_v1::model::SslCert;
8953    /// let x = InstancesListServerCertificatesResponse::new()
8954    ///     .set_server_certs([
8955    ///         SslCert::default()/* use setters */,
8956    ///         SslCert::default()/* use (different) setters */,
8957    ///     ]);
8958    /// ```
8959    pub fn set_server_certs<T, V>(mut self, v: T) -> Self
8960    where
8961        T: std::iter::IntoIterator<Item = V>,
8962        V: std::convert::Into<crate::model::SslCert>,
8963    {
8964        use std::iter::Iterator;
8965        self.server_certs = v.into_iter().map(|i| i.into()).collect();
8966        self
8967    }
8968
8969    /// Sets the value of [active_version][crate::model::InstancesListServerCertificatesResponse::active_version].
8970    ///
8971    /// # Example
8972    /// ```ignore,no_run
8973    /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8974    /// let x = InstancesListServerCertificatesResponse::new().set_active_version("example");
8975    /// ```
8976    pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8977        self.active_version = v.into();
8978        self
8979    }
8980
8981    /// Sets the value of [kind][crate::model::InstancesListServerCertificatesResponse::kind].
8982    ///
8983    /// # Example
8984    /// ```ignore,no_run
8985    /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8986    /// let x = InstancesListServerCertificatesResponse::new().set_kind("example");
8987    /// ```
8988    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8989        self.kind = v.into();
8990        self
8991    }
8992}
8993
8994impl wkt::message::Message for InstancesListServerCertificatesResponse {
8995    fn typename() -> &'static str {
8996        "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCertificatesResponse"
8997    }
8998}
8999
9000/// Instances ListEntraIdCertificates response.
9001#[derive(Clone, Default, PartialEq)]
9002#[non_exhaustive]
9003pub struct InstancesListEntraIdCertificatesResponse {
9004    /// List of Entra ID certificates for the instance.
9005    pub certs: std::vec::Vec<crate::model::SslCert>,
9006
9007    /// The `sha1_fingerprint` of the active certificate from `certs`.
9008    pub active_version: std::string::String,
9009
9010    /// This is always `sql#instancesListEntraIdCertificates`.
9011    pub kind: std::string::String,
9012
9013    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9014}
9015
9016impl InstancesListEntraIdCertificatesResponse {
9017    /// Creates a new default instance.
9018    pub fn new() -> Self {
9019        std::default::Default::default()
9020    }
9021
9022    /// Sets the value of [certs][crate::model::InstancesListEntraIdCertificatesResponse::certs].
9023    ///
9024    /// # Example
9025    /// ```ignore,no_run
9026    /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
9027    /// use google_cloud_sql_v1::model::SslCert;
9028    /// let x = InstancesListEntraIdCertificatesResponse::new()
9029    ///     .set_certs([
9030    ///         SslCert::default()/* use setters */,
9031    ///         SslCert::default()/* use (different) setters */,
9032    ///     ]);
9033    /// ```
9034    pub fn set_certs<T, V>(mut self, v: T) -> Self
9035    where
9036        T: std::iter::IntoIterator<Item = V>,
9037        V: std::convert::Into<crate::model::SslCert>,
9038    {
9039        use std::iter::Iterator;
9040        self.certs = v.into_iter().map(|i| i.into()).collect();
9041        self
9042    }
9043
9044    /// Sets the value of [active_version][crate::model::InstancesListEntraIdCertificatesResponse::active_version].
9045    ///
9046    /// # Example
9047    /// ```ignore,no_run
9048    /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
9049    /// let x = InstancesListEntraIdCertificatesResponse::new().set_active_version("example");
9050    /// ```
9051    pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9052        self.active_version = v.into();
9053        self
9054    }
9055
9056    /// Sets the value of [kind][crate::model::InstancesListEntraIdCertificatesResponse::kind].
9057    ///
9058    /// # Example
9059    /// ```ignore,no_run
9060    /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
9061    /// let x = InstancesListEntraIdCertificatesResponse::new().set_kind("example");
9062    /// ```
9063    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9064        self.kind = v.into();
9065        self
9066    }
9067}
9068
9069impl wkt::message::Message for InstancesListEntraIdCertificatesResponse {
9070    fn typename() -> &'static str {
9071        "type.googleapis.com/google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse"
9072    }
9073}
9074
9075/// Database instance restore backup request.
9076#[derive(Clone, Default, PartialEq)]
9077#[non_exhaustive]
9078pub struct InstancesRestoreBackupRequest {
9079    /// Parameters required to perform the restore backup operation.
9080    pub restore_backup_context: std::option::Option<crate::model::RestoreBackupContext>,
9081
9082    /// The name of the backup that's used to restore a Cloud SQL instance:
9083    /// Format:  projects/{project-id}/backups/{backup-uid}. Only one of
9084    /// restore_backup_context, backup, backupdr_backup can be passed to the input.
9085    pub backup: std::string::String,
9086
9087    /// The name of the backup that's used to restore a Cloud SQL instance:
9088    /// Format:
9089    /// "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
9090    /// Only one of restore_backup_context, backup, backupdr_backup can be
9091    /// passed to the input.
9092    pub backupdr_backup: std::string::String,
9093
9094    /// Optional. By using this parameter, Cloud SQL overrides any instance
9095    /// settings stored in the backup you are restoring from. You can't change the
9096    /// instance's major database version and you can only increase the disk size.
9097    /// You can use this field to restore new instances only. This field is not
9098    /// applicable for restore to existing instances.
9099    pub restore_instance_settings: std::option::Option<crate::model::DatabaseInstance>,
9100
9101    /// Optional. This field has the same purpose as restore_instance_settings,
9102    /// changes any instance settings stored in the backup you are restoring from.
9103    /// With the difference that these fields are cleared in the settings.
9104    pub restore_instance_clear_overrides_field_names: std::vec::Vec<std::string::String>,
9105
9106    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9107}
9108
9109impl InstancesRestoreBackupRequest {
9110    /// Creates a new default instance.
9111    pub fn new() -> Self {
9112        std::default::Default::default()
9113    }
9114
9115    /// Sets the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
9116    ///
9117    /// # Example
9118    /// ```ignore,no_run
9119    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9120    /// use google_cloud_sql_v1::model::RestoreBackupContext;
9121    /// let x = InstancesRestoreBackupRequest::new().set_restore_backup_context(RestoreBackupContext::default()/* use setters */);
9122    /// ```
9123    pub fn set_restore_backup_context<T>(mut self, v: T) -> Self
9124    where
9125        T: std::convert::Into<crate::model::RestoreBackupContext>,
9126    {
9127        self.restore_backup_context = std::option::Option::Some(v.into());
9128        self
9129    }
9130
9131    /// Sets or clears the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
9132    ///
9133    /// # Example
9134    /// ```ignore,no_run
9135    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9136    /// use google_cloud_sql_v1::model::RestoreBackupContext;
9137    /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(Some(RestoreBackupContext::default()/* use setters */));
9138    /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(None::<RestoreBackupContext>);
9139    /// ```
9140    pub fn set_or_clear_restore_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
9141    where
9142        T: std::convert::Into<crate::model::RestoreBackupContext>,
9143    {
9144        self.restore_backup_context = v.map(|x| x.into());
9145        self
9146    }
9147
9148    /// Sets the value of [backup][crate::model::InstancesRestoreBackupRequest::backup].
9149    ///
9150    /// # Example
9151    /// ```ignore,no_run
9152    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9153    /// # let project_id = "project_id";
9154    /// # let backup_id = "backup_id";
9155    /// let x = InstancesRestoreBackupRequest::new().set_backup(format!("projects/{project_id}/backups/{backup_id}"));
9156    /// ```
9157    pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9158        self.backup = v.into();
9159        self
9160    }
9161
9162    /// Sets the value of [backupdr_backup][crate::model::InstancesRestoreBackupRequest::backupdr_backup].
9163    ///
9164    /// # Example
9165    /// ```ignore,no_run
9166    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9167    /// let x = InstancesRestoreBackupRequest::new().set_backupdr_backup("example");
9168    /// ```
9169    pub fn set_backupdr_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9170        self.backupdr_backup = v.into();
9171        self
9172    }
9173
9174    /// Sets the value of [restore_instance_settings][crate::model::InstancesRestoreBackupRequest::restore_instance_settings].
9175    ///
9176    /// # Example
9177    /// ```ignore,no_run
9178    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9179    /// use google_cloud_sql_v1::model::DatabaseInstance;
9180    /// let x = InstancesRestoreBackupRequest::new().set_restore_instance_settings(DatabaseInstance::default()/* use setters */);
9181    /// ```
9182    pub fn set_restore_instance_settings<T>(mut self, v: T) -> Self
9183    where
9184        T: std::convert::Into<crate::model::DatabaseInstance>,
9185    {
9186        self.restore_instance_settings = std::option::Option::Some(v.into());
9187        self
9188    }
9189
9190    /// Sets or clears the value of [restore_instance_settings][crate::model::InstancesRestoreBackupRequest::restore_instance_settings].
9191    ///
9192    /// # Example
9193    /// ```ignore,no_run
9194    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9195    /// use google_cloud_sql_v1::model::DatabaseInstance;
9196    /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_instance_settings(Some(DatabaseInstance::default()/* use setters */));
9197    /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_instance_settings(None::<DatabaseInstance>);
9198    /// ```
9199    pub fn set_or_clear_restore_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
9200    where
9201        T: std::convert::Into<crate::model::DatabaseInstance>,
9202    {
9203        self.restore_instance_settings = v.map(|x| x.into());
9204        self
9205    }
9206
9207    /// Sets the value of [restore_instance_clear_overrides_field_names][crate::model::InstancesRestoreBackupRequest::restore_instance_clear_overrides_field_names].
9208    ///
9209    /// # Example
9210    /// ```ignore,no_run
9211    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9212    /// let x = InstancesRestoreBackupRequest::new().set_restore_instance_clear_overrides_field_names(["a", "b", "c"]);
9213    /// ```
9214    pub fn set_restore_instance_clear_overrides_field_names<T, V>(mut self, v: T) -> Self
9215    where
9216        T: std::iter::IntoIterator<Item = V>,
9217        V: std::convert::Into<std::string::String>,
9218    {
9219        use std::iter::Iterator;
9220        self.restore_instance_clear_overrides_field_names =
9221            v.into_iter().map(|i| i.into()).collect();
9222        self
9223    }
9224}
9225
9226impl wkt::message::Message for InstancesRestoreBackupRequest {
9227    fn typename() -> &'static str {
9228        "type.googleapis.com/google.cloud.sql.v1.InstancesRestoreBackupRequest"
9229    }
9230}
9231
9232/// Rotate server CA request.
9233#[derive(Clone, Default, PartialEq)]
9234#[non_exhaustive]
9235pub struct InstancesRotateServerCaRequest {
9236    /// Contains details about the rotate server CA operation.
9237    pub rotate_server_ca_context: std::option::Option<crate::model::RotateServerCaContext>,
9238
9239    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9240}
9241
9242impl InstancesRotateServerCaRequest {
9243    /// Creates a new default instance.
9244    pub fn new() -> Self {
9245        std::default::Default::default()
9246    }
9247
9248    /// Sets the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
9249    ///
9250    /// # Example
9251    /// ```ignore,no_run
9252    /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
9253    /// use google_cloud_sql_v1::model::RotateServerCaContext;
9254    /// let x = InstancesRotateServerCaRequest::new().set_rotate_server_ca_context(RotateServerCaContext::default()/* use setters */);
9255    /// ```
9256    pub fn set_rotate_server_ca_context<T>(mut self, v: T) -> Self
9257    where
9258        T: std::convert::Into<crate::model::RotateServerCaContext>,
9259    {
9260        self.rotate_server_ca_context = std::option::Option::Some(v.into());
9261        self
9262    }
9263
9264    /// Sets or clears the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
9265    ///
9266    /// # Example
9267    /// ```ignore,no_run
9268    /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
9269    /// use google_cloud_sql_v1::model::RotateServerCaContext;
9270    /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(Some(RotateServerCaContext::default()/* use setters */));
9271    /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(None::<RotateServerCaContext>);
9272    /// ```
9273    pub fn set_or_clear_rotate_server_ca_context<T>(mut self, v: std::option::Option<T>) -> Self
9274    where
9275        T: std::convert::Into<crate::model::RotateServerCaContext>,
9276    {
9277        self.rotate_server_ca_context = v.map(|x| x.into());
9278        self
9279    }
9280}
9281
9282impl wkt::message::Message for InstancesRotateServerCaRequest {
9283    fn typename() -> &'static str {
9284        "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCaRequest"
9285    }
9286}
9287
9288/// Rotate server certificate request.
9289#[derive(Clone, Default, PartialEq)]
9290#[non_exhaustive]
9291pub struct InstancesRotateServerCertificateRequest {
9292    /// Optional. Contains details about the rotate server certificate operation.
9293    pub rotate_server_certificate_context:
9294        std::option::Option<crate::model::RotateServerCertificateContext>,
9295
9296    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9297}
9298
9299impl InstancesRotateServerCertificateRequest {
9300    /// Creates a new default instance.
9301    pub fn new() -> Self {
9302        std::default::Default::default()
9303    }
9304
9305    /// Sets the value of [rotate_server_certificate_context][crate::model::InstancesRotateServerCertificateRequest::rotate_server_certificate_context].
9306    ///
9307    /// # Example
9308    /// ```ignore,no_run
9309    /// # use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
9310    /// use google_cloud_sql_v1::model::RotateServerCertificateContext;
9311    /// let x = InstancesRotateServerCertificateRequest::new().set_rotate_server_certificate_context(RotateServerCertificateContext::default()/* use setters */);
9312    /// ```
9313    pub fn set_rotate_server_certificate_context<T>(mut self, v: T) -> Self
9314    where
9315        T: std::convert::Into<crate::model::RotateServerCertificateContext>,
9316    {
9317        self.rotate_server_certificate_context = std::option::Option::Some(v.into());
9318        self
9319    }
9320
9321    /// Sets or clears the value of [rotate_server_certificate_context][crate::model::InstancesRotateServerCertificateRequest::rotate_server_certificate_context].
9322    ///
9323    /// # Example
9324    /// ```ignore,no_run
9325    /// # use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
9326    /// use google_cloud_sql_v1::model::RotateServerCertificateContext;
9327    /// let x = InstancesRotateServerCertificateRequest::new().set_or_clear_rotate_server_certificate_context(Some(RotateServerCertificateContext::default()/* use setters */));
9328    /// let x = InstancesRotateServerCertificateRequest::new().set_or_clear_rotate_server_certificate_context(None::<RotateServerCertificateContext>);
9329    /// ```
9330    pub fn set_or_clear_rotate_server_certificate_context<T>(
9331        mut self,
9332        v: std::option::Option<T>,
9333    ) -> Self
9334    where
9335        T: std::convert::Into<crate::model::RotateServerCertificateContext>,
9336    {
9337        self.rotate_server_certificate_context = v.map(|x| x.into());
9338        self
9339    }
9340}
9341
9342impl wkt::message::Message for InstancesRotateServerCertificateRequest {
9343    fn typename() -> &'static str {
9344        "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCertificateRequest"
9345    }
9346}
9347
9348/// Rotate Entra ID certificate request.
9349#[derive(Clone, Default, PartialEq)]
9350#[non_exhaustive]
9351pub struct InstancesRotateEntraIdCertificateRequest {
9352    /// Optional. Contains details about the rotate server certificate operation.
9353    pub rotate_entra_id_certificate_context:
9354        std::option::Option<crate::model::RotateEntraIdCertificateContext>,
9355
9356    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9357}
9358
9359impl InstancesRotateEntraIdCertificateRequest {
9360    /// Creates a new default instance.
9361    pub fn new() -> Self {
9362        std::default::Default::default()
9363    }
9364
9365    /// Sets the value of [rotate_entra_id_certificate_context][crate::model::InstancesRotateEntraIdCertificateRequest::rotate_entra_id_certificate_context].
9366    ///
9367    /// # Example
9368    /// ```ignore,no_run
9369    /// # use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
9370    /// use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
9371    /// let x = InstancesRotateEntraIdCertificateRequest::new().set_rotate_entra_id_certificate_context(RotateEntraIdCertificateContext::default()/* use setters */);
9372    /// ```
9373    pub fn set_rotate_entra_id_certificate_context<T>(mut self, v: T) -> Self
9374    where
9375        T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
9376    {
9377        self.rotate_entra_id_certificate_context = std::option::Option::Some(v.into());
9378        self
9379    }
9380
9381    /// Sets or clears the value of [rotate_entra_id_certificate_context][crate::model::InstancesRotateEntraIdCertificateRequest::rotate_entra_id_certificate_context].
9382    ///
9383    /// # Example
9384    /// ```ignore,no_run
9385    /// # use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
9386    /// use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
9387    /// let x = InstancesRotateEntraIdCertificateRequest::new().set_or_clear_rotate_entra_id_certificate_context(Some(RotateEntraIdCertificateContext::default()/* use setters */));
9388    /// let x = InstancesRotateEntraIdCertificateRequest::new().set_or_clear_rotate_entra_id_certificate_context(None::<RotateEntraIdCertificateContext>);
9389    /// ```
9390    pub fn set_or_clear_rotate_entra_id_certificate_context<T>(
9391        mut self,
9392        v: std::option::Option<T>,
9393    ) -> Self
9394    where
9395        T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
9396    {
9397        self.rotate_entra_id_certificate_context = v.map(|x| x.into());
9398        self
9399    }
9400}
9401
9402impl wkt::message::Message for InstancesRotateEntraIdCertificateRequest {
9403    fn typename() -> &'static str {
9404        "type.googleapis.com/google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest"
9405    }
9406}
9407
9408/// Instance truncate log request.
9409#[derive(Clone, Default, PartialEq)]
9410#[non_exhaustive]
9411pub struct InstancesTruncateLogRequest {
9412    /// Contains details about the truncate log operation.
9413    pub truncate_log_context: std::option::Option<crate::model::TruncateLogContext>,
9414
9415    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9416}
9417
9418impl InstancesTruncateLogRequest {
9419    /// Creates a new default instance.
9420    pub fn new() -> Self {
9421        std::default::Default::default()
9422    }
9423
9424    /// Sets the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
9425    ///
9426    /// # Example
9427    /// ```ignore,no_run
9428    /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
9429    /// use google_cloud_sql_v1::model::TruncateLogContext;
9430    /// let x = InstancesTruncateLogRequest::new().set_truncate_log_context(TruncateLogContext::default()/* use setters */);
9431    /// ```
9432    pub fn set_truncate_log_context<T>(mut self, v: T) -> Self
9433    where
9434        T: std::convert::Into<crate::model::TruncateLogContext>,
9435    {
9436        self.truncate_log_context = std::option::Option::Some(v.into());
9437        self
9438    }
9439
9440    /// Sets or clears the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
9441    ///
9442    /// # Example
9443    /// ```ignore,no_run
9444    /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
9445    /// use google_cloud_sql_v1::model::TruncateLogContext;
9446    /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(Some(TruncateLogContext::default()/* use setters */));
9447    /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(None::<TruncateLogContext>);
9448    /// ```
9449    pub fn set_or_clear_truncate_log_context<T>(mut self, v: std::option::Option<T>) -> Self
9450    where
9451        T: std::convert::Into<crate::model::TruncateLogContext>,
9452    {
9453        self.truncate_log_context = v.map(|x| x.into());
9454        self
9455    }
9456}
9457
9458impl wkt::message::Message for InstancesTruncateLogRequest {
9459    fn typename() -> &'static str {
9460        "type.googleapis.com/google.cloud.sql.v1.InstancesTruncateLogRequest"
9461    }
9462}
9463
9464/// Request to acquire a lease for SSRS.
9465#[derive(Clone, Default, PartialEq)]
9466#[non_exhaustive]
9467pub struct InstancesAcquireSsrsLeaseRequest {
9468    /// Contains details about the acquire SSRS lease operation.
9469    pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
9470
9471    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9472}
9473
9474impl InstancesAcquireSsrsLeaseRequest {
9475    /// Creates a new default instance.
9476    pub fn new() -> Self {
9477        std::default::Default::default()
9478    }
9479
9480    /// Sets the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
9481    ///
9482    /// # Example
9483    /// ```ignore,no_run
9484    /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
9485    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
9486    /// let x = InstancesAcquireSsrsLeaseRequest::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
9487    /// ```
9488    pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
9489    where
9490        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
9491    {
9492        self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
9493        self
9494    }
9495
9496    /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
9497    ///
9498    /// # Example
9499    /// ```ignore,no_run
9500    /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
9501    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
9502    /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
9503    /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
9504    /// ```
9505    pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
9506    where
9507        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
9508    {
9509        self.acquire_ssrs_lease_context = v.map(|x| x.into());
9510        self
9511    }
9512}
9513
9514impl wkt::message::Message for InstancesAcquireSsrsLeaseRequest {
9515    fn typename() -> &'static str {
9516        "type.googleapis.com/google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest"
9517    }
9518}
9519
9520/// Request for Pre-checks for MVU
9521#[derive(Clone, Default, PartialEq)]
9522#[non_exhaustive]
9523pub struct SqlInstancesPreCheckMajorVersionUpgradeRequest {
9524    /// Required. Cloud SQL instance ID. This does not include the project ID.
9525    pub instance: std::string::String,
9526
9527    /// Required. Project ID of the project that contains the instance.
9528    pub project: std::string::String,
9529
9530    /// Required. The context for request to perform the pre-check major version
9531    /// upgrade operation.
9532    pub body: std::option::Option<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9533
9534    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9535}
9536
9537impl SqlInstancesPreCheckMajorVersionUpgradeRequest {
9538    /// Creates a new default instance.
9539    pub fn new() -> Self {
9540        std::default::Default::default()
9541    }
9542
9543    /// Sets the value of [instance][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::instance].
9544    ///
9545    /// # Example
9546    /// ```ignore,no_run
9547    /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9548    /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_instance("example");
9549    /// ```
9550    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9551        self.instance = v.into();
9552        self
9553    }
9554
9555    /// Sets the value of [project][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::project].
9556    ///
9557    /// # Example
9558    /// ```ignore,no_run
9559    /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9560    /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_project("example");
9561    /// ```
9562    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9563        self.project = v.into();
9564        self
9565    }
9566
9567    /// Sets the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
9568    ///
9569    /// # Example
9570    /// ```ignore,no_run
9571    /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9572    /// use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
9573    /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_body(InstancesPreCheckMajorVersionUpgradeRequest::default()/* use setters */);
9574    /// ```
9575    pub fn set_body<T>(mut self, v: T) -> Self
9576    where
9577        T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9578    {
9579        self.body = std::option::Option::Some(v.into());
9580        self
9581    }
9582
9583    /// Sets or clears the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
9584    ///
9585    /// # Example
9586    /// ```ignore,no_run
9587    /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9588    /// use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
9589    /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_body(Some(InstancesPreCheckMajorVersionUpgradeRequest::default()/* use setters */));
9590    /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_body(None::<InstancesPreCheckMajorVersionUpgradeRequest>);
9591    /// ```
9592    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
9593    where
9594        T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9595    {
9596        self.body = v.map(|x| x.into());
9597        self
9598    }
9599}
9600
9601impl wkt::message::Message for SqlInstancesPreCheckMajorVersionUpgradeRequest {
9602    fn typename() -> &'static str {
9603        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest"
9604    }
9605}
9606
9607/// Instance verify external sync settings response.
9608#[derive(Clone, Default, PartialEq)]
9609#[non_exhaustive]
9610pub struct SqlInstancesVerifyExternalSyncSettingsResponse {
9611    /// This is always `sql#migrationSettingErrorList`.
9612    pub kind: std::string::String,
9613
9614    /// List of migration violations.
9615    pub errors: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
9616
9617    /// List of migration warnings.
9618    pub warnings: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
9619
9620    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9621}
9622
9623impl SqlInstancesVerifyExternalSyncSettingsResponse {
9624    /// Creates a new default instance.
9625    pub fn new() -> Self {
9626        std::default::Default::default()
9627    }
9628
9629    /// Sets the value of [kind][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::kind].
9630    ///
9631    /// # Example
9632    /// ```ignore,no_run
9633    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9634    /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new().set_kind("example");
9635    /// ```
9636    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9637        self.kind = v.into();
9638        self
9639    }
9640
9641    /// Sets the value of [errors][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::errors].
9642    ///
9643    /// # Example
9644    /// ```ignore,no_run
9645    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9646    /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
9647    /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
9648    ///     .set_errors([
9649    ///         SqlExternalSyncSettingError::default()/* use setters */,
9650    ///         SqlExternalSyncSettingError::default()/* use (different) setters */,
9651    ///     ]);
9652    /// ```
9653    pub fn set_errors<T, V>(mut self, v: T) -> Self
9654    where
9655        T: std::iter::IntoIterator<Item = V>,
9656        V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
9657    {
9658        use std::iter::Iterator;
9659        self.errors = v.into_iter().map(|i| i.into()).collect();
9660        self
9661    }
9662
9663    /// Sets the value of [warnings][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::warnings].
9664    ///
9665    /// # Example
9666    /// ```ignore,no_run
9667    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9668    /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
9669    /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
9670    ///     .set_warnings([
9671    ///         SqlExternalSyncSettingError::default()/* use setters */,
9672    ///         SqlExternalSyncSettingError::default()/* use (different) setters */,
9673    ///     ]);
9674    /// ```
9675    pub fn set_warnings<T, V>(mut self, v: T) -> Self
9676    where
9677        T: std::iter::IntoIterator<Item = V>,
9678        V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
9679    {
9680        use std::iter::Iterator;
9681        self.warnings = v.into_iter().map(|i| i.into()).collect();
9682        self
9683    }
9684}
9685
9686impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsResponse {
9687    fn typename() -> &'static str {
9688        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse"
9689    }
9690}
9691
9692/// Instance get disk shrink config response.
9693#[derive(Clone, Default, PartialEq)]
9694#[non_exhaustive]
9695pub struct SqlInstancesGetDiskShrinkConfigResponse {
9696    /// This is always `sql#getDiskShrinkConfig`.
9697    pub kind: std::string::String,
9698
9699    /// The minimum size to which a disk can be shrunk in GigaBytes.
9700    pub minimal_target_size_gb: i64,
9701
9702    /// Additional message to customers.
9703    pub message: std::string::String,
9704
9705    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9706}
9707
9708impl SqlInstancesGetDiskShrinkConfigResponse {
9709    /// Creates a new default instance.
9710    pub fn new() -> Self {
9711        std::default::Default::default()
9712    }
9713
9714    /// Sets the value of [kind][crate::model::SqlInstancesGetDiskShrinkConfigResponse::kind].
9715    ///
9716    /// # Example
9717    /// ```ignore,no_run
9718    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9719    /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_kind("example");
9720    /// ```
9721    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9722        self.kind = v.into();
9723        self
9724    }
9725
9726    /// Sets the value of [minimal_target_size_gb][crate::model::SqlInstancesGetDiskShrinkConfigResponse::minimal_target_size_gb].
9727    ///
9728    /// # Example
9729    /// ```ignore,no_run
9730    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9731    /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_minimal_target_size_gb(42);
9732    /// ```
9733    pub fn set_minimal_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9734        self.minimal_target_size_gb = v.into();
9735        self
9736    }
9737
9738    /// Sets the value of [message][crate::model::SqlInstancesGetDiskShrinkConfigResponse::message].
9739    ///
9740    /// # Example
9741    /// ```ignore,no_run
9742    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9743    /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_message("example");
9744    /// ```
9745    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9746        self.message = v.into();
9747        self
9748    }
9749}
9750
9751impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigResponse {
9752    fn typename() -> &'static str {
9753        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse"
9754    }
9755}
9756
9757/// Instance get latest recovery time request.
9758#[derive(Clone, Default, PartialEq)]
9759#[non_exhaustive]
9760pub struct SqlInstancesGetLatestRecoveryTimeRequest {
9761    /// Cloud SQL instance ID. This does not include the project ID.
9762    pub instance: std::string::String,
9763
9764    /// Project ID of the project that contains the instance.
9765    pub project: std::string::String,
9766
9767    /// The timestamp used to identify the time when the source instance is
9768    /// deleted. If this instance is deleted, then you must set the timestamp.
9769    pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
9770
9771    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9772}
9773
9774impl SqlInstancesGetLatestRecoveryTimeRequest {
9775    /// Creates a new default instance.
9776    pub fn new() -> Self {
9777        std::default::Default::default()
9778    }
9779
9780    /// Sets the value of [instance][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::instance].
9781    ///
9782    /// # Example
9783    /// ```ignore,no_run
9784    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9785    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_instance("example");
9786    /// ```
9787    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9788        self.instance = v.into();
9789        self
9790    }
9791
9792    /// Sets the value of [project][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::project].
9793    ///
9794    /// # Example
9795    /// ```ignore,no_run
9796    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9797    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_project("example");
9798    /// ```
9799    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9800        self.project = v.into();
9801        self
9802    }
9803
9804    /// Sets the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
9805    ///
9806    /// # Example
9807    /// ```ignore,no_run
9808    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9809    /// use wkt::Timestamp;
9810    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_source_instance_deletion_time(Timestamp::default()/* use setters */);
9811    /// ```
9812    pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
9813    where
9814        T: std::convert::Into<wkt::Timestamp>,
9815    {
9816        self.source_instance_deletion_time = std::option::Option::Some(v.into());
9817        self
9818    }
9819
9820    /// Sets or clears the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
9821    ///
9822    /// # Example
9823    /// ```ignore,no_run
9824    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9825    /// use wkt::Timestamp;
9826    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_or_clear_source_instance_deletion_time(Some(Timestamp::default()/* use setters */));
9827    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_or_clear_source_instance_deletion_time(None::<Timestamp>);
9828    /// ```
9829    pub fn set_or_clear_source_instance_deletion_time<T>(
9830        mut self,
9831        v: std::option::Option<T>,
9832    ) -> Self
9833    where
9834        T: std::convert::Into<wkt::Timestamp>,
9835    {
9836        self.source_instance_deletion_time = v.map(|x| x.into());
9837        self
9838    }
9839}
9840
9841impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeRequest {
9842    fn typename() -> &'static str {
9843        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest"
9844    }
9845}
9846
9847/// Instance get latest recovery time response.
9848#[derive(Clone, Default, PartialEq)]
9849#[non_exhaustive]
9850pub struct SqlInstancesGetLatestRecoveryTimeResponse {
9851    /// This is always `sql#getLatestRecoveryTime`.
9852    pub kind: std::string::String,
9853
9854    /// Timestamp, identifies the latest recovery time of the source instance.
9855    pub latest_recovery_time: std::option::Option<wkt::Timestamp>,
9856
9857    /// Timestamp, identifies the earliest recovery time of the source instance.
9858    pub earliest_recovery_time: std::option::Option<wkt::Timestamp>,
9859
9860    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9861}
9862
9863impl SqlInstancesGetLatestRecoveryTimeResponse {
9864    /// Creates a new default instance.
9865    pub fn new() -> Self {
9866        std::default::Default::default()
9867    }
9868
9869    /// Sets the value of [kind][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::kind].
9870    ///
9871    /// # Example
9872    /// ```ignore,no_run
9873    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9874    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_kind("example");
9875    /// ```
9876    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9877        self.kind = v.into();
9878        self
9879    }
9880
9881    /// Sets the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
9882    ///
9883    /// # Example
9884    /// ```ignore,no_run
9885    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9886    /// use wkt::Timestamp;
9887    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_latest_recovery_time(Timestamp::default()/* use setters */);
9888    /// ```
9889    pub fn set_latest_recovery_time<T>(mut self, v: T) -> Self
9890    where
9891        T: std::convert::Into<wkt::Timestamp>,
9892    {
9893        self.latest_recovery_time = std::option::Option::Some(v.into());
9894        self
9895    }
9896
9897    /// Sets or clears the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
9898    ///
9899    /// # Example
9900    /// ```ignore,no_run
9901    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9902    /// use wkt::Timestamp;
9903    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(Some(Timestamp::default()/* use setters */));
9904    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(None::<Timestamp>);
9905    /// ```
9906    pub fn set_or_clear_latest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
9907    where
9908        T: std::convert::Into<wkt::Timestamp>,
9909    {
9910        self.latest_recovery_time = v.map(|x| x.into());
9911        self
9912    }
9913
9914    /// Sets the value of [earliest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::earliest_recovery_time].
9915    ///
9916    /// # Example
9917    /// ```ignore,no_run
9918    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9919    /// use wkt::Timestamp;
9920    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_earliest_recovery_time(Timestamp::default()/* use setters */);
9921    /// ```
9922    pub fn set_earliest_recovery_time<T>(mut self, v: T) -> Self
9923    where
9924        T: std::convert::Into<wkt::Timestamp>,
9925    {
9926        self.earliest_recovery_time = std::option::Option::Some(v.into());
9927        self
9928    }
9929
9930    /// Sets or clears the value of [earliest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::earliest_recovery_time].
9931    ///
9932    /// # Example
9933    /// ```ignore,no_run
9934    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9935    /// use wkt::Timestamp;
9936    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_earliest_recovery_time(Some(Timestamp::default()/* use setters */));
9937    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_earliest_recovery_time(None::<Timestamp>);
9938    /// ```
9939    pub fn set_or_clear_earliest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
9940    where
9941        T: std::convert::Into<wkt::Timestamp>,
9942    {
9943        self.earliest_recovery_time = v.map(|x| x.into());
9944        self
9945    }
9946}
9947
9948impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeResponse {
9949    fn typename() -> &'static str {
9950        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse"
9951    }
9952}
9953
9954/// Database instance clone context.
9955#[derive(Clone, Default, PartialEq)]
9956#[non_exhaustive]
9957pub struct CloneContext {
9958    /// This is always `sql#cloneContext`.
9959    pub kind: std::string::String,
9960
9961    /// Reserved for future use.
9962    pub pitr_timestamp_ms: i64,
9963
9964    /// Required. Name of the Cloud SQL instance to be created as a clone.
9965    pub destination_instance_name: std::string::String,
9966
9967    /// Binary log coordinates, if specified, identify the position up to which the
9968    /// source instance is cloned. If not specified, the source instance is
9969    /// cloned up to the most recent binary log coordinates.
9970    pub bin_log_coordinates: std::option::Option<crate::model::BinLogCoordinates>,
9971
9972    /// Timestamp, if specified, identifies the time to which the source instance
9973    /// is cloned.
9974    pub point_in_time: std::option::Option<wkt::Timestamp>,
9975
9976    /// The name of the allocated ip range for the private ip Cloud SQL instance.
9977    /// For example: "google-managed-services-default". If set, the cloned instance
9978    /// ip will be created in the allocated range. The range name must comply with
9979    /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
9980    /// must be 1-63 characters long and match the regular expression
9981    /// [a-z]([-a-z0-9]*[a-z0-9])?.
9982    /// Reserved for future use.
9983    pub allocated_ip_range: std::string::String,
9984
9985    /// (SQL Server only) Clone only the specified databases from the source
9986    /// instance. Clone all databases if empty.
9987    pub database_names: std::vec::Vec<std::string::String>,
9988
9989    /// Optional. Copy clone and point-in-time recovery clone of an instance to the
9990    /// specified zone. If no zone is specified, clone to the same primary zone as
9991    /// the source instance. This field applies to all DB types.
9992    pub preferred_zone: std::option::Option<std::string::String>,
9993
9994    /// Optional. Copy clone and point-in-time recovery clone of a regional
9995    /// instance in the specified zones. If not specified, clone to the same
9996    /// secondary zone as the source instance. This value cannot be the same as the
9997    /// preferred_zone field. This field applies to all DB types.
9998    pub preferred_secondary_zone: std::option::Option<std::string::String>,
9999
10000    /// The timestamp used to identify the time when the source instance is
10001    /// deleted. If this instance is deleted, then you must set the timestamp.
10002    pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
10003
10004    /// Optional. The project ID of the destination project where the cloned
10005    /// instance will be created. To perform a cross-project clone, this field is
10006    /// required. If not specified, the clone is created in the same project
10007    /// as the source instance.
10008    pub destination_project: std::option::Option<std::string::String>,
10009
10010    /// Optional. The fully qualified URI of the VPC network to which the cloned
10011    /// instance will be connected via Private Services Access for private IP. For
10012    /// example:`projects/my-network-project/global/networks/my-network`. This
10013    /// field is only required for cross-project cloning.
10014    pub destination_network: std::option::Option<std::string::String>,
10015
10016    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10017}
10018
10019impl CloneContext {
10020    /// Creates a new default instance.
10021    pub fn new() -> Self {
10022        std::default::Default::default()
10023    }
10024
10025    /// Sets the value of [kind][crate::model::CloneContext::kind].
10026    ///
10027    /// # Example
10028    /// ```ignore,no_run
10029    /// # use google_cloud_sql_v1::model::CloneContext;
10030    /// let x = CloneContext::new().set_kind("example");
10031    /// ```
10032    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10033        self.kind = v.into();
10034        self
10035    }
10036
10037    /// Sets the value of [pitr_timestamp_ms][crate::model::CloneContext::pitr_timestamp_ms].
10038    ///
10039    /// # Example
10040    /// ```ignore,no_run
10041    /// # use google_cloud_sql_v1::model::CloneContext;
10042    /// let x = CloneContext::new().set_pitr_timestamp_ms(42);
10043    /// ```
10044    pub fn set_pitr_timestamp_ms<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10045        self.pitr_timestamp_ms = v.into();
10046        self
10047    }
10048
10049    /// Sets the value of [destination_instance_name][crate::model::CloneContext::destination_instance_name].
10050    ///
10051    /// # Example
10052    /// ```ignore,no_run
10053    /// # use google_cloud_sql_v1::model::CloneContext;
10054    /// let x = CloneContext::new().set_destination_instance_name("example");
10055    /// ```
10056    pub fn set_destination_instance_name<T: std::convert::Into<std::string::String>>(
10057        mut self,
10058        v: T,
10059    ) -> Self {
10060        self.destination_instance_name = v.into();
10061        self
10062    }
10063
10064    /// Sets the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
10065    ///
10066    /// # Example
10067    /// ```ignore,no_run
10068    /// # use google_cloud_sql_v1::model::CloneContext;
10069    /// use google_cloud_sql_v1::model::BinLogCoordinates;
10070    /// let x = CloneContext::new().set_bin_log_coordinates(BinLogCoordinates::default()/* use setters */);
10071    /// ```
10072    pub fn set_bin_log_coordinates<T>(mut self, v: T) -> Self
10073    where
10074        T: std::convert::Into<crate::model::BinLogCoordinates>,
10075    {
10076        self.bin_log_coordinates = std::option::Option::Some(v.into());
10077        self
10078    }
10079
10080    /// Sets or clears the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
10081    ///
10082    /// # Example
10083    /// ```ignore,no_run
10084    /// # use google_cloud_sql_v1::model::CloneContext;
10085    /// use google_cloud_sql_v1::model::BinLogCoordinates;
10086    /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(Some(BinLogCoordinates::default()/* use setters */));
10087    /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(None::<BinLogCoordinates>);
10088    /// ```
10089    pub fn set_or_clear_bin_log_coordinates<T>(mut self, v: std::option::Option<T>) -> Self
10090    where
10091        T: std::convert::Into<crate::model::BinLogCoordinates>,
10092    {
10093        self.bin_log_coordinates = v.map(|x| x.into());
10094        self
10095    }
10096
10097    /// Sets the value of [point_in_time][crate::model::CloneContext::point_in_time].
10098    ///
10099    /// # Example
10100    /// ```ignore,no_run
10101    /// # use google_cloud_sql_v1::model::CloneContext;
10102    /// use wkt::Timestamp;
10103    /// let x = CloneContext::new().set_point_in_time(Timestamp::default()/* use setters */);
10104    /// ```
10105    pub fn set_point_in_time<T>(mut self, v: T) -> Self
10106    where
10107        T: std::convert::Into<wkt::Timestamp>,
10108    {
10109        self.point_in_time = std::option::Option::Some(v.into());
10110        self
10111    }
10112
10113    /// Sets or clears the value of [point_in_time][crate::model::CloneContext::point_in_time].
10114    ///
10115    /// # Example
10116    /// ```ignore,no_run
10117    /// # use google_cloud_sql_v1::model::CloneContext;
10118    /// use wkt::Timestamp;
10119    /// let x = CloneContext::new().set_or_clear_point_in_time(Some(Timestamp::default()/* use setters */));
10120    /// let x = CloneContext::new().set_or_clear_point_in_time(None::<Timestamp>);
10121    /// ```
10122    pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
10123    where
10124        T: std::convert::Into<wkt::Timestamp>,
10125    {
10126        self.point_in_time = v.map(|x| x.into());
10127        self
10128    }
10129
10130    /// Sets the value of [allocated_ip_range][crate::model::CloneContext::allocated_ip_range].
10131    ///
10132    /// # Example
10133    /// ```ignore,no_run
10134    /// # use google_cloud_sql_v1::model::CloneContext;
10135    /// let x = CloneContext::new().set_allocated_ip_range("example");
10136    /// ```
10137    pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
10138        mut self,
10139        v: T,
10140    ) -> Self {
10141        self.allocated_ip_range = v.into();
10142        self
10143    }
10144
10145    /// Sets the value of [database_names][crate::model::CloneContext::database_names].
10146    ///
10147    /// # Example
10148    /// ```ignore,no_run
10149    /// # use google_cloud_sql_v1::model::CloneContext;
10150    /// let x = CloneContext::new().set_database_names(["a", "b", "c"]);
10151    /// ```
10152    pub fn set_database_names<T, V>(mut self, v: T) -> Self
10153    where
10154        T: std::iter::IntoIterator<Item = V>,
10155        V: std::convert::Into<std::string::String>,
10156    {
10157        use std::iter::Iterator;
10158        self.database_names = v.into_iter().map(|i| i.into()).collect();
10159        self
10160    }
10161
10162    /// Sets the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
10163    ///
10164    /// # Example
10165    /// ```ignore,no_run
10166    /// # use google_cloud_sql_v1::model::CloneContext;
10167    /// let x = CloneContext::new().set_preferred_zone("example");
10168    /// ```
10169    pub fn set_preferred_zone<T>(mut self, v: T) -> Self
10170    where
10171        T: std::convert::Into<std::string::String>,
10172    {
10173        self.preferred_zone = std::option::Option::Some(v.into());
10174        self
10175    }
10176
10177    /// Sets or clears the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
10178    ///
10179    /// # Example
10180    /// ```ignore,no_run
10181    /// # use google_cloud_sql_v1::model::CloneContext;
10182    /// let x = CloneContext::new().set_or_clear_preferred_zone(Some("example"));
10183    /// let x = CloneContext::new().set_or_clear_preferred_zone(None::<String>);
10184    /// ```
10185    pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
10186    where
10187        T: std::convert::Into<std::string::String>,
10188    {
10189        self.preferred_zone = v.map(|x| x.into());
10190        self
10191    }
10192
10193    /// Sets the value of [preferred_secondary_zone][crate::model::CloneContext::preferred_secondary_zone].
10194    ///
10195    /// # Example
10196    /// ```ignore,no_run
10197    /// # use google_cloud_sql_v1::model::CloneContext;
10198    /// let x = CloneContext::new().set_preferred_secondary_zone("example");
10199    /// ```
10200    pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
10201    where
10202        T: std::convert::Into<std::string::String>,
10203    {
10204        self.preferred_secondary_zone = std::option::Option::Some(v.into());
10205        self
10206    }
10207
10208    /// Sets or clears the value of [preferred_secondary_zone][crate::model::CloneContext::preferred_secondary_zone].
10209    ///
10210    /// # Example
10211    /// ```ignore,no_run
10212    /// # use google_cloud_sql_v1::model::CloneContext;
10213    /// let x = CloneContext::new().set_or_clear_preferred_secondary_zone(Some("example"));
10214    /// let x = CloneContext::new().set_or_clear_preferred_secondary_zone(None::<String>);
10215    /// ```
10216    pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
10217    where
10218        T: std::convert::Into<std::string::String>,
10219    {
10220        self.preferred_secondary_zone = v.map(|x| x.into());
10221        self
10222    }
10223
10224    /// Sets the value of [source_instance_deletion_time][crate::model::CloneContext::source_instance_deletion_time].
10225    ///
10226    /// # Example
10227    /// ```ignore,no_run
10228    /// # use google_cloud_sql_v1::model::CloneContext;
10229    /// use wkt::Timestamp;
10230    /// let x = CloneContext::new().set_source_instance_deletion_time(Timestamp::default()/* use setters */);
10231    /// ```
10232    pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
10233    where
10234        T: std::convert::Into<wkt::Timestamp>,
10235    {
10236        self.source_instance_deletion_time = std::option::Option::Some(v.into());
10237        self
10238    }
10239
10240    /// Sets or clears the value of [source_instance_deletion_time][crate::model::CloneContext::source_instance_deletion_time].
10241    ///
10242    /// # Example
10243    /// ```ignore,no_run
10244    /// # use google_cloud_sql_v1::model::CloneContext;
10245    /// use wkt::Timestamp;
10246    /// let x = CloneContext::new().set_or_clear_source_instance_deletion_time(Some(Timestamp::default()/* use setters */));
10247    /// let x = CloneContext::new().set_or_clear_source_instance_deletion_time(None::<Timestamp>);
10248    /// ```
10249    pub fn set_or_clear_source_instance_deletion_time<T>(
10250        mut self,
10251        v: std::option::Option<T>,
10252    ) -> Self
10253    where
10254        T: std::convert::Into<wkt::Timestamp>,
10255    {
10256        self.source_instance_deletion_time = v.map(|x| x.into());
10257        self
10258    }
10259
10260    /// Sets the value of [destination_project][crate::model::CloneContext::destination_project].
10261    ///
10262    /// # Example
10263    /// ```ignore,no_run
10264    /// # use google_cloud_sql_v1::model::CloneContext;
10265    /// let x = CloneContext::new().set_destination_project("example");
10266    /// ```
10267    pub fn set_destination_project<T>(mut self, v: T) -> Self
10268    where
10269        T: std::convert::Into<std::string::String>,
10270    {
10271        self.destination_project = std::option::Option::Some(v.into());
10272        self
10273    }
10274
10275    /// Sets or clears the value of [destination_project][crate::model::CloneContext::destination_project].
10276    ///
10277    /// # Example
10278    /// ```ignore,no_run
10279    /// # use google_cloud_sql_v1::model::CloneContext;
10280    /// let x = CloneContext::new().set_or_clear_destination_project(Some("example"));
10281    /// let x = CloneContext::new().set_or_clear_destination_project(None::<String>);
10282    /// ```
10283    pub fn set_or_clear_destination_project<T>(mut self, v: std::option::Option<T>) -> Self
10284    where
10285        T: std::convert::Into<std::string::String>,
10286    {
10287        self.destination_project = v.map(|x| x.into());
10288        self
10289    }
10290
10291    /// Sets the value of [destination_network][crate::model::CloneContext::destination_network].
10292    ///
10293    /// # Example
10294    /// ```ignore,no_run
10295    /// # use google_cloud_sql_v1::model::CloneContext;
10296    /// let x = CloneContext::new().set_destination_network("example");
10297    /// ```
10298    pub fn set_destination_network<T>(mut self, v: T) -> Self
10299    where
10300        T: std::convert::Into<std::string::String>,
10301    {
10302        self.destination_network = std::option::Option::Some(v.into());
10303        self
10304    }
10305
10306    /// Sets or clears the value of [destination_network][crate::model::CloneContext::destination_network].
10307    ///
10308    /// # Example
10309    /// ```ignore,no_run
10310    /// # use google_cloud_sql_v1::model::CloneContext;
10311    /// let x = CloneContext::new().set_or_clear_destination_network(Some("example"));
10312    /// let x = CloneContext::new().set_or_clear_destination_network(None::<String>);
10313    /// ```
10314    pub fn set_or_clear_destination_network<T>(mut self, v: std::option::Option<T>) -> Self
10315    where
10316        T: std::convert::Into<std::string::String>,
10317    {
10318        self.destination_network = v.map(|x| x.into());
10319        self
10320    }
10321}
10322
10323impl wkt::message::Message for CloneContext {
10324    fn typename() -> &'static str {
10325        "type.googleapis.com/google.cloud.sql.v1.CloneContext"
10326    }
10327}
10328
10329/// The context to perform a point-in-time recovery of an instance managed by
10330/// Backup and Disaster Recovery (DR) Service.
10331#[derive(Clone, Default, PartialEq)]
10332#[non_exhaustive]
10333pub struct PointInTimeRestoreContext {
10334    /// The Backup and Disaster Recovery (DR) Service Datasource URI.
10335    /// Format:
10336    /// projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
10337    pub datasource: std::option::Option<std::string::String>,
10338
10339    /// Required. The date and time to which you want to restore the instance.
10340    pub point_in_time: std::option::Option<wkt::Timestamp>,
10341
10342    /// Target instance name.
10343    pub target_instance: std::option::Option<std::string::String>,
10344
10345    /// Optional. The resource link for the VPC network from which the Cloud SQL
10346    /// instance is accessible for private IP. For example,
10347    /// `/projects/myProject/global/networks/default`.
10348    pub private_network: std::option::Option<std::string::String>,
10349
10350    /// Optional. The name of the allocated IP range for the internal IP Cloud SQL
10351    /// instance. For example: "google-managed-services-default". If you set this,
10352    /// then Cloud SQL creates the IP address for the cloned instance in the
10353    /// allocated range. This range must comply with [RFC
10354    /// 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
10355    /// name must be 1-63 characters long and match the regular expression
10356    /// [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
10357    pub allocated_ip_range: std::option::Option<std::string::String>,
10358
10359    /// Optional. Point-in-time recovery of an instance to the specified zone. If
10360    /// no zone is specified, then clone to the same primary zone as the source
10361    /// instance.
10362    pub preferred_zone: std::option::Option<std::string::String>,
10363
10364    /// Optional. Point-in-time recovery of a regional instance in the specified
10365    /// zones. If not specified, clone to the same secondary zone as the source
10366    /// instance. This value cannot be the same as the preferred_zone field.
10367    pub preferred_secondary_zone: std::option::Option<std::string::String>,
10368
10369    /// Optional. Specifies the instance settings that will be overridden from the
10370    /// source instance. This field is only applicable for cross project PITRs.
10371    pub target_instance_settings: std::option::Option<crate::model::DatabaseInstance>,
10372
10373    /// Optional. Specifies the instance settings that will be cleared from the
10374    /// source instance. This field is only applicable for cross project PITRs.
10375    pub target_instance_clear_settings_field_names: std::vec::Vec<std::string::String>,
10376
10377    /// Optional. The region of the target instance where the datasource will be
10378    /// restored. For example: "us-central1".
10379    pub region: std::option::Option<std::string::String>,
10380
10381    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10382}
10383
10384impl PointInTimeRestoreContext {
10385    /// Creates a new default instance.
10386    pub fn new() -> Self {
10387        std::default::Default::default()
10388    }
10389
10390    /// Sets the value of [datasource][crate::model::PointInTimeRestoreContext::datasource].
10391    ///
10392    /// # Example
10393    /// ```ignore,no_run
10394    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10395    /// let x = PointInTimeRestoreContext::new().set_datasource("example");
10396    /// ```
10397    pub fn set_datasource<T>(mut self, v: T) -> Self
10398    where
10399        T: std::convert::Into<std::string::String>,
10400    {
10401        self.datasource = std::option::Option::Some(v.into());
10402        self
10403    }
10404
10405    /// Sets or clears the value of [datasource][crate::model::PointInTimeRestoreContext::datasource].
10406    ///
10407    /// # Example
10408    /// ```ignore,no_run
10409    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10410    /// let x = PointInTimeRestoreContext::new().set_or_clear_datasource(Some("example"));
10411    /// let x = PointInTimeRestoreContext::new().set_or_clear_datasource(None::<String>);
10412    /// ```
10413    pub fn set_or_clear_datasource<T>(mut self, v: std::option::Option<T>) -> Self
10414    where
10415        T: std::convert::Into<std::string::String>,
10416    {
10417        self.datasource = v.map(|x| x.into());
10418        self
10419    }
10420
10421    /// Sets the value of [point_in_time][crate::model::PointInTimeRestoreContext::point_in_time].
10422    ///
10423    /// # Example
10424    /// ```ignore,no_run
10425    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10426    /// use wkt::Timestamp;
10427    /// let x = PointInTimeRestoreContext::new().set_point_in_time(Timestamp::default()/* use setters */);
10428    /// ```
10429    pub fn set_point_in_time<T>(mut self, v: T) -> Self
10430    where
10431        T: std::convert::Into<wkt::Timestamp>,
10432    {
10433        self.point_in_time = std::option::Option::Some(v.into());
10434        self
10435    }
10436
10437    /// Sets or clears the value of [point_in_time][crate::model::PointInTimeRestoreContext::point_in_time].
10438    ///
10439    /// # Example
10440    /// ```ignore,no_run
10441    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10442    /// use wkt::Timestamp;
10443    /// let x = PointInTimeRestoreContext::new().set_or_clear_point_in_time(Some(Timestamp::default()/* use setters */));
10444    /// let x = PointInTimeRestoreContext::new().set_or_clear_point_in_time(None::<Timestamp>);
10445    /// ```
10446    pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
10447    where
10448        T: std::convert::Into<wkt::Timestamp>,
10449    {
10450        self.point_in_time = v.map(|x| x.into());
10451        self
10452    }
10453
10454    /// Sets the value of [target_instance][crate::model::PointInTimeRestoreContext::target_instance].
10455    ///
10456    /// # Example
10457    /// ```ignore,no_run
10458    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10459    /// let x = PointInTimeRestoreContext::new().set_target_instance("example");
10460    /// ```
10461    pub fn set_target_instance<T>(mut self, v: T) -> Self
10462    where
10463        T: std::convert::Into<std::string::String>,
10464    {
10465        self.target_instance = std::option::Option::Some(v.into());
10466        self
10467    }
10468
10469    /// Sets or clears the value of [target_instance][crate::model::PointInTimeRestoreContext::target_instance].
10470    ///
10471    /// # Example
10472    /// ```ignore,no_run
10473    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10474    /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance(Some("example"));
10475    /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance(None::<String>);
10476    /// ```
10477    pub fn set_or_clear_target_instance<T>(mut self, v: std::option::Option<T>) -> Self
10478    where
10479        T: std::convert::Into<std::string::String>,
10480    {
10481        self.target_instance = v.map(|x| x.into());
10482        self
10483    }
10484
10485    /// Sets the value of [private_network][crate::model::PointInTimeRestoreContext::private_network].
10486    ///
10487    /// # Example
10488    /// ```ignore,no_run
10489    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10490    /// let x = PointInTimeRestoreContext::new().set_private_network("example");
10491    /// ```
10492    pub fn set_private_network<T>(mut self, v: T) -> Self
10493    where
10494        T: std::convert::Into<std::string::String>,
10495    {
10496        self.private_network = std::option::Option::Some(v.into());
10497        self
10498    }
10499
10500    /// Sets or clears the value of [private_network][crate::model::PointInTimeRestoreContext::private_network].
10501    ///
10502    /// # Example
10503    /// ```ignore,no_run
10504    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10505    /// let x = PointInTimeRestoreContext::new().set_or_clear_private_network(Some("example"));
10506    /// let x = PointInTimeRestoreContext::new().set_or_clear_private_network(None::<String>);
10507    /// ```
10508    pub fn set_or_clear_private_network<T>(mut self, v: std::option::Option<T>) -> Self
10509    where
10510        T: std::convert::Into<std::string::String>,
10511    {
10512        self.private_network = v.map(|x| x.into());
10513        self
10514    }
10515
10516    /// Sets the value of [allocated_ip_range][crate::model::PointInTimeRestoreContext::allocated_ip_range].
10517    ///
10518    /// # Example
10519    /// ```ignore,no_run
10520    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10521    /// let x = PointInTimeRestoreContext::new().set_allocated_ip_range("example");
10522    /// ```
10523    pub fn set_allocated_ip_range<T>(mut self, v: T) -> Self
10524    where
10525        T: std::convert::Into<std::string::String>,
10526    {
10527        self.allocated_ip_range = std::option::Option::Some(v.into());
10528        self
10529    }
10530
10531    /// Sets or clears the value of [allocated_ip_range][crate::model::PointInTimeRestoreContext::allocated_ip_range].
10532    ///
10533    /// # Example
10534    /// ```ignore,no_run
10535    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10536    /// let x = PointInTimeRestoreContext::new().set_or_clear_allocated_ip_range(Some("example"));
10537    /// let x = PointInTimeRestoreContext::new().set_or_clear_allocated_ip_range(None::<String>);
10538    /// ```
10539    pub fn set_or_clear_allocated_ip_range<T>(mut self, v: std::option::Option<T>) -> Self
10540    where
10541        T: std::convert::Into<std::string::String>,
10542    {
10543        self.allocated_ip_range = v.map(|x| x.into());
10544        self
10545    }
10546
10547    /// Sets the value of [preferred_zone][crate::model::PointInTimeRestoreContext::preferred_zone].
10548    ///
10549    /// # Example
10550    /// ```ignore,no_run
10551    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10552    /// let x = PointInTimeRestoreContext::new().set_preferred_zone("example");
10553    /// ```
10554    pub fn set_preferred_zone<T>(mut self, v: T) -> Self
10555    where
10556        T: std::convert::Into<std::string::String>,
10557    {
10558        self.preferred_zone = std::option::Option::Some(v.into());
10559        self
10560    }
10561
10562    /// Sets or clears the value of [preferred_zone][crate::model::PointInTimeRestoreContext::preferred_zone].
10563    ///
10564    /// # Example
10565    /// ```ignore,no_run
10566    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10567    /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_zone(Some("example"));
10568    /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_zone(None::<String>);
10569    /// ```
10570    pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
10571    where
10572        T: std::convert::Into<std::string::String>,
10573    {
10574        self.preferred_zone = v.map(|x| x.into());
10575        self
10576    }
10577
10578    /// Sets the value of [preferred_secondary_zone][crate::model::PointInTimeRestoreContext::preferred_secondary_zone].
10579    ///
10580    /// # Example
10581    /// ```ignore,no_run
10582    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10583    /// let x = PointInTimeRestoreContext::new().set_preferred_secondary_zone("example");
10584    /// ```
10585    pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
10586    where
10587        T: std::convert::Into<std::string::String>,
10588    {
10589        self.preferred_secondary_zone = std::option::Option::Some(v.into());
10590        self
10591    }
10592
10593    /// Sets or clears the value of [preferred_secondary_zone][crate::model::PointInTimeRestoreContext::preferred_secondary_zone].
10594    ///
10595    /// # Example
10596    /// ```ignore,no_run
10597    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10598    /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_secondary_zone(Some("example"));
10599    /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_secondary_zone(None::<String>);
10600    /// ```
10601    pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
10602    where
10603        T: std::convert::Into<std::string::String>,
10604    {
10605        self.preferred_secondary_zone = v.map(|x| x.into());
10606        self
10607    }
10608
10609    /// Sets the value of [target_instance_settings][crate::model::PointInTimeRestoreContext::target_instance_settings].
10610    ///
10611    /// # Example
10612    /// ```ignore,no_run
10613    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10614    /// use google_cloud_sql_v1::model::DatabaseInstance;
10615    /// let x = PointInTimeRestoreContext::new().set_target_instance_settings(DatabaseInstance::default()/* use setters */);
10616    /// ```
10617    pub fn set_target_instance_settings<T>(mut self, v: T) -> Self
10618    where
10619        T: std::convert::Into<crate::model::DatabaseInstance>,
10620    {
10621        self.target_instance_settings = std::option::Option::Some(v.into());
10622        self
10623    }
10624
10625    /// Sets or clears the value of [target_instance_settings][crate::model::PointInTimeRestoreContext::target_instance_settings].
10626    ///
10627    /// # Example
10628    /// ```ignore,no_run
10629    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10630    /// use google_cloud_sql_v1::model::DatabaseInstance;
10631    /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance_settings(Some(DatabaseInstance::default()/* use setters */));
10632    /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance_settings(None::<DatabaseInstance>);
10633    /// ```
10634    pub fn set_or_clear_target_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
10635    where
10636        T: std::convert::Into<crate::model::DatabaseInstance>,
10637    {
10638        self.target_instance_settings = v.map(|x| x.into());
10639        self
10640    }
10641
10642    /// Sets the value of [target_instance_clear_settings_field_names][crate::model::PointInTimeRestoreContext::target_instance_clear_settings_field_names].
10643    ///
10644    /// # Example
10645    /// ```ignore,no_run
10646    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10647    /// let x = PointInTimeRestoreContext::new().set_target_instance_clear_settings_field_names(["a", "b", "c"]);
10648    /// ```
10649    pub fn set_target_instance_clear_settings_field_names<T, V>(mut self, v: T) -> Self
10650    where
10651        T: std::iter::IntoIterator<Item = V>,
10652        V: std::convert::Into<std::string::String>,
10653    {
10654        use std::iter::Iterator;
10655        self.target_instance_clear_settings_field_names = v.into_iter().map(|i| i.into()).collect();
10656        self
10657    }
10658
10659    /// Sets the value of [region][crate::model::PointInTimeRestoreContext::region].
10660    ///
10661    /// # Example
10662    /// ```ignore,no_run
10663    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10664    /// let x = PointInTimeRestoreContext::new().set_region("example");
10665    /// ```
10666    pub fn set_region<T>(mut self, v: T) -> Self
10667    where
10668        T: std::convert::Into<std::string::String>,
10669    {
10670        self.region = std::option::Option::Some(v.into());
10671        self
10672    }
10673
10674    /// Sets or clears the value of [region][crate::model::PointInTimeRestoreContext::region].
10675    ///
10676    /// # Example
10677    /// ```ignore,no_run
10678    /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10679    /// let x = PointInTimeRestoreContext::new().set_or_clear_region(Some("example"));
10680    /// let x = PointInTimeRestoreContext::new().set_or_clear_region(None::<String>);
10681    /// ```
10682    pub fn set_or_clear_region<T>(mut self, v: std::option::Option<T>) -> Self
10683    where
10684        T: std::convert::Into<std::string::String>,
10685    {
10686        self.region = v.map(|x| x.into());
10687        self
10688    }
10689}
10690
10691impl wkt::message::Message for PointInTimeRestoreContext {
10692    fn typename() -> &'static str {
10693        "type.googleapis.com/google.cloud.sql.v1.PointInTimeRestoreContext"
10694    }
10695}
10696
10697/// Binary log coordinates.
10698#[derive(Clone, Default, PartialEq)]
10699#[non_exhaustive]
10700pub struct BinLogCoordinates {
10701    /// Name of the binary log file for a Cloud SQL instance.
10702    pub bin_log_file_name: std::string::String,
10703
10704    /// Position (offset) within the binary log file.
10705    pub bin_log_position: i64,
10706
10707    /// This is always `sql#binLogCoordinates`.
10708    pub kind: std::string::String,
10709
10710    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10711}
10712
10713impl BinLogCoordinates {
10714    /// Creates a new default instance.
10715    pub fn new() -> Self {
10716        std::default::Default::default()
10717    }
10718
10719    /// Sets the value of [bin_log_file_name][crate::model::BinLogCoordinates::bin_log_file_name].
10720    ///
10721    /// # Example
10722    /// ```ignore,no_run
10723    /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10724    /// let x = BinLogCoordinates::new().set_bin_log_file_name("example");
10725    /// ```
10726    pub fn set_bin_log_file_name<T: std::convert::Into<std::string::String>>(
10727        mut self,
10728        v: T,
10729    ) -> Self {
10730        self.bin_log_file_name = v.into();
10731        self
10732    }
10733
10734    /// Sets the value of [bin_log_position][crate::model::BinLogCoordinates::bin_log_position].
10735    ///
10736    /// # Example
10737    /// ```ignore,no_run
10738    /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10739    /// let x = BinLogCoordinates::new().set_bin_log_position(42);
10740    /// ```
10741    pub fn set_bin_log_position<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10742        self.bin_log_position = v.into();
10743        self
10744    }
10745
10746    /// Sets the value of [kind][crate::model::BinLogCoordinates::kind].
10747    ///
10748    /// # Example
10749    /// ```ignore,no_run
10750    /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10751    /// let x = BinLogCoordinates::new().set_kind("example");
10752    /// ```
10753    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10754        self.kind = v.into();
10755        self
10756    }
10757}
10758
10759impl wkt::message::Message for BinLogCoordinates {
10760    fn typename() -> &'static str {
10761        "type.googleapis.com/google.cloud.sql.v1.BinLogCoordinates"
10762    }
10763}
10764
10765/// A Cloud SQL instance resource.
10766#[derive(Clone, Default, PartialEq)]
10767#[non_exhaustive]
10768pub struct DatabaseInstance {
10769    /// This is always `sql#instance`.
10770    pub kind: std::string::String,
10771
10772    /// The current serving state of the Cloud SQL instance.
10773    pub state: crate::model::database_instance::SqlInstanceState,
10774
10775    /// The database engine type and version. The `databaseVersion` field cannot
10776    /// be changed after instance creation.
10777    pub database_version: crate::model::SqlDatabaseVersion,
10778
10779    /// The user settings.
10780    pub settings: std::option::Option<crate::model::Settings>,
10781
10782    /// This field is deprecated and will be removed from a future version of the
10783    /// API. Use the `settings.settingsVersion` field instead.
10784    pub etag: std::string::String,
10785
10786    /// The name and status of the failover replica.
10787    pub failover_replica: std::option::Option<crate::model::database_instance::SqlFailoverReplica>,
10788
10789    /// The name of the instance which will act as primary in the replication
10790    /// setup.
10791    pub master_instance_name: std::string::String,
10792
10793    /// The replicas of the instance.
10794    pub replica_names: std::vec::Vec<std::string::String>,
10795
10796    /// The maximum disk size of the instance in bytes.
10797    #[deprecated]
10798    pub max_disk_size: std::option::Option<wkt::Int64Value>,
10799
10800    /// The current disk usage of the instance in bytes. This property has been
10801    /// deprecated. Use the
10802    /// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
10803    /// Monitoring API instead. Please see [this
10804    /// announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
10805    /// for details.
10806    #[deprecated]
10807    pub current_disk_size: std::option::Option<wkt::Int64Value>,
10808
10809    /// The assigned IP addresses for the instance.
10810    pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
10811
10812    /// SSL configuration.
10813    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
10814
10815    /// The instance type.
10816    pub instance_type: crate::model::SqlInstanceType,
10817
10818    /// The project ID of the project containing the Cloud SQL instance. The Google
10819    /// apps domain is prefixed if applicable.
10820    pub project: std::string::String,
10821
10822    /// The IPv6 address assigned to the instance.
10823    /// (Deprecated) This property was applicable only
10824    /// to First Generation instances.
10825    #[deprecated]
10826    pub ipv6_address: std::string::String,
10827
10828    /// The service account email address assigned to the instance.\This
10829    /// property is read-only.
10830    pub service_account_email_address: std::string::String,
10831
10832    /// Configuration specific to on-premises instances.
10833    pub on_premises_configuration: std::option::Option<crate::model::OnPremisesConfiguration>,
10834
10835    /// Configuration specific to failover replicas and read replicas.
10836    pub replica_configuration: std::option::Option<crate::model::ReplicaConfiguration>,
10837
10838    /// The backend type.
10839    /// `SECOND_GEN`: Cloud SQL database instance.
10840    /// `EXTERNAL`: A database server that is not managed by Google.
10841    ///
10842    /// This property is read-only; use the `tier` property in the `settings`
10843    /// object to determine the database type.
10844    pub backend_type: crate::model::SqlBackendType,
10845
10846    /// The URI of this resource.
10847    pub self_link: std::string::String,
10848
10849    /// If the instance state is SUSPENDED, the reason for the suspension.
10850    pub suspension_reason: std::vec::Vec<crate::model::SqlSuspensionReason>,
10851
10852    /// Connection name of the Cloud SQL instance used in connection strings.
10853    pub connection_name: std::string::String,
10854
10855    /// Name of the Cloud SQL instance. This does not include the project ID.
10856    pub name: std::string::String,
10857
10858    /// The geographical region of the Cloud SQL instance.
10859    ///
10860    /// It can be one of the
10861    /// [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
10862    /// where Cloud SQL operates:
10863    ///
10864    /// For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
10865    /// The default value is `us-central1`.
10866    pub region: std::string::String,
10867
10868    /// The Compute Engine zone that the instance is currently serving from. This
10869    /// value could be different from the zone that was specified when the instance
10870    /// was created if the instance has failed over to its secondary zone. WARNING:
10871    /// Changing this might restart the instance.
10872    pub gce_zone: std::string::String,
10873
10874    /// The Compute Engine zone that the failover instance is currently serving
10875    /// from for a regional instance. This value could be different
10876    /// from the zone that was specified when the instance
10877    /// was created if the instance has failed over to its secondary/failover zone.
10878    pub secondary_gce_zone: std::string::String,
10879
10880    /// Disk encryption configuration specific to an instance.
10881    pub disk_encryption_configuration:
10882        std::option::Option<crate::model::DiskEncryptionConfiguration>,
10883
10884    /// Disk encryption status specific to an instance.
10885    pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
10886
10887    /// Initial root password. Use only on creation. You must set root passwords
10888    /// before you can connect to PostgreSQL instances.
10889    pub root_password: std::string::String,
10890
10891    /// The start time of any upcoming scheduled maintenance for this instance.
10892    pub scheduled_maintenance:
10893        std::option::Option<crate::model::database_instance::SqlScheduledMaintenance>,
10894
10895    /// This status indicates whether the instance satisfies PZS.
10896    ///
10897    /// The status is reserved for future use.
10898    pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
10899
10900    /// Output only. Stores the current database version running on the instance
10901    /// including minor version such as `MYSQL_8_0_18`.
10902    pub database_installed_version: std::string::String,
10903
10904    /// This field represents the report generated by the proactive database
10905    /// wellness job for OutOfDisk issues.
10906    ///
10907    /// * Writers:
10908    /// * the proactive database wellness job for OOD.
10909    /// * Readers:
10910    /// * the proactive database wellness job
10911    pub out_of_disk_report:
10912        std::option::Option<crate::model::database_instance::SqlOutOfDiskReport>,
10913
10914    /// Output only. The time when the instance was created in
10915    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
10916    /// `2012-11-15T16:19:00.094Z`.
10917    pub create_time: std::option::Option<wkt::Timestamp>,
10918
10919    /// Output only. List all maintenance versions applicable on the instance
10920    pub available_maintenance_versions: std::vec::Vec<std::string::String>,
10921
10922    /// The current software version on the instance.
10923    pub maintenance_version: std::string::String,
10924
10925    /// Output only. All database versions that are available for upgrade.
10926    pub upgradable_database_versions: std::vec::Vec<crate::model::AvailableDatabaseVersion>,
10927
10928    #[allow(missing_docs)]
10929    pub sql_network_architecture:
10930        std::option::Option<crate::model::database_instance::SqlNetworkArchitecture>,
10931
10932    /// Output only. The link to service attachment of PSC instance.
10933    pub psc_service_attachment_link: std::option::Option<std::string::String>,
10934
10935    /// Output only. The dns name of the instance.
10936    pub dns_name: std::option::Option<std::string::String>,
10937
10938    /// Output only. DEPRECATED: please use write_endpoint instead.
10939    #[deprecated]
10940    pub primary_dns_name: std::option::Option<std::string::String>,
10941
10942    /// Output only. The dns name of the primary instance in a replication group.
10943    pub write_endpoint: std::option::Option<std::string::String>,
10944
10945    /// Optional. A primary instance and disaster recovery (DR) replica pair.
10946    /// A DR replica is a cross-region replica that you designate
10947    /// for failover in the event that the primary instance
10948    /// experiences regional failure.
10949    /// Applicable to MySQL and PostgreSQL.
10950    pub replication_cluster: std::option::Option<crate::model::ReplicationCluster>,
10951
10952    /// Gemini instance configuration.
10953    pub gemini_config: std::option::Option<crate::model::GeminiInstanceConfig>,
10954
10955    /// Output only. This status indicates whether the instance satisfies PZI.
10956    ///
10957    /// The status is reserved for future use.
10958    pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
10959
10960    /// Input only. Whether Cloud SQL is enabled to switch storing point-in-time
10961    /// recovery log files from a data disk to Cloud Storage.
10962    pub switch_transaction_logs_to_cloud_storage_enabled: std::option::Option<wkt::BoolValue>,
10963
10964    /// Input only. Determines whether an in-place major version upgrade of
10965    /// replicas happens when an in-place major version upgrade of a primary
10966    /// instance is initiated.
10967    pub include_replicas_for_major_version_upgrade: std::option::Option<wkt::BoolValue>,
10968
10969    /// Optional. Input only. Immutable. Tag keys and tag values that are bound to
10970    /// this instance. You must represent each item in the map as:
10971    /// `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
10972    ///
10973    /// For example, a single resource can have the following tags:
10974    ///
10975    /// ```norust
10976    ///   "123/environment": "production",
10977    ///   "123/costCenter": "marketing",
10978    /// ```
10979    ///
10980    /// For more information on tag creation and management, see
10981    /// <https://cloud.google.com/resource-manager/docs/tags/tags-overview>.
10982    pub tags: std::collections::HashMap<std::string::String, std::string::String>,
10983
10984    /// The number of read pool nodes in a read pool.
10985    pub node_count: std::option::Option<i32>,
10986
10987    /// Output only. Entries containing information about each read pool node of
10988    /// the read pool.
10989    pub nodes: std::vec::Vec<crate::model::database_instance::PoolNodeConfig>,
10990
10991    /// Output only. The list of DNS names used by this instance.
10992    pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
10993
10994    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10995}
10996
10997impl DatabaseInstance {
10998    /// Creates a new default instance.
10999    pub fn new() -> Self {
11000        std::default::Default::default()
11001    }
11002
11003    /// Sets the value of [kind][crate::model::DatabaseInstance::kind].
11004    ///
11005    /// # Example
11006    /// ```ignore,no_run
11007    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11008    /// let x = DatabaseInstance::new().set_kind("example");
11009    /// ```
11010    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11011        self.kind = v.into();
11012        self
11013    }
11014
11015    /// Sets the value of [state][crate::model::DatabaseInstance::state].
11016    ///
11017    /// # Example
11018    /// ```ignore,no_run
11019    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11020    /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
11021    /// let x0 = DatabaseInstance::new().set_state(SqlInstanceState::Runnable);
11022    /// let x1 = DatabaseInstance::new().set_state(SqlInstanceState::Suspended);
11023    /// let x2 = DatabaseInstance::new().set_state(SqlInstanceState::PendingDelete);
11024    /// ```
11025    pub fn set_state<T: std::convert::Into<crate::model::database_instance::SqlInstanceState>>(
11026        mut self,
11027        v: T,
11028    ) -> Self {
11029        self.state = v.into();
11030        self
11031    }
11032
11033    /// Sets the value of [database_version][crate::model::DatabaseInstance::database_version].
11034    ///
11035    /// # Example
11036    /// ```ignore,no_run
11037    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11038    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
11039    /// let x0 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql56);
11040    /// let x1 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql57);
11041    /// let x2 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql80);
11042    /// ```
11043    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
11044        mut self,
11045        v: T,
11046    ) -> Self {
11047        self.database_version = v.into();
11048        self
11049    }
11050
11051    /// Sets the value of [settings][crate::model::DatabaseInstance::settings].
11052    ///
11053    /// # Example
11054    /// ```ignore,no_run
11055    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11056    /// use google_cloud_sql_v1::model::Settings;
11057    /// let x = DatabaseInstance::new().set_settings(Settings::default()/* use setters */);
11058    /// ```
11059    pub fn set_settings<T>(mut self, v: T) -> Self
11060    where
11061        T: std::convert::Into<crate::model::Settings>,
11062    {
11063        self.settings = std::option::Option::Some(v.into());
11064        self
11065    }
11066
11067    /// Sets or clears the value of [settings][crate::model::DatabaseInstance::settings].
11068    ///
11069    /// # Example
11070    /// ```ignore,no_run
11071    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11072    /// use google_cloud_sql_v1::model::Settings;
11073    /// let x = DatabaseInstance::new().set_or_clear_settings(Some(Settings::default()/* use setters */));
11074    /// let x = DatabaseInstance::new().set_or_clear_settings(None::<Settings>);
11075    /// ```
11076    pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
11077    where
11078        T: std::convert::Into<crate::model::Settings>,
11079    {
11080        self.settings = v.map(|x| x.into());
11081        self
11082    }
11083
11084    /// Sets the value of [etag][crate::model::DatabaseInstance::etag].
11085    ///
11086    /// # Example
11087    /// ```ignore,no_run
11088    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11089    /// let x = DatabaseInstance::new().set_etag("example");
11090    /// ```
11091    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11092        self.etag = v.into();
11093        self
11094    }
11095
11096    /// Sets the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
11097    ///
11098    /// # Example
11099    /// ```ignore,no_run
11100    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11101    /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
11102    /// let x = DatabaseInstance::new().set_failover_replica(SqlFailoverReplica::default()/* use setters */);
11103    /// ```
11104    pub fn set_failover_replica<T>(mut self, v: T) -> Self
11105    where
11106        T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
11107    {
11108        self.failover_replica = std::option::Option::Some(v.into());
11109        self
11110    }
11111
11112    /// Sets or clears the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
11113    ///
11114    /// # Example
11115    /// ```ignore,no_run
11116    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11117    /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
11118    /// let x = DatabaseInstance::new().set_or_clear_failover_replica(Some(SqlFailoverReplica::default()/* use setters */));
11119    /// let x = DatabaseInstance::new().set_or_clear_failover_replica(None::<SqlFailoverReplica>);
11120    /// ```
11121    pub fn set_or_clear_failover_replica<T>(mut self, v: std::option::Option<T>) -> Self
11122    where
11123        T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
11124    {
11125        self.failover_replica = v.map(|x| x.into());
11126        self
11127    }
11128
11129    /// Sets the value of [master_instance_name][crate::model::DatabaseInstance::master_instance_name].
11130    ///
11131    /// # Example
11132    /// ```ignore,no_run
11133    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11134    /// let x = DatabaseInstance::new().set_master_instance_name("example");
11135    /// ```
11136    pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
11137        mut self,
11138        v: T,
11139    ) -> Self {
11140        self.master_instance_name = v.into();
11141        self
11142    }
11143
11144    /// Sets the value of [replica_names][crate::model::DatabaseInstance::replica_names].
11145    ///
11146    /// # Example
11147    /// ```ignore,no_run
11148    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11149    /// let x = DatabaseInstance::new().set_replica_names(["a", "b", "c"]);
11150    /// ```
11151    pub fn set_replica_names<T, V>(mut self, v: T) -> Self
11152    where
11153        T: std::iter::IntoIterator<Item = V>,
11154        V: std::convert::Into<std::string::String>,
11155    {
11156        use std::iter::Iterator;
11157        self.replica_names = v.into_iter().map(|i| i.into()).collect();
11158        self
11159    }
11160
11161    /// Sets the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
11162    ///
11163    /// # Example
11164    /// ```ignore,no_run
11165    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11166    /// use wkt::Int64Value;
11167    /// let x = DatabaseInstance::new().set_max_disk_size(Int64Value::default()/* use setters */);
11168    /// ```
11169    #[deprecated]
11170    pub fn set_max_disk_size<T>(mut self, v: T) -> Self
11171    where
11172        T: std::convert::Into<wkt::Int64Value>,
11173    {
11174        self.max_disk_size = std::option::Option::Some(v.into());
11175        self
11176    }
11177
11178    /// Sets or clears the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
11179    ///
11180    /// # Example
11181    /// ```ignore,no_run
11182    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11183    /// use wkt::Int64Value;
11184    /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(Some(Int64Value::default()/* use setters */));
11185    /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(None::<Int64Value>);
11186    /// ```
11187    #[deprecated]
11188    pub fn set_or_clear_max_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
11189    where
11190        T: std::convert::Into<wkt::Int64Value>,
11191    {
11192        self.max_disk_size = v.map(|x| x.into());
11193        self
11194    }
11195
11196    /// Sets the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
11197    ///
11198    /// # Example
11199    /// ```ignore,no_run
11200    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11201    /// use wkt::Int64Value;
11202    /// let x = DatabaseInstance::new().set_current_disk_size(Int64Value::default()/* use setters */);
11203    /// ```
11204    #[deprecated]
11205    pub fn set_current_disk_size<T>(mut self, v: T) -> Self
11206    where
11207        T: std::convert::Into<wkt::Int64Value>,
11208    {
11209        self.current_disk_size = std::option::Option::Some(v.into());
11210        self
11211    }
11212
11213    /// Sets or clears the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
11214    ///
11215    /// # Example
11216    /// ```ignore,no_run
11217    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11218    /// use wkt::Int64Value;
11219    /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(Some(Int64Value::default()/* use setters */));
11220    /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(None::<Int64Value>);
11221    /// ```
11222    #[deprecated]
11223    pub fn set_or_clear_current_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
11224    where
11225        T: std::convert::Into<wkt::Int64Value>,
11226    {
11227        self.current_disk_size = v.map(|x| x.into());
11228        self
11229    }
11230
11231    /// Sets the value of [ip_addresses][crate::model::DatabaseInstance::ip_addresses].
11232    ///
11233    /// # Example
11234    /// ```ignore,no_run
11235    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11236    /// use google_cloud_sql_v1::model::IpMapping;
11237    /// let x = DatabaseInstance::new()
11238    ///     .set_ip_addresses([
11239    ///         IpMapping::default()/* use setters */,
11240    ///         IpMapping::default()/* use (different) setters */,
11241    ///     ]);
11242    /// ```
11243    pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
11244    where
11245        T: std::iter::IntoIterator<Item = V>,
11246        V: std::convert::Into<crate::model::IpMapping>,
11247    {
11248        use std::iter::Iterator;
11249        self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
11250        self
11251    }
11252
11253    /// Sets the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
11254    ///
11255    /// # Example
11256    /// ```ignore,no_run
11257    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11258    /// use google_cloud_sql_v1::model::SslCert;
11259    /// let x = DatabaseInstance::new().set_server_ca_cert(SslCert::default()/* use setters */);
11260    /// ```
11261    pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
11262    where
11263        T: std::convert::Into<crate::model::SslCert>,
11264    {
11265        self.server_ca_cert = std::option::Option::Some(v.into());
11266        self
11267    }
11268
11269    /// Sets or clears the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
11270    ///
11271    /// # Example
11272    /// ```ignore,no_run
11273    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11274    /// use google_cloud_sql_v1::model::SslCert;
11275    /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
11276    /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(None::<SslCert>);
11277    /// ```
11278    pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
11279    where
11280        T: std::convert::Into<crate::model::SslCert>,
11281    {
11282        self.server_ca_cert = v.map(|x| x.into());
11283        self
11284    }
11285
11286    /// Sets the value of [instance_type][crate::model::DatabaseInstance::instance_type].
11287    ///
11288    /// # Example
11289    /// ```ignore,no_run
11290    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11291    /// use google_cloud_sql_v1::model::SqlInstanceType;
11292    /// let x0 = DatabaseInstance::new().set_instance_type(SqlInstanceType::CloudSqlInstance);
11293    /// let x1 = DatabaseInstance::new().set_instance_type(SqlInstanceType::OnPremisesInstance);
11294    /// let x2 = DatabaseInstance::new().set_instance_type(SqlInstanceType::ReadReplicaInstance);
11295    /// ```
11296    pub fn set_instance_type<T: std::convert::Into<crate::model::SqlInstanceType>>(
11297        mut self,
11298        v: T,
11299    ) -> Self {
11300        self.instance_type = v.into();
11301        self
11302    }
11303
11304    /// Sets the value of [project][crate::model::DatabaseInstance::project].
11305    ///
11306    /// # Example
11307    /// ```ignore,no_run
11308    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11309    /// let x = DatabaseInstance::new().set_project("example");
11310    /// ```
11311    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11312        self.project = v.into();
11313        self
11314    }
11315
11316    /// Sets the value of [ipv6_address][crate::model::DatabaseInstance::ipv6_address].
11317    ///
11318    /// # Example
11319    /// ```ignore,no_run
11320    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11321    /// let x = DatabaseInstance::new().set_ipv6_address("example");
11322    /// ```
11323    #[deprecated]
11324    pub fn set_ipv6_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11325        self.ipv6_address = v.into();
11326        self
11327    }
11328
11329    /// Sets the value of [service_account_email_address][crate::model::DatabaseInstance::service_account_email_address].
11330    ///
11331    /// # Example
11332    /// ```ignore,no_run
11333    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11334    /// let x = DatabaseInstance::new().set_service_account_email_address("example");
11335    /// ```
11336    pub fn set_service_account_email_address<T: std::convert::Into<std::string::String>>(
11337        mut self,
11338        v: T,
11339    ) -> Self {
11340        self.service_account_email_address = v.into();
11341        self
11342    }
11343
11344    /// Sets the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
11345    ///
11346    /// # Example
11347    /// ```ignore,no_run
11348    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11349    /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
11350    /// let x = DatabaseInstance::new().set_on_premises_configuration(OnPremisesConfiguration::default()/* use setters */);
11351    /// ```
11352    pub fn set_on_premises_configuration<T>(mut self, v: T) -> Self
11353    where
11354        T: std::convert::Into<crate::model::OnPremisesConfiguration>,
11355    {
11356        self.on_premises_configuration = std::option::Option::Some(v.into());
11357        self
11358    }
11359
11360    /// Sets or clears the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
11361    ///
11362    /// # Example
11363    /// ```ignore,no_run
11364    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11365    /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
11366    /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(Some(OnPremisesConfiguration::default()/* use setters */));
11367    /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(None::<OnPremisesConfiguration>);
11368    /// ```
11369    pub fn set_or_clear_on_premises_configuration<T>(mut self, v: std::option::Option<T>) -> Self
11370    where
11371        T: std::convert::Into<crate::model::OnPremisesConfiguration>,
11372    {
11373        self.on_premises_configuration = v.map(|x| x.into());
11374        self
11375    }
11376
11377    /// Sets the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
11378    ///
11379    /// # Example
11380    /// ```ignore,no_run
11381    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11382    /// use google_cloud_sql_v1::model::ReplicaConfiguration;
11383    /// let x = DatabaseInstance::new().set_replica_configuration(ReplicaConfiguration::default()/* use setters */);
11384    /// ```
11385    pub fn set_replica_configuration<T>(mut self, v: T) -> Self
11386    where
11387        T: std::convert::Into<crate::model::ReplicaConfiguration>,
11388    {
11389        self.replica_configuration = std::option::Option::Some(v.into());
11390        self
11391    }
11392
11393    /// Sets or clears the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
11394    ///
11395    /// # Example
11396    /// ```ignore,no_run
11397    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11398    /// use google_cloud_sql_v1::model::ReplicaConfiguration;
11399    /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(Some(ReplicaConfiguration::default()/* use setters */));
11400    /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(None::<ReplicaConfiguration>);
11401    /// ```
11402    pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
11403    where
11404        T: std::convert::Into<crate::model::ReplicaConfiguration>,
11405    {
11406        self.replica_configuration = v.map(|x| x.into());
11407        self
11408    }
11409
11410    /// Sets the value of [backend_type][crate::model::DatabaseInstance::backend_type].
11411    ///
11412    /// # Example
11413    /// ```ignore,no_run
11414    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11415    /// use google_cloud_sql_v1::model::SqlBackendType;
11416    /// let x0 = DatabaseInstance::new().set_backend_type(SqlBackendType::SecondGen);
11417    /// let x1 = DatabaseInstance::new().set_backend_type(SqlBackendType::External);
11418    /// ```
11419    pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
11420        mut self,
11421        v: T,
11422    ) -> Self {
11423        self.backend_type = v.into();
11424        self
11425    }
11426
11427    /// Sets the value of [self_link][crate::model::DatabaseInstance::self_link].
11428    ///
11429    /// # Example
11430    /// ```ignore,no_run
11431    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11432    /// let x = DatabaseInstance::new().set_self_link("example");
11433    /// ```
11434    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11435        self.self_link = v.into();
11436        self
11437    }
11438
11439    /// Sets the value of [suspension_reason][crate::model::DatabaseInstance::suspension_reason].
11440    ///
11441    /// # Example
11442    /// ```ignore,no_run
11443    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11444    /// use google_cloud_sql_v1::model::SqlSuspensionReason;
11445    /// let x = DatabaseInstance::new().set_suspension_reason([
11446    ///     SqlSuspensionReason::BillingIssue,
11447    ///     SqlSuspensionReason::LegalIssue,
11448    ///     SqlSuspensionReason::OperationalIssue,
11449    /// ]);
11450    /// ```
11451    pub fn set_suspension_reason<T, V>(mut self, v: T) -> Self
11452    where
11453        T: std::iter::IntoIterator<Item = V>,
11454        V: std::convert::Into<crate::model::SqlSuspensionReason>,
11455    {
11456        use std::iter::Iterator;
11457        self.suspension_reason = v.into_iter().map(|i| i.into()).collect();
11458        self
11459    }
11460
11461    /// Sets the value of [connection_name][crate::model::DatabaseInstance::connection_name].
11462    ///
11463    /// # Example
11464    /// ```ignore,no_run
11465    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11466    /// let x = DatabaseInstance::new().set_connection_name("example");
11467    /// ```
11468    pub fn set_connection_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11469        self.connection_name = v.into();
11470        self
11471    }
11472
11473    /// Sets the value of [name][crate::model::DatabaseInstance::name].
11474    ///
11475    /// # Example
11476    /// ```ignore,no_run
11477    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11478    /// let x = DatabaseInstance::new().set_name("example");
11479    /// ```
11480    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11481        self.name = v.into();
11482        self
11483    }
11484
11485    /// Sets the value of [region][crate::model::DatabaseInstance::region].
11486    ///
11487    /// # Example
11488    /// ```ignore,no_run
11489    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11490    /// let x = DatabaseInstance::new().set_region("example");
11491    /// ```
11492    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11493        self.region = v.into();
11494        self
11495    }
11496
11497    /// Sets the value of [gce_zone][crate::model::DatabaseInstance::gce_zone].
11498    ///
11499    /// # Example
11500    /// ```ignore,no_run
11501    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11502    /// let x = DatabaseInstance::new().set_gce_zone("example");
11503    /// ```
11504    pub fn set_gce_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11505        self.gce_zone = v.into();
11506        self
11507    }
11508
11509    /// Sets the value of [secondary_gce_zone][crate::model::DatabaseInstance::secondary_gce_zone].
11510    ///
11511    /// # Example
11512    /// ```ignore,no_run
11513    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11514    /// let x = DatabaseInstance::new().set_secondary_gce_zone("example");
11515    /// ```
11516    pub fn set_secondary_gce_zone<T: std::convert::Into<std::string::String>>(
11517        mut self,
11518        v: T,
11519    ) -> Self {
11520        self.secondary_gce_zone = v.into();
11521        self
11522    }
11523
11524    /// Sets the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
11525    ///
11526    /// # Example
11527    /// ```ignore,no_run
11528    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11529    /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
11530    /// let x = DatabaseInstance::new().set_disk_encryption_configuration(DiskEncryptionConfiguration::default()/* use setters */);
11531    /// ```
11532    pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
11533    where
11534        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
11535    {
11536        self.disk_encryption_configuration = std::option::Option::Some(v.into());
11537        self
11538    }
11539
11540    /// Sets or clears the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
11541    ///
11542    /// # Example
11543    /// ```ignore,no_run
11544    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11545    /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
11546    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(Some(DiskEncryptionConfiguration::default()/* use setters */));
11547    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(None::<DiskEncryptionConfiguration>);
11548    /// ```
11549    pub fn set_or_clear_disk_encryption_configuration<T>(
11550        mut self,
11551        v: std::option::Option<T>,
11552    ) -> Self
11553    where
11554        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
11555    {
11556        self.disk_encryption_configuration = v.map(|x| x.into());
11557        self
11558    }
11559
11560    /// Sets the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
11561    ///
11562    /// # Example
11563    /// ```ignore,no_run
11564    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11565    /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
11566    /// let x = DatabaseInstance::new().set_disk_encryption_status(DiskEncryptionStatus::default()/* use setters */);
11567    /// ```
11568    pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
11569    where
11570        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
11571    {
11572        self.disk_encryption_status = std::option::Option::Some(v.into());
11573        self
11574    }
11575
11576    /// Sets or clears the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
11577    ///
11578    /// # Example
11579    /// ```ignore,no_run
11580    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11581    /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
11582    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(Some(DiskEncryptionStatus::default()/* use setters */));
11583    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(None::<DiskEncryptionStatus>);
11584    /// ```
11585    pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
11586    where
11587        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
11588    {
11589        self.disk_encryption_status = v.map(|x| x.into());
11590        self
11591    }
11592
11593    /// Sets the value of [root_password][crate::model::DatabaseInstance::root_password].
11594    ///
11595    /// # Example
11596    /// ```ignore,no_run
11597    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11598    /// let x = DatabaseInstance::new().set_root_password("example");
11599    /// ```
11600    pub fn set_root_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11601        self.root_password = v.into();
11602        self
11603    }
11604
11605    /// Sets the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
11606    ///
11607    /// # Example
11608    /// ```ignore,no_run
11609    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11610    /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
11611    /// let x = DatabaseInstance::new().set_scheduled_maintenance(SqlScheduledMaintenance::default()/* use setters */);
11612    /// ```
11613    pub fn set_scheduled_maintenance<T>(mut self, v: T) -> Self
11614    where
11615        T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
11616    {
11617        self.scheduled_maintenance = std::option::Option::Some(v.into());
11618        self
11619    }
11620
11621    /// Sets or clears the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
11622    ///
11623    /// # Example
11624    /// ```ignore,no_run
11625    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11626    /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
11627    /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(Some(SqlScheduledMaintenance::default()/* use setters */));
11628    /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(None::<SqlScheduledMaintenance>);
11629    /// ```
11630    pub fn set_or_clear_scheduled_maintenance<T>(mut self, v: std::option::Option<T>) -> Self
11631    where
11632        T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
11633    {
11634        self.scheduled_maintenance = v.map(|x| x.into());
11635        self
11636    }
11637
11638    /// Sets the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
11639    ///
11640    /// # Example
11641    /// ```ignore,no_run
11642    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11643    /// use wkt::BoolValue;
11644    /// let x = DatabaseInstance::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
11645    /// ```
11646    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
11647    where
11648        T: std::convert::Into<wkt::BoolValue>,
11649    {
11650        self.satisfies_pzs = std::option::Option::Some(v.into());
11651        self
11652    }
11653
11654    /// Sets or clears the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
11655    ///
11656    /// # Example
11657    /// ```ignore,no_run
11658    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11659    /// use wkt::BoolValue;
11660    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
11661    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
11662    /// ```
11663    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
11664    where
11665        T: std::convert::Into<wkt::BoolValue>,
11666    {
11667        self.satisfies_pzs = v.map(|x| x.into());
11668        self
11669    }
11670
11671    /// Sets the value of [database_installed_version][crate::model::DatabaseInstance::database_installed_version].
11672    ///
11673    /// # Example
11674    /// ```ignore,no_run
11675    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11676    /// let x = DatabaseInstance::new().set_database_installed_version("example");
11677    /// ```
11678    pub fn set_database_installed_version<T: std::convert::Into<std::string::String>>(
11679        mut self,
11680        v: T,
11681    ) -> Self {
11682        self.database_installed_version = v.into();
11683        self
11684    }
11685
11686    /// Sets the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
11687    ///
11688    /// # Example
11689    /// ```ignore,no_run
11690    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11691    /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
11692    /// let x = DatabaseInstance::new().set_out_of_disk_report(SqlOutOfDiskReport::default()/* use setters */);
11693    /// ```
11694    pub fn set_out_of_disk_report<T>(mut self, v: T) -> Self
11695    where
11696        T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
11697    {
11698        self.out_of_disk_report = std::option::Option::Some(v.into());
11699        self
11700    }
11701
11702    /// Sets or clears the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
11703    ///
11704    /// # Example
11705    /// ```ignore,no_run
11706    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11707    /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
11708    /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(Some(SqlOutOfDiskReport::default()/* use setters */));
11709    /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(None::<SqlOutOfDiskReport>);
11710    /// ```
11711    pub fn set_or_clear_out_of_disk_report<T>(mut self, v: std::option::Option<T>) -> Self
11712    where
11713        T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
11714    {
11715        self.out_of_disk_report = v.map(|x| x.into());
11716        self
11717    }
11718
11719    /// Sets the value of [create_time][crate::model::DatabaseInstance::create_time].
11720    ///
11721    /// # Example
11722    /// ```ignore,no_run
11723    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11724    /// use wkt::Timestamp;
11725    /// let x = DatabaseInstance::new().set_create_time(Timestamp::default()/* use setters */);
11726    /// ```
11727    pub fn set_create_time<T>(mut self, v: T) -> Self
11728    where
11729        T: std::convert::Into<wkt::Timestamp>,
11730    {
11731        self.create_time = std::option::Option::Some(v.into());
11732        self
11733    }
11734
11735    /// Sets or clears the value of [create_time][crate::model::DatabaseInstance::create_time].
11736    ///
11737    /// # Example
11738    /// ```ignore,no_run
11739    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11740    /// use wkt::Timestamp;
11741    /// let x = DatabaseInstance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11742    /// let x = DatabaseInstance::new().set_or_clear_create_time(None::<Timestamp>);
11743    /// ```
11744    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11745    where
11746        T: std::convert::Into<wkt::Timestamp>,
11747    {
11748        self.create_time = v.map(|x| x.into());
11749        self
11750    }
11751
11752    /// Sets the value of [available_maintenance_versions][crate::model::DatabaseInstance::available_maintenance_versions].
11753    ///
11754    /// # Example
11755    /// ```ignore,no_run
11756    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11757    /// let x = DatabaseInstance::new().set_available_maintenance_versions(["a", "b", "c"]);
11758    /// ```
11759    pub fn set_available_maintenance_versions<T, V>(mut self, v: T) -> Self
11760    where
11761        T: std::iter::IntoIterator<Item = V>,
11762        V: std::convert::Into<std::string::String>,
11763    {
11764        use std::iter::Iterator;
11765        self.available_maintenance_versions = v.into_iter().map(|i| i.into()).collect();
11766        self
11767    }
11768
11769    /// Sets the value of [maintenance_version][crate::model::DatabaseInstance::maintenance_version].
11770    ///
11771    /// # Example
11772    /// ```ignore,no_run
11773    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11774    /// let x = DatabaseInstance::new().set_maintenance_version("example");
11775    /// ```
11776    pub fn set_maintenance_version<T: std::convert::Into<std::string::String>>(
11777        mut self,
11778        v: T,
11779    ) -> Self {
11780        self.maintenance_version = v.into();
11781        self
11782    }
11783
11784    /// Sets the value of [upgradable_database_versions][crate::model::DatabaseInstance::upgradable_database_versions].
11785    ///
11786    /// # Example
11787    /// ```ignore,no_run
11788    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11789    /// use google_cloud_sql_v1::model::AvailableDatabaseVersion;
11790    /// let x = DatabaseInstance::new()
11791    ///     .set_upgradable_database_versions([
11792    ///         AvailableDatabaseVersion::default()/* use setters */,
11793    ///         AvailableDatabaseVersion::default()/* use (different) setters */,
11794    ///     ]);
11795    /// ```
11796    pub fn set_upgradable_database_versions<T, V>(mut self, v: T) -> Self
11797    where
11798        T: std::iter::IntoIterator<Item = V>,
11799        V: std::convert::Into<crate::model::AvailableDatabaseVersion>,
11800    {
11801        use std::iter::Iterator;
11802        self.upgradable_database_versions = v.into_iter().map(|i| i.into()).collect();
11803        self
11804    }
11805
11806    /// Sets the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
11807    ///
11808    /// # Example
11809    /// ```ignore,no_run
11810    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11811    /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
11812    /// let x0 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::NewNetworkArchitecture);
11813    /// let x1 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::OldNetworkArchitecture);
11814    /// ```
11815    pub fn set_sql_network_architecture<T>(mut self, v: T) -> Self
11816    where
11817        T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
11818    {
11819        self.sql_network_architecture = std::option::Option::Some(v.into());
11820        self
11821    }
11822
11823    /// Sets or clears the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
11824    ///
11825    /// # Example
11826    /// ```ignore,no_run
11827    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11828    /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
11829    /// let x0 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::NewNetworkArchitecture));
11830    /// let x1 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::OldNetworkArchitecture));
11831    /// let x_none = DatabaseInstance::new().set_or_clear_sql_network_architecture(None::<SqlNetworkArchitecture>);
11832    /// ```
11833    pub fn set_or_clear_sql_network_architecture<T>(mut self, v: std::option::Option<T>) -> Self
11834    where
11835        T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
11836    {
11837        self.sql_network_architecture = v.map(|x| x.into());
11838        self
11839    }
11840
11841    /// Sets the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
11842    ///
11843    /// # Example
11844    /// ```ignore,no_run
11845    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11846    /// let x = DatabaseInstance::new().set_psc_service_attachment_link("example");
11847    /// ```
11848    pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
11849    where
11850        T: std::convert::Into<std::string::String>,
11851    {
11852        self.psc_service_attachment_link = std::option::Option::Some(v.into());
11853        self
11854    }
11855
11856    /// Sets or clears the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
11857    ///
11858    /// # Example
11859    /// ```ignore,no_run
11860    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11861    /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(Some("example"));
11862    /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(None::<String>);
11863    /// ```
11864    pub fn set_or_clear_psc_service_attachment_link<T>(mut self, v: std::option::Option<T>) -> Self
11865    where
11866        T: std::convert::Into<std::string::String>,
11867    {
11868        self.psc_service_attachment_link = v.map(|x| x.into());
11869        self
11870    }
11871
11872    /// Sets the value of [dns_name][crate::model::DatabaseInstance::dns_name].
11873    ///
11874    /// # Example
11875    /// ```ignore,no_run
11876    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11877    /// let x = DatabaseInstance::new().set_dns_name("example");
11878    /// ```
11879    pub fn set_dns_name<T>(mut self, v: T) -> Self
11880    where
11881        T: std::convert::Into<std::string::String>,
11882    {
11883        self.dns_name = std::option::Option::Some(v.into());
11884        self
11885    }
11886
11887    /// Sets or clears the value of [dns_name][crate::model::DatabaseInstance::dns_name].
11888    ///
11889    /// # Example
11890    /// ```ignore,no_run
11891    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11892    /// let x = DatabaseInstance::new().set_or_clear_dns_name(Some("example"));
11893    /// let x = DatabaseInstance::new().set_or_clear_dns_name(None::<String>);
11894    /// ```
11895    pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
11896    where
11897        T: std::convert::Into<std::string::String>,
11898    {
11899        self.dns_name = v.map(|x| x.into());
11900        self
11901    }
11902
11903    /// Sets the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
11904    ///
11905    /// # Example
11906    /// ```ignore,no_run
11907    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11908    /// let x = DatabaseInstance::new().set_primary_dns_name("example");
11909    /// ```
11910    #[deprecated]
11911    pub fn set_primary_dns_name<T>(mut self, v: T) -> Self
11912    where
11913        T: std::convert::Into<std::string::String>,
11914    {
11915        self.primary_dns_name = std::option::Option::Some(v.into());
11916        self
11917    }
11918
11919    /// Sets or clears the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
11920    ///
11921    /// # Example
11922    /// ```ignore,no_run
11923    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11924    /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(Some("example"));
11925    /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(None::<String>);
11926    /// ```
11927    #[deprecated]
11928    pub fn set_or_clear_primary_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
11929    where
11930        T: std::convert::Into<std::string::String>,
11931    {
11932        self.primary_dns_name = v.map(|x| x.into());
11933        self
11934    }
11935
11936    /// Sets the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
11937    ///
11938    /// # Example
11939    /// ```ignore,no_run
11940    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11941    /// let x = DatabaseInstance::new().set_write_endpoint("example");
11942    /// ```
11943    pub fn set_write_endpoint<T>(mut self, v: T) -> Self
11944    where
11945        T: std::convert::Into<std::string::String>,
11946    {
11947        self.write_endpoint = std::option::Option::Some(v.into());
11948        self
11949    }
11950
11951    /// Sets or clears the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
11952    ///
11953    /// # Example
11954    /// ```ignore,no_run
11955    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11956    /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(Some("example"));
11957    /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(None::<String>);
11958    /// ```
11959    pub fn set_or_clear_write_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
11960    where
11961        T: std::convert::Into<std::string::String>,
11962    {
11963        self.write_endpoint = v.map(|x| x.into());
11964        self
11965    }
11966
11967    /// Sets the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
11968    ///
11969    /// # Example
11970    /// ```ignore,no_run
11971    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11972    /// use google_cloud_sql_v1::model::ReplicationCluster;
11973    /// let x = DatabaseInstance::new().set_replication_cluster(ReplicationCluster::default()/* use setters */);
11974    /// ```
11975    pub fn set_replication_cluster<T>(mut self, v: T) -> Self
11976    where
11977        T: std::convert::Into<crate::model::ReplicationCluster>,
11978    {
11979        self.replication_cluster = std::option::Option::Some(v.into());
11980        self
11981    }
11982
11983    /// Sets or clears the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
11984    ///
11985    /// # Example
11986    /// ```ignore,no_run
11987    /// # use google_cloud_sql_v1::model::DatabaseInstance;
11988    /// use google_cloud_sql_v1::model::ReplicationCluster;
11989    /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(Some(ReplicationCluster::default()/* use setters */));
11990    /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(None::<ReplicationCluster>);
11991    /// ```
11992    pub fn set_or_clear_replication_cluster<T>(mut self, v: std::option::Option<T>) -> Self
11993    where
11994        T: std::convert::Into<crate::model::ReplicationCluster>,
11995    {
11996        self.replication_cluster = v.map(|x| x.into());
11997        self
11998    }
11999
12000    /// Sets the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
12001    ///
12002    /// # Example
12003    /// ```ignore,no_run
12004    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12005    /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
12006    /// let x = DatabaseInstance::new().set_gemini_config(GeminiInstanceConfig::default()/* use setters */);
12007    /// ```
12008    pub fn set_gemini_config<T>(mut self, v: T) -> Self
12009    where
12010        T: std::convert::Into<crate::model::GeminiInstanceConfig>,
12011    {
12012        self.gemini_config = std::option::Option::Some(v.into());
12013        self
12014    }
12015
12016    /// Sets or clears the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
12017    ///
12018    /// # Example
12019    /// ```ignore,no_run
12020    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12021    /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
12022    /// let x = DatabaseInstance::new().set_or_clear_gemini_config(Some(GeminiInstanceConfig::default()/* use setters */));
12023    /// let x = DatabaseInstance::new().set_or_clear_gemini_config(None::<GeminiInstanceConfig>);
12024    /// ```
12025    pub fn set_or_clear_gemini_config<T>(mut self, v: std::option::Option<T>) -> Self
12026    where
12027        T: std::convert::Into<crate::model::GeminiInstanceConfig>,
12028    {
12029        self.gemini_config = v.map(|x| x.into());
12030        self
12031    }
12032
12033    /// Sets the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
12034    ///
12035    /// # Example
12036    /// ```ignore,no_run
12037    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12038    /// use wkt::BoolValue;
12039    /// let x = DatabaseInstance::new().set_satisfies_pzi(BoolValue::default()/* use setters */);
12040    /// ```
12041    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
12042    where
12043        T: std::convert::Into<wkt::BoolValue>,
12044    {
12045        self.satisfies_pzi = std::option::Option::Some(v.into());
12046        self
12047    }
12048
12049    /// Sets or clears the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
12050    ///
12051    /// # Example
12052    /// ```ignore,no_run
12053    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12054    /// use wkt::BoolValue;
12055    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(Some(BoolValue::default()/* use setters */));
12056    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(None::<BoolValue>);
12057    /// ```
12058    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
12059    where
12060        T: std::convert::Into<wkt::BoolValue>,
12061    {
12062        self.satisfies_pzi = v.map(|x| x.into());
12063        self
12064    }
12065
12066    /// Sets the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
12067    ///
12068    /// # Example
12069    /// ```ignore,no_run
12070    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12071    /// use wkt::BoolValue;
12072    /// let x = DatabaseInstance::new().set_switch_transaction_logs_to_cloud_storage_enabled(BoolValue::default()/* use setters */);
12073    /// ```
12074    pub fn set_switch_transaction_logs_to_cloud_storage_enabled<T>(mut self, v: T) -> Self
12075    where
12076        T: std::convert::Into<wkt::BoolValue>,
12077    {
12078        self.switch_transaction_logs_to_cloud_storage_enabled = std::option::Option::Some(v.into());
12079        self
12080    }
12081
12082    /// Sets or clears the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
12083    ///
12084    /// # Example
12085    /// ```ignore,no_run
12086    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12087    /// use wkt::BoolValue;
12088    /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(Some(BoolValue::default()/* use setters */));
12089    /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(None::<BoolValue>);
12090    /// ```
12091    pub fn set_or_clear_switch_transaction_logs_to_cloud_storage_enabled<T>(
12092        mut self,
12093        v: std::option::Option<T>,
12094    ) -> Self
12095    where
12096        T: std::convert::Into<wkt::BoolValue>,
12097    {
12098        self.switch_transaction_logs_to_cloud_storage_enabled = v.map(|x| x.into());
12099        self
12100    }
12101
12102    /// Sets the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
12103    ///
12104    /// # Example
12105    /// ```ignore,no_run
12106    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12107    /// use wkt::BoolValue;
12108    /// let x = DatabaseInstance::new().set_include_replicas_for_major_version_upgrade(BoolValue::default()/* use setters */);
12109    /// ```
12110    pub fn set_include_replicas_for_major_version_upgrade<T>(mut self, v: T) -> Self
12111    where
12112        T: std::convert::Into<wkt::BoolValue>,
12113    {
12114        self.include_replicas_for_major_version_upgrade = std::option::Option::Some(v.into());
12115        self
12116    }
12117
12118    /// Sets or clears the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
12119    ///
12120    /// # Example
12121    /// ```ignore,no_run
12122    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12123    /// use wkt::BoolValue;
12124    /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(Some(BoolValue::default()/* use setters */));
12125    /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(None::<BoolValue>);
12126    /// ```
12127    pub fn set_or_clear_include_replicas_for_major_version_upgrade<T>(
12128        mut self,
12129        v: std::option::Option<T>,
12130    ) -> Self
12131    where
12132        T: std::convert::Into<wkt::BoolValue>,
12133    {
12134        self.include_replicas_for_major_version_upgrade = v.map(|x| x.into());
12135        self
12136    }
12137
12138    /// Sets the value of [tags][crate::model::DatabaseInstance::tags].
12139    ///
12140    /// # Example
12141    /// ```ignore,no_run
12142    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12143    /// let x = DatabaseInstance::new().set_tags([
12144    ///     ("key0", "abc"),
12145    ///     ("key1", "xyz"),
12146    /// ]);
12147    /// ```
12148    pub fn set_tags<T, K, V>(mut self, v: T) -> Self
12149    where
12150        T: std::iter::IntoIterator<Item = (K, V)>,
12151        K: std::convert::Into<std::string::String>,
12152        V: std::convert::Into<std::string::String>,
12153    {
12154        use std::iter::Iterator;
12155        self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12156        self
12157    }
12158
12159    /// Sets the value of [node_count][crate::model::DatabaseInstance::node_count].
12160    ///
12161    /// # Example
12162    /// ```ignore,no_run
12163    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12164    /// let x = DatabaseInstance::new().set_node_count(42);
12165    /// ```
12166    pub fn set_node_count<T>(mut self, v: T) -> Self
12167    where
12168        T: std::convert::Into<i32>,
12169    {
12170        self.node_count = std::option::Option::Some(v.into());
12171        self
12172    }
12173
12174    /// Sets or clears the value of [node_count][crate::model::DatabaseInstance::node_count].
12175    ///
12176    /// # Example
12177    /// ```ignore,no_run
12178    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12179    /// let x = DatabaseInstance::new().set_or_clear_node_count(Some(42));
12180    /// let x = DatabaseInstance::new().set_or_clear_node_count(None::<i32>);
12181    /// ```
12182    pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
12183    where
12184        T: std::convert::Into<i32>,
12185    {
12186        self.node_count = v.map(|x| x.into());
12187        self
12188    }
12189
12190    /// Sets the value of [nodes][crate::model::DatabaseInstance::nodes].
12191    ///
12192    /// # Example
12193    /// ```ignore,no_run
12194    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12195    /// use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12196    /// let x = DatabaseInstance::new()
12197    ///     .set_nodes([
12198    ///         PoolNodeConfig::default()/* use setters */,
12199    ///         PoolNodeConfig::default()/* use (different) setters */,
12200    ///     ]);
12201    /// ```
12202    pub fn set_nodes<T, V>(mut self, v: T) -> Self
12203    where
12204        T: std::iter::IntoIterator<Item = V>,
12205        V: std::convert::Into<crate::model::database_instance::PoolNodeConfig>,
12206    {
12207        use std::iter::Iterator;
12208        self.nodes = v.into_iter().map(|i| i.into()).collect();
12209        self
12210    }
12211
12212    /// Sets the value of [dns_names][crate::model::DatabaseInstance::dns_names].
12213    ///
12214    /// # Example
12215    /// ```ignore,no_run
12216    /// # use google_cloud_sql_v1::model::DatabaseInstance;
12217    /// use google_cloud_sql_v1::model::DnsNameMapping;
12218    /// let x = DatabaseInstance::new()
12219    ///     .set_dns_names([
12220    ///         DnsNameMapping::default()/* use setters */,
12221    ///         DnsNameMapping::default()/* use (different) setters */,
12222    ///     ]);
12223    /// ```
12224    pub fn set_dns_names<T, V>(mut self, v: T) -> Self
12225    where
12226        T: std::iter::IntoIterator<Item = V>,
12227        V: std::convert::Into<crate::model::DnsNameMapping>,
12228    {
12229        use std::iter::Iterator;
12230        self.dns_names = v.into_iter().map(|i| i.into()).collect();
12231        self
12232    }
12233}
12234
12235impl wkt::message::Message for DatabaseInstance {
12236    fn typename() -> &'static str {
12237        "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance"
12238    }
12239}
12240
12241/// Defines additional types related to [DatabaseInstance].
12242pub mod database_instance {
12243    #[allow(unused_imports)]
12244    use super::*;
12245
12246    #[allow(missing_docs)]
12247    #[derive(Clone, Default, PartialEq)]
12248    #[non_exhaustive]
12249    pub struct SqlFailoverReplica {
12250        /// The name of the failover replica. If specified at instance creation, a
12251        /// failover replica is created for the instance. The name
12252        /// doesn't include the project ID.
12253        pub name: std::string::String,
12254
12255        /// The availability status of the failover replica. A false status indicates
12256        /// that the failover replica is out of sync. The primary instance can only
12257        /// failover to the failover replica when the status is true.
12258        pub available: std::option::Option<wkt::BoolValue>,
12259
12260        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12261    }
12262
12263    impl SqlFailoverReplica {
12264        /// Creates a new default instance.
12265        pub fn new() -> Self {
12266            std::default::Default::default()
12267        }
12268
12269        /// Sets the value of [name][crate::model::database_instance::SqlFailoverReplica::name].
12270        ///
12271        /// # Example
12272        /// ```ignore,no_run
12273        /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12274        /// let x = SqlFailoverReplica::new().set_name("example");
12275        /// ```
12276        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12277            self.name = v.into();
12278            self
12279        }
12280
12281        /// Sets the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
12282        ///
12283        /// # Example
12284        /// ```ignore,no_run
12285        /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12286        /// use wkt::BoolValue;
12287        /// let x = SqlFailoverReplica::new().set_available(BoolValue::default()/* use setters */);
12288        /// ```
12289        pub fn set_available<T>(mut self, v: T) -> Self
12290        where
12291            T: std::convert::Into<wkt::BoolValue>,
12292        {
12293            self.available = std::option::Option::Some(v.into());
12294            self
12295        }
12296
12297        /// Sets or clears the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
12298        ///
12299        /// # Example
12300        /// ```ignore,no_run
12301        /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12302        /// use wkt::BoolValue;
12303        /// let x = SqlFailoverReplica::new().set_or_clear_available(Some(BoolValue::default()/* use setters */));
12304        /// let x = SqlFailoverReplica::new().set_or_clear_available(None::<BoolValue>);
12305        /// ```
12306        pub fn set_or_clear_available<T>(mut self, v: std::option::Option<T>) -> Self
12307        where
12308            T: std::convert::Into<wkt::BoolValue>,
12309        {
12310            self.available = v.map(|x| x.into());
12311            self
12312        }
12313    }
12314
12315    impl wkt::message::Message for SqlFailoverReplica {
12316        fn typename() -> &'static str {
12317            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica"
12318        }
12319    }
12320
12321    /// Any scheduled maintenance for this instance.
12322    #[derive(Clone, Default, PartialEq)]
12323    #[non_exhaustive]
12324    pub struct SqlScheduledMaintenance {
12325        /// The start time of any upcoming scheduled maintenance for this instance.
12326        pub start_time: std::option::Option<wkt::Timestamp>,
12327
12328        #[allow(missing_docs)]
12329        #[deprecated]
12330        pub can_defer: bool,
12331
12332        /// If the scheduled maintenance can be rescheduled.
12333        pub can_reschedule: bool,
12334
12335        /// Maintenance cannot be rescheduled to start beyond this deadline.
12336        pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
12337
12338        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12339    }
12340
12341    impl SqlScheduledMaintenance {
12342        /// Creates a new default instance.
12343        pub fn new() -> Self {
12344            std::default::Default::default()
12345        }
12346
12347        /// Sets the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
12348        ///
12349        /// # Example
12350        /// ```ignore,no_run
12351        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12352        /// use wkt::Timestamp;
12353        /// let x = SqlScheduledMaintenance::new().set_start_time(Timestamp::default()/* use setters */);
12354        /// ```
12355        pub fn set_start_time<T>(mut self, v: T) -> Self
12356        where
12357            T: std::convert::Into<wkt::Timestamp>,
12358        {
12359            self.start_time = std::option::Option::Some(v.into());
12360            self
12361        }
12362
12363        /// Sets or clears the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
12364        ///
12365        /// # Example
12366        /// ```ignore,no_run
12367        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12368        /// use wkt::Timestamp;
12369        /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
12370        /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(None::<Timestamp>);
12371        /// ```
12372        pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12373        where
12374            T: std::convert::Into<wkt::Timestamp>,
12375        {
12376            self.start_time = v.map(|x| x.into());
12377            self
12378        }
12379
12380        /// Sets the value of [can_defer][crate::model::database_instance::SqlScheduledMaintenance::can_defer].
12381        ///
12382        /// # Example
12383        /// ```ignore,no_run
12384        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12385        /// let x = SqlScheduledMaintenance::new().set_can_defer(true);
12386        /// ```
12387        #[deprecated]
12388        pub fn set_can_defer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12389            self.can_defer = v.into();
12390            self
12391        }
12392
12393        /// Sets the value of [can_reschedule][crate::model::database_instance::SqlScheduledMaintenance::can_reschedule].
12394        ///
12395        /// # Example
12396        /// ```ignore,no_run
12397        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12398        /// let x = SqlScheduledMaintenance::new().set_can_reschedule(true);
12399        /// ```
12400        pub fn set_can_reschedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12401            self.can_reschedule = v.into();
12402            self
12403        }
12404
12405        /// Sets the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
12406        ///
12407        /// # Example
12408        /// ```ignore,no_run
12409        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12410        /// use wkt::Timestamp;
12411        /// let x = SqlScheduledMaintenance::new().set_schedule_deadline_time(Timestamp::default()/* use setters */);
12412        /// ```
12413        pub fn set_schedule_deadline_time<T>(mut self, v: T) -> Self
12414        where
12415            T: std::convert::Into<wkt::Timestamp>,
12416        {
12417            self.schedule_deadline_time = std::option::Option::Some(v.into());
12418            self
12419        }
12420
12421        /// Sets or clears the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
12422        ///
12423        /// # Example
12424        /// ```ignore,no_run
12425        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12426        /// use wkt::Timestamp;
12427        /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(Some(Timestamp::default()/* use setters */));
12428        /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(None::<Timestamp>);
12429        /// ```
12430        pub fn set_or_clear_schedule_deadline_time<T>(mut self, v: std::option::Option<T>) -> Self
12431        where
12432            T: std::convert::Into<wkt::Timestamp>,
12433        {
12434            self.schedule_deadline_time = v.map(|x| x.into());
12435            self
12436        }
12437    }
12438
12439    impl wkt::message::Message for SqlScheduledMaintenance {
12440        fn typename() -> &'static str {
12441            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance"
12442        }
12443    }
12444
12445    /// This message wraps up the information written by out-of-disk detection job.
12446    #[derive(Clone, Default, PartialEq)]
12447    #[non_exhaustive]
12448    pub struct SqlOutOfDiskReport {
12449        /// This field represents the state generated by the proactive database
12450        /// wellness job for OutOfDisk issues.
12451        ///
12452        /// * Writers:
12453        /// * the proactive database wellness job for OOD.
12454        /// * Readers:
12455        /// * the proactive database wellness job
12456        pub sql_out_of_disk_state: std::option::Option<
12457            crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12458        >,
12459
12460        /// The minimum recommended increase size in GigaBytes
12461        /// This field is consumed by the frontend
12462        ///
12463        /// * Writers:
12464        /// * the proactive database wellness job for OOD.
12465        /// * Readers:
12466        pub sql_min_recommended_increase_size_gb: std::option::Option<i32>,
12467
12468        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12469    }
12470
12471    impl SqlOutOfDiskReport {
12472        /// Creates a new default instance.
12473        pub fn new() -> Self {
12474            std::default::Default::default()
12475        }
12476
12477        /// Sets the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
12478        ///
12479        /// # Example
12480        /// ```ignore,no_run
12481        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12482        /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
12483        /// let x0 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::Normal);
12484        /// let x1 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::SoftShutdown);
12485        /// ```
12486        pub fn set_sql_out_of_disk_state<T>(mut self, v: T) -> Self
12487        where
12488            T: std::convert::Into<
12489                    crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12490                >,
12491        {
12492            self.sql_out_of_disk_state = std::option::Option::Some(v.into());
12493            self
12494        }
12495
12496        /// Sets or clears the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
12497        ///
12498        /// # Example
12499        /// ```ignore,no_run
12500        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12501        /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
12502        /// let x0 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::Normal));
12503        /// let x1 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::SoftShutdown));
12504        /// let x_none = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(None::<SqlOutOfDiskState>);
12505        /// ```
12506        pub fn set_or_clear_sql_out_of_disk_state<T>(mut self, v: std::option::Option<T>) -> Self
12507        where
12508            T: std::convert::Into<
12509                    crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12510                >,
12511        {
12512            self.sql_out_of_disk_state = v.map(|x| x.into());
12513            self
12514        }
12515
12516        /// Sets the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
12517        ///
12518        /// # Example
12519        /// ```ignore,no_run
12520        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12521        /// let x = SqlOutOfDiskReport::new().set_sql_min_recommended_increase_size_gb(42);
12522        /// ```
12523        pub fn set_sql_min_recommended_increase_size_gb<T>(mut self, v: T) -> Self
12524        where
12525            T: std::convert::Into<i32>,
12526        {
12527            self.sql_min_recommended_increase_size_gb = std::option::Option::Some(v.into());
12528            self
12529        }
12530
12531        /// Sets or clears the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
12532        ///
12533        /// # Example
12534        /// ```ignore,no_run
12535        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12536        /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(Some(42));
12537        /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(None::<i32>);
12538        /// ```
12539        pub fn set_or_clear_sql_min_recommended_increase_size_gb<T>(
12540            mut self,
12541            v: std::option::Option<T>,
12542        ) -> Self
12543        where
12544            T: std::convert::Into<i32>,
12545        {
12546            self.sql_min_recommended_increase_size_gb = v.map(|x| x.into());
12547            self
12548        }
12549    }
12550
12551    impl wkt::message::Message for SqlOutOfDiskReport {
12552        fn typename() -> &'static str {
12553            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport"
12554        }
12555    }
12556
12557    /// Defines additional types related to [SqlOutOfDiskReport].
12558    pub mod sql_out_of_disk_report {
12559        #[allow(unused_imports)]
12560        use super::*;
12561
12562        /// This enum lists all possible states regarding out-of-disk issues.
12563        ///
12564        /// # Working with unknown values
12565        ///
12566        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12567        /// additional enum variants at any time. Adding new variants is not considered
12568        /// a breaking change. Applications should write their code in anticipation of:
12569        ///
12570        /// - New values appearing in future releases of the client library, **and**
12571        /// - New values received dynamically, without application changes.
12572        ///
12573        /// Please consult the [Working with enums] section in the user guide for some
12574        /// guidelines.
12575        ///
12576        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12577        #[derive(Clone, Debug, PartialEq)]
12578        #[non_exhaustive]
12579        pub enum SqlOutOfDiskState {
12580            /// Unspecified state
12581            Unspecified,
12582            /// The instance has plenty space on data disk
12583            Normal,
12584            /// Data disk is almost used up. It is shutdown to prevent data
12585            /// corruption.
12586            SoftShutdown,
12587            /// If set, the enum was initialized with an unknown value.
12588            ///
12589            /// Applications can examine the value using [SqlOutOfDiskState::value] or
12590            /// [SqlOutOfDiskState::name].
12591            UnknownValue(sql_out_of_disk_state::UnknownValue),
12592        }
12593
12594        #[doc(hidden)]
12595        pub mod sql_out_of_disk_state {
12596            #[allow(unused_imports)]
12597            use super::*;
12598            #[derive(Clone, Debug, PartialEq)]
12599            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12600        }
12601
12602        impl SqlOutOfDiskState {
12603            /// Gets the enum value.
12604            ///
12605            /// Returns `None` if the enum contains an unknown value deserialized from
12606            /// the string representation of enums.
12607            pub fn value(&self) -> std::option::Option<i32> {
12608                match self {
12609                    Self::Unspecified => std::option::Option::Some(0),
12610                    Self::Normal => std::option::Option::Some(1),
12611                    Self::SoftShutdown => std::option::Option::Some(2),
12612                    Self::UnknownValue(u) => u.0.value(),
12613                }
12614            }
12615
12616            /// Gets the enum value as a string.
12617            ///
12618            /// Returns `None` if the enum contains an unknown value deserialized from
12619            /// the integer representation of enums.
12620            pub fn name(&self) -> std::option::Option<&str> {
12621                match self {
12622                    Self::Unspecified => {
12623                        std::option::Option::Some("SQL_OUT_OF_DISK_STATE_UNSPECIFIED")
12624                    }
12625                    Self::Normal => std::option::Option::Some("NORMAL"),
12626                    Self::SoftShutdown => std::option::Option::Some("SOFT_SHUTDOWN"),
12627                    Self::UnknownValue(u) => u.0.name(),
12628                }
12629            }
12630        }
12631
12632        impl std::default::Default for SqlOutOfDiskState {
12633            fn default() -> Self {
12634                use std::convert::From;
12635                Self::from(0)
12636            }
12637        }
12638
12639        impl std::fmt::Display for SqlOutOfDiskState {
12640            fn fmt(
12641                &self,
12642                f: &mut std::fmt::Formatter<'_>,
12643            ) -> std::result::Result<(), std::fmt::Error> {
12644                wkt::internal::display_enum(f, self.name(), self.value())
12645            }
12646        }
12647
12648        impl std::convert::From<i32> for SqlOutOfDiskState {
12649            fn from(value: i32) -> Self {
12650                match value {
12651                    0 => Self::Unspecified,
12652                    1 => Self::Normal,
12653                    2 => Self::SoftShutdown,
12654                    _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
12655                        wkt::internal::UnknownEnumValue::Integer(value),
12656                    )),
12657                }
12658            }
12659        }
12660
12661        impl std::convert::From<&str> for SqlOutOfDiskState {
12662            fn from(value: &str) -> Self {
12663                use std::string::ToString;
12664                match value {
12665                    "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" => Self::Unspecified,
12666                    "NORMAL" => Self::Normal,
12667                    "SOFT_SHUTDOWN" => Self::SoftShutdown,
12668                    _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
12669                        wkt::internal::UnknownEnumValue::String(value.to_string()),
12670                    )),
12671                }
12672            }
12673        }
12674
12675        impl serde::ser::Serialize for SqlOutOfDiskState {
12676            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12677            where
12678                S: serde::Serializer,
12679            {
12680                match self {
12681                    Self::Unspecified => serializer.serialize_i32(0),
12682                    Self::Normal => serializer.serialize_i32(1),
12683                    Self::SoftShutdown => serializer.serialize_i32(2),
12684                    Self::UnknownValue(u) => u.0.serialize(serializer),
12685                }
12686            }
12687        }
12688
12689        impl<'de> serde::de::Deserialize<'de> for SqlOutOfDiskState {
12690            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12691            where
12692                D: serde::Deserializer<'de>,
12693            {
12694                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOutOfDiskState>::new(
12695                    ".google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState",
12696                ))
12697            }
12698        }
12699    }
12700
12701    /// Details of a single read pool node of a read pool.
12702    #[derive(Clone, Default, PartialEq)]
12703    #[non_exhaustive]
12704    pub struct PoolNodeConfig {
12705        /// Output only. The name of the read pool node, to be used for retrieving
12706        /// metrics and logs.
12707        pub name: std::option::Option<std::string::String>,
12708
12709        /// Output only. The zone of the read pool node.
12710        pub gce_zone: std::option::Option<std::string::String>,
12711
12712        /// Output only. Mappings containing IP addresses that can be used to connect
12713        /// to the read pool node.
12714        pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
12715
12716        /// Output only. The DNS name of the read pool node.
12717        pub dns_name: std::option::Option<std::string::String>,
12718
12719        /// Output only. The current state of the read pool node.
12720        pub state: std::option::Option<crate::model::database_instance::SqlInstanceState>,
12721
12722        /// Output only. The list of DNS names used by this read pool node.
12723        pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
12724
12725        /// Output only. The Private Service Connect (PSC) service attachment of the
12726        /// read pool node.
12727        pub psc_service_attachment_link: std::option::Option<std::string::String>,
12728
12729        /// Output only. The list of settings for requested automatically-setup
12730        /// Private Service Connect (PSC) consumer endpoints that can be used to
12731        /// connect to this read pool node.
12732        pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
12733
12734        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12735    }
12736
12737    impl PoolNodeConfig {
12738        /// Creates a new default instance.
12739        pub fn new() -> Self {
12740            std::default::Default::default()
12741        }
12742
12743        /// Sets the value of [name][crate::model::database_instance::PoolNodeConfig::name].
12744        ///
12745        /// # Example
12746        /// ```ignore,no_run
12747        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12748        /// let x = PoolNodeConfig::new().set_name("example");
12749        /// ```
12750        pub fn set_name<T>(mut self, v: T) -> Self
12751        where
12752            T: std::convert::Into<std::string::String>,
12753        {
12754            self.name = std::option::Option::Some(v.into());
12755            self
12756        }
12757
12758        /// Sets or clears the value of [name][crate::model::database_instance::PoolNodeConfig::name].
12759        ///
12760        /// # Example
12761        /// ```ignore,no_run
12762        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12763        /// let x = PoolNodeConfig::new().set_or_clear_name(Some("example"));
12764        /// let x = PoolNodeConfig::new().set_or_clear_name(None::<String>);
12765        /// ```
12766        pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
12767        where
12768            T: std::convert::Into<std::string::String>,
12769        {
12770            self.name = v.map(|x| x.into());
12771            self
12772        }
12773
12774        /// Sets the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
12775        ///
12776        /// # Example
12777        /// ```ignore,no_run
12778        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12779        /// let x = PoolNodeConfig::new().set_gce_zone("example");
12780        /// ```
12781        pub fn set_gce_zone<T>(mut self, v: T) -> Self
12782        where
12783            T: std::convert::Into<std::string::String>,
12784        {
12785            self.gce_zone = std::option::Option::Some(v.into());
12786            self
12787        }
12788
12789        /// Sets or clears the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
12790        ///
12791        /// # Example
12792        /// ```ignore,no_run
12793        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12794        /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(Some("example"));
12795        /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(None::<String>);
12796        /// ```
12797        pub fn set_or_clear_gce_zone<T>(mut self, v: std::option::Option<T>) -> Self
12798        where
12799            T: std::convert::Into<std::string::String>,
12800        {
12801            self.gce_zone = v.map(|x| x.into());
12802            self
12803        }
12804
12805        /// Sets the value of [ip_addresses][crate::model::database_instance::PoolNodeConfig::ip_addresses].
12806        ///
12807        /// # Example
12808        /// ```ignore,no_run
12809        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12810        /// use google_cloud_sql_v1::model::IpMapping;
12811        /// let x = PoolNodeConfig::new()
12812        ///     .set_ip_addresses([
12813        ///         IpMapping::default()/* use setters */,
12814        ///         IpMapping::default()/* use (different) setters */,
12815        ///     ]);
12816        /// ```
12817        pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
12818        where
12819            T: std::iter::IntoIterator<Item = V>,
12820            V: std::convert::Into<crate::model::IpMapping>,
12821        {
12822            use std::iter::Iterator;
12823            self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
12824            self
12825        }
12826
12827        /// Sets the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
12828        ///
12829        /// # Example
12830        /// ```ignore,no_run
12831        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12832        /// let x = PoolNodeConfig::new().set_dns_name("example");
12833        /// ```
12834        pub fn set_dns_name<T>(mut self, v: T) -> Self
12835        where
12836            T: std::convert::Into<std::string::String>,
12837        {
12838            self.dns_name = std::option::Option::Some(v.into());
12839            self
12840        }
12841
12842        /// Sets or clears the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
12843        ///
12844        /// # Example
12845        /// ```ignore,no_run
12846        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12847        /// let x = PoolNodeConfig::new().set_or_clear_dns_name(Some("example"));
12848        /// let x = PoolNodeConfig::new().set_or_clear_dns_name(None::<String>);
12849        /// ```
12850        pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
12851        where
12852            T: std::convert::Into<std::string::String>,
12853        {
12854            self.dns_name = v.map(|x| x.into());
12855            self
12856        }
12857
12858        /// Sets the value of [state][crate::model::database_instance::PoolNodeConfig::state].
12859        ///
12860        /// # Example
12861        /// ```ignore,no_run
12862        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12863        /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
12864        /// let x0 = PoolNodeConfig::new().set_state(SqlInstanceState::Runnable);
12865        /// let x1 = PoolNodeConfig::new().set_state(SqlInstanceState::Suspended);
12866        /// let x2 = PoolNodeConfig::new().set_state(SqlInstanceState::PendingDelete);
12867        /// ```
12868        pub fn set_state<T>(mut self, v: T) -> Self
12869        where
12870            T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
12871        {
12872            self.state = std::option::Option::Some(v.into());
12873            self
12874        }
12875
12876        /// Sets or clears the value of [state][crate::model::database_instance::PoolNodeConfig::state].
12877        ///
12878        /// # Example
12879        /// ```ignore,no_run
12880        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12881        /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
12882        /// let x0 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Runnable));
12883        /// let x1 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Suspended));
12884        /// let x2 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::PendingDelete));
12885        /// let x_none = PoolNodeConfig::new().set_or_clear_state(None::<SqlInstanceState>);
12886        /// ```
12887        pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
12888        where
12889            T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
12890        {
12891            self.state = v.map(|x| x.into());
12892            self
12893        }
12894
12895        /// Sets the value of [dns_names][crate::model::database_instance::PoolNodeConfig::dns_names].
12896        ///
12897        /// # Example
12898        /// ```ignore,no_run
12899        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12900        /// use google_cloud_sql_v1::model::DnsNameMapping;
12901        /// let x = PoolNodeConfig::new()
12902        ///     .set_dns_names([
12903        ///         DnsNameMapping::default()/* use setters */,
12904        ///         DnsNameMapping::default()/* use (different) setters */,
12905        ///     ]);
12906        /// ```
12907        pub fn set_dns_names<T, V>(mut self, v: T) -> Self
12908        where
12909            T: std::iter::IntoIterator<Item = V>,
12910            V: std::convert::Into<crate::model::DnsNameMapping>,
12911        {
12912            use std::iter::Iterator;
12913            self.dns_names = v.into_iter().map(|i| i.into()).collect();
12914            self
12915        }
12916
12917        /// Sets the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
12918        ///
12919        /// # Example
12920        /// ```ignore,no_run
12921        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12922        /// let x = PoolNodeConfig::new().set_psc_service_attachment_link("example");
12923        /// ```
12924        pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
12925        where
12926            T: std::convert::Into<std::string::String>,
12927        {
12928            self.psc_service_attachment_link = std::option::Option::Some(v.into());
12929            self
12930        }
12931
12932        /// Sets or clears the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
12933        ///
12934        /// # Example
12935        /// ```ignore,no_run
12936        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12937        /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(Some("example"));
12938        /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(None::<String>);
12939        /// ```
12940        pub fn set_or_clear_psc_service_attachment_link<T>(
12941            mut self,
12942            v: std::option::Option<T>,
12943        ) -> Self
12944        where
12945            T: std::convert::Into<std::string::String>,
12946        {
12947            self.psc_service_attachment_link = v.map(|x| x.into());
12948            self
12949        }
12950
12951        /// Sets the value of [psc_auto_connections][crate::model::database_instance::PoolNodeConfig::psc_auto_connections].
12952        ///
12953        /// # Example
12954        /// ```ignore,no_run
12955        /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12956        /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
12957        /// let x = PoolNodeConfig::new()
12958        ///     .set_psc_auto_connections([
12959        ///         PscAutoConnectionConfig::default()/* use setters */,
12960        ///         PscAutoConnectionConfig::default()/* use (different) setters */,
12961        ///     ]);
12962        /// ```
12963        pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
12964        where
12965            T: std::iter::IntoIterator<Item = V>,
12966            V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
12967        {
12968            use std::iter::Iterator;
12969            self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
12970            self
12971        }
12972    }
12973
12974    impl wkt::message::Message for PoolNodeConfig {
12975        fn typename() -> &'static str {
12976            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig"
12977        }
12978    }
12979
12980    /// The current serving state of the database instance.
12981    ///
12982    /// # Working with unknown values
12983    ///
12984    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12985    /// additional enum variants at any time. Adding new variants is not considered
12986    /// a breaking change. Applications should write their code in anticipation of:
12987    ///
12988    /// - New values appearing in future releases of the client library, **and**
12989    /// - New values received dynamically, without application changes.
12990    ///
12991    /// Please consult the [Working with enums] section in the user guide for some
12992    /// guidelines.
12993    ///
12994    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12995    #[derive(Clone, Debug, PartialEq)]
12996    #[non_exhaustive]
12997    pub enum SqlInstanceState {
12998        /// The state of the instance is unknown.
12999        Unspecified,
13000        /// The instance is running, or has been stopped by owner.
13001        Runnable,
13002        /// The instance is not available, for example due to problems with billing.
13003        Suspended,
13004        /// The instance is being deleted.
13005        PendingDelete,
13006        /// The instance is being created.
13007        PendingCreate,
13008        /// The instance is down for maintenance.
13009        Maintenance,
13010        /// The creation of the instance failed or a fatal error occurred during
13011        /// maintenance.
13012        Failed,
13013        /// Deprecated
13014        #[deprecated]
13015        OnlineMaintenance,
13016        /// (Applicable to read pool nodes only.) The read pool node needs to be
13017        /// repaired. The database might be unavailable.
13018        Repairing,
13019        /// If set, the enum was initialized with an unknown value.
13020        ///
13021        /// Applications can examine the value using [SqlInstanceState::value] or
13022        /// [SqlInstanceState::name].
13023        UnknownValue(sql_instance_state::UnknownValue),
13024    }
13025
13026    #[doc(hidden)]
13027    pub mod sql_instance_state {
13028        #[allow(unused_imports)]
13029        use super::*;
13030        #[derive(Clone, Debug, PartialEq)]
13031        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13032    }
13033
13034    impl SqlInstanceState {
13035        /// Gets the enum value.
13036        ///
13037        /// Returns `None` if the enum contains an unknown value deserialized from
13038        /// the string representation of enums.
13039        pub fn value(&self) -> std::option::Option<i32> {
13040            match self {
13041                Self::Unspecified => std::option::Option::Some(0),
13042                Self::Runnable => std::option::Option::Some(1),
13043                Self::Suspended => std::option::Option::Some(2),
13044                Self::PendingDelete => std::option::Option::Some(3),
13045                Self::PendingCreate => std::option::Option::Some(4),
13046                Self::Maintenance => std::option::Option::Some(5),
13047                Self::Failed => std::option::Option::Some(6),
13048                Self::OnlineMaintenance => std::option::Option::Some(7),
13049                Self::Repairing => std::option::Option::Some(8),
13050                Self::UnknownValue(u) => u.0.value(),
13051            }
13052        }
13053
13054        /// Gets the enum value as a string.
13055        ///
13056        /// Returns `None` if the enum contains an unknown value deserialized from
13057        /// the integer representation of enums.
13058        pub fn name(&self) -> std::option::Option<&str> {
13059            match self {
13060                Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_STATE_UNSPECIFIED"),
13061                Self::Runnable => std::option::Option::Some("RUNNABLE"),
13062                Self::Suspended => std::option::Option::Some("SUSPENDED"),
13063                Self::PendingDelete => std::option::Option::Some("PENDING_DELETE"),
13064                Self::PendingCreate => std::option::Option::Some("PENDING_CREATE"),
13065                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
13066                Self::Failed => std::option::Option::Some("FAILED"),
13067                Self::OnlineMaintenance => std::option::Option::Some("ONLINE_MAINTENANCE"),
13068                Self::Repairing => std::option::Option::Some("REPAIRING"),
13069                Self::UnknownValue(u) => u.0.name(),
13070            }
13071        }
13072    }
13073
13074    impl std::default::Default for SqlInstanceState {
13075        fn default() -> Self {
13076            use std::convert::From;
13077            Self::from(0)
13078        }
13079    }
13080
13081    impl std::fmt::Display for SqlInstanceState {
13082        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13083            wkt::internal::display_enum(f, self.name(), self.value())
13084        }
13085    }
13086
13087    impl std::convert::From<i32> for SqlInstanceState {
13088        fn from(value: i32) -> Self {
13089            match value {
13090                0 => Self::Unspecified,
13091                1 => Self::Runnable,
13092                2 => Self::Suspended,
13093                3 => Self::PendingDelete,
13094                4 => Self::PendingCreate,
13095                5 => Self::Maintenance,
13096                6 => Self::Failed,
13097                7 => Self::OnlineMaintenance,
13098                8 => Self::Repairing,
13099                _ => Self::UnknownValue(sql_instance_state::UnknownValue(
13100                    wkt::internal::UnknownEnumValue::Integer(value),
13101                )),
13102            }
13103        }
13104    }
13105
13106    impl std::convert::From<&str> for SqlInstanceState {
13107        fn from(value: &str) -> Self {
13108            use std::string::ToString;
13109            match value {
13110                "SQL_INSTANCE_STATE_UNSPECIFIED" => Self::Unspecified,
13111                "RUNNABLE" => Self::Runnable,
13112                "SUSPENDED" => Self::Suspended,
13113                "PENDING_DELETE" => Self::PendingDelete,
13114                "PENDING_CREATE" => Self::PendingCreate,
13115                "MAINTENANCE" => Self::Maintenance,
13116                "FAILED" => Self::Failed,
13117                "ONLINE_MAINTENANCE" => Self::OnlineMaintenance,
13118                "REPAIRING" => Self::Repairing,
13119                _ => Self::UnknownValue(sql_instance_state::UnknownValue(
13120                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13121                )),
13122            }
13123        }
13124    }
13125
13126    impl serde::ser::Serialize for SqlInstanceState {
13127        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13128        where
13129            S: serde::Serializer,
13130        {
13131            match self {
13132                Self::Unspecified => serializer.serialize_i32(0),
13133                Self::Runnable => serializer.serialize_i32(1),
13134                Self::Suspended => serializer.serialize_i32(2),
13135                Self::PendingDelete => serializer.serialize_i32(3),
13136                Self::PendingCreate => serializer.serialize_i32(4),
13137                Self::Maintenance => serializer.serialize_i32(5),
13138                Self::Failed => serializer.serialize_i32(6),
13139                Self::OnlineMaintenance => serializer.serialize_i32(7),
13140                Self::Repairing => serializer.serialize_i32(8),
13141                Self::UnknownValue(u) => u.0.serialize(serializer),
13142            }
13143        }
13144    }
13145
13146    impl<'de> serde::de::Deserialize<'de> for SqlInstanceState {
13147        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13148        where
13149            D: serde::Deserializer<'de>,
13150        {
13151            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceState>::new(
13152                ".google.cloud.sql.v1.DatabaseInstance.SqlInstanceState",
13153            ))
13154        }
13155    }
13156
13157    /// The SQL network architecture for the instance.
13158    ///
13159    /// # Working with unknown values
13160    ///
13161    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13162    /// additional enum variants at any time. Adding new variants is not considered
13163    /// a breaking change. Applications should write their code in anticipation of:
13164    ///
13165    /// - New values appearing in future releases of the client library, **and**
13166    /// - New values received dynamically, without application changes.
13167    ///
13168    /// Please consult the [Working with enums] section in the user guide for some
13169    /// guidelines.
13170    ///
13171    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13172    #[derive(Clone, Debug, PartialEq)]
13173    #[non_exhaustive]
13174    pub enum SqlNetworkArchitecture {
13175        #[allow(missing_docs)]
13176        Unspecified,
13177        /// The instance uses the new network architecture.
13178        NewNetworkArchitecture,
13179        /// The instance uses the old network architecture.
13180        OldNetworkArchitecture,
13181        /// If set, the enum was initialized with an unknown value.
13182        ///
13183        /// Applications can examine the value using [SqlNetworkArchitecture::value] or
13184        /// [SqlNetworkArchitecture::name].
13185        UnknownValue(sql_network_architecture::UnknownValue),
13186    }
13187
13188    #[doc(hidden)]
13189    pub mod sql_network_architecture {
13190        #[allow(unused_imports)]
13191        use super::*;
13192        #[derive(Clone, Debug, PartialEq)]
13193        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13194    }
13195
13196    impl SqlNetworkArchitecture {
13197        /// Gets the enum value.
13198        ///
13199        /// Returns `None` if the enum contains an unknown value deserialized from
13200        /// the string representation of enums.
13201        pub fn value(&self) -> std::option::Option<i32> {
13202            match self {
13203                Self::Unspecified => std::option::Option::Some(0),
13204                Self::NewNetworkArchitecture => std::option::Option::Some(1),
13205                Self::OldNetworkArchitecture => std::option::Option::Some(2),
13206                Self::UnknownValue(u) => u.0.value(),
13207            }
13208        }
13209
13210        /// Gets the enum value as a string.
13211        ///
13212        /// Returns `None` if the enum contains an unknown value deserialized from
13213        /// the integer representation of enums.
13214        pub fn name(&self) -> std::option::Option<&str> {
13215            match self {
13216                Self::Unspecified => {
13217                    std::option::Option::Some("SQL_NETWORK_ARCHITECTURE_UNSPECIFIED")
13218                }
13219                Self::NewNetworkArchitecture => {
13220                    std::option::Option::Some("NEW_NETWORK_ARCHITECTURE")
13221                }
13222                Self::OldNetworkArchitecture => {
13223                    std::option::Option::Some("OLD_NETWORK_ARCHITECTURE")
13224                }
13225                Self::UnknownValue(u) => u.0.name(),
13226            }
13227        }
13228    }
13229
13230    impl std::default::Default for SqlNetworkArchitecture {
13231        fn default() -> Self {
13232            use std::convert::From;
13233            Self::from(0)
13234        }
13235    }
13236
13237    impl std::fmt::Display for SqlNetworkArchitecture {
13238        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13239            wkt::internal::display_enum(f, self.name(), self.value())
13240        }
13241    }
13242
13243    impl std::convert::From<i32> for SqlNetworkArchitecture {
13244        fn from(value: i32) -> Self {
13245            match value {
13246                0 => Self::Unspecified,
13247                1 => Self::NewNetworkArchitecture,
13248                2 => Self::OldNetworkArchitecture,
13249                _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
13250                    wkt::internal::UnknownEnumValue::Integer(value),
13251                )),
13252            }
13253        }
13254    }
13255
13256    impl std::convert::From<&str> for SqlNetworkArchitecture {
13257        fn from(value: &str) -> Self {
13258            use std::string::ToString;
13259            match value {
13260                "SQL_NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
13261                "NEW_NETWORK_ARCHITECTURE" => Self::NewNetworkArchitecture,
13262                "OLD_NETWORK_ARCHITECTURE" => Self::OldNetworkArchitecture,
13263                _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
13264                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13265                )),
13266            }
13267        }
13268    }
13269
13270    impl serde::ser::Serialize for SqlNetworkArchitecture {
13271        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13272        where
13273            S: serde::Serializer,
13274        {
13275            match self {
13276                Self::Unspecified => serializer.serialize_i32(0),
13277                Self::NewNetworkArchitecture => serializer.serialize_i32(1),
13278                Self::OldNetworkArchitecture => serializer.serialize_i32(2),
13279                Self::UnknownValue(u) => u.0.serialize(serializer),
13280            }
13281        }
13282    }
13283
13284    impl<'de> serde::de::Deserialize<'de> for SqlNetworkArchitecture {
13285        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13286        where
13287            D: serde::Deserializer<'de>,
13288        {
13289            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlNetworkArchitecture>::new(
13290                ".google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture",
13291            ))
13292        }
13293    }
13294}
13295
13296/// Gemini instance configuration.
13297#[derive(Clone, Default, PartialEq)]
13298#[non_exhaustive]
13299pub struct GeminiInstanceConfig {
13300    /// Output only. Whether Gemini is enabled.
13301    pub entitled: std::option::Option<bool>,
13302
13303    /// Output only. Whether the vacuum management is enabled.
13304    pub google_vacuum_mgmt_enabled: std::option::Option<bool>,
13305
13306    /// Output only. Whether canceling the out-of-memory (OOM) session is enabled.
13307    pub oom_session_cancel_enabled: std::option::Option<bool>,
13308
13309    /// Output only. Whether the active query is enabled.
13310    pub active_query_enabled: std::option::Option<bool>,
13311
13312    /// Output only. Whether the index advisor is enabled.
13313    pub index_advisor_enabled: std::option::Option<bool>,
13314
13315    /// Output only. Whether the flag recommender is enabled.
13316    pub flag_recommender_enabled: std::option::Option<bool>,
13317
13318    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13319}
13320
13321impl GeminiInstanceConfig {
13322    /// Creates a new default instance.
13323    pub fn new() -> Self {
13324        std::default::Default::default()
13325    }
13326
13327    /// Sets the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
13328    ///
13329    /// # Example
13330    /// ```ignore,no_run
13331    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13332    /// let x = GeminiInstanceConfig::new().set_entitled(true);
13333    /// ```
13334    pub fn set_entitled<T>(mut self, v: T) -> Self
13335    where
13336        T: std::convert::Into<bool>,
13337    {
13338        self.entitled = std::option::Option::Some(v.into());
13339        self
13340    }
13341
13342    /// Sets or clears the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
13343    ///
13344    /// # Example
13345    /// ```ignore,no_run
13346    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13347    /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(Some(false));
13348    /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(None::<bool>);
13349    /// ```
13350    pub fn set_or_clear_entitled<T>(mut self, v: std::option::Option<T>) -> Self
13351    where
13352        T: std::convert::Into<bool>,
13353    {
13354        self.entitled = v.map(|x| x.into());
13355        self
13356    }
13357
13358    /// Sets the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
13359    ///
13360    /// # Example
13361    /// ```ignore,no_run
13362    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13363    /// let x = GeminiInstanceConfig::new().set_google_vacuum_mgmt_enabled(true);
13364    /// ```
13365    pub fn set_google_vacuum_mgmt_enabled<T>(mut self, v: T) -> Self
13366    where
13367        T: std::convert::Into<bool>,
13368    {
13369        self.google_vacuum_mgmt_enabled = std::option::Option::Some(v.into());
13370        self
13371    }
13372
13373    /// Sets or clears the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
13374    ///
13375    /// # Example
13376    /// ```ignore,no_run
13377    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13378    /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(Some(false));
13379    /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(None::<bool>);
13380    /// ```
13381    pub fn set_or_clear_google_vacuum_mgmt_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13382    where
13383        T: std::convert::Into<bool>,
13384    {
13385        self.google_vacuum_mgmt_enabled = v.map(|x| x.into());
13386        self
13387    }
13388
13389    /// Sets the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
13390    ///
13391    /// # Example
13392    /// ```ignore,no_run
13393    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13394    /// let x = GeminiInstanceConfig::new().set_oom_session_cancel_enabled(true);
13395    /// ```
13396    pub fn set_oom_session_cancel_enabled<T>(mut self, v: T) -> Self
13397    where
13398        T: std::convert::Into<bool>,
13399    {
13400        self.oom_session_cancel_enabled = std::option::Option::Some(v.into());
13401        self
13402    }
13403
13404    /// Sets or clears the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
13405    ///
13406    /// # Example
13407    /// ```ignore,no_run
13408    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13409    /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(Some(false));
13410    /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(None::<bool>);
13411    /// ```
13412    pub fn set_or_clear_oom_session_cancel_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13413    where
13414        T: std::convert::Into<bool>,
13415    {
13416        self.oom_session_cancel_enabled = v.map(|x| x.into());
13417        self
13418    }
13419
13420    /// Sets the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
13421    ///
13422    /// # Example
13423    /// ```ignore,no_run
13424    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13425    /// let x = GeminiInstanceConfig::new().set_active_query_enabled(true);
13426    /// ```
13427    pub fn set_active_query_enabled<T>(mut self, v: T) -> Self
13428    where
13429        T: std::convert::Into<bool>,
13430    {
13431        self.active_query_enabled = std::option::Option::Some(v.into());
13432        self
13433    }
13434
13435    /// Sets or clears the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
13436    ///
13437    /// # Example
13438    /// ```ignore,no_run
13439    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13440    /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(Some(false));
13441    /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(None::<bool>);
13442    /// ```
13443    pub fn set_or_clear_active_query_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13444    where
13445        T: std::convert::Into<bool>,
13446    {
13447        self.active_query_enabled = v.map(|x| x.into());
13448        self
13449    }
13450
13451    /// Sets the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
13452    ///
13453    /// # Example
13454    /// ```ignore,no_run
13455    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13456    /// let x = GeminiInstanceConfig::new().set_index_advisor_enabled(true);
13457    /// ```
13458    pub fn set_index_advisor_enabled<T>(mut self, v: T) -> Self
13459    where
13460        T: std::convert::Into<bool>,
13461    {
13462        self.index_advisor_enabled = std::option::Option::Some(v.into());
13463        self
13464    }
13465
13466    /// Sets or clears the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
13467    ///
13468    /// # Example
13469    /// ```ignore,no_run
13470    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13471    /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(Some(false));
13472    /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(None::<bool>);
13473    /// ```
13474    pub fn set_or_clear_index_advisor_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13475    where
13476        T: std::convert::Into<bool>,
13477    {
13478        self.index_advisor_enabled = v.map(|x| x.into());
13479        self
13480    }
13481
13482    /// Sets the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
13483    ///
13484    /// # Example
13485    /// ```ignore,no_run
13486    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13487    /// let x = GeminiInstanceConfig::new().set_flag_recommender_enabled(true);
13488    /// ```
13489    pub fn set_flag_recommender_enabled<T>(mut self, v: T) -> Self
13490    where
13491        T: std::convert::Into<bool>,
13492    {
13493        self.flag_recommender_enabled = std::option::Option::Some(v.into());
13494        self
13495    }
13496
13497    /// Sets or clears the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
13498    ///
13499    /// # Example
13500    /// ```ignore,no_run
13501    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13502    /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(Some(false));
13503    /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(None::<bool>);
13504    /// ```
13505    pub fn set_or_clear_flag_recommender_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13506    where
13507        T: std::convert::Into<bool>,
13508    {
13509        self.flag_recommender_enabled = v.map(|x| x.into());
13510        self
13511    }
13512}
13513
13514impl wkt::message::Message for GeminiInstanceConfig {
13515    fn typename() -> &'static str {
13516        "type.googleapis.com/google.cloud.sql.v1.GeminiInstanceConfig"
13517    }
13518}
13519
13520/// A primary instance and disaster recovery (DR) replica pair.
13521/// A DR replica is a cross-region replica that you designate for failover in
13522/// the event that the primary instance experiences regional failure.
13523/// Applicable to MySQL and PostgreSQL.
13524#[derive(Clone, Default, PartialEq)]
13525#[non_exhaustive]
13526pub struct ReplicationCluster {
13527    /// Output only. If set, this field indicates this instance has a private
13528    /// service access (PSA) DNS endpoint that is pointing to the primary instance
13529    /// of the cluster. If this instance is the primary, then the DNS endpoint
13530    /// points to this instance. After a switchover or replica failover operation,
13531    /// this DNS endpoint points to the promoted instance. This is a read-only
13532    /// field, returned to the user as information. This field can exist even if a
13533    /// standalone instance doesn't have a DR replica yet or the DR replica is
13534    /// deleted.
13535    pub psa_write_endpoint: std::string::String,
13536
13537    /// Optional. If the instance is a primary instance, then this field identifies
13538    /// the disaster recovery (DR) replica. A DR replica is an optional
13539    /// configuration for Enterprise Plus edition instances. If the instance is a
13540    /// read replica, then the field is not set. Set this field to a replica name
13541    /// to designate a DR replica for a primary instance. Remove the replica name
13542    /// to remove the DR replica designation.
13543    pub failover_dr_replica_name: std::string::String,
13544
13545    /// Output only. Read-only field that indicates whether the replica is a DR
13546    /// replica. This field is not set if the instance is a primary instance.
13547    pub dr_replica: bool,
13548
13549    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13550}
13551
13552impl ReplicationCluster {
13553    /// Creates a new default instance.
13554    pub fn new() -> Self {
13555        std::default::Default::default()
13556    }
13557
13558    /// Sets the value of [psa_write_endpoint][crate::model::ReplicationCluster::psa_write_endpoint].
13559    ///
13560    /// # Example
13561    /// ```ignore,no_run
13562    /// # use google_cloud_sql_v1::model::ReplicationCluster;
13563    /// let x = ReplicationCluster::new().set_psa_write_endpoint("example");
13564    /// ```
13565    pub fn set_psa_write_endpoint<T: std::convert::Into<std::string::String>>(
13566        mut self,
13567        v: T,
13568    ) -> Self {
13569        self.psa_write_endpoint = v.into();
13570        self
13571    }
13572
13573    /// Sets the value of [failover_dr_replica_name][crate::model::ReplicationCluster::failover_dr_replica_name].
13574    ///
13575    /// # Example
13576    /// ```ignore,no_run
13577    /// # use google_cloud_sql_v1::model::ReplicationCluster;
13578    /// let x = ReplicationCluster::new().set_failover_dr_replica_name("example");
13579    /// ```
13580    pub fn set_failover_dr_replica_name<T: std::convert::Into<std::string::String>>(
13581        mut self,
13582        v: T,
13583    ) -> Self {
13584        self.failover_dr_replica_name = v.into();
13585        self
13586    }
13587
13588    /// Sets the value of [dr_replica][crate::model::ReplicationCluster::dr_replica].
13589    ///
13590    /// # Example
13591    /// ```ignore,no_run
13592    /// # use google_cloud_sql_v1::model::ReplicationCluster;
13593    /// let x = ReplicationCluster::new().set_dr_replica(true);
13594    /// ```
13595    pub fn set_dr_replica<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13596        self.dr_replica = v.into();
13597        self
13598    }
13599}
13600
13601impl wkt::message::Message for ReplicationCluster {
13602    fn typename() -> &'static str {
13603        "type.googleapis.com/google.cloud.sql.v1.ReplicationCluster"
13604    }
13605}
13606
13607/// An available database version. It can be a major or a minor version.
13608#[derive(Clone, Default, PartialEq)]
13609#[non_exhaustive]
13610pub struct AvailableDatabaseVersion {
13611    /// The version's major version name.
13612    pub major_version: std::option::Option<std::string::String>,
13613
13614    /// The database version name. For MySQL 8.0, this string provides the database
13615    /// major and minor version.
13616    pub name: std::option::Option<std::string::String>,
13617
13618    /// The database version's display name.
13619    pub display_name: std::option::Option<std::string::String>,
13620
13621    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13622}
13623
13624impl AvailableDatabaseVersion {
13625    /// Creates a new default instance.
13626    pub fn new() -> Self {
13627        std::default::Default::default()
13628    }
13629
13630    /// Sets the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
13631    ///
13632    /// # Example
13633    /// ```ignore,no_run
13634    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13635    /// let x = AvailableDatabaseVersion::new().set_major_version("example");
13636    /// ```
13637    pub fn set_major_version<T>(mut self, v: T) -> Self
13638    where
13639        T: std::convert::Into<std::string::String>,
13640    {
13641        self.major_version = std::option::Option::Some(v.into());
13642        self
13643    }
13644
13645    /// Sets or clears the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
13646    ///
13647    /// # Example
13648    /// ```ignore,no_run
13649    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13650    /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(Some("example"));
13651    /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(None::<String>);
13652    /// ```
13653    pub fn set_or_clear_major_version<T>(mut self, v: std::option::Option<T>) -> Self
13654    where
13655        T: std::convert::Into<std::string::String>,
13656    {
13657        self.major_version = v.map(|x| x.into());
13658        self
13659    }
13660
13661    /// Sets the value of [name][crate::model::AvailableDatabaseVersion::name].
13662    ///
13663    /// # Example
13664    /// ```ignore,no_run
13665    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13666    /// let x = AvailableDatabaseVersion::new().set_name("example");
13667    /// ```
13668    pub fn set_name<T>(mut self, v: T) -> Self
13669    where
13670        T: std::convert::Into<std::string::String>,
13671    {
13672        self.name = std::option::Option::Some(v.into());
13673        self
13674    }
13675
13676    /// Sets or clears the value of [name][crate::model::AvailableDatabaseVersion::name].
13677    ///
13678    /// # Example
13679    /// ```ignore,no_run
13680    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13681    /// let x = AvailableDatabaseVersion::new().set_or_clear_name(Some("example"));
13682    /// let x = AvailableDatabaseVersion::new().set_or_clear_name(None::<String>);
13683    /// ```
13684    pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
13685    where
13686        T: std::convert::Into<std::string::String>,
13687    {
13688        self.name = v.map(|x| x.into());
13689        self
13690    }
13691
13692    /// Sets the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
13693    ///
13694    /// # Example
13695    /// ```ignore,no_run
13696    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13697    /// let x = AvailableDatabaseVersion::new().set_display_name("example");
13698    /// ```
13699    pub fn set_display_name<T>(mut self, v: T) -> Self
13700    where
13701        T: std::convert::Into<std::string::String>,
13702    {
13703        self.display_name = std::option::Option::Some(v.into());
13704        self
13705    }
13706
13707    /// Sets or clears the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
13708    ///
13709    /// # Example
13710    /// ```ignore,no_run
13711    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13712    /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(Some("example"));
13713    /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(None::<String>);
13714    /// ```
13715    pub fn set_or_clear_display_name<T>(mut self, v: std::option::Option<T>) -> Self
13716    where
13717        T: std::convert::Into<std::string::String>,
13718    {
13719        self.display_name = v.map(|x| x.into());
13720        self
13721    }
13722}
13723
13724impl wkt::message::Message for AvailableDatabaseVersion {
13725    fn typename() -> &'static str {
13726        "type.googleapis.com/google.cloud.sql.v1.AvailableDatabaseVersion"
13727    }
13728}
13729
13730/// Reschedule options for maintenance windows.
13731#[derive(Clone, Default, PartialEq)]
13732#[non_exhaustive]
13733pub struct SqlInstancesRescheduleMaintenanceRequestBody {
13734    /// Required. The type of the reschedule the user wants.
13735    pub reschedule: std::option::Option<
13736        crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13737    >,
13738
13739    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13740}
13741
13742impl SqlInstancesRescheduleMaintenanceRequestBody {
13743    /// Creates a new default instance.
13744    pub fn new() -> Self {
13745        std::default::Default::default()
13746    }
13747
13748    /// Sets the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
13749    ///
13750    /// # Example
13751    /// ```ignore,no_run
13752    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
13753    /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13754    /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_reschedule(Reschedule::default()/* use setters */);
13755    /// ```
13756    pub fn set_reschedule<T>(mut self, v: T) -> Self
13757    where
13758        T: std::convert::Into<
13759                crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13760            >,
13761    {
13762        self.reschedule = std::option::Option::Some(v.into());
13763        self
13764    }
13765
13766    /// Sets or clears the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
13767    ///
13768    /// # Example
13769    /// ```ignore,no_run
13770    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
13771    /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13772    /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(Some(Reschedule::default()/* use setters */));
13773    /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(None::<Reschedule>);
13774    /// ```
13775    pub fn set_or_clear_reschedule<T>(mut self, v: std::option::Option<T>) -> Self
13776    where
13777        T: std::convert::Into<
13778                crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13779            >,
13780    {
13781        self.reschedule = v.map(|x| x.into());
13782        self
13783    }
13784}
13785
13786impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequestBody {
13787    fn typename() -> &'static str {
13788        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody"
13789    }
13790}
13791
13792/// Defines additional types related to [SqlInstancesRescheduleMaintenanceRequestBody].
13793pub mod sql_instances_reschedule_maintenance_request_body {
13794    #[allow(unused_imports)]
13795    use super::*;
13796
13797    #[allow(missing_docs)]
13798    #[derive(Clone, Default, PartialEq)]
13799    #[non_exhaustive]
13800    pub struct Reschedule {
13801        /// Required. The type of the reschedule.
13802        pub reschedule_type:
13803            crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
13804
13805        /// Optional. Timestamp when the maintenance shall be rescheduled to if
13806        /// reschedule_type=SPECIFIC_TIME, in
13807        /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
13808        /// `2012-11-15T16:19:00.094Z`.
13809        pub schedule_time: std::option::Option<wkt::Timestamp>,
13810
13811        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13812    }
13813
13814    impl Reschedule {
13815        /// Creates a new default instance.
13816        pub fn new() -> Self {
13817            std::default::Default::default()
13818        }
13819
13820        /// Sets the value of [reschedule_type][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::reschedule_type].
13821        ///
13822        /// # Example
13823        /// ```ignore,no_run
13824        /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13825        /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::RescheduleType;
13826        /// let x0 = Reschedule::new().set_reschedule_type(RescheduleType::Immediate);
13827        /// let x1 = Reschedule::new().set_reschedule_type(RescheduleType::NextAvailableWindow);
13828        /// let x2 = Reschedule::new().set_reschedule_type(RescheduleType::SpecificTime);
13829        /// ```
13830        pub fn set_reschedule_type<
13831            T: std::convert::Into<
13832                    crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
13833                >,
13834        >(
13835            mut self,
13836            v: T,
13837        ) -> Self {
13838            self.reschedule_type = v.into();
13839            self
13840        }
13841
13842        /// Sets the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
13843        ///
13844        /// # Example
13845        /// ```ignore,no_run
13846        /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13847        /// use wkt::Timestamp;
13848        /// let x = Reschedule::new().set_schedule_time(Timestamp::default()/* use setters */);
13849        /// ```
13850        pub fn set_schedule_time<T>(mut self, v: T) -> Self
13851        where
13852            T: std::convert::Into<wkt::Timestamp>,
13853        {
13854            self.schedule_time = std::option::Option::Some(v.into());
13855            self
13856        }
13857
13858        /// Sets or clears the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
13859        ///
13860        /// # Example
13861        /// ```ignore,no_run
13862        /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13863        /// use wkt::Timestamp;
13864        /// let x = Reschedule::new().set_or_clear_schedule_time(Some(Timestamp::default()/* use setters */));
13865        /// let x = Reschedule::new().set_or_clear_schedule_time(None::<Timestamp>);
13866        /// ```
13867        pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
13868        where
13869            T: std::convert::Into<wkt::Timestamp>,
13870        {
13871            self.schedule_time = v.map(|x| x.into());
13872            self
13873        }
13874    }
13875
13876    impl wkt::message::Message for Reschedule {
13877        fn typename() -> &'static str {
13878            "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule"
13879        }
13880    }
13881
13882    /// Enum for [RescheduleType].
13883    ///
13884    /// # Working with unknown values
13885    ///
13886    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13887    /// additional enum variants at any time. Adding new variants is not considered
13888    /// a breaking change. Applications should write their code in anticipation of:
13889    ///
13890    /// - New values appearing in future releases of the client library, **and**
13891    /// - New values received dynamically, without application changes.
13892    ///
13893    /// Please consult the [Working with enums] section in the user guide for some
13894    /// guidelines.
13895    ///
13896    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13897    #[derive(Clone, Debug, PartialEq)]
13898    #[non_exhaustive]
13899    pub enum RescheduleType {
13900        #[allow(missing_docs)]
13901        Unspecified,
13902        /// Reschedules maintenance to happen now (within 5 minutes).
13903        Immediate,
13904        /// Reschedules maintenance to occur within one week from the originally
13905        /// scheduled day and time.
13906        NextAvailableWindow,
13907        /// Reschedules maintenance to a specific time and day.
13908        SpecificTime,
13909        /// If set, the enum was initialized with an unknown value.
13910        ///
13911        /// Applications can examine the value using [RescheduleType::value] or
13912        /// [RescheduleType::name].
13913        UnknownValue(reschedule_type::UnknownValue),
13914    }
13915
13916    #[doc(hidden)]
13917    pub mod reschedule_type {
13918        #[allow(unused_imports)]
13919        use super::*;
13920        #[derive(Clone, Debug, PartialEq)]
13921        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13922    }
13923
13924    impl RescheduleType {
13925        /// Gets the enum value.
13926        ///
13927        /// Returns `None` if the enum contains an unknown value deserialized from
13928        /// the string representation of enums.
13929        pub fn value(&self) -> std::option::Option<i32> {
13930            match self {
13931                Self::Unspecified => std::option::Option::Some(0),
13932                Self::Immediate => std::option::Option::Some(1),
13933                Self::NextAvailableWindow => std::option::Option::Some(2),
13934                Self::SpecificTime => std::option::Option::Some(3),
13935                Self::UnknownValue(u) => u.0.value(),
13936            }
13937        }
13938
13939        /// Gets the enum value as a string.
13940        ///
13941        /// Returns `None` if the enum contains an unknown value deserialized from
13942        /// the integer representation of enums.
13943        pub fn name(&self) -> std::option::Option<&str> {
13944            match self {
13945                Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
13946                Self::Immediate => std::option::Option::Some("IMMEDIATE"),
13947                Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
13948                Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
13949                Self::UnknownValue(u) => u.0.name(),
13950            }
13951        }
13952    }
13953
13954    impl std::default::Default for RescheduleType {
13955        fn default() -> Self {
13956            use std::convert::From;
13957            Self::from(0)
13958        }
13959    }
13960
13961    impl std::fmt::Display for RescheduleType {
13962        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13963            wkt::internal::display_enum(f, self.name(), self.value())
13964        }
13965    }
13966
13967    impl std::convert::From<i32> for RescheduleType {
13968        fn from(value: i32) -> Self {
13969            match value {
13970                0 => Self::Unspecified,
13971                1 => Self::Immediate,
13972                2 => Self::NextAvailableWindow,
13973                3 => Self::SpecificTime,
13974                _ => Self::UnknownValue(reschedule_type::UnknownValue(
13975                    wkt::internal::UnknownEnumValue::Integer(value),
13976                )),
13977            }
13978        }
13979    }
13980
13981    impl std::convert::From<&str> for RescheduleType {
13982        fn from(value: &str) -> Self {
13983            use std::string::ToString;
13984            match value {
13985                "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
13986                "IMMEDIATE" => Self::Immediate,
13987                "NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
13988                "SPECIFIC_TIME" => Self::SpecificTime,
13989                _ => Self::UnknownValue(reschedule_type::UnknownValue(
13990                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13991                )),
13992            }
13993        }
13994    }
13995
13996    impl serde::ser::Serialize for RescheduleType {
13997        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13998        where
13999            S: serde::Serializer,
14000        {
14001            match self {
14002                Self::Unspecified => serializer.serialize_i32(0),
14003                Self::Immediate => serializer.serialize_i32(1),
14004                Self::NextAvailableWindow => serializer.serialize_i32(2),
14005                Self::SpecificTime => serializer.serialize_i32(3),
14006                Self::UnknownValue(u) => u.0.serialize(serializer),
14007            }
14008        }
14009    }
14010
14011    impl<'de> serde::de::Deserialize<'de> for RescheduleType {
14012        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14013        where
14014            D: serde::Deserializer<'de>,
14015        {
14016            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
14017                ".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType",
14018            ))
14019        }
14020    }
14021}
14022
14023/// Database instance demote primary instance context.
14024#[derive(Clone, Default, PartialEq)]
14025#[non_exhaustive]
14026pub struct DemoteMasterContext {
14027    /// This is always `sql#demoteMasterContext`.
14028    pub kind: std::string::String,
14029
14030    /// Verify the GTID consistency for demote operation. Default value:
14031    /// `True`. Setting this flag to `false` enables you to bypass the GTID
14032    /// consistency check between on-premises primary instance and Cloud SQL
14033    /// instance during the demotion operation but also exposes you to the risk of
14034    /// future replication failures. Change the value only if you know the reason
14035    /// for the GTID divergence and are confident that doing so will not cause any
14036    /// replication issues.
14037    pub verify_gtid_consistency: std::option::Option<wkt::BoolValue>,
14038
14039    /// The name of the instance which will act as on-premises primary instance
14040    /// in the replication setup.
14041    pub master_instance_name: std::string::String,
14042
14043    /// Configuration specific to read-replicas replicating from the on-premises
14044    /// primary instance.
14045    pub replica_configuration: std::option::Option<crate::model::DemoteMasterConfiguration>,
14046
14047    /// Flag to skip replication setup on the instance.
14048    pub skip_replication_setup: bool,
14049
14050    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14051}
14052
14053impl DemoteMasterContext {
14054    /// Creates a new default instance.
14055    pub fn new() -> Self {
14056        std::default::Default::default()
14057    }
14058
14059    /// Sets the value of [kind][crate::model::DemoteMasterContext::kind].
14060    ///
14061    /// # Example
14062    /// ```ignore,no_run
14063    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14064    /// let x = DemoteMasterContext::new().set_kind("example");
14065    /// ```
14066    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14067        self.kind = v.into();
14068        self
14069    }
14070
14071    /// Sets the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
14072    ///
14073    /// # Example
14074    /// ```ignore,no_run
14075    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14076    /// use wkt::BoolValue;
14077    /// let x = DemoteMasterContext::new().set_verify_gtid_consistency(BoolValue::default()/* use setters */);
14078    /// ```
14079    pub fn set_verify_gtid_consistency<T>(mut self, v: T) -> Self
14080    where
14081        T: std::convert::Into<wkt::BoolValue>,
14082    {
14083        self.verify_gtid_consistency = std::option::Option::Some(v.into());
14084        self
14085    }
14086
14087    /// Sets or clears the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
14088    ///
14089    /// # Example
14090    /// ```ignore,no_run
14091    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14092    /// use wkt::BoolValue;
14093    /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(Some(BoolValue::default()/* use setters */));
14094    /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(None::<BoolValue>);
14095    /// ```
14096    pub fn set_or_clear_verify_gtid_consistency<T>(mut self, v: std::option::Option<T>) -> Self
14097    where
14098        T: std::convert::Into<wkt::BoolValue>,
14099    {
14100        self.verify_gtid_consistency = v.map(|x| x.into());
14101        self
14102    }
14103
14104    /// Sets the value of [master_instance_name][crate::model::DemoteMasterContext::master_instance_name].
14105    ///
14106    /// # Example
14107    /// ```ignore,no_run
14108    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14109    /// let x = DemoteMasterContext::new().set_master_instance_name("example");
14110    /// ```
14111    pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
14112        mut self,
14113        v: T,
14114    ) -> Self {
14115        self.master_instance_name = v.into();
14116        self
14117    }
14118
14119    /// Sets the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
14120    ///
14121    /// # Example
14122    /// ```ignore,no_run
14123    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14124    /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
14125    /// let x = DemoteMasterContext::new().set_replica_configuration(DemoteMasterConfiguration::default()/* use setters */);
14126    /// ```
14127    pub fn set_replica_configuration<T>(mut self, v: T) -> Self
14128    where
14129        T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
14130    {
14131        self.replica_configuration = std::option::Option::Some(v.into());
14132        self
14133    }
14134
14135    /// Sets or clears the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
14136    ///
14137    /// # Example
14138    /// ```ignore,no_run
14139    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14140    /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
14141    /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(Some(DemoteMasterConfiguration::default()/* use setters */));
14142    /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(None::<DemoteMasterConfiguration>);
14143    /// ```
14144    pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
14145    where
14146        T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
14147    {
14148        self.replica_configuration = v.map(|x| x.into());
14149        self
14150    }
14151
14152    /// Sets the value of [skip_replication_setup][crate::model::DemoteMasterContext::skip_replication_setup].
14153    ///
14154    /// # Example
14155    /// ```ignore,no_run
14156    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14157    /// let x = DemoteMasterContext::new().set_skip_replication_setup(true);
14158    /// ```
14159    pub fn set_skip_replication_setup<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14160        self.skip_replication_setup = v.into();
14161        self
14162    }
14163}
14164
14165impl wkt::message::Message for DemoteMasterContext {
14166    fn typename() -> &'static str {
14167        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterContext"
14168    }
14169}
14170
14171/// This context is used to demote an existing standalone instance to be
14172/// a Cloud SQL read replica for an external database server.
14173#[derive(Clone, Default, PartialEq)]
14174#[non_exhaustive]
14175pub struct DemoteContext {
14176    /// This is always `sql#demoteContext`.
14177    pub kind: std::string::String,
14178
14179    /// Required. The name of the instance which acts as the on-premises primary
14180    /// instance in the replication setup.
14181    pub source_representative_instance_name: std::string::String,
14182
14183    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14184}
14185
14186impl DemoteContext {
14187    /// Creates a new default instance.
14188    pub fn new() -> Self {
14189        std::default::Default::default()
14190    }
14191
14192    /// Sets the value of [kind][crate::model::DemoteContext::kind].
14193    ///
14194    /// # Example
14195    /// ```ignore,no_run
14196    /// # use google_cloud_sql_v1::model::DemoteContext;
14197    /// let x = DemoteContext::new().set_kind("example");
14198    /// ```
14199    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14200        self.kind = v.into();
14201        self
14202    }
14203
14204    /// Sets the value of [source_representative_instance_name][crate::model::DemoteContext::source_representative_instance_name].
14205    ///
14206    /// # Example
14207    /// ```ignore,no_run
14208    /// # use google_cloud_sql_v1::model::DemoteContext;
14209    /// let x = DemoteContext::new().set_source_representative_instance_name("example");
14210    /// ```
14211    pub fn set_source_representative_instance_name<T: std::convert::Into<std::string::String>>(
14212        mut self,
14213        v: T,
14214    ) -> Self {
14215        self.source_representative_instance_name = v.into();
14216        self
14217    }
14218}
14219
14220impl wkt::message::Message for DemoteContext {
14221    fn typename() -> &'static str {
14222        "type.googleapis.com/google.cloud.sql.v1.DemoteContext"
14223    }
14224}
14225
14226/// Database instance failover context.
14227#[derive(Clone, Default, PartialEq)]
14228#[non_exhaustive]
14229pub struct FailoverContext {
14230    /// The current settings version of this instance. Request will be rejected if
14231    /// this version doesn't match the current settings version.
14232    pub settings_version: i64,
14233
14234    /// This is always `sql#failoverContext`.
14235    pub kind: std::string::String,
14236
14237    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14238}
14239
14240impl FailoverContext {
14241    /// Creates a new default instance.
14242    pub fn new() -> Self {
14243        std::default::Default::default()
14244    }
14245
14246    /// Sets the value of [settings_version][crate::model::FailoverContext::settings_version].
14247    ///
14248    /// # Example
14249    /// ```ignore,no_run
14250    /// # use google_cloud_sql_v1::model::FailoverContext;
14251    /// let x = FailoverContext::new().set_settings_version(42);
14252    /// ```
14253    pub fn set_settings_version<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14254        self.settings_version = v.into();
14255        self
14256    }
14257
14258    /// Sets the value of [kind][crate::model::FailoverContext::kind].
14259    ///
14260    /// # Example
14261    /// ```ignore,no_run
14262    /// # use google_cloud_sql_v1::model::FailoverContext;
14263    /// let x = FailoverContext::new().set_kind("example");
14264    /// ```
14265    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14266        self.kind = v.into();
14267        self
14268    }
14269}
14270
14271impl wkt::message::Message for FailoverContext {
14272    fn typename() -> &'static str {
14273        "type.googleapis.com/google.cloud.sql.v1.FailoverContext"
14274    }
14275}
14276
14277/// Database instance restore from backup context.
14278/// Backup context contains source instance id and project id.
14279#[derive(Clone, Default, PartialEq)]
14280#[non_exhaustive]
14281pub struct RestoreBackupContext {
14282    /// This is always `sql#restoreBackupContext`.
14283    pub kind: std::string::String,
14284
14285    /// The ID of the backup run to restore from.
14286    pub backup_run_id: i64,
14287
14288    /// The ID of the instance that the backup was taken from.
14289    pub instance_id: std::string::String,
14290
14291    /// The full project ID of the source instance.
14292    pub project: std::string::String,
14293
14294    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14295}
14296
14297impl RestoreBackupContext {
14298    /// Creates a new default instance.
14299    pub fn new() -> Self {
14300        std::default::Default::default()
14301    }
14302
14303    /// Sets the value of [kind][crate::model::RestoreBackupContext::kind].
14304    ///
14305    /// # Example
14306    /// ```ignore,no_run
14307    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14308    /// let x = RestoreBackupContext::new().set_kind("example");
14309    /// ```
14310    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14311        self.kind = v.into();
14312        self
14313    }
14314
14315    /// Sets the value of [backup_run_id][crate::model::RestoreBackupContext::backup_run_id].
14316    ///
14317    /// # Example
14318    /// ```ignore,no_run
14319    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14320    /// let x = RestoreBackupContext::new().set_backup_run_id(42);
14321    /// ```
14322    pub fn set_backup_run_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14323        self.backup_run_id = v.into();
14324        self
14325    }
14326
14327    /// Sets the value of [instance_id][crate::model::RestoreBackupContext::instance_id].
14328    ///
14329    /// # Example
14330    /// ```ignore,no_run
14331    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14332    /// let x = RestoreBackupContext::new().set_instance_id("example");
14333    /// ```
14334    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14335        self.instance_id = v.into();
14336        self
14337    }
14338
14339    /// Sets the value of [project][crate::model::RestoreBackupContext::project].
14340    ///
14341    /// # Example
14342    /// ```ignore,no_run
14343    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14344    /// let x = RestoreBackupContext::new().set_project("example");
14345    /// ```
14346    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14347        self.project = v.into();
14348        self
14349    }
14350}
14351
14352impl wkt::message::Message for RestoreBackupContext {
14353    fn typename() -> &'static str {
14354        "type.googleapis.com/google.cloud.sql.v1.RestoreBackupContext"
14355    }
14356}
14357
14358/// Instance rotate server CA context.
14359#[derive(Clone, Default, PartialEq)]
14360#[non_exhaustive]
14361pub struct RotateServerCaContext {
14362    /// This is always `sql#rotateServerCaContext`.
14363    pub kind: std::string::String,
14364
14365    /// The fingerprint of the next version to be rotated to. If left unspecified,
14366    /// will be rotated to the most recently added server CA 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 RotateServerCaContext {
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::RotateServerCaContext::kind].
14379    ///
14380    /// # Example
14381    /// ```ignore,no_run
14382    /// # use google_cloud_sql_v1::model::RotateServerCaContext;
14383    /// let x = RotateServerCaContext::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::RotateServerCaContext::next_version].
14391    ///
14392    /// # Example
14393    /// ```ignore,no_run
14394    /// # use google_cloud_sql_v1::model::RotateServerCaContext;
14395    /// let x = RotateServerCaContext::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 RotateServerCaContext {
14404    fn typename() -> &'static str {
14405        "type.googleapis.com/google.cloud.sql.v1.RotateServerCaContext"
14406    }
14407}
14408
14409/// Instance rotate server certificate context.
14410#[derive(Clone, Default, PartialEq)]
14411#[non_exhaustive]
14412pub struct RotateServerCertificateContext {
14413    /// Optional. This is always `sql#rotateServerCertificateContext`.
14414    pub kind: std::string::String,
14415
14416    /// The fingerprint of the next version to be rotated to. If left unspecified,
14417    /// will be rotated to the most recently added server certificate version.
14418    pub next_version: std::string::String,
14419
14420    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14421}
14422
14423impl RotateServerCertificateContext {
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::RotateServerCertificateContext::kind].
14430    ///
14431    /// # Example
14432    /// ```ignore,no_run
14433    /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
14434    /// let x = RotateServerCertificateContext::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 [next_version][crate::model::RotateServerCertificateContext::next_version].
14442    ///
14443    /// # Example
14444    /// ```ignore,no_run
14445    /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
14446    /// let x = RotateServerCertificateContext::new().set_next_version("example");
14447    /// ```
14448    pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14449        self.next_version = v.into();
14450        self
14451    }
14452}
14453
14454impl wkt::message::Message for RotateServerCertificateContext {
14455    fn typename() -> &'static str {
14456        "type.googleapis.com/google.cloud.sql.v1.RotateServerCertificateContext"
14457    }
14458}
14459
14460/// Instance rotate Entra ID certificate context.
14461#[derive(Clone, Default, PartialEq)]
14462#[non_exhaustive]
14463pub struct RotateEntraIdCertificateContext {
14464    /// Optional. This is always `sql#rotateEntraIdCertificateContext`.
14465    pub kind: std::string::String,
14466
14467    /// Optional. The fingerprint of the next version to be rotated to. If left
14468    /// unspecified, will be rotated to the most recently added server certificate
14469    /// version.
14470    pub next_version: std::string::String,
14471
14472    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14473}
14474
14475impl RotateEntraIdCertificateContext {
14476    /// Creates a new default instance.
14477    pub fn new() -> Self {
14478        std::default::Default::default()
14479    }
14480
14481    /// Sets the value of [kind][crate::model::RotateEntraIdCertificateContext::kind].
14482    ///
14483    /// # Example
14484    /// ```ignore,no_run
14485    /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
14486    /// let x = RotateEntraIdCertificateContext::new().set_kind("example");
14487    /// ```
14488    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14489        self.kind = v.into();
14490        self
14491    }
14492
14493    /// Sets the value of [next_version][crate::model::RotateEntraIdCertificateContext::next_version].
14494    ///
14495    /// # Example
14496    /// ```ignore,no_run
14497    /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
14498    /// let x = RotateEntraIdCertificateContext::new().set_next_version("example");
14499    /// ```
14500    pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14501        self.next_version = v.into();
14502        self
14503    }
14504}
14505
14506impl wkt::message::Message for RotateEntraIdCertificateContext {
14507    fn typename() -> &'static str {
14508        "type.googleapis.com/google.cloud.sql.v1.RotateEntraIdCertificateContext"
14509    }
14510}
14511
14512/// Database Instance truncate log context.
14513#[derive(Clone, Default, PartialEq)]
14514#[non_exhaustive]
14515pub struct TruncateLogContext {
14516    /// This is always `sql#truncateLogContext`.
14517    pub kind: std::string::String,
14518
14519    /// The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
14520    /// `MYSQL_SLOW_TABLE`.
14521    pub log_type: std::string::String,
14522
14523    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14524}
14525
14526impl TruncateLogContext {
14527    /// Creates a new default instance.
14528    pub fn new() -> Self {
14529        std::default::Default::default()
14530    }
14531
14532    /// Sets the value of [kind][crate::model::TruncateLogContext::kind].
14533    ///
14534    /// # Example
14535    /// ```ignore,no_run
14536    /// # use google_cloud_sql_v1::model::TruncateLogContext;
14537    /// let x = TruncateLogContext::new().set_kind("example");
14538    /// ```
14539    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14540        self.kind = v.into();
14541        self
14542    }
14543
14544    /// Sets the value of [log_type][crate::model::TruncateLogContext::log_type].
14545    ///
14546    /// # Example
14547    /// ```ignore,no_run
14548    /// # use google_cloud_sql_v1::model::TruncateLogContext;
14549    /// let x = TruncateLogContext::new().set_log_type("example");
14550    /// ```
14551    pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14552        self.log_type = v.into();
14553        self
14554    }
14555}
14556
14557impl wkt::message::Message for TruncateLogContext {
14558    fn typename() -> &'static str {
14559        "type.googleapis.com/google.cloud.sql.v1.TruncateLogContext"
14560    }
14561}
14562
14563/// External primary instance migration setting error/warning.
14564#[derive(Clone, Default, PartialEq)]
14565#[non_exhaustive]
14566pub struct SqlExternalSyncSettingError {
14567    /// Can be `sql#externalSyncSettingError` or
14568    /// `sql#externalSyncSettingWarning`.
14569    pub kind: std::string::String,
14570
14571    /// Identifies the specific error that occurred.
14572    pub r#type: crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
14573
14574    /// Additional information about the error encountered.
14575    pub detail: std::string::String,
14576
14577    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14578}
14579
14580impl SqlExternalSyncSettingError {
14581    /// Creates a new default instance.
14582    pub fn new() -> Self {
14583        std::default::Default::default()
14584    }
14585
14586    /// Sets the value of [kind][crate::model::SqlExternalSyncSettingError::kind].
14587    ///
14588    /// # Example
14589    /// ```ignore,no_run
14590    /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14591    /// let x = SqlExternalSyncSettingError::new().set_kind("example");
14592    /// ```
14593    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14594        self.kind = v.into();
14595        self
14596    }
14597
14598    /// Sets the value of [r#type][crate::model::SqlExternalSyncSettingError::type].
14599    ///
14600    /// # Example
14601    /// ```ignore,no_run
14602    /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14603    /// use google_cloud_sql_v1::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType;
14604    /// let x0 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::ConnectionFailure);
14605    /// let x1 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::BinlogNotEnabled);
14606    /// let x2 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::IncompatibleDatabaseVersion);
14607    /// ```
14608    pub fn set_type<
14609        T: std::convert::Into<
14610                crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
14611            >,
14612    >(
14613        mut self,
14614        v: T,
14615    ) -> Self {
14616        self.r#type = v.into();
14617        self
14618    }
14619
14620    /// Sets the value of [detail][crate::model::SqlExternalSyncSettingError::detail].
14621    ///
14622    /// # Example
14623    /// ```ignore,no_run
14624    /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14625    /// let x = SqlExternalSyncSettingError::new().set_detail("example");
14626    /// ```
14627    pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14628        self.detail = v.into();
14629        self
14630    }
14631}
14632
14633impl wkt::message::Message for SqlExternalSyncSettingError {
14634    fn typename() -> &'static str {
14635        "type.googleapis.com/google.cloud.sql.v1.SqlExternalSyncSettingError"
14636    }
14637}
14638
14639/// Defines additional types related to [SqlExternalSyncSettingError].
14640pub mod sql_external_sync_setting_error {
14641    #[allow(unused_imports)]
14642    use super::*;
14643
14644    /// Enum for [SqlExternalSyncSettingErrorType].
14645    ///
14646    /// # Working with unknown values
14647    ///
14648    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14649    /// additional enum variants at any time. Adding new variants is not considered
14650    /// a breaking change. Applications should write their code in anticipation of:
14651    ///
14652    /// - New values appearing in future releases of the client library, **and**
14653    /// - New values received dynamically, without application changes.
14654    ///
14655    /// Please consult the [Working with enums] section in the user guide for some
14656    /// guidelines.
14657    ///
14658    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14659    #[derive(Clone, Debug, PartialEq)]
14660    #[non_exhaustive]
14661    pub enum SqlExternalSyncSettingErrorType {
14662        #[allow(missing_docs)]
14663        Unspecified,
14664        #[allow(missing_docs)]
14665        ConnectionFailure,
14666        #[allow(missing_docs)]
14667        BinlogNotEnabled,
14668        #[allow(missing_docs)]
14669        IncompatibleDatabaseVersion,
14670        #[allow(missing_docs)]
14671        ReplicaAlreadySetup,
14672        /// The replication user is missing privileges that are required.
14673        InsufficientPrivilege,
14674        /// Unsupported migration type.
14675        UnsupportedMigrationType,
14676        /// No pglogical extension installed on databases, applicable for postgres.
14677        NoPglogicalInstalled,
14678        /// pglogical node already exists on databases, applicable for postgres.
14679        PglogicalNodeAlreadyExists,
14680        /// The value of parameter wal_level is not set to logical.
14681        InvalidWalLevel,
14682        /// The value of parameter shared_preload_libraries does not include
14683        /// pglogical.
14684        InvalidSharedPreloadLibrary,
14685        /// The value of parameter max_replication_slots is not sufficient.
14686        InsufficientMaxReplicationSlots,
14687        /// The value of parameter max_wal_senders is not sufficient.
14688        InsufficientMaxWalSenders,
14689        /// The value of parameter max_worker_processes is not sufficient.
14690        InsufficientMaxWorkerProcesses,
14691        /// Extensions installed are either not supported or having unsupported
14692        /// versions.
14693        UnsupportedExtensions,
14694        /// The value of parameter rds.logical_replication is not set to 1.
14695        InvalidRdsLogicalReplication,
14696        /// The primary instance logging setup doesn't allow EM sync.
14697        InvalidLoggingSetup,
14698        /// The primary instance database parameter setup doesn't allow EM sync.
14699        InvalidDbParam,
14700        /// The gtid_mode is not supported, applicable for MySQL.
14701        UnsupportedGtidMode,
14702        /// SQL Server Agent is not running.
14703        SqlserverAgentNotRunning,
14704        /// The table definition is not support due to missing primary key or replica
14705        /// identity, applicable for postgres. Note that this is a warning and won't
14706        /// block the migration.
14707        UnsupportedTableDefinition,
14708        /// The customer has a definer that will break EM setup.
14709        UnsupportedDefiner,
14710        /// SQL Server @@SERVERNAME does not match actual host name.
14711        SqlserverServernameMismatch,
14712        /// The primary instance has been setup and will fail the setup.
14713        PrimaryAlreadySetup,
14714        /// The primary instance has unsupported binary log format.
14715        UnsupportedBinlogFormat,
14716        /// The primary instance's binary log retention setting.
14717        BinlogRetentionSetting,
14718        /// The primary instance has tables with unsupported storage engine.
14719        UnsupportedStorageEngine,
14720        /// Source has tables with limited support
14721        /// eg: PostgreSQL tables without primary keys.
14722        LimitedSupportTables,
14723        /// The replica instance contains existing data.
14724        ExistingDataInReplica,
14725        /// The replication user is missing privileges that are optional.
14726        MissingOptionalPrivileges,
14727        /// Additional BACKUP_ADMIN privilege is granted to the replication user
14728        /// which may lock source MySQL 8 instance for DDLs during initial sync.
14729        RiskyBackupAdminPrivilege,
14730        /// The Cloud Storage bucket is missing necessary permissions.
14731        InsufficientGcsPermissions,
14732        /// The Cloud Storage bucket has an error in the file or contains invalid
14733        /// file information.
14734        InvalidFileInfo,
14735        /// The source instance has unsupported database settings for migration.
14736        UnsupportedDatabaseSettings,
14737        /// The replication user is missing parallel import specific privileges.
14738        /// (e.g. LOCK TABLES) for MySQL.
14739        MysqlParallelImportInsufficientPrivilege,
14740        /// The global variable local_infile is off on external server replica.
14741        LocalInfileOff,
14742        /// This code instructs customers to turn on point-in-time recovery manually
14743        /// for the instance after promoting the Cloud SQL for PostgreSQL instance.
14744        TurnOnPitrAfterPromote,
14745        /// The minor version of replica database is incompatible with the source.
14746        IncompatibleDatabaseMinorVersion,
14747        /// This warning message indicates that Cloud SQL uses the maximum number of
14748        /// subscriptions to migrate data from the source to the destination.
14749        SourceMaxSubscriptions,
14750        /// Unable to verify definers on the source for MySQL.
14751        UnableToVerifyDefiners,
14752        /// If a time out occurs while the subscription counts are calculated, then
14753        /// this value is set to 1. Otherwise, this value is set to 2.
14754        SubscriptionCalculationStatus,
14755        /// Count of subscriptions needed to sync source data for PostgreSQL
14756        /// database.
14757        PgSubscriptionCount,
14758        /// Final parallel level that is used to do migration.
14759        PgSyncParallelLevel,
14760        /// The disk size of the replica instance is smaller than the data size of
14761        /// the source instance.
14762        InsufficientDiskSize,
14763        /// The data size of the source instance is greater than 1 TB, the number of
14764        /// cores of the replica instance is less than 8, and the memory of the
14765        /// replica is less than 32 GB.
14766        InsufficientMachineTier,
14767        /// The warning message indicates the unsupported extensions will not be
14768        /// migrated to the destination.
14769        UnsupportedExtensionsNotMigrated,
14770        /// The warning message indicates the pg_cron extension and settings will not
14771        /// be migrated to the destination.
14772        ExtensionsNotMigrated,
14773        /// The error message indicates that pg_cron flags are enabled on the
14774        /// destination which is not supported during the migration.
14775        PgCronFlagEnabledInReplica,
14776        /// This error message indicates that the specified extensions are not
14777        /// enabled on destination instance. For example, before you can migrate
14778        /// data to the destination instance, you must enable the PGAudit extension
14779        /// on the instance.
14780        ExtensionsNotEnabledInReplica,
14781        /// The source database has generated columns that can't be migrated. Please
14782        /// change them to regular columns before migration.
14783        UnsupportedColumns,
14784        /// The source database has users that aren't created in the replica.
14785        /// First, create all users, which are in the pg_user_mappings table
14786        /// of the source database, in the destination instance. Then, perform the
14787        /// migration.
14788        UsersNotCreatedInReplica,
14789        /// The selected objects include system objects that aren't supported for
14790        /// migration.
14791        UnsupportedSystemObjects,
14792        /// The source database has tables with the FULL or NOTHING replica identity.
14793        /// Before starting your migration, either remove the identity or change it
14794        /// to DEFAULT. Note that this is an error and will block the migration.
14795        UnsupportedTablesWithReplicaIdentity,
14796        /// The selected objects don't exist on the source instance.
14797        SelectedObjectsNotExistOnSource,
14798        /// PSC only destination instance does not have a network attachment URI.
14799        PscOnlyInstanceWithNoNetworkAttachmentUri,
14800        /// Selected objects reference unselected objects. Based on their object type
14801        /// (foreign key constraint or view), selected objects will fail during
14802        /// migration.
14803        SelectedObjectsReferenceUnselectedObjects,
14804        /// The migration will delete existing data in the replica; set
14805        /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
14806        /// in the request to acknowledge this. This is an error. MySQL only.
14807        ///
14808        /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
14809        PromptDeleteExisting,
14810        /// The migration will delete existing data in the replica;
14811        /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
14812        /// was set in the request acknowledging this. This is a warning rather than
14813        /// an error. MySQL only.
14814        ///
14815        /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
14816        WillDeleteExisting,
14817        /// The replication user is missing specific privileges to setup DDL
14818        /// replication. (e.g. CREATE EVENT TRIGGER, CREATE SCHEMA) for PostgreSQL.
14819        PgDdlReplicationInsufficientPrivilege,
14820        /// If set, the enum was initialized with an unknown value.
14821        ///
14822        /// Applications can examine the value using [SqlExternalSyncSettingErrorType::value] or
14823        /// [SqlExternalSyncSettingErrorType::name].
14824        UnknownValue(sql_external_sync_setting_error_type::UnknownValue),
14825    }
14826
14827    #[doc(hidden)]
14828    pub mod sql_external_sync_setting_error_type {
14829        #[allow(unused_imports)]
14830        use super::*;
14831        #[derive(Clone, Debug, PartialEq)]
14832        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14833    }
14834
14835    impl SqlExternalSyncSettingErrorType {
14836        /// Gets the enum value.
14837        ///
14838        /// Returns `None` if the enum contains an unknown value deserialized from
14839        /// the string representation of enums.
14840        pub fn value(&self) -> std::option::Option<i32> {
14841            match self {
14842                Self::Unspecified => std::option::Option::Some(0),
14843                Self::ConnectionFailure => std::option::Option::Some(1),
14844                Self::BinlogNotEnabled => std::option::Option::Some(2),
14845                Self::IncompatibleDatabaseVersion => std::option::Option::Some(3),
14846                Self::ReplicaAlreadySetup => std::option::Option::Some(4),
14847                Self::InsufficientPrivilege => std::option::Option::Some(5),
14848                Self::UnsupportedMigrationType => std::option::Option::Some(6),
14849                Self::NoPglogicalInstalled => std::option::Option::Some(7),
14850                Self::PglogicalNodeAlreadyExists => std::option::Option::Some(8),
14851                Self::InvalidWalLevel => std::option::Option::Some(9),
14852                Self::InvalidSharedPreloadLibrary => std::option::Option::Some(10),
14853                Self::InsufficientMaxReplicationSlots => std::option::Option::Some(11),
14854                Self::InsufficientMaxWalSenders => std::option::Option::Some(12),
14855                Self::InsufficientMaxWorkerProcesses => std::option::Option::Some(13),
14856                Self::UnsupportedExtensions => std::option::Option::Some(14),
14857                Self::InvalidRdsLogicalReplication => std::option::Option::Some(15),
14858                Self::InvalidLoggingSetup => std::option::Option::Some(16),
14859                Self::InvalidDbParam => std::option::Option::Some(17),
14860                Self::UnsupportedGtidMode => std::option::Option::Some(18),
14861                Self::SqlserverAgentNotRunning => std::option::Option::Some(19),
14862                Self::UnsupportedTableDefinition => std::option::Option::Some(20),
14863                Self::UnsupportedDefiner => std::option::Option::Some(21),
14864                Self::SqlserverServernameMismatch => std::option::Option::Some(22),
14865                Self::PrimaryAlreadySetup => std::option::Option::Some(23),
14866                Self::UnsupportedBinlogFormat => std::option::Option::Some(24),
14867                Self::BinlogRetentionSetting => std::option::Option::Some(25),
14868                Self::UnsupportedStorageEngine => std::option::Option::Some(26),
14869                Self::LimitedSupportTables => std::option::Option::Some(27),
14870                Self::ExistingDataInReplica => std::option::Option::Some(28),
14871                Self::MissingOptionalPrivileges => std::option::Option::Some(29),
14872                Self::RiskyBackupAdminPrivilege => std::option::Option::Some(30),
14873                Self::InsufficientGcsPermissions => std::option::Option::Some(31),
14874                Self::InvalidFileInfo => std::option::Option::Some(32),
14875                Self::UnsupportedDatabaseSettings => std::option::Option::Some(33),
14876                Self::MysqlParallelImportInsufficientPrivilege => std::option::Option::Some(34),
14877                Self::LocalInfileOff => std::option::Option::Some(35),
14878                Self::TurnOnPitrAfterPromote => std::option::Option::Some(36),
14879                Self::IncompatibleDatabaseMinorVersion => std::option::Option::Some(37),
14880                Self::SourceMaxSubscriptions => std::option::Option::Some(38),
14881                Self::UnableToVerifyDefiners => std::option::Option::Some(39),
14882                Self::SubscriptionCalculationStatus => std::option::Option::Some(40),
14883                Self::PgSubscriptionCount => std::option::Option::Some(41),
14884                Self::PgSyncParallelLevel => std::option::Option::Some(42),
14885                Self::InsufficientDiskSize => std::option::Option::Some(43),
14886                Self::InsufficientMachineTier => std::option::Option::Some(44),
14887                Self::UnsupportedExtensionsNotMigrated => std::option::Option::Some(45),
14888                Self::ExtensionsNotMigrated => std::option::Option::Some(46),
14889                Self::PgCronFlagEnabledInReplica => std::option::Option::Some(47),
14890                Self::ExtensionsNotEnabledInReplica => std::option::Option::Some(48),
14891                Self::UnsupportedColumns => std::option::Option::Some(49),
14892                Self::UsersNotCreatedInReplica => std::option::Option::Some(50),
14893                Self::UnsupportedSystemObjects => std::option::Option::Some(51),
14894                Self::UnsupportedTablesWithReplicaIdentity => std::option::Option::Some(52),
14895                Self::SelectedObjectsNotExistOnSource => std::option::Option::Some(53),
14896                Self::PscOnlyInstanceWithNoNetworkAttachmentUri => std::option::Option::Some(54),
14897                Self::SelectedObjectsReferenceUnselectedObjects => std::option::Option::Some(55),
14898                Self::PromptDeleteExisting => std::option::Option::Some(56),
14899                Self::WillDeleteExisting => std::option::Option::Some(57),
14900                Self::PgDdlReplicationInsufficientPrivilege => std::option::Option::Some(58),
14901                Self::UnknownValue(u) => u.0.value(),
14902            }
14903        }
14904
14905        /// Gets the enum value as a string.
14906        ///
14907        /// Returns `None` if the enum contains an unknown value deserialized from
14908        /// the integer representation of enums.
14909        pub fn name(&self) -> std::option::Option<&str> {
14910            match self {
14911                Self::Unspecified => {
14912                    std::option::Option::Some("SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED")
14913                }
14914                Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
14915                Self::BinlogNotEnabled => std::option::Option::Some("BINLOG_NOT_ENABLED"),
14916                Self::IncompatibleDatabaseVersion => {
14917                    std::option::Option::Some("INCOMPATIBLE_DATABASE_VERSION")
14918                }
14919                Self::ReplicaAlreadySetup => std::option::Option::Some("REPLICA_ALREADY_SETUP"),
14920                Self::InsufficientPrivilege => std::option::Option::Some("INSUFFICIENT_PRIVILEGE"),
14921                Self::UnsupportedMigrationType => {
14922                    std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
14923                }
14924                Self::NoPglogicalInstalled => std::option::Option::Some("NO_PGLOGICAL_INSTALLED"),
14925                Self::PglogicalNodeAlreadyExists => {
14926                    std::option::Option::Some("PGLOGICAL_NODE_ALREADY_EXISTS")
14927                }
14928                Self::InvalidWalLevel => std::option::Option::Some("INVALID_WAL_LEVEL"),
14929                Self::InvalidSharedPreloadLibrary => {
14930                    std::option::Option::Some("INVALID_SHARED_PRELOAD_LIBRARY")
14931                }
14932                Self::InsufficientMaxReplicationSlots => {
14933                    std::option::Option::Some("INSUFFICIENT_MAX_REPLICATION_SLOTS")
14934                }
14935                Self::InsufficientMaxWalSenders => {
14936                    std::option::Option::Some("INSUFFICIENT_MAX_WAL_SENDERS")
14937                }
14938                Self::InsufficientMaxWorkerProcesses => {
14939                    std::option::Option::Some("INSUFFICIENT_MAX_WORKER_PROCESSES")
14940                }
14941                Self::UnsupportedExtensions => std::option::Option::Some("UNSUPPORTED_EXTENSIONS"),
14942                Self::InvalidRdsLogicalReplication => {
14943                    std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
14944                }
14945                Self::InvalidLoggingSetup => std::option::Option::Some("INVALID_LOGGING_SETUP"),
14946                Self::InvalidDbParam => std::option::Option::Some("INVALID_DB_PARAM"),
14947                Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
14948                Self::SqlserverAgentNotRunning => {
14949                    std::option::Option::Some("SQLSERVER_AGENT_NOT_RUNNING")
14950                }
14951                Self::UnsupportedTableDefinition => {
14952                    std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
14953                }
14954                Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
14955                Self::SqlserverServernameMismatch => {
14956                    std::option::Option::Some("SQLSERVER_SERVERNAME_MISMATCH")
14957                }
14958                Self::PrimaryAlreadySetup => std::option::Option::Some("PRIMARY_ALREADY_SETUP"),
14959                Self::UnsupportedBinlogFormat => {
14960                    std::option::Option::Some("UNSUPPORTED_BINLOG_FORMAT")
14961                }
14962                Self::BinlogRetentionSetting => {
14963                    std::option::Option::Some("BINLOG_RETENTION_SETTING")
14964                }
14965                Self::UnsupportedStorageEngine => {
14966                    std::option::Option::Some("UNSUPPORTED_STORAGE_ENGINE")
14967                }
14968                Self::LimitedSupportTables => std::option::Option::Some("LIMITED_SUPPORT_TABLES"),
14969                Self::ExistingDataInReplica => {
14970                    std::option::Option::Some("EXISTING_DATA_IN_REPLICA")
14971                }
14972                Self::MissingOptionalPrivileges => {
14973                    std::option::Option::Some("MISSING_OPTIONAL_PRIVILEGES")
14974                }
14975                Self::RiskyBackupAdminPrivilege => {
14976                    std::option::Option::Some("RISKY_BACKUP_ADMIN_PRIVILEGE")
14977                }
14978                Self::InsufficientGcsPermissions => {
14979                    std::option::Option::Some("INSUFFICIENT_GCS_PERMISSIONS")
14980                }
14981                Self::InvalidFileInfo => std::option::Option::Some("INVALID_FILE_INFO"),
14982                Self::UnsupportedDatabaseSettings => {
14983                    std::option::Option::Some("UNSUPPORTED_DATABASE_SETTINGS")
14984                }
14985                Self::MysqlParallelImportInsufficientPrivilege => {
14986                    std::option::Option::Some("MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
14987                }
14988                Self::LocalInfileOff => std::option::Option::Some("LOCAL_INFILE_OFF"),
14989                Self::TurnOnPitrAfterPromote => {
14990                    std::option::Option::Some("TURN_ON_PITR_AFTER_PROMOTE")
14991                }
14992                Self::IncompatibleDatabaseMinorVersion => {
14993                    std::option::Option::Some("INCOMPATIBLE_DATABASE_MINOR_VERSION")
14994                }
14995                Self::SourceMaxSubscriptions => {
14996                    std::option::Option::Some("SOURCE_MAX_SUBSCRIPTIONS")
14997                }
14998                Self::UnableToVerifyDefiners => {
14999                    std::option::Option::Some("UNABLE_TO_VERIFY_DEFINERS")
15000                }
15001                Self::SubscriptionCalculationStatus => {
15002                    std::option::Option::Some("SUBSCRIPTION_CALCULATION_STATUS")
15003                }
15004                Self::PgSubscriptionCount => std::option::Option::Some("PG_SUBSCRIPTION_COUNT"),
15005                Self::PgSyncParallelLevel => std::option::Option::Some("PG_SYNC_PARALLEL_LEVEL"),
15006                Self::InsufficientDiskSize => std::option::Option::Some("INSUFFICIENT_DISK_SIZE"),
15007                Self::InsufficientMachineTier => {
15008                    std::option::Option::Some("INSUFFICIENT_MACHINE_TIER")
15009                }
15010                Self::UnsupportedExtensionsNotMigrated => {
15011                    std::option::Option::Some("UNSUPPORTED_EXTENSIONS_NOT_MIGRATED")
15012                }
15013                Self::ExtensionsNotMigrated => std::option::Option::Some("EXTENSIONS_NOT_MIGRATED"),
15014                Self::PgCronFlagEnabledInReplica => {
15015                    std::option::Option::Some("PG_CRON_FLAG_ENABLED_IN_REPLICA")
15016                }
15017                Self::ExtensionsNotEnabledInReplica => {
15018                    std::option::Option::Some("EXTENSIONS_NOT_ENABLED_IN_REPLICA")
15019                }
15020                Self::UnsupportedColumns => std::option::Option::Some("UNSUPPORTED_COLUMNS"),
15021                Self::UsersNotCreatedInReplica => {
15022                    std::option::Option::Some("USERS_NOT_CREATED_IN_REPLICA")
15023                }
15024                Self::UnsupportedSystemObjects => {
15025                    std::option::Option::Some("UNSUPPORTED_SYSTEM_OBJECTS")
15026                }
15027                Self::UnsupportedTablesWithReplicaIdentity => {
15028                    std::option::Option::Some("UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY")
15029                }
15030                Self::SelectedObjectsNotExistOnSource => {
15031                    std::option::Option::Some("SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE")
15032                }
15033                Self::PscOnlyInstanceWithNoNetworkAttachmentUri => {
15034                    std::option::Option::Some("PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI")
15035                }
15036                Self::SelectedObjectsReferenceUnselectedObjects => {
15037                    std::option::Option::Some("SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS")
15038                }
15039                Self::PromptDeleteExisting => std::option::Option::Some("PROMPT_DELETE_EXISTING"),
15040                Self::WillDeleteExisting => std::option::Option::Some("WILL_DELETE_EXISTING"),
15041                Self::PgDdlReplicationInsufficientPrivilege => {
15042                    std::option::Option::Some("PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE")
15043                }
15044                Self::UnknownValue(u) => u.0.name(),
15045            }
15046        }
15047    }
15048
15049    impl std::default::Default for SqlExternalSyncSettingErrorType {
15050        fn default() -> Self {
15051            use std::convert::From;
15052            Self::from(0)
15053        }
15054    }
15055
15056    impl std::fmt::Display for SqlExternalSyncSettingErrorType {
15057        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15058            wkt::internal::display_enum(f, self.name(), self.value())
15059        }
15060    }
15061
15062    impl std::convert::From<i32> for SqlExternalSyncSettingErrorType {
15063        fn from(value: i32) -> Self {
15064            match value {
15065                0 => Self::Unspecified,
15066                1 => Self::ConnectionFailure,
15067                2 => Self::BinlogNotEnabled,
15068                3 => Self::IncompatibleDatabaseVersion,
15069                4 => Self::ReplicaAlreadySetup,
15070                5 => Self::InsufficientPrivilege,
15071                6 => Self::UnsupportedMigrationType,
15072                7 => Self::NoPglogicalInstalled,
15073                8 => Self::PglogicalNodeAlreadyExists,
15074                9 => Self::InvalidWalLevel,
15075                10 => Self::InvalidSharedPreloadLibrary,
15076                11 => Self::InsufficientMaxReplicationSlots,
15077                12 => Self::InsufficientMaxWalSenders,
15078                13 => Self::InsufficientMaxWorkerProcesses,
15079                14 => Self::UnsupportedExtensions,
15080                15 => Self::InvalidRdsLogicalReplication,
15081                16 => Self::InvalidLoggingSetup,
15082                17 => Self::InvalidDbParam,
15083                18 => Self::UnsupportedGtidMode,
15084                19 => Self::SqlserverAgentNotRunning,
15085                20 => Self::UnsupportedTableDefinition,
15086                21 => Self::UnsupportedDefiner,
15087                22 => Self::SqlserverServernameMismatch,
15088                23 => Self::PrimaryAlreadySetup,
15089                24 => Self::UnsupportedBinlogFormat,
15090                25 => Self::BinlogRetentionSetting,
15091                26 => Self::UnsupportedStorageEngine,
15092                27 => Self::LimitedSupportTables,
15093                28 => Self::ExistingDataInReplica,
15094                29 => Self::MissingOptionalPrivileges,
15095                30 => Self::RiskyBackupAdminPrivilege,
15096                31 => Self::InsufficientGcsPermissions,
15097                32 => Self::InvalidFileInfo,
15098                33 => Self::UnsupportedDatabaseSettings,
15099                34 => Self::MysqlParallelImportInsufficientPrivilege,
15100                35 => Self::LocalInfileOff,
15101                36 => Self::TurnOnPitrAfterPromote,
15102                37 => Self::IncompatibleDatabaseMinorVersion,
15103                38 => Self::SourceMaxSubscriptions,
15104                39 => Self::UnableToVerifyDefiners,
15105                40 => Self::SubscriptionCalculationStatus,
15106                41 => Self::PgSubscriptionCount,
15107                42 => Self::PgSyncParallelLevel,
15108                43 => Self::InsufficientDiskSize,
15109                44 => Self::InsufficientMachineTier,
15110                45 => Self::UnsupportedExtensionsNotMigrated,
15111                46 => Self::ExtensionsNotMigrated,
15112                47 => Self::PgCronFlagEnabledInReplica,
15113                48 => Self::ExtensionsNotEnabledInReplica,
15114                49 => Self::UnsupportedColumns,
15115                50 => Self::UsersNotCreatedInReplica,
15116                51 => Self::UnsupportedSystemObjects,
15117                52 => Self::UnsupportedTablesWithReplicaIdentity,
15118                53 => Self::SelectedObjectsNotExistOnSource,
15119                54 => Self::PscOnlyInstanceWithNoNetworkAttachmentUri,
15120                55 => Self::SelectedObjectsReferenceUnselectedObjects,
15121                56 => Self::PromptDeleteExisting,
15122                57 => Self::WillDeleteExisting,
15123                58 => Self::PgDdlReplicationInsufficientPrivilege,
15124                _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
15125                    wkt::internal::UnknownEnumValue::Integer(value),
15126                )),
15127            }
15128        }
15129    }
15130
15131    impl std::convert::From<&str> for SqlExternalSyncSettingErrorType {
15132        fn from(value: &str) -> Self {
15133            use std::string::ToString;
15134            match value {
15135                "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
15136                "CONNECTION_FAILURE" => Self::ConnectionFailure,
15137                "BINLOG_NOT_ENABLED" => Self::BinlogNotEnabled,
15138                "INCOMPATIBLE_DATABASE_VERSION" => Self::IncompatibleDatabaseVersion,
15139                "REPLICA_ALREADY_SETUP" => Self::ReplicaAlreadySetup,
15140                "INSUFFICIENT_PRIVILEGE" => Self::InsufficientPrivilege,
15141                "UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
15142                "NO_PGLOGICAL_INSTALLED" => Self::NoPglogicalInstalled,
15143                "PGLOGICAL_NODE_ALREADY_EXISTS" => Self::PglogicalNodeAlreadyExists,
15144                "INVALID_WAL_LEVEL" => Self::InvalidWalLevel,
15145                "INVALID_SHARED_PRELOAD_LIBRARY" => Self::InvalidSharedPreloadLibrary,
15146                "INSUFFICIENT_MAX_REPLICATION_SLOTS" => Self::InsufficientMaxReplicationSlots,
15147                "INSUFFICIENT_MAX_WAL_SENDERS" => Self::InsufficientMaxWalSenders,
15148                "INSUFFICIENT_MAX_WORKER_PROCESSES" => Self::InsufficientMaxWorkerProcesses,
15149                "UNSUPPORTED_EXTENSIONS" => Self::UnsupportedExtensions,
15150                "INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
15151                "INVALID_LOGGING_SETUP" => Self::InvalidLoggingSetup,
15152                "INVALID_DB_PARAM" => Self::InvalidDbParam,
15153                "UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
15154                "SQLSERVER_AGENT_NOT_RUNNING" => Self::SqlserverAgentNotRunning,
15155                "UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
15156                "UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
15157                "SQLSERVER_SERVERNAME_MISMATCH" => Self::SqlserverServernameMismatch,
15158                "PRIMARY_ALREADY_SETUP" => Self::PrimaryAlreadySetup,
15159                "UNSUPPORTED_BINLOG_FORMAT" => Self::UnsupportedBinlogFormat,
15160                "BINLOG_RETENTION_SETTING" => Self::BinlogRetentionSetting,
15161                "UNSUPPORTED_STORAGE_ENGINE" => Self::UnsupportedStorageEngine,
15162                "LIMITED_SUPPORT_TABLES" => Self::LimitedSupportTables,
15163                "EXISTING_DATA_IN_REPLICA" => Self::ExistingDataInReplica,
15164                "MISSING_OPTIONAL_PRIVILEGES" => Self::MissingOptionalPrivileges,
15165                "RISKY_BACKUP_ADMIN_PRIVILEGE" => Self::RiskyBackupAdminPrivilege,
15166                "INSUFFICIENT_GCS_PERMISSIONS" => Self::InsufficientGcsPermissions,
15167                "INVALID_FILE_INFO" => Self::InvalidFileInfo,
15168                "UNSUPPORTED_DATABASE_SETTINGS" => Self::UnsupportedDatabaseSettings,
15169                "MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
15170                    Self::MysqlParallelImportInsufficientPrivilege
15171                }
15172                "LOCAL_INFILE_OFF" => Self::LocalInfileOff,
15173                "TURN_ON_PITR_AFTER_PROMOTE" => Self::TurnOnPitrAfterPromote,
15174                "INCOMPATIBLE_DATABASE_MINOR_VERSION" => Self::IncompatibleDatabaseMinorVersion,
15175                "SOURCE_MAX_SUBSCRIPTIONS" => Self::SourceMaxSubscriptions,
15176                "UNABLE_TO_VERIFY_DEFINERS" => Self::UnableToVerifyDefiners,
15177                "SUBSCRIPTION_CALCULATION_STATUS" => Self::SubscriptionCalculationStatus,
15178                "PG_SUBSCRIPTION_COUNT" => Self::PgSubscriptionCount,
15179                "PG_SYNC_PARALLEL_LEVEL" => Self::PgSyncParallelLevel,
15180                "INSUFFICIENT_DISK_SIZE" => Self::InsufficientDiskSize,
15181                "INSUFFICIENT_MACHINE_TIER" => Self::InsufficientMachineTier,
15182                "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED" => Self::UnsupportedExtensionsNotMigrated,
15183                "EXTENSIONS_NOT_MIGRATED" => Self::ExtensionsNotMigrated,
15184                "PG_CRON_FLAG_ENABLED_IN_REPLICA" => Self::PgCronFlagEnabledInReplica,
15185                "EXTENSIONS_NOT_ENABLED_IN_REPLICA" => Self::ExtensionsNotEnabledInReplica,
15186                "UNSUPPORTED_COLUMNS" => Self::UnsupportedColumns,
15187                "USERS_NOT_CREATED_IN_REPLICA" => Self::UsersNotCreatedInReplica,
15188                "UNSUPPORTED_SYSTEM_OBJECTS" => Self::UnsupportedSystemObjects,
15189                "UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY" => {
15190                    Self::UnsupportedTablesWithReplicaIdentity
15191                }
15192                "SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE" => Self::SelectedObjectsNotExistOnSource,
15193                "PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI" => {
15194                    Self::PscOnlyInstanceWithNoNetworkAttachmentUri
15195                }
15196                "SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS" => {
15197                    Self::SelectedObjectsReferenceUnselectedObjects
15198                }
15199                "PROMPT_DELETE_EXISTING" => Self::PromptDeleteExisting,
15200                "WILL_DELETE_EXISTING" => Self::WillDeleteExisting,
15201                "PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE" => {
15202                    Self::PgDdlReplicationInsufficientPrivilege
15203                }
15204                _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
15205                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15206                )),
15207            }
15208        }
15209    }
15210
15211    impl serde::ser::Serialize for SqlExternalSyncSettingErrorType {
15212        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15213        where
15214            S: serde::Serializer,
15215        {
15216            match self {
15217                Self::Unspecified => serializer.serialize_i32(0),
15218                Self::ConnectionFailure => serializer.serialize_i32(1),
15219                Self::BinlogNotEnabled => serializer.serialize_i32(2),
15220                Self::IncompatibleDatabaseVersion => serializer.serialize_i32(3),
15221                Self::ReplicaAlreadySetup => serializer.serialize_i32(4),
15222                Self::InsufficientPrivilege => serializer.serialize_i32(5),
15223                Self::UnsupportedMigrationType => serializer.serialize_i32(6),
15224                Self::NoPglogicalInstalled => serializer.serialize_i32(7),
15225                Self::PglogicalNodeAlreadyExists => serializer.serialize_i32(8),
15226                Self::InvalidWalLevel => serializer.serialize_i32(9),
15227                Self::InvalidSharedPreloadLibrary => serializer.serialize_i32(10),
15228                Self::InsufficientMaxReplicationSlots => serializer.serialize_i32(11),
15229                Self::InsufficientMaxWalSenders => serializer.serialize_i32(12),
15230                Self::InsufficientMaxWorkerProcesses => serializer.serialize_i32(13),
15231                Self::UnsupportedExtensions => serializer.serialize_i32(14),
15232                Self::InvalidRdsLogicalReplication => serializer.serialize_i32(15),
15233                Self::InvalidLoggingSetup => serializer.serialize_i32(16),
15234                Self::InvalidDbParam => serializer.serialize_i32(17),
15235                Self::UnsupportedGtidMode => serializer.serialize_i32(18),
15236                Self::SqlserverAgentNotRunning => serializer.serialize_i32(19),
15237                Self::UnsupportedTableDefinition => serializer.serialize_i32(20),
15238                Self::UnsupportedDefiner => serializer.serialize_i32(21),
15239                Self::SqlserverServernameMismatch => serializer.serialize_i32(22),
15240                Self::PrimaryAlreadySetup => serializer.serialize_i32(23),
15241                Self::UnsupportedBinlogFormat => serializer.serialize_i32(24),
15242                Self::BinlogRetentionSetting => serializer.serialize_i32(25),
15243                Self::UnsupportedStorageEngine => serializer.serialize_i32(26),
15244                Self::LimitedSupportTables => serializer.serialize_i32(27),
15245                Self::ExistingDataInReplica => serializer.serialize_i32(28),
15246                Self::MissingOptionalPrivileges => serializer.serialize_i32(29),
15247                Self::RiskyBackupAdminPrivilege => serializer.serialize_i32(30),
15248                Self::InsufficientGcsPermissions => serializer.serialize_i32(31),
15249                Self::InvalidFileInfo => serializer.serialize_i32(32),
15250                Self::UnsupportedDatabaseSettings => serializer.serialize_i32(33),
15251                Self::MysqlParallelImportInsufficientPrivilege => serializer.serialize_i32(34),
15252                Self::LocalInfileOff => serializer.serialize_i32(35),
15253                Self::TurnOnPitrAfterPromote => serializer.serialize_i32(36),
15254                Self::IncompatibleDatabaseMinorVersion => serializer.serialize_i32(37),
15255                Self::SourceMaxSubscriptions => serializer.serialize_i32(38),
15256                Self::UnableToVerifyDefiners => serializer.serialize_i32(39),
15257                Self::SubscriptionCalculationStatus => serializer.serialize_i32(40),
15258                Self::PgSubscriptionCount => serializer.serialize_i32(41),
15259                Self::PgSyncParallelLevel => serializer.serialize_i32(42),
15260                Self::InsufficientDiskSize => serializer.serialize_i32(43),
15261                Self::InsufficientMachineTier => serializer.serialize_i32(44),
15262                Self::UnsupportedExtensionsNotMigrated => serializer.serialize_i32(45),
15263                Self::ExtensionsNotMigrated => serializer.serialize_i32(46),
15264                Self::PgCronFlagEnabledInReplica => serializer.serialize_i32(47),
15265                Self::ExtensionsNotEnabledInReplica => serializer.serialize_i32(48),
15266                Self::UnsupportedColumns => serializer.serialize_i32(49),
15267                Self::UsersNotCreatedInReplica => serializer.serialize_i32(50),
15268                Self::UnsupportedSystemObjects => serializer.serialize_i32(51),
15269                Self::UnsupportedTablesWithReplicaIdentity => serializer.serialize_i32(52),
15270                Self::SelectedObjectsNotExistOnSource => serializer.serialize_i32(53),
15271                Self::PscOnlyInstanceWithNoNetworkAttachmentUri => serializer.serialize_i32(54),
15272                Self::SelectedObjectsReferenceUnselectedObjects => serializer.serialize_i32(55),
15273                Self::PromptDeleteExisting => serializer.serialize_i32(56),
15274                Self::WillDeleteExisting => serializer.serialize_i32(57),
15275                Self::PgDdlReplicationInsufficientPrivilege => serializer.serialize_i32(58),
15276                Self::UnknownValue(u) => u.0.serialize(serializer),
15277            }
15278        }
15279    }
15280
15281    impl<'de> serde::de::Deserialize<'de> for SqlExternalSyncSettingErrorType {
15282        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15283        where
15284            D: serde::Deserializer<'de>,
15285        {
15286            deserializer.deserialize_any(wkt::internal::EnumVisitor::<
15287                SqlExternalSyncSettingErrorType,
15288            >::new(
15289                ".google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType",
15290            ))
15291        }
15292    }
15293}
15294
15295/// A list of objects that the user selects for replication from an external
15296/// source instance.
15297#[derive(Clone, Default, PartialEq)]
15298#[non_exhaustive]
15299pub struct SelectedObjects {
15300    /// Required. The name of the database to migrate.
15301    pub database: std::string::String,
15302
15303    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15304}
15305
15306impl SelectedObjects {
15307    /// Creates a new default instance.
15308    pub fn new() -> Self {
15309        std::default::Default::default()
15310    }
15311
15312    /// Sets the value of [database][crate::model::SelectedObjects::database].
15313    ///
15314    /// # Example
15315    /// ```ignore,no_run
15316    /// # use google_cloud_sql_v1::model::SelectedObjects;
15317    /// let x = SelectedObjects::new().set_database("example");
15318    /// ```
15319    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15320        self.database = v.into();
15321        self
15322    }
15323}
15324
15325impl wkt::message::Message for SelectedObjects {
15326    fn typename() -> &'static str {
15327        "type.googleapis.com/google.cloud.sql.v1.SelectedObjects"
15328    }
15329}
15330
15331/// On-premises instance configuration.
15332#[derive(Clone, Default, PartialEq)]
15333#[non_exhaustive]
15334pub struct OnPremisesConfiguration {
15335    /// The host and port of the on-premises instance in host:port format
15336    pub host_port: std::string::String,
15337
15338    /// This is always `sql#onPremisesConfiguration`.
15339    pub kind: std::string::String,
15340
15341    /// The username for connecting to on-premises instance.
15342    pub username: std::string::String,
15343
15344    /// The password for connecting to on-premises instance.
15345    pub password: std::string::String,
15346
15347    /// PEM representation of the trusted CA's x509 certificate.
15348    pub ca_certificate: std::string::String,
15349
15350    /// PEM representation of the replica's x509 certificate.
15351    pub client_certificate: std::string::String,
15352
15353    /// PEM representation of the replica's private key. The corresponding public
15354    /// key is encoded in the client's certificate.
15355    pub client_key: std::string::String,
15356
15357    /// The dump file to create the Cloud SQL replica.
15358    pub dump_file_path: std::string::String,
15359
15360    /// The reference to Cloud SQL instance if the source is Cloud SQL.
15361    pub source_instance: std::option::Option<crate::model::InstanceReference>,
15362
15363    /// Optional. A list of objects that the user selects for replication from an
15364    /// external source instance.
15365    pub selected_objects: std::vec::Vec<crate::model::SelectedObjects>,
15366
15367    /// Optional. SSL option for replica connection to the on-premises source.
15368    pub ssl_option: crate::model::on_premises_configuration::SslOption,
15369
15370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15371}
15372
15373impl OnPremisesConfiguration {
15374    /// Creates a new default instance.
15375    pub fn new() -> Self {
15376        std::default::Default::default()
15377    }
15378
15379    /// Sets the value of [host_port][crate::model::OnPremisesConfiguration::host_port].
15380    ///
15381    /// # Example
15382    /// ```ignore,no_run
15383    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15384    /// let x = OnPremisesConfiguration::new().set_host_port("example");
15385    /// ```
15386    pub fn set_host_port<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15387        self.host_port = v.into();
15388        self
15389    }
15390
15391    /// Sets the value of [kind][crate::model::OnPremisesConfiguration::kind].
15392    ///
15393    /// # Example
15394    /// ```ignore,no_run
15395    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15396    /// let x = OnPremisesConfiguration::new().set_kind("example");
15397    /// ```
15398    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15399        self.kind = v.into();
15400        self
15401    }
15402
15403    /// Sets the value of [username][crate::model::OnPremisesConfiguration::username].
15404    ///
15405    /// # Example
15406    /// ```ignore,no_run
15407    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15408    /// let x = OnPremisesConfiguration::new().set_username("example");
15409    /// ```
15410    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15411        self.username = v.into();
15412        self
15413    }
15414
15415    /// Sets the value of [password][crate::model::OnPremisesConfiguration::password].
15416    ///
15417    /// # Example
15418    /// ```ignore,no_run
15419    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15420    /// let x = OnPremisesConfiguration::new().set_password("example");
15421    /// ```
15422    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15423        self.password = v.into();
15424        self
15425    }
15426
15427    /// Sets the value of [ca_certificate][crate::model::OnPremisesConfiguration::ca_certificate].
15428    ///
15429    /// # Example
15430    /// ```ignore,no_run
15431    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15432    /// let x = OnPremisesConfiguration::new().set_ca_certificate("example");
15433    /// ```
15434    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15435        self.ca_certificate = v.into();
15436        self
15437    }
15438
15439    /// Sets the value of [client_certificate][crate::model::OnPremisesConfiguration::client_certificate].
15440    ///
15441    /// # Example
15442    /// ```ignore,no_run
15443    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15444    /// let x = OnPremisesConfiguration::new().set_client_certificate("example");
15445    /// ```
15446    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
15447        mut self,
15448        v: T,
15449    ) -> Self {
15450        self.client_certificate = v.into();
15451        self
15452    }
15453
15454    /// Sets the value of [client_key][crate::model::OnPremisesConfiguration::client_key].
15455    ///
15456    /// # Example
15457    /// ```ignore,no_run
15458    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15459    /// let x = OnPremisesConfiguration::new().set_client_key("example");
15460    /// ```
15461    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15462        self.client_key = v.into();
15463        self
15464    }
15465
15466    /// Sets the value of [dump_file_path][crate::model::OnPremisesConfiguration::dump_file_path].
15467    ///
15468    /// # Example
15469    /// ```ignore,no_run
15470    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15471    /// let x = OnPremisesConfiguration::new().set_dump_file_path("example");
15472    /// ```
15473    pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15474        self.dump_file_path = v.into();
15475        self
15476    }
15477
15478    /// Sets the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
15479    ///
15480    /// # Example
15481    /// ```ignore,no_run
15482    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15483    /// use google_cloud_sql_v1::model::InstanceReference;
15484    /// let x = OnPremisesConfiguration::new().set_source_instance(InstanceReference::default()/* use setters */);
15485    /// ```
15486    pub fn set_source_instance<T>(mut self, v: T) -> Self
15487    where
15488        T: std::convert::Into<crate::model::InstanceReference>,
15489    {
15490        self.source_instance = std::option::Option::Some(v.into());
15491        self
15492    }
15493
15494    /// Sets or clears the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
15495    ///
15496    /// # Example
15497    /// ```ignore,no_run
15498    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15499    /// use google_cloud_sql_v1::model::InstanceReference;
15500    /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(Some(InstanceReference::default()/* use setters */));
15501    /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(None::<InstanceReference>);
15502    /// ```
15503    pub fn set_or_clear_source_instance<T>(mut self, v: std::option::Option<T>) -> Self
15504    where
15505        T: std::convert::Into<crate::model::InstanceReference>,
15506    {
15507        self.source_instance = v.map(|x| x.into());
15508        self
15509    }
15510
15511    /// Sets the value of [selected_objects][crate::model::OnPremisesConfiguration::selected_objects].
15512    ///
15513    /// # Example
15514    /// ```ignore,no_run
15515    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15516    /// use google_cloud_sql_v1::model::SelectedObjects;
15517    /// let x = OnPremisesConfiguration::new()
15518    ///     .set_selected_objects([
15519    ///         SelectedObjects::default()/* use setters */,
15520    ///         SelectedObjects::default()/* use (different) setters */,
15521    ///     ]);
15522    /// ```
15523    pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
15524    where
15525        T: std::iter::IntoIterator<Item = V>,
15526        V: std::convert::Into<crate::model::SelectedObjects>,
15527    {
15528        use std::iter::Iterator;
15529        self.selected_objects = v.into_iter().map(|i| i.into()).collect();
15530        self
15531    }
15532
15533    /// Sets the value of [ssl_option][crate::model::OnPremisesConfiguration::ssl_option].
15534    ///
15535    /// # Example
15536    /// ```ignore,no_run
15537    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15538    /// use google_cloud_sql_v1::model::on_premises_configuration::SslOption;
15539    /// let x0 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Disable);
15540    /// let x1 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Require);
15541    /// let x2 = OnPremisesConfiguration::new().set_ssl_option(SslOption::VerifyCa);
15542    /// ```
15543    pub fn set_ssl_option<
15544        T: std::convert::Into<crate::model::on_premises_configuration::SslOption>,
15545    >(
15546        mut self,
15547        v: T,
15548    ) -> Self {
15549        self.ssl_option = v.into();
15550        self
15551    }
15552}
15553
15554impl wkt::message::Message for OnPremisesConfiguration {
15555    fn typename() -> &'static str {
15556        "type.googleapis.com/google.cloud.sql.v1.OnPremisesConfiguration"
15557    }
15558}
15559
15560/// Defines additional types related to [OnPremisesConfiguration].
15561pub mod on_premises_configuration {
15562    #[allow(unused_imports)]
15563    use super::*;
15564
15565    /// SslOption defines the SSL mode to be used for replica connection to the
15566    /// on-premises source.
15567    ///
15568    /// # Working with unknown values
15569    ///
15570    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15571    /// additional enum variants at any time. Adding new variants is not considered
15572    /// a breaking change. Applications should write their code in anticipation of:
15573    ///
15574    /// - New values appearing in future releases of the client library, **and**
15575    /// - New values received dynamically, without application changes.
15576    ///
15577    /// Please consult the [Working with enums] section in the user guide for some
15578    /// guidelines.
15579    ///
15580    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15581    #[derive(Clone, Debug, PartialEq)]
15582    #[non_exhaustive]
15583    pub enum SslOption {
15584        /// Unknown SSL option i.e. SSL option not specified by user.
15585        Unspecified,
15586        /// SSL is not used for replica connection to the on-premises source.
15587        Disable,
15588        /// SSL is required for replica connection to the on-premises source.
15589        Require,
15590        /// Verify CA is required for replica connection to the on-premises source.
15591        VerifyCa,
15592        /// If set, the enum was initialized with an unknown value.
15593        ///
15594        /// Applications can examine the value using [SslOption::value] or
15595        /// [SslOption::name].
15596        UnknownValue(ssl_option::UnknownValue),
15597    }
15598
15599    #[doc(hidden)]
15600    pub mod ssl_option {
15601        #[allow(unused_imports)]
15602        use super::*;
15603        #[derive(Clone, Debug, PartialEq)]
15604        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15605    }
15606
15607    impl SslOption {
15608        /// Gets the enum value.
15609        ///
15610        /// Returns `None` if the enum contains an unknown value deserialized from
15611        /// the string representation of enums.
15612        pub fn value(&self) -> std::option::Option<i32> {
15613            match self {
15614                Self::Unspecified => std::option::Option::Some(0),
15615                Self::Disable => std::option::Option::Some(1),
15616                Self::Require => std::option::Option::Some(2),
15617                Self::VerifyCa => std::option::Option::Some(3),
15618                Self::UnknownValue(u) => u.0.value(),
15619            }
15620        }
15621
15622        /// Gets the enum value as a string.
15623        ///
15624        /// Returns `None` if the enum contains an unknown value deserialized from
15625        /// the integer representation of enums.
15626        pub fn name(&self) -> std::option::Option<&str> {
15627            match self {
15628                Self::Unspecified => std::option::Option::Some("SSL_OPTION_UNSPECIFIED"),
15629                Self::Disable => std::option::Option::Some("DISABLE"),
15630                Self::Require => std::option::Option::Some("REQUIRE"),
15631                Self::VerifyCa => std::option::Option::Some("VERIFY_CA"),
15632                Self::UnknownValue(u) => u.0.name(),
15633            }
15634        }
15635    }
15636
15637    impl std::default::Default for SslOption {
15638        fn default() -> Self {
15639            use std::convert::From;
15640            Self::from(0)
15641        }
15642    }
15643
15644    impl std::fmt::Display for SslOption {
15645        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15646            wkt::internal::display_enum(f, self.name(), self.value())
15647        }
15648    }
15649
15650    impl std::convert::From<i32> for SslOption {
15651        fn from(value: i32) -> Self {
15652            match value {
15653                0 => Self::Unspecified,
15654                1 => Self::Disable,
15655                2 => Self::Require,
15656                3 => Self::VerifyCa,
15657                _ => Self::UnknownValue(ssl_option::UnknownValue(
15658                    wkt::internal::UnknownEnumValue::Integer(value),
15659                )),
15660            }
15661        }
15662    }
15663
15664    impl std::convert::From<&str> for SslOption {
15665        fn from(value: &str) -> Self {
15666            use std::string::ToString;
15667            match value {
15668                "SSL_OPTION_UNSPECIFIED" => Self::Unspecified,
15669                "DISABLE" => Self::Disable,
15670                "REQUIRE" => Self::Require,
15671                "VERIFY_CA" => Self::VerifyCa,
15672                _ => Self::UnknownValue(ssl_option::UnknownValue(
15673                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15674                )),
15675            }
15676        }
15677    }
15678
15679    impl serde::ser::Serialize for SslOption {
15680        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15681        where
15682            S: serde::Serializer,
15683        {
15684            match self {
15685                Self::Unspecified => serializer.serialize_i32(0),
15686                Self::Disable => serializer.serialize_i32(1),
15687                Self::Require => serializer.serialize_i32(2),
15688                Self::VerifyCa => serializer.serialize_i32(3),
15689                Self::UnknownValue(u) => u.0.serialize(serializer),
15690            }
15691        }
15692    }
15693
15694    impl<'de> serde::de::Deserialize<'de> for SslOption {
15695        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15696        where
15697            D: serde::Deserializer<'de>,
15698        {
15699            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslOption>::new(
15700                ".google.cloud.sql.v1.OnPremisesConfiguration.SslOption",
15701            ))
15702        }
15703    }
15704}
15705
15706/// Read-replica configuration for connecting to the primary instance.
15707#[derive(Clone, Default, PartialEq)]
15708#[non_exhaustive]
15709pub struct ReplicaConfiguration {
15710    /// This is always `sql#replicaConfiguration`.
15711    pub kind: std::string::String,
15712
15713    /// MySQL specific configuration when replicating from a MySQL on-premises
15714    /// primary instance. Replication configuration information such as the
15715    /// username, password, certificates, and keys are not stored in the instance
15716    /// metadata. The configuration information is used only to set up the
15717    /// replication connection and is stored by MySQL in a file named
15718    /// `master.info` in the data directory.
15719    pub mysql_replica_configuration: std::option::Option<crate::model::MySqlReplicaConfiguration>,
15720
15721    /// Specifies if the replica is the failover target. If the field is set to
15722    /// `true`, the replica will be designated as a failover replica. In case the
15723    /// primary instance fails, the replica instance will be promoted as the new
15724    /// primary instance. Only one replica can be specified as failover target, and
15725    /// the replica has to be in different zone with the primary instance.
15726    pub failover_target: std::option::Option<wkt::BoolValue>,
15727
15728    /// Optional. Specifies if a SQL Server replica is a cascadable replica. A
15729    /// cascadable replica is a SQL Server cross region replica that supports
15730    /// replica(s) under it.
15731    pub cascadable_replica: std::option::Option<wkt::BoolValue>,
15732
15733    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15734}
15735
15736impl ReplicaConfiguration {
15737    /// Creates a new default instance.
15738    pub fn new() -> Self {
15739        std::default::Default::default()
15740    }
15741
15742    /// Sets the value of [kind][crate::model::ReplicaConfiguration::kind].
15743    ///
15744    /// # Example
15745    /// ```ignore,no_run
15746    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15747    /// let x = ReplicaConfiguration::new().set_kind("example");
15748    /// ```
15749    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15750        self.kind = v.into();
15751        self
15752    }
15753
15754    /// Sets the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
15755    ///
15756    /// # Example
15757    /// ```ignore,no_run
15758    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15759    /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
15760    /// let x = ReplicaConfiguration::new().set_mysql_replica_configuration(MySqlReplicaConfiguration::default()/* use setters */);
15761    /// ```
15762    pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
15763    where
15764        T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
15765    {
15766        self.mysql_replica_configuration = std::option::Option::Some(v.into());
15767        self
15768    }
15769
15770    /// Sets or clears the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
15771    ///
15772    /// # Example
15773    /// ```ignore,no_run
15774    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15775    /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
15776    /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(Some(MySqlReplicaConfiguration::default()/* use setters */));
15777    /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(None::<MySqlReplicaConfiguration>);
15778    /// ```
15779    pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
15780    where
15781        T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
15782    {
15783        self.mysql_replica_configuration = v.map(|x| x.into());
15784        self
15785    }
15786
15787    /// Sets the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
15788    ///
15789    /// # Example
15790    /// ```ignore,no_run
15791    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15792    /// use wkt::BoolValue;
15793    /// let x = ReplicaConfiguration::new().set_failover_target(BoolValue::default()/* use setters */);
15794    /// ```
15795    pub fn set_failover_target<T>(mut self, v: T) -> Self
15796    where
15797        T: std::convert::Into<wkt::BoolValue>,
15798    {
15799        self.failover_target = std::option::Option::Some(v.into());
15800        self
15801    }
15802
15803    /// Sets or clears the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
15804    ///
15805    /// # Example
15806    /// ```ignore,no_run
15807    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15808    /// use wkt::BoolValue;
15809    /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(Some(BoolValue::default()/* use setters */));
15810    /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(None::<BoolValue>);
15811    /// ```
15812    pub fn set_or_clear_failover_target<T>(mut self, v: std::option::Option<T>) -> Self
15813    where
15814        T: std::convert::Into<wkt::BoolValue>,
15815    {
15816        self.failover_target = v.map(|x| x.into());
15817        self
15818    }
15819
15820    /// Sets the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
15821    ///
15822    /// # Example
15823    /// ```ignore,no_run
15824    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15825    /// use wkt::BoolValue;
15826    /// let x = ReplicaConfiguration::new().set_cascadable_replica(BoolValue::default()/* use setters */);
15827    /// ```
15828    pub fn set_cascadable_replica<T>(mut self, v: T) -> Self
15829    where
15830        T: std::convert::Into<wkt::BoolValue>,
15831    {
15832        self.cascadable_replica = std::option::Option::Some(v.into());
15833        self
15834    }
15835
15836    /// Sets or clears the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
15837    ///
15838    /// # Example
15839    /// ```ignore,no_run
15840    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15841    /// use wkt::BoolValue;
15842    /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(Some(BoolValue::default()/* use setters */));
15843    /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(None::<BoolValue>);
15844    /// ```
15845    pub fn set_or_clear_cascadable_replica<T>(mut self, v: std::option::Option<T>) -> Self
15846    where
15847        T: std::convert::Into<wkt::BoolValue>,
15848    {
15849        self.cascadable_replica = v.map(|x| x.into());
15850        self
15851    }
15852}
15853
15854impl wkt::message::Message for ReplicaConfiguration {
15855    fn typename() -> &'static str {
15856        "type.googleapis.com/google.cloud.sql.v1.ReplicaConfiguration"
15857    }
15858}
15859
15860/// Execute SQL statements request.
15861#[derive(Clone, Default, PartialEq)]
15862#[non_exhaustive]
15863pub struct SqlInstancesExecuteSqlRequest {
15864    /// Required. Database instance ID. This does not include the project ID.
15865    pub instance: std::string::String,
15866
15867    /// Required. Project ID of the project that contains the instance.
15868    pub project: std::string::String,
15869
15870    /// The request body.
15871    pub body: std::option::Option<crate::model::ExecuteSqlPayload>,
15872
15873    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15874}
15875
15876impl SqlInstancesExecuteSqlRequest {
15877    /// Creates a new default instance.
15878    pub fn new() -> Self {
15879        std::default::Default::default()
15880    }
15881
15882    /// Sets the value of [instance][crate::model::SqlInstancesExecuteSqlRequest::instance].
15883    ///
15884    /// # Example
15885    /// ```ignore,no_run
15886    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15887    /// let x = SqlInstancesExecuteSqlRequest::new().set_instance("example");
15888    /// ```
15889    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15890        self.instance = v.into();
15891        self
15892    }
15893
15894    /// Sets the value of [project][crate::model::SqlInstancesExecuteSqlRequest::project].
15895    ///
15896    /// # Example
15897    /// ```ignore,no_run
15898    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15899    /// let x = SqlInstancesExecuteSqlRequest::new().set_project("example");
15900    /// ```
15901    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15902        self.project = v.into();
15903        self
15904    }
15905
15906    /// Sets the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
15907    ///
15908    /// # Example
15909    /// ```ignore,no_run
15910    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15911    /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
15912    /// let x = SqlInstancesExecuteSqlRequest::new().set_body(ExecuteSqlPayload::default()/* use setters */);
15913    /// ```
15914    pub fn set_body<T>(mut self, v: T) -> Self
15915    where
15916        T: std::convert::Into<crate::model::ExecuteSqlPayload>,
15917    {
15918        self.body = std::option::Option::Some(v.into());
15919        self
15920    }
15921
15922    /// Sets or clears the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
15923    ///
15924    /// # Example
15925    /// ```ignore,no_run
15926    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15927    /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
15928    /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(Some(ExecuteSqlPayload::default()/* use setters */));
15929    /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(None::<ExecuteSqlPayload>);
15930    /// ```
15931    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15932    where
15933        T: std::convert::Into<crate::model::ExecuteSqlPayload>,
15934    {
15935        self.body = v.map(|x| x.into());
15936        self
15937    }
15938}
15939
15940impl wkt::message::Message for SqlInstancesExecuteSqlRequest {
15941    fn typename() -> &'static str {
15942        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlRequest"
15943    }
15944}
15945
15946/// The request payload used to execute SQL statements.
15947#[derive(Clone, Default, PartialEq)]
15948#[non_exhaustive]
15949pub struct ExecuteSqlPayload {
15950    /// Optional. The name of an existing database user to connect to the database.
15951    /// When `auto_iam_authn` is set to true, this field is ignored and the API
15952    /// caller's IAM user is used.
15953    pub user: std::string::String,
15954
15955    /// Required. SQL statements to run on the database. It can be a single
15956    /// statement or a sequence of statements separated by semicolons.
15957    pub sql_statement: std::string::String,
15958
15959    /// Optional. Name of the database on which the statement will be executed.
15960    pub database: std::string::String,
15961
15962    /// Optional. The maximum number of rows returned per SQL statement.
15963    pub row_limit: i64,
15964
15965    /// Optional. Controls how the API should respond when the SQL execution result
15966    /// is incomplete due to the size limit or another error. The default mode is
15967    /// to throw an error.
15968    pub partial_result_mode: crate::model::execute_sql_payload::PartialResultMode,
15969
15970    /// Optional. Specifies the name of the application that is making the request.
15971    /// This field is used for telemetry. Only alphanumeric characters, dashes, and
15972    /// underscores are allowed. The maximum length is 32 characters.
15973    pub application: std::string::String,
15974
15975    /// Credentials for the database connection.
15976    pub user_password: std::option::Option<crate::model::execute_sql_payload::UserPassword>,
15977
15978    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15979}
15980
15981impl ExecuteSqlPayload {
15982    /// Creates a new default instance.
15983    pub fn new() -> Self {
15984        std::default::Default::default()
15985    }
15986
15987    /// Sets the value of [user][crate::model::ExecuteSqlPayload::user].
15988    ///
15989    /// # Example
15990    /// ```ignore,no_run
15991    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15992    /// let x = ExecuteSqlPayload::new().set_user("example");
15993    /// ```
15994    pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15995        self.user = v.into();
15996        self
15997    }
15998
15999    /// Sets the value of [sql_statement][crate::model::ExecuteSqlPayload::sql_statement].
16000    ///
16001    /// # Example
16002    /// ```ignore,no_run
16003    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16004    /// let x = ExecuteSqlPayload::new().set_sql_statement("example");
16005    /// ```
16006    pub fn set_sql_statement<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16007        self.sql_statement = v.into();
16008        self
16009    }
16010
16011    /// Sets the value of [database][crate::model::ExecuteSqlPayload::database].
16012    ///
16013    /// # Example
16014    /// ```ignore,no_run
16015    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16016    /// let x = ExecuteSqlPayload::new().set_database("example");
16017    /// ```
16018    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16019        self.database = v.into();
16020        self
16021    }
16022
16023    /// Sets the value of [row_limit][crate::model::ExecuteSqlPayload::row_limit].
16024    ///
16025    /// # Example
16026    /// ```ignore,no_run
16027    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16028    /// let x = ExecuteSqlPayload::new().set_row_limit(42);
16029    /// ```
16030    pub fn set_row_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
16031        self.row_limit = v.into();
16032        self
16033    }
16034
16035    /// Sets the value of [partial_result_mode][crate::model::ExecuteSqlPayload::partial_result_mode].
16036    ///
16037    /// # Example
16038    /// ```ignore,no_run
16039    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16040    /// use google_cloud_sql_v1::model::execute_sql_payload::PartialResultMode;
16041    /// let x0 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::FailPartialResult);
16042    /// let x1 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::AllowPartialResult);
16043    /// ```
16044    pub fn set_partial_result_mode<
16045        T: std::convert::Into<crate::model::execute_sql_payload::PartialResultMode>,
16046    >(
16047        mut self,
16048        v: T,
16049    ) -> Self {
16050        self.partial_result_mode = v.into();
16051        self
16052    }
16053
16054    /// Sets the value of [application][crate::model::ExecuteSqlPayload::application].
16055    ///
16056    /// # Example
16057    /// ```ignore,no_run
16058    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16059    /// let x = ExecuteSqlPayload::new().set_application("example");
16060    /// ```
16061    pub fn set_application<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16062        self.application = v.into();
16063        self
16064    }
16065
16066    /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password].
16067    ///
16068    /// Note that all the setters affecting `user_password` are mutually
16069    /// exclusive.
16070    ///
16071    /// # Example
16072    /// ```ignore,no_run
16073    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16074    /// use google_cloud_sql_v1::model::execute_sql_payload::UserPassword;
16075    /// let x = ExecuteSqlPayload::new().set_user_password(Some(UserPassword::AutoIamAuthn(true)));
16076    /// ```
16077    pub fn set_user_password<
16078        T: std::convert::Into<std::option::Option<crate::model::execute_sql_payload::UserPassword>>,
16079    >(
16080        mut self,
16081        v: T,
16082    ) -> Self {
16083        self.user_password = v.into();
16084        self
16085    }
16086
16087    /// The value of [user_password][crate::model::ExecuteSqlPayload::user_password]
16088    /// if it holds a `AutoIamAuthn`, `None` if the field is not set or
16089    /// holds a different branch.
16090    pub fn auto_iam_authn(&self) -> std::option::Option<&bool> {
16091        #[allow(unreachable_patterns)]
16092        self.user_password.as_ref().and_then(|v| match v {
16093            crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v) => {
16094                std::option::Option::Some(v)
16095            }
16096            _ => std::option::Option::None,
16097        })
16098    }
16099
16100    /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password]
16101    /// to hold a `AutoIamAuthn`.
16102    ///
16103    /// Note that all the setters affecting `user_password` are
16104    /// mutually exclusive.
16105    ///
16106    /// # Example
16107    /// ```ignore,no_run
16108    /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16109    /// let x = ExecuteSqlPayload::new().set_auto_iam_authn(true);
16110    /// assert!(x.auto_iam_authn().is_some());
16111    /// ```
16112    pub fn set_auto_iam_authn<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16113        self.user_password = std::option::Option::Some(
16114            crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v.into()),
16115        );
16116        self
16117    }
16118}
16119
16120impl wkt::message::Message for ExecuteSqlPayload {
16121    fn typename() -> &'static str {
16122        "type.googleapis.com/google.cloud.sql.v1.ExecuteSqlPayload"
16123    }
16124}
16125
16126/// Defines additional types related to [ExecuteSqlPayload].
16127pub mod execute_sql_payload {
16128    #[allow(unused_imports)]
16129    use super::*;
16130
16131    /// Controls how the API should respond when the SQL execution result exceeds
16132    /// 10 MB.
16133    ///
16134    /// # Working with unknown values
16135    ///
16136    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16137    /// additional enum variants at any time. Adding new variants is not considered
16138    /// a breaking change. Applications should write their code in anticipation of:
16139    ///
16140    /// - New values appearing in future releases of the client library, **and**
16141    /// - New values received dynamically, without application changes.
16142    ///
16143    /// Please consult the [Working with enums] section in the user guide for some
16144    /// guidelines.
16145    ///
16146    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16147    #[derive(Clone, Debug, PartialEq)]
16148    #[non_exhaustive]
16149    pub enum PartialResultMode {
16150        /// Unspecified mode, effectively the same as `FAIL_PARTIAL_RESULT`.
16151        Unspecified,
16152        /// Throw an error if the result exceeds 10 MB or if only a partial result
16153        /// can be retrieved. Don't return the result.
16154        FailPartialResult,
16155        /// Return a truncated result and set `partial_result` to true if the result
16156        /// exceeds 10 MB or if only a partial result can be retrieved due to error.
16157        /// Don't throw an error.
16158        AllowPartialResult,
16159        /// If set, the enum was initialized with an unknown value.
16160        ///
16161        /// Applications can examine the value using [PartialResultMode::value] or
16162        /// [PartialResultMode::name].
16163        UnknownValue(partial_result_mode::UnknownValue),
16164    }
16165
16166    #[doc(hidden)]
16167    pub mod partial_result_mode {
16168        #[allow(unused_imports)]
16169        use super::*;
16170        #[derive(Clone, Debug, PartialEq)]
16171        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16172    }
16173
16174    impl PartialResultMode {
16175        /// Gets the enum value.
16176        ///
16177        /// Returns `None` if the enum contains an unknown value deserialized from
16178        /// the string representation of enums.
16179        pub fn value(&self) -> std::option::Option<i32> {
16180            match self {
16181                Self::Unspecified => std::option::Option::Some(0),
16182                Self::FailPartialResult => std::option::Option::Some(1),
16183                Self::AllowPartialResult => std::option::Option::Some(2),
16184                Self::UnknownValue(u) => u.0.value(),
16185            }
16186        }
16187
16188        /// Gets the enum value as a string.
16189        ///
16190        /// Returns `None` if the enum contains an unknown value deserialized from
16191        /// the integer representation of enums.
16192        pub fn name(&self) -> std::option::Option<&str> {
16193            match self {
16194                Self::Unspecified => std::option::Option::Some("PARTIAL_RESULT_MODE_UNSPECIFIED"),
16195                Self::FailPartialResult => std::option::Option::Some("FAIL_PARTIAL_RESULT"),
16196                Self::AllowPartialResult => std::option::Option::Some("ALLOW_PARTIAL_RESULT"),
16197                Self::UnknownValue(u) => u.0.name(),
16198            }
16199        }
16200    }
16201
16202    impl std::default::Default for PartialResultMode {
16203        fn default() -> Self {
16204            use std::convert::From;
16205            Self::from(0)
16206        }
16207    }
16208
16209    impl std::fmt::Display for PartialResultMode {
16210        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16211            wkt::internal::display_enum(f, self.name(), self.value())
16212        }
16213    }
16214
16215    impl std::convert::From<i32> for PartialResultMode {
16216        fn from(value: i32) -> Self {
16217            match value {
16218                0 => Self::Unspecified,
16219                1 => Self::FailPartialResult,
16220                2 => Self::AllowPartialResult,
16221                _ => Self::UnknownValue(partial_result_mode::UnknownValue(
16222                    wkt::internal::UnknownEnumValue::Integer(value),
16223                )),
16224            }
16225        }
16226    }
16227
16228    impl std::convert::From<&str> for PartialResultMode {
16229        fn from(value: &str) -> Self {
16230            use std::string::ToString;
16231            match value {
16232                "PARTIAL_RESULT_MODE_UNSPECIFIED" => Self::Unspecified,
16233                "FAIL_PARTIAL_RESULT" => Self::FailPartialResult,
16234                "ALLOW_PARTIAL_RESULT" => Self::AllowPartialResult,
16235                _ => Self::UnknownValue(partial_result_mode::UnknownValue(
16236                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16237                )),
16238            }
16239        }
16240    }
16241
16242    impl serde::ser::Serialize for PartialResultMode {
16243        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16244        where
16245            S: serde::Serializer,
16246        {
16247            match self {
16248                Self::Unspecified => serializer.serialize_i32(0),
16249                Self::FailPartialResult => serializer.serialize_i32(1),
16250                Self::AllowPartialResult => serializer.serialize_i32(2),
16251                Self::UnknownValue(u) => u.0.serialize(serializer),
16252            }
16253        }
16254    }
16255
16256    impl<'de> serde::de::Deserialize<'de> for PartialResultMode {
16257        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16258        where
16259            D: serde::Deserializer<'de>,
16260        {
16261            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PartialResultMode>::new(
16262                ".google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode",
16263            ))
16264        }
16265    }
16266
16267    /// Credentials for the database connection.
16268    #[derive(Clone, Debug, PartialEq)]
16269    #[non_exhaustive]
16270    pub enum UserPassword {
16271        /// Optional. When set to `true`, the API caller identity associated with the
16272        /// request is used for database authentication. The API caller must be an
16273        /// IAM user in the database.
16274        AutoIamAuthn(bool),
16275    }
16276}
16277
16278/// Execute SQL statements response.
16279#[derive(Clone, Default, PartialEq)]
16280#[non_exhaustive]
16281pub struct SqlInstancesExecuteSqlResponse {
16282    /// A list of notices and warnings generated during query execution.
16283    /// For PostgreSQL, this includes all notices and warnings.
16284    /// For MySQL, this includes warnings generated by the last executed statement.
16285    /// To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
16286    /// be executed after each statement.
16287    pub messages: std::vec::Vec<crate::model::sql_instances_execute_sql_response::Message>,
16288
16289    /// The additional metadata information regarding the execution of the SQL
16290    /// statements.
16291    pub metadata: std::option::Option<crate::model::Metadata>,
16292
16293    /// The list of results after executing all the SQL statements.
16294    pub results: std::vec::Vec<crate::model::QueryResult>,
16295
16296    /// Contains the error from the database if the SQL execution failed.
16297    pub status: std::option::Option<google_cloud_rpc::model::Status>,
16298
16299    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16300}
16301
16302impl SqlInstancesExecuteSqlResponse {
16303    /// Creates a new default instance.
16304    pub fn new() -> Self {
16305        std::default::Default::default()
16306    }
16307
16308    /// Sets the value of [messages][crate::model::SqlInstancesExecuteSqlResponse::messages].
16309    ///
16310    /// # Example
16311    /// ```ignore,no_run
16312    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16313    /// use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16314    /// let x = SqlInstancesExecuteSqlResponse::new()
16315    ///     .set_messages([
16316    ///         Message::default()/* use setters */,
16317    ///         Message::default()/* use (different) setters */,
16318    ///     ]);
16319    /// ```
16320    pub fn set_messages<T, V>(mut self, v: T) -> Self
16321    where
16322        T: std::iter::IntoIterator<Item = V>,
16323        V: std::convert::Into<crate::model::sql_instances_execute_sql_response::Message>,
16324    {
16325        use std::iter::Iterator;
16326        self.messages = v.into_iter().map(|i| i.into()).collect();
16327        self
16328    }
16329
16330    /// Sets the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
16331    ///
16332    /// # Example
16333    /// ```ignore,no_run
16334    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16335    /// use google_cloud_sql_v1::model::Metadata;
16336    /// let x = SqlInstancesExecuteSqlResponse::new().set_metadata(Metadata::default()/* use setters */);
16337    /// ```
16338    pub fn set_metadata<T>(mut self, v: T) -> Self
16339    where
16340        T: std::convert::Into<crate::model::Metadata>,
16341    {
16342        self.metadata = std::option::Option::Some(v.into());
16343        self
16344    }
16345
16346    /// Sets or clears the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
16347    ///
16348    /// # Example
16349    /// ```ignore,no_run
16350    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16351    /// use google_cloud_sql_v1::model::Metadata;
16352    /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
16353    /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(None::<Metadata>);
16354    /// ```
16355    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16356    where
16357        T: std::convert::Into<crate::model::Metadata>,
16358    {
16359        self.metadata = v.map(|x| x.into());
16360        self
16361    }
16362
16363    /// Sets the value of [results][crate::model::SqlInstancesExecuteSqlResponse::results].
16364    ///
16365    /// # Example
16366    /// ```ignore,no_run
16367    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16368    /// use google_cloud_sql_v1::model::QueryResult;
16369    /// let x = SqlInstancesExecuteSqlResponse::new()
16370    ///     .set_results([
16371    ///         QueryResult::default()/* use setters */,
16372    ///         QueryResult::default()/* use (different) setters */,
16373    ///     ]);
16374    /// ```
16375    pub fn set_results<T, V>(mut self, v: T) -> Self
16376    where
16377        T: std::iter::IntoIterator<Item = V>,
16378        V: std::convert::Into<crate::model::QueryResult>,
16379    {
16380        use std::iter::Iterator;
16381        self.results = v.into_iter().map(|i| i.into()).collect();
16382        self
16383    }
16384
16385    /// Sets the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
16386    ///
16387    /// # Example
16388    /// ```ignore,no_run
16389    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16390    /// use google_cloud_rpc::model::Status;
16391    /// let x = SqlInstancesExecuteSqlResponse::new().set_status(Status::default()/* use setters */);
16392    /// ```
16393    pub fn set_status<T>(mut self, v: T) -> Self
16394    where
16395        T: std::convert::Into<google_cloud_rpc::model::Status>,
16396    {
16397        self.status = std::option::Option::Some(v.into());
16398        self
16399    }
16400
16401    /// Sets or clears the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
16402    ///
16403    /// # Example
16404    /// ```ignore,no_run
16405    /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16406    /// use google_cloud_rpc::model::Status;
16407    /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(Some(Status::default()/* use setters */));
16408    /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(None::<Status>);
16409    /// ```
16410    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
16411    where
16412        T: std::convert::Into<google_cloud_rpc::model::Status>,
16413    {
16414        self.status = v.map(|x| x.into());
16415        self
16416    }
16417}
16418
16419impl wkt::message::Message for SqlInstancesExecuteSqlResponse {
16420    fn typename() -> &'static str {
16421        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse"
16422    }
16423}
16424
16425/// Defines additional types related to [SqlInstancesExecuteSqlResponse].
16426pub mod sql_instances_execute_sql_response {
16427    #[allow(unused_imports)]
16428    use super::*;
16429
16430    /// Represents a notice or warning message from the database.
16431    #[derive(Clone, Default, PartialEq)]
16432    #[non_exhaustive]
16433    pub struct Message {
16434        /// The full message string.
16435        /// For PostgreSQL, this is a formatted string that may include severity,
16436        /// code, and the notice/warning message.
16437        /// For MySQL, this contains the warning message.
16438        pub message: std::option::Option<std::string::String>,
16439
16440        /// The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
16441        /// MySQL).
16442        pub severity: std::option::Option<std::string::String>,
16443
16444        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16445    }
16446
16447    impl Message {
16448        /// Creates a new default instance.
16449        pub fn new() -> Self {
16450            std::default::Default::default()
16451        }
16452
16453        /// Sets the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
16454        ///
16455        /// # Example
16456        /// ```ignore,no_run
16457        /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16458        /// let x = Message::new().set_message("example");
16459        /// ```
16460        pub fn set_message<T>(mut self, v: T) -> Self
16461        where
16462            T: std::convert::Into<std::string::String>,
16463        {
16464            self.message = std::option::Option::Some(v.into());
16465            self
16466        }
16467
16468        /// Sets or clears the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
16469        ///
16470        /// # Example
16471        /// ```ignore,no_run
16472        /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16473        /// let x = Message::new().set_or_clear_message(Some("example"));
16474        /// let x = Message::new().set_or_clear_message(None::<String>);
16475        /// ```
16476        pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
16477        where
16478            T: std::convert::Into<std::string::String>,
16479        {
16480            self.message = v.map(|x| x.into());
16481            self
16482        }
16483
16484        /// Sets the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
16485        ///
16486        /// # Example
16487        /// ```ignore,no_run
16488        /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16489        /// let x = Message::new().set_severity("example");
16490        /// ```
16491        pub fn set_severity<T>(mut self, v: T) -> Self
16492        where
16493            T: std::convert::Into<std::string::String>,
16494        {
16495            self.severity = std::option::Option::Some(v.into());
16496            self
16497        }
16498
16499        /// Sets or clears the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
16500        ///
16501        /// # Example
16502        /// ```ignore,no_run
16503        /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16504        /// let x = Message::new().set_or_clear_severity(Some("example"));
16505        /// let x = Message::new().set_or_clear_severity(None::<String>);
16506        /// ```
16507        pub fn set_or_clear_severity<T>(mut self, v: std::option::Option<T>) -> Self
16508        where
16509            T: std::convert::Into<std::string::String>,
16510        {
16511            self.severity = v.map(|x| x.into());
16512            self
16513        }
16514    }
16515
16516    impl wkt::message::Message for Message {
16517        fn typename() -> &'static str {
16518            "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message"
16519        }
16520    }
16521}
16522
16523/// QueryResult contains the result of executing a single SQL statement.
16524#[derive(Clone, Default, PartialEq)]
16525#[non_exhaustive]
16526pub struct QueryResult {
16527    /// List of columns included in the result. This also includes the data type
16528    /// of the column.
16529    pub columns: std::vec::Vec<crate::model::Column>,
16530
16531    /// Rows returned by the SQL statement.
16532    pub rows: std::vec::Vec<crate::model::Row>,
16533
16534    /// Message related to the SQL execution result.
16535    pub message: std::string::String,
16536
16537    /// Set to true if the SQL execution's result is truncated due to size limits
16538    /// or an error retrieving results.
16539    pub partial_result: bool,
16540
16541    /// If results were truncated due to an error, details of that error.
16542    pub status: std::option::Option<google_cloud_rpc::model::Status>,
16543
16544    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16545}
16546
16547impl QueryResult {
16548    /// Creates a new default instance.
16549    pub fn new() -> Self {
16550        std::default::Default::default()
16551    }
16552
16553    /// Sets the value of [columns][crate::model::QueryResult::columns].
16554    ///
16555    /// # Example
16556    /// ```ignore,no_run
16557    /// # use google_cloud_sql_v1::model::QueryResult;
16558    /// use google_cloud_sql_v1::model::Column;
16559    /// let x = QueryResult::new()
16560    ///     .set_columns([
16561    ///         Column::default()/* use setters */,
16562    ///         Column::default()/* use (different) setters */,
16563    ///     ]);
16564    /// ```
16565    pub fn set_columns<T, V>(mut self, v: T) -> Self
16566    where
16567        T: std::iter::IntoIterator<Item = V>,
16568        V: std::convert::Into<crate::model::Column>,
16569    {
16570        use std::iter::Iterator;
16571        self.columns = v.into_iter().map(|i| i.into()).collect();
16572        self
16573    }
16574
16575    /// Sets the value of [rows][crate::model::QueryResult::rows].
16576    ///
16577    /// # Example
16578    /// ```ignore,no_run
16579    /// # use google_cloud_sql_v1::model::QueryResult;
16580    /// use google_cloud_sql_v1::model::Row;
16581    /// let x = QueryResult::new()
16582    ///     .set_rows([
16583    ///         Row::default()/* use setters */,
16584    ///         Row::default()/* use (different) setters */,
16585    ///     ]);
16586    /// ```
16587    pub fn set_rows<T, V>(mut self, v: T) -> Self
16588    where
16589        T: std::iter::IntoIterator<Item = V>,
16590        V: std::convert::Into<crate::model::Row>,
16591    {
16592        use std::iter::Iterator;
16593        self.rows = v.into_iter().map(|i| i.into()).collect();
16594        self
16595    }
16596
16597    /// Sets the value of [message][crate::model::QueryResult::message].
16598    ///
16599    /// # Example
16600    /// ```ignore,no_run
16601    /// # use google_cloud_sql_v1::model::QueryResult;
16602    /// let x = QueryResult::new().set_message("example");
16603    /// ```
16604    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16605        self.message = v.into();
16606        self
16607    }
16608
16609    /// Sets the value of [partial_result][crate::model::QueryResult::partial_result].
16610    ///
16611    /// # Example
16612    /// ```ignore,no_run
16613    /// # use google_cloud_sql_v1::model::QueryResult;
16614    /// let x = QueryResult::new().set_partial_result(true);
16615    /// ```
16616    pub fn set_partial_result<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16617        self.partial_result = v.into();
16618        self
16619    }
16620
16621    /// Sets the value of [status][crate::model::QueryResult::status].
16622    ///
16623    /// # Example
16624    /// ```ignore,no_run
16625    /// # use google_cloud_sql_v1::model::QueryResult;
16626    /// use google_cloud_rpc::model::Status;
16627    /// let x = QueryResult::new().set_status(Status::default()/* use setters */);
16628    /// ```
16629    pub fn set_status<T>(mut self, v: T) -> Self
16630    where
16631        T: std::convert::Into<google_cloud_rpc::model::Status>,
16632    {
16633        self.status = std::option::Option::Some(v.into());
16634        self
16635    }
16636
16637    /// Sets or clears the value of [status][crate::model::QueryResult::status].
16638    ///
16639    /// # Example
16640    /// ```ignore,no_run
16641    /// # use google_cloud_sql_v1::model::QueryResult;
16642    /// use google_cloud_rpc::model::Status;
16643    /// let x = QueryResult::new().set_or_clear_status(Some(Status::default()/* use setters */));
16644    /// let x = QueryResult::new().set_or_clear_status(None::<Status>);
16645    /// ```
16646    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
16647    where
16648        T: std::convert::Into<google_cloud_rpc::model::Status>,
16649    {
16650        self.status = v.map(|x| x.into());
16651        self
16652    }
16653}
16654
16655impl wkt::message::Message for QueryResult {
16656    fn typename() -> &'static str {
16657        "type.googleapis.com/google.cloud.sql.v1.QueryResult"
16658    }
16659}
16660
16661/// Contains the name and datatype of a column.
16662#[derive(Clone, Default, PartialEq)]
16663#[non_exhaustive]
16664pub struct Column {
16665    /// Name of the column.
16666    pub name: std::string::String,
16667
16668    /// Datatype of the column.
16669    pub r#type: std::string::String,
16670
16671    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16672}
16673
16674impl Column {
16675    /// Creates a new default instance.
16676    pub fn new() -> Self {
16677        std::default::Default::default()
16678    }
16679
16680    /// Sets the value of [name][crate::model::Column::name].
16681    ///
16682    /// # Example
16683    /// ```ignore,no_run
16684    /// # use google_cloud_sql_v1::model::Column;
16685    /// let x = Column::new().set_name("example");
16686    /// ```
16687    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16688        self.name = v.into();
16689        self
16690    }
16691
16692    /// Sets the value of [r#type][crate::model::Column::type].
16693    ///
16694    /// # Example
16695    /// ```ignore,no_run
16696    /// # use google_cloud_sql_v1::model::Column;
16697    /// let x = Column::new().set_type("example");
16698    /// ```
16699    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16700        self.r#type = v.into();
16701        self
16702    }
16703}
16704
16705impl wkt::message::Message for Column {
16706    fn typename() -> &'static str {
16707        "type.googleapis.com/google.cloud.sql.v1.Column"
16708    }
16709}
16710
16711/// Contains the values for a row.
16712#[derive(Clone, Default, PartialEq)]
16713#[non_exhaustive]
16714pub struct Row {
16715    /// The values for the row.
16716    pub values: std::vec::Vec<crate::model::Value>,
16717
16718    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16719}
16720
16721impl Row {
16722    /// Creates a new default instance.
16723    pub fn new() -> Self {
16724        std::default::Default::default()
16725    }
16726
16727    /// Sets the value of [values][crate::model::Row::values].
16728    ///
16729    /// # Example
16730    /// ```ignore,no_run
16731    /// # use google_cloud_sql_v1::model::Row;
16732    /// use google_cloud_sql_v1::model::Value;
16733    /// let x = Row::new()
16734    ///     .set_values([
16735    ///         Value::default()/* use setters */,
16736    ///         Value::default()/* use (different) setters */,
16737    ///     ]);
16738    /// ```
16739    pub fn set_values<T, V>(mut self, v: T) -> Self
16740    where
16741        T: std::iter::IntoIterator<Item = V>,
16742        V: std::convert::Into<crate::model::Value>,
16743    {
16744        use std::iter::Iterator;
16745        self.values = v.into_iter().map(|i| i.into()).collect();
16746        self
16747    }
16748}
16749
16750impl wkt::message::Message for Row {
16751    fn typename() -> &'static str {
16752        "type.googleapis.com/google.cloud.sql.v1.Row"
16753    }
16754}
16755
16756/// The cell value of the table.
16757#[derive(Clone, Default, PartialEq)]
16758#[non_exhaustive]
16759pub struct Value {
16760    /// The cell value in string format.
16761    pub value: std::string::String,
16762
16763    /// If cell value is null, then this flag will be set to true.
16764    pub null_value: bool,
16765
16766    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16767}
16768
16769impl Value {
16770    /// Creates a new default instance.
16771    pub fn new() -> Self {
16772        std::default::Default::default()
16773    }
16774
16775    /// Sets the value of [value][crate::model::Value::value].
16776    ///
16777    /// # Example
16778    /// ```ignore,no_run
16779    /// # use google_cloud_sql_v1::model::Value;
16780    /// let x = Value::new().set_value("example");
16781    /// ```
16782    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16783        self.value = v.into();
16784        self
16785    }
16786
16787    /// Sets the value of [null_value][crate::model::Value::null_value].
16788    ///
16789    /// # Example
16790    /// ```ignore,no_run
16791    /// # use google_cloud_sql_v1::model::Value;
16792    /// let x = Value::new().set_null_value(true);
16793    /// ```
16794    pub fn set_null_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16795        self.null_value = v.into();
16796        self
16797    }
16798}
16799
16800impl wkt::message::Message for Value {
16801    fn typename() -> &'static str {
16802        "type.googleapis.com/google.cloud.sql.v1.Value"
16803    }
16804}
16805
16806/// The additional metadata information regarding the execution of the SQL
16807/// statements.
16808#[derive(Clone, Default, PartialEq)]
16809#[non_exhaustive]
16810pub struct Metadata {
16811    /// The time taken to execute the SQL statements.
16812    pub sql_statement_execution_time: std::option::Option<wkt::Duration>,
16813
16814    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16815}
16816
16817impl Metadata {
16818    /// Creates a new default instance.
16819    pub fn new() -> Self {
16820        std::default::Default::default()
16821    }
16822
16823    /// Sets the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
16824    ///
16825    /// # Example
16826    /// ```ignore,no_run
16827    /// # use google_cloud_sql_v1::model::Metadata;
16828    /// use wkt::Duration;
16829    /// let x = Metadata::new().set_sql_statement_execution_time(Duration::default()/* use setters */);
16830    /// ```
16831    pub fn set_sql_statement_execution_time<T>(mut self, v: T) -> Self
16832    where
16833        T: std::convert::Into<wkt::Duration>,
16834    {
16835        self.sql_statement_execution_time = std::option::Option::Some(v.into());
16836        self
16837    }
16838
16839    /// Sets or clears the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
16840    ///
16841    /// # Example
16842    /// ```ignore,no_run
16843    /// # use google_cloud_sql_v1::model::Metadata;
16844    /// use wkt::Duration;
16845    /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(Some(Duration::default()/* use setters */));
16846    /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(None::<Duration>);
16847    /// ```
16848    pub fn set_or_clear_sql_statement_execution_time<T>(mut self, v: std::option::Option<T>) -> Self
16849    where
16850        T: std::convert::Into<wkt::Duration>,
16851    {
16852        self.sql_statement_execution_time = v.map(|x| x.into());
16853        self
16854    }
16855}
16856
16857impl wkt::message::Message for Metadata {
16858    fn typename() -> &'static str {
16859        "type.googleapis.com/google.cloud.sql.v1.Metadata"
16860    }
16861}
16862
16863/// Request to acquire a lease for SSRS.
16864#[derive(Clone, Default, PartialEq)]
16865#[non_exhaustive]
16866pub struct SqlInstancesAcquireSsrsLeaseRequest {
16867    /// Required. Cloud SQL instance ID. This doesn't include the project ID. It's
16868    /// composed of lowercase letters, numbers, and hyphens, and it must start with
16869    /// a letter. The total length must be 98 characters or less (Example:
16870    /// instance-id).
16871    pub instance: std::string::String,
16872
16873    /// Required. Project ID of the project that contains the instance (Example:
16874    /// project-id).
16875    pub project: std::string::String,
16876
16877    /// Required. The request body.
16878    pub body: std::option::Option<crate::model::InstancesAcquireSsrsLeaseRequest>,
16879
16880    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16881}
16882
16883impl SqlInstancesAcquireSsrsLeaseRequest {
16884    /// Creates a new default instance.
16885    pub fn new() -> Self {
16886        std::default::Default::default()
16887    }
16888
16889    /// Sets the value of [instance][crate::model::SqlInstancesAcquireSsrsLeaseRequest::instance].
16890    ///
16891    /// # Example
16892    /// ```ignore,no_run
16893    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16894    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_instance("example");
16895    /// ```
16896    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16897        self.instance = v.into();
16898        self
16899    }
16900
16901    /// Sets the value of [project][crate::model::SqlInstancesAcquireSsrsLeaseRequest::project].
16902    ///
16903    /// # Example
16904    /// ```ignore,no_run
16905    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16906    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_project("example");
16907    /// ```
16908    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16909        self.project = v.into();
16910        self
16911    }
16912
16913    /// Sets the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
16914    ///
16915    /// # Example
16916    /// ```ignore,no_run
16917    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16918    /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
16919    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_body(InstancesAcquireSsrsLeaseRequest::default()/* use setters */);
16920    /// ```
16921    pub fn set_body<T>(mut self, v: T) -> Self
16922    where
16923        T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
16924    {
16925        self.body = std::option::Option::Some(v.into());
16926        self
16927    }
16928
16929    /// Sets or clears the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
16930    ///
16931    /// # Example
16932    /// ```ignore,no_run
16933    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16934    /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
16935    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(Some(InstancesAcquireSsrsLeaseRequest::default()/* use setters */));
16936    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(None::<InstancesAcquireSsrsLeaseRequest>);
16937    /// ```
16938    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16939    where
16940        T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
16941    {
16942        self.body = v.map(|x| x.into());
16943        self
16944    }
16945}
16946
16947impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseRequest {
16948    fn typename() -> &'static str {
16949        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest"
16950    }
16951}
16952
16953/// Response for the acquire SSRS lease request.
16954#[derive(Clone, Default, PartialEq)]
16955#[non_exhaustive]
16956pub struct SqlInstancesAcquireSsrsLeaseResponse {
16957    /// The unique identifier for this operation.
16958    pub operation_id: std::string::String,
16959
16960    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16961}
16962
16963impl SqlInstancesAcquireSsrsLeaseResponse {
16964    /// Creates a new default instance.
16965    pub fn new() -> Self {
16966        std::default::Default::default()
16967    }
16968
16969    /// Sets the value of [operation_id][crate::model::SqlInstancesAcquireSsrsLeaseResponse::operation_id].
16970    ///
16971    /// # Example
16972    /// ```ignore,no_run
16973    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseResponse;
16974    /// let x = SqlInstancesAcquireSsrsLeaseResponse::new().set_operation_id("example");
16975    /// ```
16976    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16977        self.operation_id = v.into();
16978        self
16979    }
16980}
16981
16982impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseResponse {
16983    fn typename() -> &'static str {
16984        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse"
16985    }
16986}
16987
16988/// Request to release a lease for SSRS.
16989#[derive(Clone, Default, PartialEq)]
16990#[non_exhaustive]
16991pub struct SqlInstancesReleaseSsrsLeaseRequest {
16992    /// Required. The Cloud SQL instance ID. This doesn't include the project ID.
16993    /// The instance ID contains lowercase letters, numbers, and hyphens, and it
16994    /// must start with a letter. This ID can have a maximum length of 98
16995    /// characters.
16996    pub instance: std::string::String,
16997
16998    /// Required. The project ID that contains the instance.
16999    pub project: std::string::String,
17000
17001    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17002}
17003
17004impl SqlInstancesReleaseSsrsLeaseRequest {
17005    /// Creates a new default instance.
17006    pub fn new() -> Self {
17007        std::default::Default::default()
17008    }
17009
17010    /// Sets the value of [instance][crate::model::SqlInstancesReleaseSsrsLeaseRequest::instance].
17011    ///
17012    /// # Example
17013    /// ```ignore,no_run
17014    /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
17015    /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_instance("example");
17016    /// ```
17017    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17018        self.instance = v.into();
17019        self
17020    }
17021
17022    /// Sets the value of [project][crate::model::SqlInstancesReleaseSsrsLeaseRequest::project].
17023    ///
17024    /// # Example
17025    /// ```ignore,no_run
17026    /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
17027    /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_project("example");
17028    /// ```
17029    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17030        self.project = v.into();
17031        self
17032    }
17033}
17034
17035impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseRequest {
17036    fn typename() -> &'static str {
17037        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest"
17038    }
17039}
17040
17041/// Response for the release SSRS lease request.
17042#[derive(Clone, Default, PartialEq)]
17043#[non_exhaustive]
17044pub struct SqlInstancesReleaseSsrsLeaseResponse {
17045    /// The unique identifier for this operation.
17046    pub operation_id: std::string::String,
17047
17048    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17049}
17050
17051impl SqlInstancesReleaseSsrsLeaseResponse {
17052    /// Creates a new default instance.
17053    pub fn new() -> Self {
17054        std::default::Default::default()
17055    }
17056
17057    /// Sets the value of [operation_id][crate::model::SqlInstancesReleaseSsrsLeaseResponse::operation_id].
17058    ///
17059    /// # Example
17060    /// ```ignore,no_run
17061    /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseResponse;
17062    /// let x = SqlInstancesReleaseSsrsLeaseResponse::new().set_operation_id("example");
17063    /// ```
17064    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17065        self.operation_id = v.into();
17066        self
17067    }
17068}
17069
17070impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseResponse {
17071    fn typename() -> &'static str {
17072        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse"
17073    }
17074}
17075
17076/// Request to perform a point in time restore on a Google Cloud Backup and
17077/// Disaster Recovery managed instance.
17078#[derive(Clone, Default, PartialEq)]
17079#[non_exhaustive]
17080pub struct SqlInstancesPointInTimeRestoreRequest {
17081    /// Required. The parent resource where you created this instance.
17082    /// Format: projects/{project}
17083    pub parent: std::string::String,
17084
17085    /// Required. The context for request to perform a PITR on a Google Cloud
17086    /// Backup and Disaster Recovery managed instance.
17087    pub context: std::option::Option<crate::model::PointInTimeRestoreContext>,
17088
17089    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17090}
17091
17092impl SqlInstancesPointInTimeRestoreRequest {
17093    /// Creates a new default instance.
17094    pub fn new() -> Self {
17095        std::default::Default::default()
17096    }
17097
17098    /// Sets the value of [parent][crate::model::SqlInstancesPointInTimeRestoreRequest::parent].
17099    ///
17100    /// # Example
17101    /// ```ignore,no_run
17102    /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
17103    /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_parent("example");
17104    /// ```
17105    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17106        self.parent = v.into();
17107        self
17108    }
17109
17110    /// Sets the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
17111    ///
17112    /// # Example
17113    /// ```ignore,no_run
17114    /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
17115    /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
17116    /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_context(PointInTimeRestoreContext::default()/* use setters */);
17117    /// ```
17118    pub fn set_context<T>(mut self, v: T) -> Self
17119    where
17120        T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
17121    {
17122        self.context = std::option::Option::Some(v.into());
17123        self
17124    }
17125
17126    /// Sets or clears the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
17127    ///
17128    /// # Example
17129    /// ```ignore,no_run
17130    /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
17131    /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
17132    /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(Some(PointInTimeRestoreContext::default()/* use setters */));
17133    /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(None::<PointInTimeRestoreContext>);
17134    /// ```
17135    pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
17136    where
17137        T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
17138    {
17139        self.context = v.map(|x| x.into());
17140        self
17141    }
17142}
17143
17144impl wkt::message::Message for SqlInstancesPointInTimeRestoreRequest {
17145    fn typename() -> &'static str {
17146        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest"
17147    }
17148}
17149
17150/// Operations get request.
17151#[derive(Clone, Default, PartialEq)]
17152#[non_exhaustive]
17153pub struct SqlOperationsGetRequest {
17154    /// Required. Instance operation ID.
17155    pub operation: std::string::String,
17156
17157    /// Required. Project ID of the project that contains the instance.
17158    pub project: std::string::String,
17159
17160    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17161}
17162
17163impl SqlOperationsGetRequest {
17164    /// Creates a new default instance.
17165    pub fn new() -> Self {
17166        std::default::Default::default()
17167    }
17168
17169    /// Sets the value of [operation][crate::model::SqlOperationsGetRequest::operation].
17170    ///
17171    /// # Example
17172    /// ```ignore,no_run
17173    /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
17174    /// let x = SqlOperationsGetRequest::new().set_operation("example");
17175    /// ```
17176    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17177        self.operation = v.into();
17178        self
17179    }
17180
17181    /// Sets the value of [project][crate::model::SqlOperationsGetRequest::project].
17182    ///
17183    /// # Example
17184    /// ```ignore,no_run
17185    /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
17186    /// let x = SqlOperationsGetRequest::new().set_project("example");
17187    /// ```
17188    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17189        self.project = v.into();
17190        self
17191    }
17192}
17193
17194impl wkt::message::Message for SqlOperationsGetRequest {
17195    fn typename() -> &'static str {
17196        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsGetRequest"
17197    }
17198}
17199
17200/// Operations list request.
17201#[derive(Clone, Default, PartialEq)]
17202#[non_exhaustive]
17203pub struct SqlOperationsListRequest {
17204    /// Cloud SQL instance ID. This does not include the project ID.
17205    pub instance: std::string::String,
17206
17207    /// Maximum number of operations per response.
17208    pub max_results: u32,
17209
17210    /// A previously-returned page token representing part of the larger set of
17211    /// results to view.
17212    pub page_token: std::string::String,
17213
17214    /// Project ID of the project that contains the instance.
17215    pub project: std::string::String,
17216
17217    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17218}
17219
17220impl SqlOperationsListRequest {
17221    /// Creates a new default instance.
17222    pub fn new() -> Self {
17223        std::default::Default::default()
17224    }
17225
17226    /// Sets the value of [instance][crate::model::SqlOperationsListRequest::instance].
17227    ///
17228    /// # Example
17229    /// ```ignore,no_run
17230    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17231    /// let x = SqlOperationsListRequest::new().set_instance("example");
17232    /// ```
17233    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17234        self.instance = v.into();
17235        self
17236    }
17237
17238    /// Sets the value of [max_results][crate::model::SqlOperationsListRequest::max_results].
17239    ///
17240    /// # Example
17241    /// ```ignore,no_run
17242    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17243    /// let x = SqlOperationsListRequest::new().set_max_results(42_u32);
17244    /// ```
17245    pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
17246        self.max_results = v.into();
17247        self
17248    }
17249
17250    /// Sets the value of [page_token][crate::model::SqlOperationsListRequest::page_token].
17251    ///
17252    /// # Example
17253    /// ```ignore,no_run
17254    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17255    /// let x = SqlOperationsListRequest::new().set_page_token("example");
17256    /// ```
17257    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17258        self.page_token = v.into();
17259        self
17260    }
17261
17262    /// Sets the value of [project][crate::model::SqlOperationsListRequest::project].
17263    ///
17264    /// # Example
17265    /// ```ignore,no_run
17266    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17267    /// let x = SqlOperationsListRequest::new().set_project("example");
17268    /// ```
17269    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17270        self.project = v.into();
17271        self
17272    }
17273}
17274
17275impl wkt::message::Message for SqlOperationsListRequest {
17276    fn typename() -> &'static str {
17277        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsListRequest"
17278    }
17279}
17280
17281/// Operations list response.
17282#[derive(Clone, Default, PartialEq)]
17283#[non_exhaustive]
17284pub struct OperationsListResponse {
17285    /// This is always `sql#operationsList`.
17286    pub kind: std::string::String,
17287
17288    /// List of operation resources.
17289    pub items: std::vec::Vec<crate::model::Operation>,
17290
17291    /// The continuation token, used to page through large result sets. Provide
17292    /// this value in a subsequent request to return the next page of results.
17293    pub next_page_token: std::string::String,
17294
17295    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17296}
17297
17298impl OperationsListResponse {
17299    /// Creates a new default instance.
17300    pub fn new() -> Self {
17301        std::default::Default::default()
17302    }
17303
17304    /// Sets the value of [kind][crate::model::OperationsListResponse::kind].
17305    ///
17306    /// # Example
17307    /// ```ignore,no_run
17308    /// # use google_cloud_sql_v1::model::OperationsListResponse;
17309    /// let x = OperationsListResponse::new().set_kind("example");
17310    /// ```
17311    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17312        self.kind = v.into();
17313        self
17314    }
17315
17316    /// Sets the value of [items][crate::model::OperationsListResponse::items].
17317    ///
17318    /// # Example
17319    /// ```ignore,no_run
17320    /// # use google_cloud_sql_v1::model::OperationsListResponse;
17321    /// use google_cloud_sql_v1::model::Operation;
17322    /// let x = OperationsListResponse::new()
17323    ///     .set_items([
17324    ///         Operation::default()/* use setters */,
17325    ///         Operation::default()/* use (different) setters */,
17326    ///     ]);
17327    /// ```
17328    pub fn set_items<T, V>(mut self, v: T) -> Self
17329    where
17330        T: std::iter::IntoIterator<Item = V>,
17331        V: std::convert::Into<crate::model::Operation>,
17332    {
17333        use std::iter::Iterator;
17334        self.items = v.into_iter().map(|i| i.into()).collect();
17335        self
17336    }
17337
17338    /// Sets the value of [next_page_token][crate::model::OperationsListResponse::next_page_token].
17339    ///
17340    /// # Example
17341    /// ```ignore,no_run
17342    /// # use google_cloud_sql_v1::model::OperationsListResponse;
17343    /// let x = OperationsListResponse::new().set_next_page_token("example");
17344    /// ```
17345    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17346        self.next_page_token = v.into();
17347        self
17348    }
17349}
17350
17351impl wkt::message::Message for OperationsListResponse {
17352    fn typename() -> &'static str {
17353        "type.googleapis.com/google.cloud.sql.v1.OperationsListResponse"
17354    }
17355}
17356
17357#[doc(hidden)]
17358impl google_cloud_gax::paginator::internal::PageableResponse for OperationsListResponse {
17359    type PageItem = crate::model::Operation;
17360
17361    fn items(self) -> std::vec::Vec<Self::PageItem> {
17362        self.items
17363    }
17364
17365    fn next_page_token(&self) -> std::string::String {
17366        use std::clone::Clone;
17367        self.next_page_token.clone()
17368    }
17369}
17370
17371/// Operations cancel request.
17372#[derive(Clone, Default, PartialEq)]
17373#[non_exhaustive]
17374pub struct SqlOperationsCancelRequest {
17375    /// Instance operation ID.
17376    pub operation: std::string::String,
17377
17378    /// Project ID of the project that contains the instance.
17379    pub project: std::string::String,
17380
17381    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17382}
17383
17384impl SqlOperationsCancelRequest {
17385    /// Creates a new default instance.
17386    pub fn new() -> Self {
17387        std::default::Default::default()
17388    }
17389
17390    /// Sets the value of [operation][crate::model::SqlOperationsCancelRequest::operation].
17391    ///
17392    /// # Example
17393    /// ```ignore,no_run
17394    /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
17395    /// let x = SqlOperationsCancelRequest::new().set_operation("example");
17396    /// ```
17397    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17398        self.operation = v.into();
17399        self
17400    }
17401
17402    /// Sets the value of [project][crate::model::SqlOperationsCancelRequest::project].
17403    ///
17404    /// # Example
17405    /// ```ignore,no_run
17406    /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
17407    /// let x = SqlOperationsCancelRequest::new().set_project("example");
17408    /// ```
17409    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17410        self.project = v.into();
17411        self
17412    }
17413}
17414
17415impl wkt::message::Message for SqlOperationsCancelRequest {
17416    fn typename() -> &'static str {
17417        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsCancelRequest"
17418    }
17419}
17420
17421/// An entry for an Access Control list.
17422#[derive(Clone, Default, PartialEq)]
17423#[non_exhaustive]
17424pub struct AclEntry {
17425    /// The allowlisted value for the access control list.
17426    pub value: std::string::String,
17427
17428    /// The time when this access control entry expires in
17429    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
17430    /// `2012-11-15T16:19:00.094Z`.
17431    pub expiration_time: std::option::Option<wkt::Timestamp>,
17432
17433    /// Optional. A label to identify this entry.
17434    pub name: std::string::String,
17435
17436    /// This is always `sql#aclEntry`.
17437    pub kind: std::string::String,
17438
17439    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17440}
17441
17442impl AclEntry {
17443    /// Creates a new default instance.
17444    pub fn new() -> Self {
17445        std::default::Default::default()
17446    }
17447
17448    /// Sets the value of [value][crate::model::AclEntry::value].
17449    ///
17450    /// # Example
17451    /// ```ignore,no_run
17452    /// # use google_cloud_sql_v1::model::AclEntry;
17453    /// let x = AclEntry::new().set_value("example");
17454    /// ```
17455    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17456        self.value = v.into();
17457        self
17458    }
17459
17460    /// Sets the value of [expiration_time][crate::model::AclEntry::expiration_time].
17461    ///
17462    /// # Example
17463    /// ```ignore,no_run
17464    /// # use google_cloud_sql_v1::model::AclEntry;
17465    /// use wkt::Timestamp;
17466    /// let x = AclEntry::new().set_expiration_time(Timestamp::default()/* use setters */);
17467    /// ```
17468    pub fn set_expiration_time<T>(mut self, v: T) -> Self
17469    where
17470        T: std::convert::Into<wkt::Timestamp>,
17471    {
17472        self.expiration_time = std::option::Option::Some(v.into());
17473        self
17474    }
17475
17476    /// Sets or clears the value of [expiration_time][crate::model::AclEntry::expiration_time].
17477    ///
17478    /// # Example
17479    /// ```ignore,no_run
17480    /// # use google_cloud_sql_v1::model::AclEntry;
17481    /// use wkt::Timestamp;
17482    /// let x = AclEntry::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
17483    /// let x = AclEntry::new().set_or_clear_expiration_time(None::<Timestamp>);
17484    /// ```
17485    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
17486    where
17487        T: std::convert::Into<wkt::Timestamp>,
17488    {
17489        self.expiration_time = v.map(|x| x.into());
17490        self
17491    }
17492
17493    /// Sets the value of [name][crate::model::AclEntry::name].
17494    ///
17495    /// # Example
17496    /// ```ignore,no_run
17497    /// # use google_cloud_sql_v1::model::AclEntry;
17498    /// let x = AclEntry::new().set_name("example");
17499    /// ```
17500    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17501        self.name = v.into();
17502        self
17503    }
17504
17505    /// Sets the value of [kind][crate::model::AclEntry::kind].
17506    ///
17507    /// # Example
17508    /// ```ignore,no_run
17509    /// # use google_cloud_sql_v1::model::AclEntry;
17510    /// let x = AclEntry::new().set_kind("example");
17511    /// ```
17512    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17513        self.kind = v.into();
17514        self
17515    }
17516}
17517
17518impl wkt::message::Message for AclEntry {
17519    fn typename() -> &'static str {
17520        "type.googleapis.com/google.cloud.sql.v1.AclEntry"
17521    }
17522}
17523
17524/// An Admin API warning message.
17525#[derive(Clone, Default, PartialEq)]
17526#[non_exhaustive]
17527pub struct ApiWarning {
17528    /// Code to uniquely identify the warning type.
17529    pub code: crate::model::api_warning::SqlApiWarningCode,
17530
17531    /// The warning message.
17532    pub message: std::string::String,
17533
17534    /// The region name for REGION_UNREACHABLE warning.
17535    pub region: std::string::String,
17536
17537    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17538}
17539
17540impl ApiWarning {
17541    /// Creates a new default instance.
17542    pub fn new() -> Self {
17543        std::default::Default::default()
17544    }
17545
17546    /// Sets the value of [code][crate::model::ApiWarning::code].
17547    ///
17548    /// # Example
17549    /// ```ignore,no_run
17550    /// # use google_cloud_sql_v1::model::ApiWarning;
17551    /// use google_cloud_sql_v1::model::api_warning::SqlApiWarningCode;
17552    /// let x0 = ApiWarning::new().set_code(SqlApiWarningCode::RegionUnreachable);
17553    /// let x1 = ApiWarning::new().set_code(SqlApiWarningCode::MaxResultsExceedsLimit);
17554    /// let x2 = ApiWarning::new().set_code(SqlApiWarningCode::CompromisedCredentials);
17555    /// ```
17556    pub fn set_code<T: std::convert::Into<crate::model::api_warning::SqlApiWarningCode>>(
17557        mut self,
17558        v: T,
17559    ) -> Self {
17560        self.code = v.into();
17561        self
17562    }
17563
17564    /// Sets the value of [message][crate::model::ApiWarning::message].
17565    ///
17566    /// # Example
17567    /// ```ignore,no_run
17568    /// # use google_cloud_sql_v1::model::ApiWarning;
17569    /// let x = ApiWarning::new().set_message("example");
17570    /// ```
17571    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17572        self.message = v.into();
17573        self
17574    }
17575
17576    /// Sets the value of [region][crate::model::ApiWarning::region].
17577    ///
17578    /// # Example
17579    /// ```ignore,no_run
17580    /// # use google_cloud_sql_v1::model::ApiWarning;
17581    /// let x = ApiWarning::new().set_region("example");
17582    /// ```
17583    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17584        self.region = v.into();
17585        self
17586    }
17587}
17588
17589impl wkt::message::Message for ApiWarning {
17590    fn typename() -> &'static str {
17591        "type.googleapis.com/google.cloud.sql.v1.ApiWarning"
17592    }
17593}
17594
17595/// Defines additional types related to [ApiWarning].
17596pub mod api_warning {
17597    #[allow(unused_imports)]
17598    use super::*;
17599
17600    /// Enum for [SqlApiWarningCode].
17601    ///
17602    /// # Working with unknown values
17603    ///
17604    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17605    /// additional enum variants at any time. Adding new variants is not considered
17606    /// a breaking change. Applications should write their code in anticipation of:
17607    ///
17608    /// - New values appearing in future releases of the client library, **and**
17609    /// - New values received dynamically, without application changes.
17610    ///
17611    /// Please consult the [Working with enums] section in the user guide for some
17612    /// guidelines.
17613    ///
17614    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17615    #[derive(Clone, Debug, PartialEq)]
17616    #[non_exhaustive]
17617    pub enum SqlApiWarningCode {
17618        /// An unknown or unset warning type from Cloud SQL API.
17619        Unspecified,
17620        /// Warning when one or more regions are not reachable.  The returned result
17621        /// set may be incomplete.
17622        RegionUnreachable,
17623        /// Warning when user provided maxResults parameter exceeds the limit.  The
17624        /// returned result set may be incomplete.
17625        MaxResultsExceedsLimit,
17626        /// Warning when user tries to create/update a user with credentials that
17627        /// have previously been compromised by a public data breach.
17628        CompromisedCredentials,
17629        /// Warning when the operation succeeds but some non-critical workflow state
17630        /// failed.
17631        InternalStateFailure,
17632        /// If set, the enum was initialized with an unknown value.
17633        ///
17634        /// Applications can examine the value using [SqlApiWarningCode::value] or
17635        /// [SqlApiWarningCode::name].
17636        UnknownValue(sql_api_warning_code::UnknownValue),
17637    }
17638
17639    #[doc(hidden)]
17640    pub mod sql_api_warning_code {
17641        #[allow(unused_imports)]
17642        use super::*;
17643        #[derive(Clone, Debug, PartialEq)]
17644        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17645    }
17646
17647    impl SqlApiWarningCode {
17648        /// Gets the enum value.
17649        ///
17650        /// Returns `None` if the enum contains an unknown value deserialized from
17651        /// the string representation of enums.
17652        pub fn value(&self) -> std::option::Option<i32> {
17653            match self {
17654                Self::Unspecified => std::option::Option::Some(0),
17655                Self::RegionUnreachable => std::option::Option::Some(1),
17656                Self::MaxResultsExceedsLimit => std::option::Option::Some(2),
17657                Self::CompromisedCredentials => std::option::Option::Some(3),
17658                Self::InternalStateFailure => std::option::Option::Some(4),
17659                Self::UnknownValue(u) => u.0.value(),
17660            }
17661        }
17662
17663        /// Gets the enum value as a string.
17664        ///
17665        /// Returns `None` if the enum contains an unknown value deserialized from
17666        /// the integer representation of enums.
17667        pub fn name(&self) -> std::option::Option<&str> {
17668            match self {
17669                Self::Unspecified => std::option::Option::Some("SQL_API_WARNING_CODE_UNSPECIFIED"),
17670                Self::RegionUnreachable => std::option::Option::Some("REGION_UNREACHABLE"),
17671                Self::MaxResultsExceedsLimit => {
17672                    std::option::Option::Some("MAX_RESULTS_EXCEEDS_LIMIT")
17673                }
17674                Self::CompromisedCredentials => {
17675                    std::option::Option::Some("COMPROMISED_CREDENTIALS")
17676                }
17677                Self::InternalStateFailure => std::option::Option::Some("INTERNAL_STATE_FAILURE"),
17678                Self::UnknownValue(u) => u.0.name(),
17679            }
17680        }
17681    }
17682
17683    impl std::default::Default for SqlApiWarningCode {
17684        fn default() -> Self {
17685            use std::convert::From;
17686            Self::from(0)
17687        }
17688    }
17689
17690    impl std::fmt::Display for SqlApiWarningCode {
17691        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17692            wkt::internal::display_enum(f, self.name(), self.value())
17693        }
17694    }
17695
17696    impl std::convert::From<i32> for SqlApiWarningCode {
17697        fn from(value: i32) -> Self {
17698            match value {
17699                0 => Self::Unspecified,
17700                1 => Self::RegionUnreachable,
17701                2 => Self::MaxResultsExceedsLimit,
17702                3 => Self::CompromisedCredentials,
17703                4 => Self::InternalStateFailure,
17704                _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
17705                    wkt::internal::UnknownEnumValue::Integer(value),
17706                )),
17707            }
17708        }
17709    }
17710
17711    impl std::convert::From<&str> for SqlApiWarningCode {
17712        fn from(value: &str) -> Self {
17713            use std::string::ToString;
17714            match value {
17715                "SQL_API_WARNING_CODE_UNSPECIFIED" => Self::Unspecified,
17716                "REGION_UNREACHABLE" => Self::RegionUnreachable,
17717                "MAX_RESULTS_EXCEEDS_LIMIT" => Self::MaxResultsExceedsLimit,
17718                "COMPROMISED_CREDENTIALS" => Self::CompromisedCredentials,
17719                "INTERNAL_STATE_FAILURE" => Self::InternalStateFailure,
17720                _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
17721                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17722                )),
17723            }
17724        }
17725    }
17726
17727    impl serde::ser::Serialize for SqlApiWarningCode {
17728        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17729        where
17730            S: serde::Serializer,
17731        {
17732            match self {
17733                Self::Unspecified => serializer.serialize_i32(0),
17734                Self::RegionUnreachable => serializer.serialize_i32(1),
17735                Self::MaxResultsExceedsLimit => serializer.serialize_i32(2),
17736                Self::CompromisedCredentials => serializer.serialize_i32(3),
17737                Self::InternalStateFailure => serializer.serialize_i32(4),
17738                Self::UnknownValue(u) => u.0.serialize(serializer),
17739            }
17740        }
17741    }
17742
17743    impl<'de> serde::de::Deserialize<'de> for SqlApiWarningCode {
17744        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17745        where
17746            D: serde::Deserializer<'de>,
17747        {
17748            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlApiWarningCode>::new(
17749                ".google.cloud.sql.v1.ApiWarning.SqlApiWarningCode",
17750            ))
17751        }
17752    }
17753}
17754
17755/// We currently only support backup retention by specifying the number
17756/// of backups we will retain.
17757#[derive(Clone, Default, PartialEq)]
17758#[non_exhaustive]
17759pub struct BackupRetentionSettings {
17760    /// The unit that 'retained_backups' represents.
17761    pub retention_unit: crate::model::backup_retention_settings::RetentionUnit,
17762
17763    /// Depending on the value of retention_unit, this is used to determine
17764    /// if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
17765    /// retain this many backups.
17766    pub retained_backups: std::option::Option<wkt::Int32Value>,
17767
17768    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17769}
17770
17771impl BackupRetentionSettings {
17772    /// Creates a new default instance.
17773    pub fn new() -> Self {
17774        std::default::Default::default()
17775    }
17776
17777    /// Sets the value of [retention_unit][crate::model::BackupRetentionSettings::retention_unit].
17778    ///
17779    /// # Example
17780    /// ```ignore,no_run
17781    /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17782    /// use google_cloud_sql_v1::model::backup_retention_settings::RetentionUnit;
17783    /// let x0 = BackupRetentionSettings::new().set_retention_unit(RetentionUnit::Count);
17784    /// ```
17785    pub fn set_retention_unit<
17786        T: std::convert::Into<crate::model::backup_retention_settings::RetentionUnit>,
17787    >(
17788        mut self,
17789        v: T,
17790    ) -> Self {
17791        self.retention_unit = v.into();
17792        self
17793    }
17794
17795    /// Sets the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
17796    ///
17797    /// # Example
17798    /// ```ignore,no_run
17799    /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17800    /// use wkt::Int32Value;
17801    /// let x = BackupRetentionSettings::new().set_retained_backups(Int32Value::default()/* use setters */);
17802    /// ```
17803    pub fn set_retained_backups<T>(mut self, v: T) -> Self
17804    where
17805        T: std::convert::Into<wkt::Int32Value>,
17806    {
17807        self.retained_backups = std::option::Option::Some(v.into());
17808        self
17809    }
17810
17811    /// Sets or clears the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
17812    ///
17813    /// # Example
17814    /// ```ignore,no_run
17815    /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17816    /// use wkt::Int32Value;
17817    /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(Some(Int32Value::default()/* use setters */));
17818    /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(None::<Int32Value>);
17819    /// ```
17820    pub fn set_or_clear_retained_backups<T>(mut self, v: std::option::Option<T>) -> Self
17821    where
17822        T: std::convert::Into<wkt::Int32Value>,
17823    {
17824        self.retained_backups = v.map(|x| x.into());
17825        self
17826    }
17827}
17828
17829impl wkt::message::Message for BackupRetentionSettings {
17830    fn typename() -> &'static str {
17831        "type.googleapis.com/google.cloud.sql.v1.BackupRetentionSettings"
17832    }
17833}
17834
17835/// Defines additional types related to [BackupRetentionSettings].
17836pub mod backup_retention_settings {
17837    #[allow(unused_imports)]
17838    use super::*;
17839
17840    /// The units that retained_backups specifies, we only support COUNT.
17841    ///
17842    /// # Working with unknown values
17843    ///
17844    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17845    /// additional enum variants at any time. Adding new variants is not considered
17846    /// a breaking change. Applications should write their code in anticipation of:
17847    ///
17848    /// - New values appearing in future releases of the client library, **and**
17849    /// - New values received dynamically, without application changes.
17850    ///
17851    /// Please consult the [Working with enums] section in the user guide for some
17852    /// guidelines.
17853    ///
17854    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17855    #[derive(Clone, Debug, PartialEq)]
17856    #[non_exhaustive]
17857    pub enum RetentionUnit {
17858        /// Backup retention unit is unspecified, will be treated as COUNT.
17859        Unspecified,
17860        /// Retention will be by count, eg. "retain the most recent 7 backups".
17861        Count,
17862        /// If set, the enum was initialized with an unknown value.
17863        ///
17864        /// Applications can examine the value using [RetentionUnit::value] or
17865        /// [RetentionUnit::name].
17866        UnknownValue(retention_unit::UnknownValue),
17867    }
17868
17869    #[doc(hidden)]
17870    pub mod retention_unit {
17871        #[allow(unused_imports)]
17872        use super::*;
17873        #[derive(Clone, Debug, PartialEq)]
17874        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17875    }
17876
17877    impl RetentionUnit {
17878        /// Gets the enum value.
17879        ///
17880        /// Returns `None` if the enum contains an unknown value deserialized from
17881        /// the string representation of enums.
17882        pub fn value(&self) -> std::option::Option<i32> {
17883            match self {
17884                Self::Unspecified => std::option::Option::Some(0),
17885                Self::Count => std::option::Option::Some(1),
17886                Self::UnknownValue(u) => u.0.value(),
17887            }
17888        }
17889
17890        /// Gets the enum value as a string.
17891        ///
17892        /// Returns `None` if the enum contains an unknown value deserialized from
17893        /// the integer representation of enums.
17894        pub fn name(&self) -> std::option::Option<&str> {
17895            match self {
17896                Self::Unspecified => std::option::Option::Some("RETENTION_UNIT_UNSPECIFIED"),
17897                Self::Count => std::option::Option::Some("COUNT"),
17898                Self::UnknownValue(u) => u.0.name(),
17899            }
17900        }
17901    }
17902
17903    impl std::default::Default for RetentionUnit {
17904        fn default() -> Self {
17905            use std::convert::From;
17906            Self::from(0)
17907        }
17908    }
17909
17910    impl std::fmt::Display for RetentionUnit {
17911        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17912            wkt::internal::display_enum(f, self.name(), self.value())
17913        }
17914    }
17915
17916    impl std::convert::From<i32> for RetentionUnit {
17917        fn from(value: i32) -> Self {
17918            match value {
17919                0 => Self::Unspecified,
17920                1 => Self::Count,
17921                _ => Self::UnknownValue(retention_unit::UnknownValue(
17922                    wkt::internal::UnknownEnumValue::Integer(value),
17923                )),
17924            }
17925        }
17926    }
17927
17928    impl std::convert::From<&str> for RetentionUnit {
17929        fn from(value: &str) -> Self {
17930            use std::string::ToString;
17931            match value {
17932                "RETENTION_UNIT_UNSPECIFIED" => Self::Unspecified,
17933                "COUNT" => Self::Count,
17934                _ => Self::UnknownValue(retention_unit::UnknownValue(
17935                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17936                )),
17937            }
17938        }
17939    }
17940
17941    impl serde::ser::Serialize for RetentionUnit {
17942        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17943        where
17944            S: serde::Serializer,
17945        {
17946            match self {
17947                Self::Unspecified => serializer.serialize_i32(0),
17948                Self::Count => serializer.serialize_i32(1),
17949                Self::UnknownValue(u) => u.0.serialize(serializer),
17950            }
17951        }
17952    }
17953
17954    impl<'de> serde::de::Deserialize<'de> for RetentionUnit {
17955        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17956        where
17957            D: serde::Deserializer<'de>,
17958        {
17959            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RetentionUnit>::new(
17960                ".google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit",
17961            ))
17962        }
17963    }
17964}
17965
17966/// Database instance backup configuration.
17967#[derive(Clone, Default, PartialEq)]
17968#[non_exhaustive]
17969pub struct BackupConfiguration {
17970    /// Start time for the daily backup configuration in UTC timezone in the 24
17971    /// hour format - `HH:MM`.
17972    pub start_time: std::string::String,
17973
17974    /// Whether this configuration is enabled.
17975    pub enabled: std::option::Option<wkt::BoolValue>,
17976
17977    /// This is always `sql#backupConfiguration`.
17978    pub kind: std::string::String,
17979
17980    /// (MySQL only) Whether binary log is enabled. If backup configuration is
17981    /// disabled, binarylog must be disabled as well.
17982    pub binary_log_enabled: std::option::Option<wkt::BoolValue>,
17983
17984    /// Reserved for future use.
17985    pub replication_log_archiving_enabled: std::option::Option<wkt::BoolValue>,
17986
17987    /// Location of the backup
17988    pub location: std::string::String,
17989
17990    /// Whether point in time recovery is enabled.
17991    pub point_in_time_recovery_enabled: std::option::Option<wkt::BoolValue>,
17992
17993    /// Backup retention settings.
17994    pub backup_retention_settings: std::option::Option<crate::model::BackupRetentionSettings>,
17995
17996    /// The number of days of transaction logs we retain for point in time
17997    /// restore, from 1-7.
17998    pub transaction_log_retention_days: std::option::Option<wkt::Int32Value>,
17999
18000    /// Output only. This value contains the storage location of transactional logs
18001    /// used to perform point-in-time recovery (PITR) for the database.
18002    pub transactional_log_storage_state:
18003        std::option::Option<crate::model::backup_configuration::TransactionalLogStorageState>,
18004
18005    /// Output only. Backup tier that manages the backups for the instance.
18006    pub backup_tier: std::option::Option<crate::model::backup_configuration::BackupTier>,
18007
18008    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18009}
18010
18011impl BackupConfiguration {
18012    /// Creates a new default instance.
18013    pub fn new() -> Self {
18014        std::default::Default::default()
18015    }
18016
18017    /// Sets the value of [start_time][crate::model::BackupConfiguration::start_time].
18018    ///
18019    /// # Example
18020    /// ```ignore,no_run
18021    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18022    /// let x = BackupConfiguration::new().set_start_time("example");
18023    /// ```
18024    pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18025        self.start_time = v.into();
18026        self
18027    }
18028
18029    /// Sets the value of [enabled][crate::model::BackupConfiguration::enabled].
18030    ///
18031    /// # Example
18032    /// ```ignore,no_run
18033    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18034    /// use wkt::BoolValue;
18035    /// let x = BackupConfiguration::new().set_enabled(BoolValue::default()/* use setters */);
18036    /// ```
18037    pub fn set_enabled<T>(mut self, v: T) -> Self
18038    where
18039        T: std::convert::Into<wkt::BoolValue>,
18040    {
18041        self.enabled = std::option::Option::Some(v.into());
18042        self
18043    }
18044
18045    /// Sets or clears the value of [enabled][crate::model::BackupConfiguration::enabled].
18046    ///
18047    /// # Example
18048    /// ```ignore,no_run
18049    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18050    /// use wkt::BoolValue;
18051    /// let x = BackupConfiguration::new().set_or_clear_enabled(Some(BoolValue::default()/* use setters */));
18052    /// let x = BackupConfiguration::new().set_or_clear_enabled(None::<BoolValue>);
18053    /// ```
18054    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
18055    where
18056        T: std::convert::Into<wkt::BoolValue>,
18057    {
18058        self.enabled = v.map(|x| x.into());
18059        self
18060    }
18061
18062    /// Sets the value of [kind][crate::model::BackupConfiguration::kind].
18063    ///
18064    /// # Example
18065    /// ```ignore,no_run
18066    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18067    /// let x = BackupConfiguration::new().set_kind("example");
18068    /// ```
18069    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18070        self.kind = v.into();
18071        self
18072    }
18073
18074    /// Sets the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
18075    ///
18076    /// # Example
18077    /// ```ignore,no_run
18078    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18079    /// use wkt::BoolValue;
18080    /// let x = BackupConfiguration::new().set_binary_log_enabled(BoolValue::default()/* use setters */);
18081    /// ```
18082    pub fn set_binary_log_enabled<T>(mut self, v: T) -> Self
18083    where
18084        T: std::convert::Into<wkt::BoolValue>,
18085    {
18086        self.binary_log_enabled = std::option::Option::Some(v.into());
18087        self
18088    }
18089
18090    /// Sets or clears the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
18091    ///
18092    /// # Example
18093    /// ```ignore,no_run
18094    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18095    /// use wkt::BoolValue;
18096    /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(Some(BoolValue::default()/* use setters */));
18097    /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(None::<BoolValue>);
18098    /// ```
18099    pub fn set_or_clear_binary_log_enabled<T>(mut self, v: std::option::Option<T>) -> Self
18100    where
18101        T: std::convert::Into<wkt::BoolValue>,
18102    {
18103        self.binary_log_enabled = v.map(|x| x.into());
18104        self
18105    }
18106
18107    /// Sets the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
18108    ///
18109    /// # Example
18110    /// ```ignore,no_run
18111    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18112    /// use wkt::BoolValue;
18113    /// let x = BackupConfiguration::new().set_replication_log_archiving_enabled(BoolValue::default()/* use setters */);
18114    /// ```
18115    pub fn set_replication_log_archiving_enabled<T>(mut self, v: T) -> Self
18116    where
18117        T: std::convert::Into<wkt::BoolValue>,
18118    {
18119        self.replication_log_archiving_enabled = std::option::Option::Some(v.into());
18120        self
18121    }
18122
18123    /// Sets or clears the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
18124    ///
18125    /// # Example
18126    /// ```ignore,no_run
18127    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18128    /// use wkt::BoolValue;
18129    /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(Some(BoolValue::default()/* use setters */));
18130    /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(None::<BoolValue>);
18131    /// ```
18132    pub fn set_or_clear_replication_log_archiving_enabled<T>(
18133        mut self,
18134        v: std::option::Option<T>,
18135    ) -> Self
18136    where
18137        T: std::convert::Into<wkt::BoolValue>,
18138    {
18139        self.replication_log_archiving_enabled = v.map(|x| x.into());
18140        self
18141    }
18142
18143    /// Sets the value of [location][crate::model::BackupConfiguration::location].
18144    ///
18145    /// # Example
18146    /// ```ignore,no_run
18147    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18148    /// let x = BackupConfiguration::new().set_location("example");
18149    /// ```
18150    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18151        self.location = v.into();
18152        self
18153    }
18154
18155    /// Sets the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
18156    ///
18157    /// # Example
18158    /// ```ignore,no_run
18159    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18160    /// use wkt::BoolValue;
18161    /// let x = BackupConfiguration::new().set_point_in_time_recovery_enabled(BoolValue::default()/* use setters */);
18162    /// ```
18163    pub fn set_point_in_time_recovery_enabled<T>(mut self, v: T) -> Self
18164    where
18165        T: std::convert::Into<wkt::BoolValue>,
18166    {
18167        self.point_in_time_recovery_enabled = std::option::Option::Some(v.into());
18168        self
18169    }
18170
18171    /// Sets or clears the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
18172    ///
18173    /// # Example
18174    /// ```ignore,no_run
18175    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18176    /// use wkt::BoolValue;
18177    /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(Some(BoolValue::default()/* use setters */));
18178    /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(None::<BoolValue>);
18179    /// ```
18180    pub fn set_or_clear_point_in_time_recovery_enabled<T>(
18181        mut self,
18182        v: std::option::Option<T>,
18183    ) -> Self
18184    where
18185        T: std::convert::Into<wkt::BoolValue>,
18186    {
18187        self.point_in_time_recovery_enabled = v.map(|x| x.into());
18188        self
18189    }
18190
18191    /// Sets the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
18192    ///
18193    /// # Example
18194    /// ```ignore,no_run
18195    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18196    /// use google_cloud_sql_v1::model::BackupRetentionSettings;
18197    /// let x = BackupConfiguration::new().set_backup_retention_settings(BackupRetentionSettings::default()/* use setters */);
18198    /// ```
18199    pub fn set_backup_retention_settings<T>(mut self, v: T) -> Self
18200    where
18201        T: std::convert::Into<crate::model::BackupRetentionSettings>,
18202    {
18203        self.backup_retention_settings = std::option::Option::Some(v.into());
18204        self
18205    }
18206
18207    /// Sets or clears the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
18208    ///
18209    /// # Example
18210    /// ```ignore,no_run
18211    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18212    /// use google_cloud_sql_v1::model::BackupRetentionSettings;
18213    /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(Some(BackupRetentionSettings::default()/* use setters */));
18214    /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(None::<BackupRetentionSettings>);
18215    /// ```
18216    pub fn set_or_clear_backup_retention_settings<T>(mut self, v: std::option::Option<T>) -> Self
18217    where
18218        T: std::convert::Into<crate::model::BackupRetentionSettings>,
18219    {
18220        self.backup_retention_settings = v.map(|x| x.into());
18221        self
18222    }
18223
18224    /// Sets the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
18225    ///
18226    /// # Example
18227    /// ```ignore,no_run
18228    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18229    /// use wkt::Int32Value;
18230    /// let x = BackupConfiguration::new().set_transaction_log_retention_days(Int32Value::default()/* use setters */);
18231    /// ```
18232    pub fn set_transaction_log_retention_days<T>(mut self, v: T) -> Self
18233    where
18234        T: std::convert::Into<wkt::Int32Value>,
18235    {
18236        self.transaction_log_retention_days = std::option::Option::Some(v.into());
18237        self
18238    }
18239
18240    /// Sets or clears the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
18241    ///
18242    /// # Example
18243    /// ```ignore,no_run
18244    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18245    /// use wkt::Int32Value;
18246    /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(Some(Int32Value::default()/* use setters */));
18247    /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(None::<Int32Value>);
18248    /// ```
18249    pub fn set_or_clear_transaction_log_retention_days<T>(
18250        mut self,
18251        v: std::option::Option<T>,
18252    ) -> Self
18253    where
18254        T: std::convert::Into<wkt::Int32Value>,
18255    {
18256        self.transaction_log_retention_days = v.map(|x| x.into());
18257        self
18258    }
18259
18260    /// Sets the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
18261    ///
18262    /// # Example
18263    /// ```ignore,no_run
18264    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18265    /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
18266    /// let x0 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::Disk);
18267    /// let x1 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchingToCloudStorage);
18268    /// let x2 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchedToCloudStorage);
18269    /// ```
18270    pub fn set_transactional_log_storage_state<T>(mut self, v: T) -> Self
18271    where
18272        T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
18273    {
18274        self.transactional_log_storage_state = std::option::Option::Some(v.into());
18275        self
18276    }
18277
18278    /// Sets or clears the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
18279    ///
18280    /// # Example
18281    /// ```ignore,no_run
18282    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18283    /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
18284    /// let x0 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::Disk));
18285    /// let x1 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchingToCloudStorage));
18286    /// let x2 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchedToCloudStorage));
18287    /// let x_none = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(None::<TransactionalLogStorageState>);
18288    /// ```
18289    pub fn set_or_clear_transactional_log_storage_state<T>(
18290        mut self,
18291        v: std::option::Option<T>,
18292    ) -> Self
18293    where
18294        T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
18295    {
18296        self.transactional_log_storage_state = v.map(|x| x.into());
18297        self
18298    }
18299
18300    /// Sets the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
18301    ///
18302    /// # Example
18303    /// ```ignore,no_run
18304    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18305    /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
18306    /// let x0 = BackupConfiguration::new().set_backup_tier(BackupTier::Standard);
18307    /// let x1 = BackupConfiguration::new().set_backup_tier(BackupTier::Enhanced);
18308    /// ```
18309    pub fn set_backup_tier<T>(mut self, v: T) -> Self
18310    where
18311        T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
18312    {
18313        self.backup_tier = std::option::Option::Some(v.into());
18314        self
18315    }
18316
18317    /// Sets or clears the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
18318    ///
18319    /// # Example
18320    /// ```ignore,no_run
18321    /// # use google_cloud_sql_v1::model::BackupConfiguration;
18322    /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
18323    /// let x0 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Standard));
18324    /// let x1 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Enhanced));
18325    /// let x_none = BackupConfiguration::new().set_or_clear_backup_tier(None::<BackupTier>);
18326    /// ```
18327    pub fn set_or_clear_backup_tier<T>(mut self, v: std::option::Option<T>) -> Self
18328    where
18329        T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
18330    {
18331        self.backup_tier = v.map(|x| x.into());
18332        self
18333    }
18334}
18335
18336impl wkt::message::Message for BackupConfiguration {
18337    fn typename() -> &'static str {
18338        "type.googleapis.com/google.cloud.sql.v1.BackupConfiguration"
18339    }
18340}
18341
18342/// Defines additional types related to [BackupConfiguration].
18343pub mod backup_configuration {
18344    #[allow(unused_imports)]
18345    use super::*;
18346
18347    /// This value contains the storage location of the transactional logs
18348    /// used to perform point-in-time recovery (PITR) for the database.
18349    ///
18350    /// # Working with unknown values
18351    ///
18352    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18353    /// additional enum variants at any time. Adding new variants is not considered
18354    /// a breaking change. Applications should write their code in anticipation of:
18355    ///
18356    /// - New values appearing in future releases of the client library, **and**
18357    /// - New values received dynamically, without application changes.
18358    ///
18359    /// Please consult the [Working with enums] section in the user guide for some
18360    /// guidelines.
18361    ///
18362    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18363    #[derive(Clone, Debug, PartialEq)]
18364    #[non_exhaustive]
18365    pub enum TransactionalLogStorageState {
18366        /// Unspecified.
18367        Unspecified,
18368        /// The transaction logs used for PITR for the instance are stored
18369        /// on a data disk.
18370        Disk,
18371        /// The transaction logs used for PITR for the instance are switching from
18372        /// being stored on a data disk to being stored in Cloud Storage.
18373        /// Only applicable to MySQL.
18374        SwitchingToCloudStorage,
18375        /// The transaction logs used for PITR for the instance are now stored
18376        /// in Cloud Storage. Previously, they were stored on a data disk.
18377        /// Only applicable to MySQL.
18378        SwitchedToCloudStorage,
18379        /// The transaction logs used for PITR for the instance are stored in
18380        /// Cloud Storage. Only applicable to MySQL and PostgreSQL.
18381        CloudStorage,
18382        /// If set, the enum was initialized with an unknown value.
18383        ///
18384        /// Applications can examine the value using [TransactionalLogStorageState::value] or
18385        /// [TransactionalLogStorageState::name].
18386        UnknownValue(transactional_log_storage_state::UnknownValue),
18387    }
18388
18389    #[doc(hidden)]
18390    pub mod transactional_log_storage_state {
18391        #[allow(unused_imports)]
18392        use super::*;
18393        #[derive(Clone, Debug, PartialEq)]
18394        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18395    }
18396
18397    impl TransactionalLogStorageState {
18398        /// Gets the enum value.
18399        ///
18400        /// Returns `None` if the enum contains an unknown value deserialized from
18401        /// the string representation of enums.
18402        pub fn value(&self) -> std::option::Option<i32> {
18403            match self {
18404                Self::Unspecified => std::option::Option::Some(0),
18405                Self::Disk => std::option::Option::Some(1),
18406                Self::SwitchingToCloudStorage => std::option::Option::Some(2),
18407                Self::SwitchedToCloudStorage => std::option::Option::Some(3),
18408                Self::CloudStorage => std::option::Option::Some(4),
18409                Self::UnknownValue(u) => u.0.value(),
18410            }
18411        }
18412
18413        /// Gets the enum value as a string.
18414        ///
18415        /// Returns `None` if the enum contains an unknown value deserialized from
18416        /// the integer representation of enums.
18417        pub fn name(&self) -> std::option::Option<&str> {
18418            match self {
18419                Self::Unspecified => {
18420                    std::option::Option::Some("TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED")
18421                }
18422                Self::Disk => std::option::Option::Some("DISK"),
18423                Self::SwitchingToCloudStorage => {
18424                    std::option::Option::Some("SWITCHING_TO_CLOUD_STORAGE")
18425                }
18426                Self::SwitchedToCloudStorage => {
18427                    std::option::Option::Some("SWITCHED_TO_CLOUD_STORAGE")
18428                }
18429                Self::CloudStorage => std::option::Option::Some("CLOUD_STORAGE"),
18430                Self::UnknownValue(u) => u.0.name(),
18431            }
18432        }
18433    }
18434
18435    impl std::default::Default for TransactionalLogStorageState {
18436        fn default() -> Self {
18437            use std::convert::From;
18438            Self::from(0)
18439        }
18440    }
18441
18442    impl std::fmt::Display for TransactionalLogStorageState {
18443        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18444            wkt::internal::display_enum(f, self.name(), self.value())
18445        }
18446    }
18447
18448    impl std::convert::From<i32> for TransactionalLogStorageState {
18449        fn from(value: i32) -> Self {
18450            match value {
18451                0 => Self::Unspecified,
18452                1 => Self::Disk,
18453                2 => Self::SwitchingToCloudStorage,
18454                3 => Self::SwitchedToCloudStorage,
18455                4 => Self::CloudStorage,
18456                _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
18457                    wkt::internal::UnknownEnumValue::Integer(value),
18458                )),
18459            }
18460        }
18461    }
18462
18463    impl std::convert::From<&str> for TransactionalLogStorageState {
18464        fn from(value: &str) -> Self {
18465            use std::string::ToString;
18466            match value {
18467                "TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED" => Self::Unspecified,
18468                "DISK" => Self::Disk,
18469                "SWITCHING_TO_CLOUD_STORAGE" => Self::SwitchingToCloudStorage,
18470                "SWITCHED_TO_CLOUD_STORAGE" => Self::SwitchedToCloudStorage,
18471                "CLOUD_STORAGE" => Self::CloudStorage,
18472                _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
18473                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18474                )),
18475            }
18476        }
18477    }
18478
18479    impl serde::ser::Serialize for TransactionalLogStorageState {
18480        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18481        where
18482            S: serde::Serializer,
18483        {
18484            match self {
18485                Self::Unspecified => serializer.serialize_i32(0),
18486                Self::Disk => serializer.serialize_i32(1),
18487                Self::SwitchingToCloudStorage => serializer.serialize_i32(2),
18488                Self::SwitchedToCloudStorage => serializer.serialize_i32(3),
18489                Self::CloudStorage => serializer.serialize_i32(4),
18490                Self::UnknownValue(u) => u.0.serialize(serializer),
18491            }
18492        }
18493    }
18494
18495    impl<'de> serde::de::Deserialize<'de> for TransactionalLogStorageState {
18496        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18497        where
18498            D: serde::Deserializer<'de>,
18499        {
18500            deserializer.deserialize_any(
18501                wkt::internal::EnumVisitor::<TransactionalLogStorageState>::new(
18502                    ".google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState",
18503                ),
18504            )
18505        }
18506    }
18507
18508    /// Backup tier that manages the backups for the instance.
18509    ///
18510    /// # Working with unknown values
18511    ///
18512    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18513    /// additional enum variants at any time. Adding new variants is not considered
18514    /// a breaking change. Applications should write their code in anticipation of:
18515    ///
18516    /// - New values appearing in future releases of the client library, **and**
18517    /// - New values received dynamically, without application changes.
18518    ///
18519    /// Please consult the [Working with enums] section in the user guide for some
18520    /// guidelines.
18521    ///
18522    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18523    #[derive(Clone, Debug, PartialEq)]
18524    #[non_exhaustive]
18525    pub enum BackupTier {
18526        /// Unspecified.
18527        Unspecified,
18528        /// Instance is managed by Cloud SQL.
18529        Standard,
18530        /// Deprecated: ADVANCED is deprecated. Please use ENHANCED instead.
18531        #[deprecated]
18532        Advanced,
18533        /// Instance is managed by Google Cloud Backup and DR Service.
18534        Enhanced,
18535        /// If set, the enum was initialized with an unknown value.
18536        ///
18537        /// Applications can examine the value using [BackupTier::value] or
18538        /// [BackupTier::name].
18539        UnknownValue(backup_tier::UnknownValue),
18540    }
18541
18542    #[doc(hidden)]
18543    pub mod backup_tier {
18544        #[allow(unused_imports)]
18545        use super::*;
18546        #[derive(Clone, Debug, PartialEq)]
18547        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18548    }
18549
18550    impl BackupTier {
18551        /// Gets the enum value.
18552        ///
18553        /// Returns `None` if the enum contains an unknown value deserialized from
18554        /// the string representation of enums.
18555        pub fn value(&self) -> std::option::Option<i32> {
18556            match self {
18557                Self::Unspecified => std::option::Option::Some(0),
18558                Self::Standard => std::option::Option::Some(1),
18559                Self::Advanced => std::option::Option::Some(2),
18560                Self::Enhanced => std::option::Option::Some(3),
18561                Self::UnknownValue(u) => u.0.value(),
18562            }
18563        }
18564
18565        /// Gets the enum value as a string.
18566        ///
18567        /// Returns `None` if the enum contains an unknown value deserialized from
18568        /// the integer representation of enums.
18569        pub fn name(&self) -> std::option::Option<&str> {
18570            match self {
18571                Self::Unspecified => std::option::Option::Some("BACKUP_TIER_UNSPECIFIED"),
18572                Self::Standard => std::option::Option::Some("STANDARD"),
18573                Self::Advanced => std::option::Option::Some("ADVANCED"),
18574                Self::Enhanced => std::option::Option::Some("ENHANCED"),
18575                Self::UnknownValue(u) => u.0.name(),
18576            }
18577        }
18578    }
18579
18580    impl std::default::Default for BackupTier {
18581        fn default() -> Self {
18582            use std::convert::From;
18583            Self::from(0)
18584        }
18585    }
18586
18587    impl std::fmt::Display for BackupTier {
18588        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18589            wkt::internal::display_enum(f, self.name(), self.value())
18590        }
18591    }
18592
18593    impl std::convert::From<i32> for BackupTier {
18594        fn from(value: i32) -> Self {
18595            match value {
18596                0 => Self::Unspecified,
18597                1 => Self::Standard,
18598                2 => Self::Advanced,
18599                3 => Self::Enhanced,
18600                _ => Self::UnknownValue(backup_tier::UnknownValue(
18601                    wkt::internal::UnknownEnumValue::Integer(value),
18602                )),
18603            }
18604        }
18605    }
18606
18607    impl std::convert::From<&str> for BackupTier {
18608        fn from(value: &str) -> Self {
18609            use std::string::ToString;
18610            match value {
18611                "BACKUP_TIER_UNSPECIFIED" => Self::Unspecified,
18612                "STANDARD" => Self::Standard,
18613                "ADVANCED" => Self::Advanced,
18614                "ENHANCED" => Self::Enhanced,
18615                _ => Self::UnknownValue(backup_tier::UnknownValue(
18616                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18617                )),
18618            }
18619        }
18620    }
18621
18622    impl serde::ser::Serialize for BackupTier {
18623        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18624        where
18625            S: serde::Serializer,
18626        {
18627            match self {
18628                Self::Unspecified => serializer.serialize_i32(0),
18629                Self::Standard => serializer.serialize_i32(1),
18630                Self::Advanced => serializer.serialize_i32(2),
18631                Self::Enhanced => serializer.serialize_i32(3),
18632                Self::UnknownValue(u) => u.0.serialize(serializer),
18633            }
18634        }
18635    }
18636
18637    impl<'de> serde::de::Deserialize<'de> for BackupTier {
18638        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18639        where
18640            D: serde::Deserializer<'de>,
18641        {
18642            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupTier>::new(
18643                ".google.cloud.sql.v1.BackupConfiguration.BackupTier",
18644            ))
18645        }
18646    }
18647}
18648
18649/// Perform disk shrink context.
18650#[derive(Clone, Default, PartialEq)]
18651#[non_exhaustive]
18652pub struct PerformDiskShrinkContext {
18653    /// The target disk shrink size in GigaBytes.
18654    pub target_size_gb: i64,
18655
18656    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18657}
18658
18659impl PerformDiskShrinkContext {
18660    /// Creates a new default instance.
18661    pub fn new() -> Self {
18662        std::default::Default::default()
18663    }
18664
18665    /// Sets the value of [target_size_gb][crate::model::PerformDiskShrinkContext::target_size_gb].
18666    ///
18667    /// # Example
18668    /// ```ignore,no_run
18669    /// # use google_cloud_sql_v1::model::PerformDiskShrinkContext;
18670    /// let x = PerformDiskShrinkContext::new().set_target_size_gb(42);
18671    /// ```
18672    pub fn set_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18673        self.target_size_gb = v.into();
18674        self
18675    }
18676}
18677
18678impl wkt::message::Message for PerformDiskShrinkContext {
18679    fn typename() -> &'static str {
18680        "type.googleapis.com/google.cloud.sql.v1.PerformDiskShrinkContext"
18681    }
18682}
18683
18684/// Structured PreCheckResponse containing message, type, and required
18685/// actions.
18686#[derive(Clone, Default, PartialEq)]
18687#[non_exhaustive]
18688pub struct PreCheckResponse {
18689    /// The message to be displayed to the user.
18690    pub message: std::option::Option<std::string::String>,
18691
18692    /// The type of message whether it is an info, warning, or error.
18693    pub message_type: std::option::Option<crate::model::pre_check_response::MessageType>,
18694
18695    /// The actions that the user needs to take. Use repeated for multiple
18696    /// actions.
18697    pub actions_required: std::vec::Vec<std::string::String>,
18698
18699    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18700}
18701
18702impl PreCheckResponse {
18703    /// Creates a new default instance.
18704    pub fn new() -> Self {
18705        std::default::Default::default()
18706    }
18707
18708    /// Sets the value of [message][crate::model::PreCheckResponse::message].
18709    ///
18710    /// # Example
18711    /// ```ignore,no_run
18712    /// # use google_cloud_sql_v1::model::PreCheckResponse;
18713    /// let x = PreCheckResponse::new().set_message("example");
18714    /// ```
18715    pub fn set_message<T>(mut self, v: T) -> Self
18716    where
18717        T: std::convert::Into<std::string::String>,
18718    {
18719        self.message = std::option::Option::Some(v.into());
18720        self
18721    }
18722
18723    /// Sets or clears the value of [message][crate::model::PreCheckResponse::message].
18724    ///
18725    /// # Example
18726    /// ```ignore,no_run
18727    /// # use google_cloud_sql_v1::model::PreCheckResponse;
18728    /// let x = PreCheckResponse::new().set_or_clear_message(Some("example"));
18729    /// let x = PreCheckResponse::new().set_or_clear_message(None::<String>);
18730    /// ```
18731    pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
18732    where
18733        T: std::convert::Into<std::string::String>,
18734    {
18735        self.message = v.map(|x| x.into());
18736        self
18737    }
18738
18739    /// Sets the value of [message_type][crate::model::PreCheckResponse::message_type].
18740    ///
18741    /// # Example
18742    /// ```ignore,no_run
18743    /// # use google_cloud_sql_v1::model::PreCheckResponse;
18744    /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
18745    /// let x0 = PreCheckResponse::new().set_message_type(MessageType::Info);
18746    /// let x1 = PreCheckResponse::new().set_message_type(MessageType::Warning);
18747    /// let x2 = PreCheckResponse::new().set_message_type(MessageType::Error);
18748    /// ```
18749    pub fn set_message_type<T>(mut self, v: T) -> Self
18750    where
18751        T: std::convert::Into<crate::model::pre_check_response::MessageType>,
18752    {
18753        self.message_type = std::option::Option::Some(v.into());
18754        self
18755    }
18756
18757    /// Sets or clears the value of [message_type][crate::model::PreCheckResponse::message_type].
18758    ///
18759    /// # Example
18760    /// ```ignore,no_run
18761    /// # use google_cloud_sql_v1::model::PreCheckResponse;
18762    /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
18763    /// let x0 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Info));
18764    /// let x1 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Warning));
18765    /// let x2 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Error));
18766    /// let x_none = PreCheckResponse::new().set_or_clear_message_type(None::<MessageType>);
18767    /// ```
18768    pub fn set_or_clear_message_type<T>(mut self, v: std::option::Option<T>) -> Self
18769    where
18770        T: std::convert::Into<crate::model::pre_check_response::MessageType>,
18771    {
18772        self.message_type = v.map(|x| x.into());
18773        self
18774    }
18775
18776    /// Sets the value of [actions_required][crate::model::PreCheckResponse::actions_required].
18777    ///
18778    /// # Example
18779    /// ```ignore,no_run
18780    /// # use google_cloud_sql_v1::model::PreCheckResponse;
18781    /// let x = PreCheckResponse::new().set_actions_required(["a", "b", "c"]);
18782    /// ```
18783    pub fn set_actions_required<T, V>(mut self, v: T) -> Self
18784    where
18785        T: std::iter::IntoIterator<Item = V>,
18786        V: std::convert::Into<std::string::String>,
18787    {
18788        use std::iter::Iterator;
18789        self.actions_required = v.into_iter().map(|i| i.into()).collect();
18790        self
18791    }
18792}
18793
18794impl wkt::message::Message for PreCheckResponse {
18795    fn typename() -> &'static str {
18796        "type.googleapis.com/google.cloud.sql.v1.PreCheckResponse"
18797    }
18798}
18799
18800/// Defines additional types related to [PreCheckResponse].
18801pub mod pre_check_response {
18802    #[allow(unused_imports)]
18803    use super::*;
18804
18805    /// The type of message which can be an info, a warning, or an error that
18806    /// requires user intervention.
18807    ///
18808    /// # Working with unknown values
18809    ///
18810    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18811    /// additional enum variants at any time. Adding new variants is not considered
18812    /// a breaking change. Applications should write their code in anticipation of:
18813    ///
18814    /// - New values appearing in future releases of the client library, **and**
18815    /// - New values received dynamically, without application changes.
18816    ///
18817    /// Please consult the [Working with enums] section in the user guide for some
18818    /// guidelines.
18819    ///
18820    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18821    #[derive(Clone, Debug, PartialEq)]
18822    #[non_exhaustive]
18823    pub enum MessageType {
18824        /// Default unspecified value to prevent unintended behavior changes.
18825        Unspecified,
18826        /// General informational messages that don't require action.
18827        Info,
18828        /// Warnings that might impact the upgrade but don't block it.
18829        Warning,
18830        /// Errors that a user must resolve before proceeding with the upgrade.
18831        Error,
18832        /// If set, the enum was initialized with an unknown value.
18833        ///
18834        /// Applications can examine the value using [MessageType::value] or
18835        /// [MessageType::name].
18836        UnknownValue(message_type::UnknownValue),
18837    }
18838
18839    #[doc(hidden)]
18840    pub mod message_type {
18841        #[allow(unused_imports)]
18842        use super::*;
18843        #[derive(Clone, Debug, PartialEq)]
18844        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18845    }
18846
18847    impl MessageType {
18848        /// Gets the enum value.
18849        ///
18850        /// Returns `None` if the enum contains an unknown value deserialized from
18851        /// the string representation of enums.
18852        pub fn value(&self) -> std::option::Option<i32> {
18853            match self {
18854                Self::Unspecified => std::option::Option::Some(0),
18855                Self::Info => std::option::Option::Some(1),
18856                Self::Warning => std::option::Option::Some(2),
18857                Self::Error => std::option::Option::Some(3),
18858                Self::UnknownValue(u) => u.0.value(),
18859            }
18860        }
18861
18862        /// Gets the enum value as a string.
18863        ///
18864        /// Returns `None` if the enum contains an unknown value deserialized from
18865        /// the integer representation of enums.
18866        pub fn name(&self) -> std::option::Option<&str> {
18867            match self {
18868                Self::Unspecified => std::option::Option::Some("MESSAGE_TYPE_UNSPECIFIED"),
18869                Self::Info => std::option::Option::Some("INFO"),
18870                Self::Warning => std::option::Option::Some("WARNING"),
18871                Self::Error => std::option::Option::Some("ERROR"),
18872                Self::UnknownValue(u) => u.0.name(),
18873            }
18874        }
18875    }
18876
18877    impl std::default::Default for MessageType {
18878        fn default() -> Self {
18879            use std::convert::From;
18880            Self::from(0)
18881        }
18882    }
18883
18884    impl std::fmt::Display for MessageType {
18885        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18886            wkt::internal::display_enum(f, self.name(), self.value())
18887        }
18888    }
18889
18890    impl std::convert::From<i32> for MessageType {
18891        fn from(value: i32) -> Self {
18892            match value {
18893                0 => Self::Unspecified,
18894                1 => Self::Info,
18895                2 => Self::Warning,
18896                3 => Self::Error,
18897                _ => Self::UnknownValue(message_type::UnknownValue(
18898                    wkt::internal::UnknownEnumValue::Integer(value),
18899                )),
18900            }
18901        }
18902    }
18903
18904    impl std::convert::From<&str> for MessageType {
18905        fn from(value: &str) -> Self {
18906            use std::string::ToString;
18907            match value {
18908                "MESSAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
18909                "INFO" => Self::Info,
18910                "WARNING" => Self::Warning,
18911                "ERROR" => Self::Error,
18912                _ => Self::UnknownValue(message_type::UnknownValue(
18913                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18914                )),
18915            }
18916        }
18917    }
18918
18919    impl serde::ser::Serialize for MessageType {
18920        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18921        where
18922            S: serde::Serializer,
18923        {
18924            match self {
18925                Self::Unspecified => serializer.serialize_i32(0),
18926                Self::Info => serializer.serialize_i32(1),
18927                Self::Warning => serializer.serialize_i32(2),
18928                Self::Error => serializer.serialize_i32(3),
18929                Self::UnknownValue(u) => u.0.serialize(serializer),
18930            }
18931        }
18932    }
18933
18934    impl<'de> serde::de::Deserialize<'de> for MessageType {
18935        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18936        where
18937            D: serde::Deserializer<'de>,
18938        {
18939            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MessageType>::new(
18940                ".google.cloud.sql.v1.PreCheckResponse.MessageType",
18941            ))
18942        }
18943    }
18944}
18945
18946/// Pre-check major version upgrade context.
18947#[derive(Clone, Default, PartialEq)]
18948#[non_exhaustive]
18949pub struct PreCheckMajorVersionUpgradeContext {
18950    /// Required. The target database version to upgrade to.
18951    pub target_database_version: crate::model::SqlDatabaseVersion,
18952
18953    /// Output only. The responses from the precheck operation.
18954    pub pre_check_response: std::vec::Vec<crate::model::PreCheckResponse>,
18955
18956    /// Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
18957    pub kind: std::string::String,
18958
18959    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18960}
18961
18962impl PreCheckMajorVersionUpgradeContext {
18963    /// Creates a new default instance.
18964    pub fn new() -> Self {
18965        std::default::Default::default()
18966    }
18967
18968    /// Sets the value of [target_database_version][crate::model::PreCheckMajorVersionUpgradeContext::target_database_version].
18969    ///
18970    /// # Example
18971    /// ```ignore,no_run
18972    /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
18973    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
18974    /// let x0 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql56);
18975    /// let x1 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql57);
18976    /// let x2 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql80);
18977    /// ```
18978    pub fn set_target_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
18979        mut self,
18980        v: T,
18981    ) -> Self {
18982        self.target_database_version = v.into();
18983        self
18984    }
18985
18986    /// Sets the value of [pre_check_response][crate::model::PreCheckMajorVersionUpgradeContext::pre_check_response].
18987    ///
18988    /// # Example
18989    /// ```ignore,no_run
18990    /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
18991    /// use google_cloud_sql_v1::model::PreCheckResponse;
18992    /// let x = PreCheckMajorVersionUpgradeContext::new()
18993    ///     .set_pre_check_response([
18994    ///         PreCheckResponse::default()/* use setters */,
18995    ///         PreCheckResponse::default()/* use (different) setters */,
18996    ///     ]);
18997    /// ```
18998    pub fn set_pre_check_response<T, V>(mut self, v: T) -> Self
18999    where
19000        T: std::iter::IntoIterator<Item = V>,
19001        V: std::convert::Into<crate::model::PreCheckResponse>,
19002    {
19003        use std::iter::Iterator;
19004        self.pre_check_response = v.into_iter().map(|i| i.into()).collect();
19005        self
19006    }
19007
19008    /// Sets the value of [kind][crate::model::PreCheckMajorVersionUpgradeContext::kind].
19009    ///
19010    /// # Example
19011    /// ```ignore,no_run
19012    /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
19013    /// let x = PreCheckMajorVersionUpgradeContext::new().set_kind("example");
19014    /// ```
19015    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19016        self.kind = v.into();
19017        self
19018    }
19019}
19020
19021impl wkt::message::Message for PreCheckMajorVersionUpgradeContext {
19022    fn typename() -> &'static str {
19023        "type.googleapis.com/google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext"
19024    }
19025}
19026
19027/// Backup context.
19028#[derive(Clone, Default, PartialEq)]
19029#[non_exhaustive]
19030pub struct BackupContext {
19031    /// The identifier of the backup.
19032    pub backup_id: i64,
19033
19034    /// This is always `sql#backupContext`.
19035    pub kind: std::string::String,
19036
19037    /// The name of the backup.
19038    /// Format: projects/{project}/backups/{backup}
19039    pub name: std::string::String,
19040
19041    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19042}
19043
19044impl BackupContext {
19045    /// Creates a new default instance.
19046    pub fn new() -> Self {
19047        std::default::Default::default()
19048    }
19049
19050    /// Sets the value of [backup_id][crate::model::BackupContext::backup_id].
19051    ///
19052    /// # Example
19053    /// ```ignore,no_run
19054    /// # use google_cloud_sql_v1::model::BackupContext;
19055    /// let x = BackupContext::new().set_backup_id(42);
19056    /// ```
19057    pub fn set_backup_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
19058        self.backup_id = v.into();
19059        self
19060    }
19061
19062    /// Sets the value of [kind][crate::model::BackupContext::kind].
19063    ///
19064    /// # Example
19065    /// ```ignore,no_run
19066    /// # use google_cloud_sql_v1::model::BackupContext;
19067    /// let x = BackupContext::new().set_kind("example");
19068    /// ```
19069    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19070        self.kind = v.into();
19071        self
19072    }
19073
19074    /// Sets the value of [name][crate::model::BackupContext::name].
19075    ///
19076    /// # Example
19077    /// ```ignore,no_run
19078    /// # use google_cloud_sql_v1::model::BackupContext;
19079    /// let x = BackupContext::new().set_name("example");
19080    /// ```
19081    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19082        self.name = v.into();
19083        self
19084    }
19085}
19086
19087impl wkt::message::Message for BackupContext {
19088    fn typename() -> &'static str {
19089        "type.googleapis.com/google.cloud.sql.v1.BackupContext"
19090    }
19091}
19092
19093/// Represents a SQL database on the Cloud SQL instance.
19094#[derive(Clone, Default, PartialEq)]
19095#[non_exhaustive]
19096pub struct Database {
19097    /// This is always `sql#database`.
19098    pub kind: std::string::String,
19099
19100    /// The Cloud SQL charset value.
19101    pub charset: std::string::String,
19102
19103    /// The Cloud SQL collation value.
19104    pub collation: std::string::String,
19105
19106    /// This field is deprecated and will be removed from a future version of the
19107    /// API.
19108    pub etag: std::string::String,
19109
19110    /// The name of the database in the Cloud SQL instance. This does not include
19111    /// the project ID or instance name.
19112    pub name: std::string::String,
19113
19114    /// The name of the Cloud SQL instance. This does not include the project ID.
19115    pub instance: std::string::String,
19116
19117    /// The URI of this resource.
19118    pub self_link: std::string::String,
19119
19120    /// The project ID of the project containing the Cloud SQL database. The Google
19121    /// apps domain is prefixed if applicable.
19122    pub project: std::string::String,
19123
19124    #[allow(missing_docs)]
19125    pub database_details: std::option::Option<crate::model::database::DatabaseDetails>,
19126
19127    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19128}
19129
19130impl Database {
19131    /// Creates a new default instance.
19132    pub fn new() -> Self {
19133        std::default::Default::default()
19134    }
19135
19136    /// Sets the value of [kind][crate::model::Database::kind].
19137    ///
19138    /// # Example
19139    /// ```ignore,no_run
19140    /// # use google_cloud_sql_v1::model::Database;
19141    /// let x = Database::new().set_kind("example");
19142    /// ```
19143    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19144        self.kind = v.into();
19145        self
19146    }
19147
19148    /// Sets the value of [charset][crate::model::Database::charset].
19149    ///
19150    /// # Example
19151    /// ```ignore,no_run
19152    /// # use google_cloud_sql_v1::model::Database;
19153    /// let x = Database::new().set_charset("example");
19154    /// ```
19155    pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19156        self.charset = v.into();
19157        self
19158    }
19159
19160    /// Sets the value of [collation][crate::model::Database::collation].
19161    ///
19162    /// # Example
19163    /// ```ignore,no_run
19164    /// # use google_cloud_sql_v1::model::Database;
19165    /// let x = Database::new().set_collation("example");
19166    /// ```
19167    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19168        self.collation = v.into();
19169        self
19170    }
19171
19172    /// Sets the value of [etag][crate::model::Database::etag].
19173    ///
19174    /// # Example
19175    /// ```ignore,no_run
19176    /// # use google_cloud_sql_v1::model::Database;
19177    /// let x = Database::new().set_etag("example");
19178    /// ```
19179    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19180        self.etag = v.into();
19181        self
19182    }
19183
19184    /// Sets the value of [name][crate::model::Database::name].
19185    ///
19186    /// # Example
19187    /// ```ignore,no_run
19188    /// # use google_cloud_sql_v1::model::Database;
19189    /// let x = Database::new().set_name("example");
19190    /// ```
19191    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19192        self.name = v.into();
19193        self
19194    }
19195
19196    /// Sets the value of [instance][crate::model::Database::instance].
19197    ///
19198    /// # Example
19199    /// ```ignore,no_run
19200    /// # use google_cloud_sql_v1::model::Database;
19201    /// let x = Database::new().set_instance("example");
19202    /// ```
19203    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19204        self.instance = v.into();
19205        self
19206    }
19207
19208    /// Sets the value of [self_link][crate::model::Database::self_link].
19209    ///
19210    /// # Example
19211    /// ```ignore,no_run
19212    /// # use google_cloud_sql_v1::model::Database;
19213    /// let x = Database::new().set_self_link("example");
19214    /// ```
19215    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19216        self.self_link = v.into();
19217        self
19218    }
19219
19220    /// Sets the value of [project][crate::model::Database::project].
19221    ///
19222    /// # Example
19223    /// ```ignore,no_run
19224    /// # use google_cloud_sql_v1::model::Database;
19225    /// let x = Database::new().set_project("example");
19226    /// ```
19227    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19228        self.project = v.into();
19229        self
19230    }
19231
19232    /// Sets the value of [database_details][crate::model::Database::database_details].
19233    ///
19234    /// Note that all the setters affecting `database_details` are mutually
19235    /// exclusive.
19236    ///
19237    /// # Example
19238    /// ```ignore,no_run
19239    /// # use google_cloud_sql_v1::model::Database;
19240    /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19241    /// let x = Database::new().set_database_details(Some(
19242    ///     google_cloud_sql_v1::model::database::DatabaseDetails::SqlserverDatabaseDetails(SqlServerDatabaseDetails::default().into())));
19243    /// ```
19244    pub fn set_database_details<
19245        T: std::convert::Into<std::option::Option<crate::model::database::DatabaseDetails>>,
19246    >(
19247        mut self,
19248        v: T,
19249    ) -> Self {
19250        self.database_details = v.into();
19251        self
19252    }
19253
19254    /// The value of [database_details][crate::model::Database::database_details]
19255    /// if it holds a `SqlserverDatabaseDetails`, `None` if the field is not set or
19256    /// holds a different branch.
19257    pub fn sqlserver_database_details(
19258        &self,
19259    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerDatabaseDetails>> {
19260        #[allow(unreachable_patterns)]
19261        self.database_details.as_ref().and_then(|v| match v {
19262            crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v) => {
19263                std::option::Option::Some(v)
19264            }
19265            _ => std::option::Option::None,
19266        })
19267    }
19268
19269    /// Sets the value of [database_details][crate::model::Database::database_details]
19270    /// to hold a `SqlserverDatabaseDetails`.
19271    ///
19272    /// Note that all the setters affecting `database_details` are
19273    /// mutually exclusive.
19274    ///
19275    /// # Example
19276    /// ```ignore,no_run
19277    /// # use google_cloud_sql_v1::model::Database;
19278    /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19279    /// let x = Database::new().set_sqlserver_database_details(SqlServerDatabaseDetails::default()/* use setters */);
19280    /// assert!(x.sqlserver_database_details().is_some());
19281    /// ```
19282    pub fn set_sqlserver_database_details<
19283        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerDatabaseDetails>>,
19284    >(
19285        mut self,
19286        v: T,
19287    ) -> Self {
19288        self.database_details = std::option::Option::Some(
19289            crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v.into()),
19290        );
19291        self
19292    }
19293}
19294
19295impl wkt::message::Message for Database {
19296    fn typename() -> &'static str {
19297        "type.googleapis.com/google.cloud.sql.v1.Database"
19298    }
19299}
19300
19301/// Defines additional types related to [Database].
19302pub mod database {
19303    #[allow(unused_imports)]
19304    use super::*;
19305
19306    #[allow(missing_docs)]
19307    #[derive(Clone, Debug, PartialEq)]
19308    #[non_exhaustive]
19309    pub enum DatabaseDetails {
19310        #[allow(missing_docs)]
19311        SqlserverDatabaseDetails(std::boxed::Box<crate::model::SqlServerDatabaseDetails>),
19312    }
19313}
19314
19315/// Represents a Sql Server database on the Cloud SQL instance.
19316#[derive(Clone, Default, PartialEq)]
19317#[non_exhaustive]
19318pub struct SqlServerDatabaseDetails {
19319    /// The version of SQL Server with which the database is to be made compatible
19320    pub compatibility_level: i32,
19321
19322    /// The recovery model of a SQL Server database
19323    pub recovery_model: std::string::String,
19324
19325    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19326}
19327
19328impl SqlServerDatabaseDetails {
19329    /// Creates a new default instance.
19330    pub fn new() -> Self {
19331        std::default::Default::default()
19332    }
19333
19334    /// Sets the value of [compatibility_level][crate::model::SqlServerDatabaseDetails::compatibility_level].
19335    ///
19336    /// # Example
19337    /// ```ignore,no_run
19338    /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19339    /// let x = SqlServerDatabaseDetails::new().set_compatibility_level(42);
19340    /// ```
19341    pub fn set_compatibility_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19342        self.compatibility_level = v.into();
19343        self
19344    }
19345
19346    /// Sets the value of [recovery_model][crate::model::SqlServerDatabaseDetails::recovery_model].
19347    ///
19348    /// # Example
19349    /// ```ignore,no_run
19350    /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19351    /// let x = SqlServerDatabaseDetails::new().set_recovery_model("example");
19352    /// ```
19353    pub fn set_recovery_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19354        self.recovery_model = v.into();
19355        self
19356    }
19357}
19358
19359impl wkt::message::Message for SqlServerDatabaseDetails {
19360    fn typename() -> &'static str {
19361        "type.googleapis.com/google.cloud.sql.v1.SqlServerDatabaseDetails"
19362    }
19363}
19364
19365/// Database flags for Cloud SQL instances.
19366#[derive(Clone, Default, PartialEq)]
19367#[non_exhaustive]
19368pub struct DatabaseFlags {
19369    /// The name of the flag. These flags are passed at instance startup, so
19370    /// include both server options and system variables. Flags are
19371    /// specified with underscores, not hyphens. For more information, see
19372    /// [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
19373    /// in the Cloud SQL documentation.
19374    pub name: std::string::String,
19375
19376    /// The value of the flag. Boolean flags are set to `on` for true
19377    /// and `off` for false. This field must be omitted if the flag
19378    /// doesn't take a value.
19379    pub value: std::string::String,
19380
19381    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19382}
19383
19384impl DatabaseFlags {
19385    /// Creates a new default instance.
19386    pub fn new() -> Self {
19387        std::default::Default::default()
19388    }
19389
19390    /// Sets the value of [name][crate::model::DatabaseFlags::name].
19391    ///
19392    /// # Example
19393    /// ```ignore,no_run
19394    /// # use google_cloud_sql_v1::model::DatabaseFlags;
19395    /// let x = DatabaseFlags::new().set_name("example");
19396    /// ```
19397    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19398        self.name = v.into();
19399        self
19400    }
19401
19402    /// Sets the value of [value][crate::model::DatabaseFlags::value].
19403    ///
19404    /// # Example
19405    /// ```ignore,no_run
19406    /// # use google_cloud_sql_v1::model::DatabaseFlags;
19407    /// let x = DatabaseFlags::new().set_value("example");
19408    /// ```
19409    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19410        self.value = v.into();
19411        self
19412    }
19413}
19414
19415impl wkt::message::Message for DatabaseFlags {
19416    fn typename() -> &'static str {
19417        "type.googleapis.com/google.cloud.sql.v1.DatabaseFlags"
19418    }
19419}
19420
19421/// MySQL-specific external server sync settings.
19422#[derive(Clone, Default, PartialEq)]
19423#[non_exhaustive]
19424pub struct MySqlSyncConfig {
19425    /// Flags to use for the initial dump.
19426    pub initial_sync_flags: std::vec::Vec<crate::model::SyncFlags>,
19427
19428    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19429}
19430
19431impl MySqlSyncConfig {
19432    /// Creates a new default instance.
19433    pub fn new() -> Self {
19434        std::default::Default::default()
19435    }
19436
19437    /// Sets the value of [initial_sync_flags][crate::model::MySqlSyncConfig::initial_sync_flags].
19438    ///
19439    /// # Example
19440    /// ```ignore,no_run
19441    /// # use google_cloud_sql_v1::model::MySqlSyncConfig;
19442    /// use google_cloud_sql_v1::model::SyncFlags;
19443    /// let x = MySqlSyncConfig::new()
19444    ///     .set_initial_sync_flags([
19445    ///         SyncFlags::default()/* use setters */,
19446    ///         SyncFlags::default()/* use (different) setters */,
19447    ///     ]);
19448    /// ```
19449    pub fn set_initial_sync_flags<T, V>(mut self, v: T) -> Self
19450    where
19451        T: std::iter::IntoIterator<Item = V>,
19452        V: std::convert::Into<crate::model::SyncFlags>,
19453    {
19454        use std::iter::Iterator;
19455        self.initial_sync_flags = v.into_iter().map(|i| i.into()).collect();
19456        self
19457    }
19458}
19459
19460impl wkt::message::Message for MySqlSyncConfig {
19461    fn typename() -> &'static str {
19462        "type.googleapis.com/google.cloud.sql.v1.MySqlSyncConfig"
19463    }
19464}
19465
19466/// Initial sync flags for certain Cloud SQL APIs.
19467/// Currently used for the MySQL external server initial dump.
19468#[derive(Clone, Default, PartialEq)]
19469#[non_exhaustive]
19470pub struct SyncFlags {
19471    /// The name of the flag.
19472    pub name: std::string::String,
19473
19474    /// The value of the flag. This field must be omitted if the flag
19475    /// doesn't take a value.
19476    pub value: std::string::String,
19477
19478    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19479}
19480
19481impl SyncFlags {
19482    /// Creates a new default instance.
19483    pub fn new() -> Self {
19484        std::default::Default::default()
19485    }
19486
19487    /// Sets the value of [name][crate::model::SyncFlags::name].
19488    ///
19489    /// # Example
19490    /// ```ignore,no_run
19491    /// # use google_cloud_sql_v1::model::SyncFlags;
19492    /// let x = SyncFlags::new().set_name("example");
19493    /// ```
19494    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19495        self.name = v.into();
19496        self
19497    }
19498
19499    /// Sets the value of [value][crate::model::SyncFlags::value].
19500    ///
19501    /// # Example
19502    /// ```ignore,no_run
19503    /// # use google_cloud_sql_v1::model::SyncFlags;
19504    /// let x = SyncFlags::new().set_value("example");
19505    /// ```
19506    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19507        self.value = v.into();
19508        self
19509    }
19510}
19511
19512impl wkt::message::Message for SyncFlags {
19513    fn typename() -> &'static str {
19514        "type.googleapis.com/google.cloud.sql.v1.SyncFlags"
19515    }
19516}
19517
19518/// Reference to another Cloud SQL instance.
19519#[derive(Clone, Default, PartialEq)]
19520#[non_exhaustive]
19521pub struct InstanceReference {
19522    /// The name of the Cloud SQL instance being referenced.
19523    /// This does not include the project ID.
19524    pub name: std::string::String,
19525
19526    /// The region of the Cloud SQL instance being referenced.
19527    pub region: std::string::String,
19528
19529    /// The project ID of the Cloud SQL instance being referenced.
19530    /// The default is the same project ID as the instance references it.
19531    pub project: std::string::String,
19532
19533    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19534}
19535
19536impl InstanceReference {
19537    /// Creates a new default instance.
19538    pub fn new() -> Self {
19539        std::default::Default::default()
19540    }
19541
19542    /// Sets the value of [name][crate::model::InstanceReference::name].
19543    ///
19544    /// # Example
19545    /// ```ignore,no_run
19546    /// # use google_cloud_sql_v1::model::InstanceReference;
19547    /// let x = InstanceReference::new().set_name("example");
19548    /// ```
19549    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19550        self.name = v.into();
19551        self
19552    }
19553
19554    /// Sets the value of [region][crate::model::InstanceReference::region].
19555    ///
19556    /// # Example
19557    /// ```ignore,no_run
19558    /// # use google_cloud_sql_v1::model::InstanceReference;
19559    /// let x = InstanceReference::new().set_region("example");
19560    /// ```
19561    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19562        self.region = v.into();
19563        self
19564    }
19565
19566    /// Sets the value of [project][crate::model::InstanceReference::project].
19567    ///
19568    /// # Example
19569    /// ```ignore,no_run
19570    /// # use google_cloud_sql_v1::model::InstanceReference;
19571    /// let x = InstanceReference::new().set_project("example");
19572    /// ```
19573    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19574        self.project = v.into();
19575        self
19576    }
19577}
19578
19579impl wkt::message::Message for InstanceReference {
19580    fn typename() -> &'static str {
19581        "type.googleapis.com/google.cloud.sql.v1.InstanceReference"
19582    }
19583}
19584
19585/// Read-replica configuration for connecting to the on-premises primary
19586/// instance.
19587#[derive(Clone, Default, PartialEq)]
19588#[non_exhaustive]
19589pub struct DemoteMasterConfiguration {
19590    /// This is always `sql#demoteMasterConfiguration`.
19591    pub kind: std::string::String,
19592
19593    /// MySQL specific configuration when replicating from a MySQL on-premises
19594    /// primary instance. Replication configuration information such as the
19595    /// username, password, certificates, and keys are not stored in the instance
19596    /// metadata. The configuration information is used only to set up the
19597    /// replication connection and is stored by MySQL in a file named
19598    /// `master.info` in the data directory.
19599    pub mysql_replica_configuration:
19600        std::option::Option<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19601
19602    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19603}
19604
19605impl DemoteMasterConfiguration {
19606    /// Creates a new default instance.
19607    pub fn new() -> Self {
19608        std::default::Default::default()
19609    }
19610
19611    /// Sets the value of [kind][crate::model::DemoteMasterConfiguration::kind].
19612    ///
19613    /// # Example
19614    /// ```ignore,no_run
19615    /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19616    /// let x = DemoteMasterConfiguration::new().set_kind("example");
19617    /// ```
19618    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19619        self.kind = v.into();
19620        self
19621    }
19622
19623    /// Sets the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
19624    ///
19625    /// # Example
19626    /// ```ignore,no_run
19627    /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19628    /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19629    /// let x = DemoteMasterConfiguration::new().set_mysql_replica_configuration(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */);
19630    /// ```
19631    pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
19632    where
19633        T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19634    {
19635        self.mysql_replica_configuration = std::option::Option::Some(v.into());
19636        self
19637    }
19638
19639    /// Sets or clears the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
19640    ///
19641    /// # Example
19642    /// ```ignore,no_run
19643    /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19644    /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19645    /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(Some(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */));
19646    /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(None::<DemoteMasterMySqlReplicaConfiguration>);
19647    /// ```
19648    pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
19649    where
19650        T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19651    {
19652        self.mysql_replica_configuration = v.map(|x| x.into());
19653        self
19654    }
19655}
19656
19657impl wkt::message::Message for DemoteMasterConfiguration {
19658    fn typename() -> &'static str {
19659        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterConfiguration"
19660    }
19661}
19662
19663/// Read-replica configuration specific to MySQL databases.
19664#[derive(Clone, Default, PartialEq)]
19665#[non_exhaustive]
19666pub struct DemoteMasterMySqlReplicaConfiguration {
19667    /// This is always `sql#demoteMasterMysqlReplicaConfiguration`.
19668    pub kind: std::string::String,
19669
19670    /// The username for the replication connection.
19671    pub username: std::string::String,
19672
19673    /// The password for the replication connection.
19674    pub password: std::string::String,
19675
19676    /// PEM representation of the replica's private key. The corresponding public
19677    /// key is encoded in the client's certificate. The format of the replica's
19678    /// private key can be either PKCS #1 or PKCS #8.
19679    pub client_key: std::string::String,
19680
19681    /// PEM representation of the replica's x509 certificate.
19682    pub client_certificate: std::string::String,
19683
19684    /// PEM representation of the trusted CA's x509 certificate.
19685    pub ca_certificate: std::string::String,
19686
19687    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19688}
19689
19690impl DemoteMasterMySqlReplicaConfiguration {
19691    /// Creates a new default instance.
19692    pub fn new() -> Self {
19693        std::default::Default::default()
19694    }
19695
19696    /// Sets the value of [kind][crate::model::DemoteMasterMySqlReplicaConfiguration::kind].
19697    ///
19698    /// # Example
19699    /// ```ignore,no_run
19700    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19701    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_kind("example");
19702    /// ```
19703    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19704        self.kind = v.into();
19705        self
19706    }
19707
19708    /// Sets the value of [username][crate::model::DemoteMasterMySqlReplicaConfiguration::username].
19709    ///
19710    /// # Example
19711    /// ```ignore,no_run
19712    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19713    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_username("example");
19714    /// ```
19715    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19716        self.username = v.into();
19717        self
19718    }
19719
19720    /// Sets the value of [password][crate::model::DemoteMasterMySqlReplicaConfiguration::password].
19721    ///
19722    /// # Example
19723    /// ```ignore,no_run
19724    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19725    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_password("example");
19726    /// ```
19727    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19728        self.password = v.into();
19729        self
19730    }
19731
19732    /// Sets the value of [client_key][crate::model::DemoteMasterMySqlReplicaConfiguration::client_key].
19733    ///
19734    /// # Example
19735    /// ```ignore,no_run
19736    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19737    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_key("example");
19738    /// ```
19739    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19740        self.client_key = v.into();
19741        self
19742    }
19743
19744    /// Sets the value of [client_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::client_certificate].
19745    ///
19746    /// # Example
19747    /// ```ignore,no_run
19748    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19749    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_certificate("example");
19750    /// ```
19751    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
19752        mut self,
19753        v: T,
19754    ) -> Self {
19755        self.client_certificate = v.into();
19756        self
19757    }
19758
19759    /// Sets the value of [ca_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::ca_certificate].
19760    ///
19761    /// # Example
19762    /// ```ignore,no_run
19763    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19764    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_ca_certificate("example");
19765    /// ```
19766    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19767        self.ca_certificate = v.into();
19768        self
19769    }
19770}
19771
19772impl wkt::message::Message for DemoteMasterMySqlReplicaConfiguration {
19773    fn typename() -> &'static str {
19774        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration"
19775    }
19776}
19777
19778/// Database instance export context.
19779#[derive(Clone, Default, PartialEq)]
19780#[non_exhaustive]
19781pub struct ExportContext {
19782    /// The path to the file in Google Cloud Storage where the export will be
19783    /// stored. The URI is in the form `gs://bucketName/fileName`. If the file
19784    /// already exists, the request succeeds, but the operation fails. If
19785    /// `fileType` is `SQL` and the filename ends with .gz,
19786    /// the contents are compressed.
19787    pub uri: std::string::String,
19788
19789    /// Databases to be exported. <br /> `MySQL instances:` If
19790    /// `fileType` is `SQL` and no database is specified, all
19791    /// databases are exported, except for the `mysql` system database.
19792    /// If `fileType` is `CSV`, you can specify one database,
19793    /// either by using this property or by using the
19794    /// `csvExportOptions.selectQuery` property, which takes precedence
19795    /// over this property. <br /> `PostgreSQL instances:` If you don't specify a
19796    /// database by name, all user databases in the instance are exported.
19797    /// This excludes system databases and Cloud SQL databases used to manage
19798    /// internal operations. Exporting all user databases is only available for
19799    /// directory-formatted parallel export. If `fileType` is `CSV`,
19800    /// this database must match the one specified in the
19801    /// `csvExportOptions.selectQuery` property. <br /> `SQL Server
19802    /// instances:` You must specify one database to be exported, and the
19803    /// `fileType` must be `BAK`.
19804    pub databases: std::vec::Vec<std::string::String>,
19805
19806    /// This is always `sql#exportContext`.
19807    pub kind: std::string::String,
19808
19809    /// Options for exporting data as SQL statements.
19810    pub sql_export_options: std::option::Option<crate::model::export_context::SqlExportOptions>,
19811
19812    /// Options for exporting data as CSV. `MySQL` and `PostgreSQL`
19813    /// instances only.
19814    pub csv_export_options: std::option::Option<crate::model::export_context::SqlCsvExportOptions>,
19815
19816    /// The file type for the specified uri.
19817    pub file_type: crate::model::SqlFileType,
19818
19819    /// Whether to perform a serverless export.
19820    pub offload: std::option::Option<wkt::BoolValue>,
19821
19822    /// Options for exporting data as BAK files.
19823    pub bak_export_options: std::option::Option<crate::model::export_context::SqlBakExportOptions>,
19824
19825    /// Optional. Export parameters specific to SQL Server TDE certificates
19826    pub tde_export_options: std::option::Option<crate::model::export_context::SqlTdeExportOptions>,
19827
19828    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19829}
19830
19831impl ExportContext {
19832    /// Creates a new default instance.
19833    pub fn new() -> Self {
19834        std::default::Default::default()
19835    }
19836
19837    /// Sets the value of [uri][crate::model::ExportContext::uri].
19838    ///
19839    /// # Example
19840    /// ```ignore,no_run
19841    /// # use google_cloud_sql_v1::model::ExportContext;
19842    /// let x = ExportContext::new().set_uri("example");
19843    /// ```
19844    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19845        self.uri = v.into();
19846        self
19847    }
19848
19849    /// Sets the value of [databases][crate::model::ExportContext::databases].
19850    ///
19851    /// # Example
19852    /// ```ignore,no_run
19853    /// # use google_cloud_sql_v1::model::ExportContext;
19854    /// let x = ExportContext::new().set_databases(["a", "b", "c"]);
19855    /// ```
19856    pub fn set_databases<T, V>(mut self, v: T) -> Self
19857    where
19858        T: std::iter::IntoIterator<Item = V>,
19859        V: std::convert::Into<std::string::String>,
19860    {
19861        use std::iter::Iterator;
19862        self.databases = v.into_iter().map(|i| i.into()).collect();
19863        self
19864    }
19865
19866    /// Sets the value of [kind][crate::model::ExportContext::kind].
19867    ///
19868    /// # Example
19869    /// ```ignore,no_run
19870    /// # use google_cloud_sql_v1::model::ExportContext;
19871    /// let x = ExportContext::new().set_kind("example");
19872    /// ```
19873    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19874        self.kind = v.into();
19875        self
19876    }
19877
19878    /// Sets the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
19879    ///
19880    /// # Example
19881    /// ```ignore,no_run
19882    /// # use google_cloud_sql_v1::model::ExportContext;
19883    /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19884    /// let x = ExportContext::new().set_sql_export_options(SqlExportOptions::default()/* use setters */);
19885    /// ```
19886    pub fn set_sql_export_options<T>(mut self, v: T) -> Self
19887    where
19888        T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
19889    {
19890        self.sql_export_options = std::option::Option::Some(v.into());
19891        self
19892    }
19893
19894    /// Sets or clears the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
19895    ///
19896    /// # Example
19897    /// ```ignore,no_run
19898    /// # use google_cloud_sql_v1::model::ExportContext;
19899    /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19900    /// let x = ExportContext::new().set_or_clear_sql_export_options(Some(SqlExportOptions::default()/* use setters */));
19901    /// let x = ExportContext::new().set_or_clear_sql_export_options(None::<SqlExportOptions>);
19902    /// ```
19903    pub fn set_or_clear_sql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19904    where
19905        T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
19906    {
19907        self.sql_export_options = v.map(|x| x.into());
19908        self
19909    }
19910
19911    /// Sets the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
19912    ///
19913    /// # Example
19914    /// ```ignore,no_run
19915    /// # use google_cloud_sql_v1::model::ExportContext;
19916    /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19917    /// let x = ExportContext::new().set_csv_export_options(SqlCsvExportOptions::default()/* use setters */);
19918    /// ```
19919    pub fn set_csv_export_options<T>(mut self, v: T) -> Self
19920    where
19921        T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
19922    {
19923        self.csv_export_options = std::option::Option::Some(v.into());
19924        self
19925    }
19926
19927    /// Sets or clears the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
19928    ///
19929    /// # Example
19930    /// ```ignore,no_run
19931    /// # use google_cloud_sql_v1::model::ExportContext;
19932    /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19933    /// let x = ExportContext::new().set_or_clear_csv_export_options(Some(SqlCsvExportOptions::default()/* use setters */));
19934    /// let x = ExportContext::new().set_or_clear_csv_export_options(None::<SqlCsvExportOptions>);
19935    /// ```
19936    pub fn set_or_clear_csv_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19937    where
19938        T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
19939    {
19940        self.csv_export_options = v.map(|x| x.into());
19941        self
19942    }
19943
19944    /// Sets the value of [file_type][crate::model::ExportContext::file_type].
19945    ///
19946    /// # Example
19947    /// ```ignore,no_run
19948    /// # use google_cloud_sql_v1::model::ExportContext;
19949    /// use google_cloud_sql_v1::model::SqlFileType;
19950    /// let x0 = ExportContext::new().set_file_type(SqlFileType::Sql);
19951    /// let x1 = ExportContext::new().set_file_type(SqlFileType::Csv);
19952    /// let x2 = ExportContext::new().set_file_type(SqlFileType::Bak);
19953    /// ```
19954    pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
19955        self.file_type = v.into();
19956        self
19957    }
19958
19959    /// Sets the value of [offload][crate::model::ExportContext::offload].
19960    ///
19961    /// # Example
19962    /// ```ignore,no_run
19963    /// # use google_cloud_sql_v1::model::ExportContext;
19964    /// use wkt::BoolValue;
19965    /// let x = ExportContext::new().set_offload(BoolValue::default()/* use setters */);
19966    /// ```
19967    pub fn set_offload<T>(mut self, v: T) -> Self
19968    where
19969        T: std::convert::Into<wkt::BoolValue>,
19970    {
19971        self.offload = std::option::Option::Some(v.into());
19972        self
19973    }
19974
19975    /// Sets or clears the value of [offload][crate::model::ExportContext::offload].
19976    ///
19977    /// # Example
19978    /// ```ignore,no_run
19979    /// # use google_cloud_sql_v1::model::ExportContext;
19980    /// use wkt::BoolValue;
19981    /// let x = ExportContext::new().set_or_clear_offload(Some(BoolValue::default()/* use setters */));
19982    /// let x = ExportContext::new().set_or_clear_offload(None::<BoolValue>);
19983    /// ```
19984    pub fn set_or_clear_offload<T>(mut self, v: std::option::Option<T>) -> Self
19985    where
19986        T: std::convert::Into<wkt::BoolValue>,
19987    {
19988        self.offload = v.map(|x| x.into());
19989        self
19990    }
19991
19992    /// Sets the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
19993    ///
19994    /// # Example
19995    /// ```ignore,no_run
19996    /// # use google_cloud_sql_v1::model::ExportContext;
19997    /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
19998    /// let x = ExportContext::new().set_bak_export_options(SqlBakExportOptions::default()/* use setters */);
19999    /// ```
20000    pub fn set_bak_export_options<T>(mut self, v: T) -> Self
20001    where
20002        T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
20003    {
20004        self.bak_export_options = std::option::Option::Some(v.into());
20005        self
20006    }
20007
20008    /// Sets or clears the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
20009    ///
20010    /// # Example
20011    /// ```ignore,no_run
20012    /// # use google_cloud_sql_v1::model::ExportContext;
20013    /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20014    /// let x = ExportContext::new().set_or_clear_bak_export_options(Some(SqlBakExportOptions::default()/* use setters */));
20015    /// let x = ExportContext::new().set_or_clear_bak_export_options(None::<SqlBakExportOptions>);
20016    /// ```
20017    pub fn set_or_clear_bak_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20018    where
20019        T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
20020    {
20021        self.bak_export_options = v.map(|x| x.into());
20022        self
20023    }
20024
20025    /// Sets the value of [tde_export_options][crate::model::ExportContext::tde_export_options].
20026    ///
20027    /// # Example
20028    /// ```ignore,no_run
20029    /// # use google_cloud_sql_v1::model::ExportContext;
20030    /// use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20031    /// let x = ExportContext::new().set_tde_export_options(SqlTdeExportOptions::default()/* use setters */);
20032    /// ```
20033    pub fn set_tde_export_options<T>(mut self, v: T) -> Self
20034    where
20035        T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
20036    {
20037        self.tde_export_options = std::option::Option::Some(v.into());
20038        self
20039    }
20040
20041    /// Sets or clears the value of [tde_export_options][crate::model::ExportContext::tde_export_options].
20042    ///
20043    /// # Example
20044    /// ```ignore,no_run
20045    /// # use google_cloud_sql_v1::model::ExportContext;
20046    /// use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20047    /// let x = ExportContext::new().set_or_clear_tde_export_options(Some(SqlTdeExportOptions::default()/* use setters */));
20048    /// let x = ExportContext::new().set_or_clear_tde_export_options(None::<SqlTdeExportOptions>);
20049    /// ```
20050    pub fn set_or_clear_tde_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20051    where
20052        T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
20053    {
20054        self.tde_export_options = v.map(|x| x.into());
20055        self
20056    }
20057}
20058
20059impl wkt::message::Message for ExportContext {
20060    fn typename() -> &'static str {
20061        "type.googleapis.com/google.cloud.sql.v1.ExportContext"
20062    }
20063}
20064
20065/// Defines additional types related to [ExportContext].
20066pub mod export_context {
20067    #[allow(unused_imports)]
20068    use super::*;
20069
20070    #[allow(missing_docs)]
20071    #[derive(Clone, Default, PartialEq)]
20072    #[non_exhaustive]
20073    pub struct SqlCsvExportOptions {
20074        /// The select query used to extract the data.
20075        pub select_query: std::string::String,
20076
20077        /// Specifies the character that should appear before a data character that
20078        /// needs to be escaped.
20079        pub escape_character: std::string::String,
20080
20081        /// Specifies the quoting character to be used when a data value is quoted.
20082        pub quote_character: std::string::String,
20083
20084        /// Specifies the character that separates columns within each row (line) of
20085        /// the file.
20086        pub fields_terminated_by: std::string::String,
20087
20088        /// This is used to separate lines. If a line does not contain all fields,
20089        /// the rest of the columns are set to their default values.
20090        pub lines_terminated_by: std::string::String,
20091
20092        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20093    }
20094
20095    impl SqlCsvExportOptions {
20096        /// Creates a new default instance.
20097        pub fn new() -> Self {
20098            std::default::Default::default()
20099        }
20100
20101        /// Sets the value of [select_query][crate::model::export_context::SqlCsvExportOptions::select_query].
20102        ///
20103        /// # Example
20104        /// ```ignore,no_run
20105        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20106        /// let x = SqlCsvExportOptions::new().set_select_query("example");
20107        /// ```
20108        pub fn set_select_query<T: std::convert::Into<std::string::String>>(
20109            mut self,
20110            v: T,
20111        ) -> Self {
20112            self.select_query = v.into();
20113            self
20114        }
20115
20116        /// Sets the value of [escape_character][crate::model::export_context::SqlCsvExportOptions::escape_character].
20117        ///
20118        /// # Example
20119        /// ```ignore,no_run
20120        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20121        /// let x = SqlCsvExportOptions::new().set_escape_character("example");
20122        /// ```
20123        pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
20124            mut self,
20125            v: T,
20126        ) -> Self {
20127            self.escape_character = v.into();
20128            self
20129        }
20130
20131        /// Sets the value of [quote_character][crate::model::export_context::SqlCsvExportOptions::quote_character].
20132        ///
20133        /// # Example
20134        /// ```ignore,no_run
20135        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20136        /// let x = SqlCsvExportOptions::new().set_quote_character("example");
20137        /// ```
20138        pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
20139            mut self,
20140            v: T,
20141        ) -> Self {
20142            self.quote_character = v.into();
20143            self
20144        }
20145
20146        /// Sets the value of [fields_terminated_by][crate::model::export_context::SqlCsvExportOptions::fields_terminated_by].
20147        ///
20148        /// # Example
20149        /// ```ignore,no_run
20150        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20151        /// let x = SqlCsvExportOptions::new().set_fields_terminated_by("example");
20152        /// ```
20153        pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
20154            mut self,
20155            v: T,
20156        ) -> Self {
20157            self.fields_terminated_by = v.into();
20158            self
20159        }
20160
20161        /// Sets the value of [lines_terminated_by][crate::model::export_context::SqlCsvExportOptions::lines_terminated_by].
20162        ///
20163        /// # Example
20164        /// ```ignore,no_run
20165        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20166        /// let x = SqlCsvExportOptions::new().set_lines_terminated_by("example");
20167        /// ```
20168        pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
20169            mut self,
20170            v: T,
20171        ) -> Self {
20172            self.lines_terminated_by = v.into();
20173            self
20174        }
20175    }
20176
20177    impl wkt::message::Message for SqlCsvExportOptions {
20178        fn typename() -> &'static str {
20179            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlCsvExportOptions"
20180        }
20181    }
20182
20183    #[allow(missing_docs)]
20184    #[derive(Clone, Default, PartialEq)]
20185    #[non_exhaustive]
20186    pub struct SqlExportOptions {
20187        /// Tables to export, or that were exported, from the specified database. If
20188        /// you specify tables, specify one and only one database. For PostgreSQL
20189        /// instances, you can specify only one table.
20190        pub tables: std::vec::Vec<std::string::String>,
20191
20192        /// Export only schemas.
20193        pub schema_only: std::option::Option<wkt::BoolValue>,
20194
20195        #[allow(missing_docs)]
20196        pub mysql_export_options: std::option::Option<
20197            crate::model::export_context::sql_export_options::MysqlExportOptions,
20198        >,
20199
20200        /// Optional. The number of threads to use for parallel export.
20201        pub threads: std::option::Option<wkt::Int32Value>,
20202
20203        /// Optional. Whether or not the export should be parallel.
20204        pub parallel: std::option::Option<wkt::BoolValue>,
20205
20206        /// Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
20207        pub postgres_export_options: std::option::Option<
20208            crate::model::export_context::sql_export_options::PostgresExportOptions,
20209        >,
20210
20211        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20212    }
20213
20214    impl SqlExportOptions {
20215        /// Creates a new default instance.
20216        pub fn new() -> Self {
20217            std::default::Default::default()
20218        }
20219
20220        /// Sets the value of [tables][crate::model::export_context::SqlExportOptions::tables].
20221        ///
20222        /// # Example
20223        /// ```ignore,no_run
20224        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20225        /// let x = SqlExportOptions::new().set_tables(["a", "b", "c"]);
20226        /// ```
20227        pub fn set_tables<T, V>(mut self, v: T) -> Self
20228        where
20229            T: std::iter::IntoIterator<Item = V>,
20230            V: std::convert::Into<std::string::String>,
20231        {
20232            use std::iter::Iterator;
20233            self.tables = v.into_iter().map(|i| i.into()).collect();
20234            self
20235        }
20236
20237        /// Sets the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
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_schema_only(BoolValue::default()/* use setters */);
20244        /// ```
20245        pub fn set_schema_only<T>(mut self, v: T) -> Self
20246        where
20247            T: std::convert::Into<wkt::BoolValue>,
20248        {
20249            self.schema_only = std::option::Option::Some(v.into());
20250            self
20251        }
20252
20253        /// Sets or clears the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
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_schema_only(Some(BoolValue::default()/* use setters */));
20260        /// let x = SqlExportOptions::new().set_or_clear_schema_only(None::<BoolValue>);
20261        /// ```
20262        pub fn set_or_clear_schema_only<T>(mut self, v: std::option::Option<T>) -> Self
20263        where
20264            T: std::convert::Into<wkt::BoolValue>,
20265        {
20266            self.schema_only = v.map(|x| x.into());
20267            self
20268        }
20269
20270        /// Sets the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_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::MysqlExportOptions;
20276        /// let x = SqlExportOptions::new().set_mysql_export_options(MysqlExportOptions::default()/* use setters */);
20277        /// ```
20278        pub fn set_mysql_export_options<T>(mut self, v: T) -> Self
20279        where
20280            T: std::convert::Into<
20281                    crate::model::export_context::sql_export_options::MysqlExportOptions,
20282                >,
20283        {
20284            self.mysql_export_options = std::option::Option::Some(v.into());
20285            self
20286        }
20287
20288        /// Sets or clears the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_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::MysqlExportOptions;
20294        /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(Some(MysqlExportOptions::default()/* use setters */));
20295        /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(None::<MysqlExportOptions>);
20296        /// ```
20297        pub fn set_or_clear_mysql_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::MysqlExportOptions,
20301                >,
20302        {
20303            self.mysql_export_options = v.map(|x| x.into());
20304            self
20305        }
20306
20307        /// Sets the value of [threads][crate::model::export_context::SqlExportOptions::threads].
20308        ///
20309        /// # Example
20310        /// ```ignore,no_run
20311        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20312        /// use wkt::Int32Value;
20313        /// let x = SqlExportOptions::new().set_threads(Int32Value::default()/* use setters */);
20314        /// ```
20315        pub fn set_threads<T>(mut self, v: T) -> Self
20316        where
20317            T: std::convert::Into<wkt::Int32Value>,
20318        {
20319            self.threads = std::option::Option::Some(v.into());
20320            self
20321        }
20322
20323        /// Sets or clears the value of [threads][crate::model::export_context::SqlExportOptions::threads].
20324        ///
20325        /// # Example
20326        /// ```ignore,no_run
20327        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20328        /// use wkt::Int32Value;
20329        /// let x = SqlExportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
20330        /// let x = SqlExportOptions::new().set_or_clear_threads(None::<Int32Value>);
20331        /// ```
20332        pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
20333        where
20334            T: std::convert::Into<wkt::Int32Value>,
20335        {
20336            self.threads = v.map(|x| x.into());
20337            self
20338        }
20339
20340        /// Sets the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
20341        ///
20342        /// # Example
20343        /// ```ignore,no_run
20344        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20345        /// use wkt::BoolValue;
20346        /// let x = SqlExportOptions::new().set_parallel(BoolValue::default()/* use setters */);
20347        /// ```
20348        pub fn set_parallel<T>(mut self, v: T) -> Self
20349        where
20350            T: std::convert::Into<wkt::BoolValue>,
20351        {
20352            self.parallel = std::option::Option::Some(v.into());
20353            self
20354        }
20355
20356        /// Sets or clears the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
20357        ///
20358        /// # Example
20359        /// ```ignore,no_run
20360        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20361        /// use wkt::BoolValue;
20362        /// let x = SqlExportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
20363        /// let x = SqlExportOptions::new().set_or_clear_parallel(None::<BoolValue>);
20364        /// ```
20365        pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
20366        where
20367            T: std::convert::Into<wkt::BoolValue>,
20368        {
20369            self.parallel = v.map(|x| x.into());
20370            self
20371        }
20372
20373        /// Sets the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
20374        ///
20375        /// # Example
20376        /// ```ignore,no_run
20377        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20378        /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20379        /// let x = SqlExportOptions::new().set_postgres_export_options(PostgresExportOptions::default()/* use setters */);
20380        /// ```
20381        pub fn set_postgres_export_options<T>(mut self, v: T) -> Self
20382        where
20383            T: std::convert::Into<
20384                    crate::model::export_context::sql_export_options::PostgresExportOptions,
20385                >,
20386        {
20387            self.postgres_export_options = std::option::Option::Some(v.into());
20388            self
20389        }
20390
20391        /// Sets or clears the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
20392        ///
20393        /// # Example
20394        /// ```ignore,no_run
20395        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20396        /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20397        /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(Some(PostgresExportOptions::default()/* use setters */));
20398        /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(None::<PostgresExportOptions>);
20399        /// ```
20400        pub fn set_or_clear_postgres_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20401        where
20402            T: std::convert::Into<
20403                    crate::model::export_context::sql_export_options::PostgresExportOptions,
20404                >,
20405        {
20406            self.postgres_export_options = v.map(|x| x.into());
20407            self
20408        }
20409    }
20410
20411    impl wkt::message::Message for SqlExportOptions {
20412        fn typename() -> &'static str {
20413            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions"
20414        }
20415    }
20416
20417    /// Defines additional types related to [SqlExportOptions].
20418    pub mod sql_export_options {
20419        #[allow(unused_imports)]
20420        use super::*;
20421
20422        /// Options for exporting from MySQL.
20423        #[derive(Clone, Default, PartialEq)]
20424        #[non_exhaustive]
20425        pub struct MysqlExportOptions {
20426            /// Option to include SQL statement required to set up replication. If set
20427            /// to `1`, the dump file includes a CHANGE MASTER TO statement with the
20428            /// binary log coordinates, and --set-gtid-purged is set to ON. If set to
20429            /// `2`, the CHANGE MASTER TO statement is written as a SQL comment and
20430            /// has no effect. If set to any value other than `1`, --set-gtid-purged
20431            /// is set to OFF.
20432            pub master_data: std::option::Option<wkt::Int32Value>,
20433
20434            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20435        }
20436
20437        impl MysqlExportOptions {
20438            /// Creates a new default instance.
20439            pub fn new() -> Self {
20440                std::default::Default::default()
20441            }
20442
20443            /// Sets the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
20444            ///
20445            /// # Example
20446            /// ```ignore,no_run
20447            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20448            /// use wkt::Int32Value;
20449            /// let x = MysqlExportOptions::new().set_master_data(Int32Value::default()/* use setters */);
20450            /// ```
20451            pub fn set_master_data<T>(mut self, v: T) -> Self
20452            where
20453                T: std::convert::Into<wkt::Int32Value>,
20454            {
20455                self.master_data = std::option::Option::Some(v.into());
20456                self
20457            }
20458
20459            /// Sets or clears the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
20460            ///
20461            /// # Example
20462            /// ```ignore,no_run
20463            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20464            /// use wkt::Int32Value;
20465            /// let x = MysqlExportOptions::new().set_or_clear_master_data(Some(Int32Value::default()/* use setters */));
20466            /// let x = MysqlExportOptions::new().set_or_clear_master_data(None::<Int32Value>);
20467            /// ```
20468            pub fn set_or_clear_master_data<T>(mut self, v: std::option::Option<T>) -> Self
20469            where
20470                T: std::convert::Into<wkt::Int32Value>,
20471            {
20472                self.master_data = v.map(|x| x.into());
20473                self
20474            }
20475        }
20476
20477        impl wkt::message::Message for MysqlExportOptions {
20478            fn typename() -> &'static str {
20479                "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions"
20480            }
20481        }
20482
20483        /// Options for exporting from a Cloud SQL for PostgreSQL instance.
20484        #[derive(Clone, Default, PartialEq)]
20485        #[non_exhaustive]
20486        pub struct PostgresExportOptions {
20487            /// Optional. Use this option to include DROP \<code\>&lt;object&gt;\</code\>
20488            /// SQL statements. Use these statements to delete database objects before
20489            /// running the import operation.
20490            pub clean: std::option::Option<wkt::BoolValue>,
20491
20492            /// Optional. Option to include an IF EXISTS SQL statement with each DROP
20493            /// statement produced by clean.
20494            pub if_exists: std::option::Option<wkt::BoolValue>,
20495
20496            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20497        }
20498
20499        impl PostgresExportOptions {
20500            /// Creates a new default instance.
20501            pub fn new() -> Self {
20502                std::default::Default::default()
20503            }
20504
20505            /// Sets the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
20506            ///
20507            /// # Example
20508            /// ```ignore,no_run
20509            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20510            /// use wkt::BoolValue;
20511            /// let x = PostgresExportOptions::new().set_clean(BoolValue::default()/* use setters */);
20512            /// ```
20513            pub fn set_clean<T>(mut self, v: T) -> Self
20514            where
20515                T: std::convert::Into<wkt::BoolValue>,
20516            {
20517                self.clean = std::option::Option::Some(v.into());
20518                self
20519            }
20520
20521            /// Sets or clears the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
20522            ///
20523            /// # Example
20524            /// ```ignore,no_run
20525            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20526            /// use wkt::BoolValue;
20527            /// let x = PostgresExportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
20528            /// let x = PostgresExportOptions::new().set_or_clear_clean(None::<BoolValue>);
20529            /// ```
20530            pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
20531            where
20532                T: std::convert::Into<wkt::BoolValue>,
20533            {
20534                self.clean = v.map(|x| x.into());
20535                self
20536            }
20537
20538            /// Sets the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
20539            ///
20540            /// # Example
20541            /// ```ignore,no_run
20542            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20543            /// use wkt::BoolValue;
20544            /// let x = PostgresExportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
20545            /// ```
20546            pub fn set_if_exists<T>(mut self, v: T) -> Self
20547            where
20548                T: std::convert::Into<wkt::BoolValue>,
20549            {
20550                self.if_exists = std::option::Option::Some(v.into());
20551                self
20552            }
20553
20554            /// Sets or clears the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
20555            ///
20556            /// # Example
20557            /// ```ignore,no_run
20558            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20559            /// use wkt::BoolValue;
20560            /// let x = PostgresExportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
20561            /// let x = PostgresExportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
20562            /// ```
20563            pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
20564            where
20565                T: std::convert::Into<wkt::BoolValue>,
20566            {
20567                self.if_exists = v.map(|x| x.into());
20568                self
20569            }
20570        }
20571
20572        impl wkt::message::Message for PostgresExportOptions {
20573            fn typename() -> &'static str {
20574                "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions"
20575            }
20576        }
20577    }
20578
20579    /// Options for exporting BAK files (SQL Server-only)
20580    #[derive(Clone, Default, PartialEq)]
20581    #[non_exhaustive]
20582    pub struct SqlBakExportOptions {
20583        /// Whether or not the export should be striped.
20584        pub striped: std::option::Option<wkt::BoolValue>,
20585
20586        /// Option for specifying how many stripes to use for the export.
20587        /// If blank, and the value of the striped field is true,
20588        /// the number of stripes is automatically chosen.
20589        pub stripe_count: std::option::Option<wkt::Int32Value>,
20590
20591        /// Type of this bak file will be export, FULL or DIFF, SQL Server only
20592        pub bak_type: crate::model::BakType,
20593
20594        /// Deprecated: copy_only is deprecated. Use differential_base instead
20595        #[deprecated]
20596        pub copy_only: std::option::Option<wkt::BoolValue>,
20597
20598        /// Whether or not the backup can be used as a differential base
20599        /// copy_only backup can not be served as differential base
20600        pub differential_base: std::option::Option<wkt::BoolValue>,
20601
20602        /// Optional. The begin timestamp when transaction log will be included in
20603        /// the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
20604        /// format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
20605        /// available logs from the beginning of retention period will be included.
20606        /// Only applied to Cloud SQL for SQL Server.
20607        pub export_log_start_time: std::option::Option<wkt::Timestamp>,
20608
20609        /// Optional. The end timestamp when transaction log will be included in the
20610        /// export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
20611        /// (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
20612        /// available logs until current time will be included. Only applied to Cloud
20613        /// SQL for SQL Server.
20614        pub export_log_end_time: std::option::Option<wkt::Timestamp>,
20615
20616        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20617    }
20618
20619    impl SqlBakExportOptions {
20620        /// Creates a new default instance.
20621        pub fn new() -> Self {
20622            std::default::Default::default()
20623        }
20624
20625        /// Sets the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
20626        ///
20627        /// # Example
20628        /// ```ignore,no_run
20629        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20630        /// use wkt::BoolValue;
20631        /// let x = SqlBakExportOptions::new().set_striped(BoolValue::default()/* use setters */);
20632        /// ```
20633        pub fn set_striped<T>(mut self, v: T) -> Self
20634        where
20635            T: std::convert::Into<wkt::BoolValue>,
20636        {
20637            self.striped = std::option::Option::Some(v.into());
20638            self
20639        }
20640
20641        /// Sets or clears the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
20642        ///
20643        /// # Example
20644        /// ```ignore,no_run
20645        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20646        /// use wkt::BoolValue;
20647        /// let x = SqlBakExportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
20648        /// let x = SqlBakExportOptions::new().set_or_clear_striped(None::<BoolValue>);
20649        /// ```
20650        pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
20651        where
20652            T: std::convert::Into<wkt::BoolValue>,
20653        {
20654            self.striped = v.map(|x| x.into());
20655            self
20656        }
20657
20658        /// Sets the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
20659        ///
20660        /// # Example
20661        /// ```ignore,no_run
20662        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20663        /// use wkt::Int32Value;
20664        /// let x = SqlBakExportOptions::new().set_stripe_count(Int32Value::default()/* use setters */);
20665        /// ```
20666        pub fn set_stripe_count<T>(mut self, v: T) -> Self
20667        where
20668            T: std::convert::Into<wkt::Int32Value>,
20669        {
20670            self.stripe_count = std::option::Option::Some(v.into());
20671            self
20672        }
20673
20674        /// Sets or clears the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
20675        ///
20676        /// # Example
20677        /// ```ignore,no_run
20678        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20679        /// use wkt::Int32Value;
20680        /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(Some(Int32Value::default()/* use setters */));
20681        /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(None::<Int32Value>);
20682        /// ```
20683        pub fn set_or_clear_stripe_count<T>(mut self, v: std::option::Option<T>) -> Self
20684        where
20685            T: std::convert::Into<wkt::Int32Value>,
20686        {
20687            self.stripe_count = v.map(|x| x.into());
20688            self
20689        }
20690
20691        /// Sets the value of [bak_type][crate::model::export_context::SqlBakExportOptions::bak_type].
20692        ///
20693        /// # Example
20694        /// ```ignore,no_run
20695        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20696        /// use google_cloud_sql_v1::model::BakType;
20697        /// let x0 = SqlBakExportOptions::new().set_bak_type(BakType::Full);
20698        /// let x1 = SqlBakExportOptions::new().set_bak_type(BakType::Diff);
20699        /// let x2 = SqlBakExportOptions::new().set_bak_type(BakType::Tlog);
20700        /// ```
20701        pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
20702            self.bak_type = v.into();
20703            self
20704        }
20705
20706        /// Sets the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
20707        ///
20708        /// # Example
20709        /// ```ignore,no_run
20710        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20711        /// use wkt::BoolValue;
20712        /// let x = SqlBakExportOptions::new().set_copy_only(BoolValue::default()/* use setters */);
20713        /// ```
20714        #[deprecated]
20715        pub fn set_copy_only<T>(mut self, v: T) -> Self
20716        where
20717            T: std::convert::Into<wkt::BoolValue>,
20718        {
20719            self.copy_only = std::option::Option::Some(v.into());
20720            self
20721        }
20722
20723        /// Sets or clears the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
20724        ///
20725        /// # Example
20726        /// ```ignore,no_run
20727        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20728        /// use wkt::BoolValue;
20729        /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(Some(BoolValue::default()/* use setters */));
20730        /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(None::<BoolValue>);
20731        /// ```
20732        #[deprecated]
20733        pub fn set_or_clear_copy_only<T>(mut self, v: std::option::Option<T>) -> Self
20734        where
20735            T: std::convert::Into<wkt::BoolValue>,
20736        {
20737            self.copy_only = v.map(|x| x.into());
20738            self
20739        }
20740
20741        /// Sets the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
20742        ///
20743        /// # Example
20744        /// ```ignore,no_run
20745        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20746        /// use wkt::BoolValue;
20747        /// let x = SqlBakExportOptions::new().set_differential_base(BoolValue::default()/* use setters */);
20748        /// ```
20749        pub fn set_differential_base<T>(mut self, v: T) -> Self
20750        where
20751            T: std::convert::Into<wkt::BoolValue>,
20752        {
20753            self.differential_base = std::option::Option::Some(v.into());
20754            self
20755        }
20756
20757        /// Sets or clears the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
20758        ///
20759        /// # Example
20760        /// ```ignore,no_run
20761        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20762        /// use wkt::BoolValue;
20763        /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(Some(BoolValue::default()/* use setters */));
20764        /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(None::<BoolValue>);
20765        /// ```
20766        pub fn set_or_clear_differential_base<T>(mut self, v: std::option::Option<T>) -> Self
20767        where
20768            T: std::convert::Into<wkt::BoolValue>,
20769        {
20770            self.differential_base = v.map(|x| x.into());
20771            self
20772        }
20773
20774        /// Sets the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
20775        ///
20776        /// # Example
20777        /// ```ignore,no_run
20778        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20779        /// use wkt::Timestamp;
20780        /// let x = SqlBakExportOptions::new().set_export_log_start_time(Timestamp::default()/* use setters */);
20781        /// ```
20782        pub fn set_export_log_start_time<T>(mut self, v: T) -> Self
20783        where
20784            T: std::convert::Into<wkt::Timestamp>,
20785        {
20786            self.export_log_start_time = std::option::Option::Some(v.into());
20787            self
20788        }
20789
20790        /// Sets or clears the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
20791        ///
20792        /// # Example
20793        /// ```ignore,no_run
20794        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20795        /// use wkt::Timestamp;
20796        /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(Some(Timestamp::default()/* use setters */));
20797        /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(None::<Timestamp>);
20798        /// ```
20799        pub fn set_or_clear_export_log_start_time<T>(mut self, v: std::option::Option<T>) -> Self
20800        where
20801            T: std::convert::Into<wkt::Timestamp>,
20802        {
20803            self.export_log_start_time = v.map(|x| x.into());
20804            self
20805        }
20806
20807        /// Sets the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
20808        ///
20809        /// # Example
20810        /// ```ignore,no_run
20811        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20812        /// use wkt::Timestamp;
20813        /// let x = SqlBakExportOptions::new().set_export_log_end_time(Timestamp::default()/* use setters */);
20814        /// ```
20815        pub fn set_export_log_end_time<T>(mut self, v: T) -> Self
20816        where
20817            T: std::convert::Into<wkt::Timestamp>,
20818        {
20819            self.export_log_end_time = std::option::Option::Some(v.into());
20820            self
20821        }
20822
20823        /// Sets or clears the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
20824        ///
20825        /// # Example
20826        /// ```ignore,no_run
20827        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20828        /// use wkt::Timestamp;
20829        /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(Some(Timestamp::default()/* use setters */));
20830        /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(None::<Timestamp>);
20831        /// ```
20832        pub fn set_or_clear_export_log_end_time<T>(mut self, v: std::option::Option<T>) -> Self
20833        where
20834            T: std::convert::Into<wkt::Timestamp>,
20835        {
20836            self.export_log_end_time = v.map(|x| x.into());
20837            self
20838        }
20839    }
20840
20841    impl wkt::message::Message for SqlBakExportOptions {
20842        fn typename() -> &'static str {
20843            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlBakExportOptions"
20844        }
20845    }
20846
20847    #[allow(missing_docs)]
20848    #[derive(Clone, Default, PartialEq)]
20849    #[non_exhaustive]
20850    pub struct SqlTdeExportOptions {
20851        /// Required. Path to the TDE certificate public key
20852        /// in the form gs://bucketName/fileName.
20853        /// The instance must have write access to the bucket.
20854        /// Applicable only for SQL Server instances.
20855        pub certificate_path: std::string::String,
20856
20857        /// Required. Path to the TDE certificate private key
20858        /// in the form gs://bucketName/fileName.
20859        /// The instance must have write access to the location.
20860        /// Applicable only for SQL Server instances.
20861        pub private_key_path: std::string::String,
20862
20863        /// Required. Password that encrypts the private key.
20864        pub private_key_password: std::string::String,
20865
20866        /// Required. Certificate name.
20867        /// Applicable only for SQL Server instances.
20868        pub name: std::string::String,
20869
20870        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20871    }
20872
20873    impl SqlTdeExportOptions {
20874        /// Creates a new default instance.
20875        pub fn new() -> Self {
20876            std::default::Default::default()
20877        }
20878
20879        /// Sets the value of [certificate_path][crate::model::export_context::SqlTdeExportOptions::certificate_path].
20880        ///
20881        /// # Example
20882        /// ```ignore,no_run
20883        /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20884        /// let x = SqlTdeExportOptions::new().set_certificate_path("example");
20885        /// ```
20886        pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
20887            mut self,
20888            v: T,
20889        ) -> Self {
20890            self.certificate_path = v.into();
20891            self
20892        }
20893
20894        /// Sets the value of [private_key_path][crate::model::export_context::SqlTdeExportOptions::private_key_path].
20895        ///
20896        /// # Example
20897        /// ```ignore,no_run
20898        /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20899        /// let x = SqlTdeExportOptions::new().set_private_key_path("example");
20900        /// ```
20901        pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
20902            mut self,
20903            v: T,
20904        ) -> Self {
20905            self.private_key_path = v.into();
20906            self
20907        }
20908
20909        /// Sets the value of [private_key_password][crate::model::export_context::SqlTdeExportOptions::private_key_password].
20910        ///
20911        /// # Example
20912        /// ```ignore,no_run
20913        /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20914        /// let x = SqlTdeExportOptions::new().set_private_key_password("example");
20915        /// ```
20916        pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
20917            mut self,
20918            v: T,
20919        ) -> Self {
20920            self.private_key_password = v.into();
20921            self
20922        }
20923
20924        /// Sets the value of [name][crate::model::export_context::SqlTdeExportOptions::name].
20925        ///
20926        /// # Example
20927        /// ```ignore,no_run
20928        /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20929        /// let x = SqlTdeExportOptions::new().set_name("example");
20930        /// ```
20931        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20932            self.name = v.into();
20933            self
20934        }
20935    }
20936
20937    impl wkt::message::Message for SqlTdeExportOptions {
20938        fn typename() -> &'static str {
20939            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlTdeExportOptions"
20940        }
20941    }
20942}
20943
20944/// Database instance import context.
20945#[derive(Clone, Default, PartialEq)]
20946#[non_exhaustive]
20947pub struct ImportContext {
20948    /// Path to the import file in Cloud Storage, in the form
20949    /// `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
20950    /// when `fileType` is `SQL`. The instance must have
20951    /// write permissions to the bucket and read access to the file.
20952    pub uri: std::string::String,
20953
20954    /// The target database for the import. If `fileType` is `SQL`, this field
20955    /// is required only if the import file does not specify a database, and is
20956    /// overridden by any database specification in the import file. For entire
20957    /// instance parallel import operations, the database is overridden by the
20958    /// database name stored in subdirectory name. If
20959    /// `fileType` is `CSV`, one database must be specified.
20960    pub database: std::string::String,
20961
20962    /// This is always `sql#importContext`.
20963    pub kind: std::string::String,
20964
20965    /// The file type for the specified uri.\`SQL`: The file
20966    /// contains SQL statements. \`CSV`: The file contains CSV data.
20967    pub file_type: crate::model::SqlFileType,
20968
20969    /// Options for importing data as CSV.
20970    pub csv_import_options: std::option::Option<crate::model::import_context::SqlCsvImportOptions>,
20971
20972    /// The PostgreSQL user for this import operation. PostgreSQL instances only.
20973    pub import_user: std::string::String,
20974
20975    /// Import parameters specific to SQL Server .BAK files
20976    pub bak_import_options: std::option::Option<crate::model::import_context::SqlBakImportOptions>,
20977
20978    /// Optional. Options for importing data from SQL statements.
20979    pub sql_import_options: std::option::Option<crate::model::import_context::SqlImportOptions>,
20980
20981    /// Optional. Import parameters specific to SQL Server TDE certificates
20982    pub tde_import_options: std::option::Option<crate::model::import_context::SqlTdeImportOptions>,
20983
20984    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20985}
20986
20987impl ImportContext {
20988    /// Creates a new default instance.
20989    pub fn new() -> Self {
20990        std::default::Default::default()
20991    }
20992
20993    /// Sets the value of [uri][crate::model::ImportContext::uri].
20994    ///
20995    /// # Example
20996    /// ```ignore,no_run
20997    /// # use google_cloud_sql_v1::model::ImportContext;
20998    /// let x = ImportContext::new().set_uri("example");
20999    /// ```
21000    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21001        self.uri = v.into();
21002        self
21003    }
21004
21005    /// Sets the value of [database][crate::model::ImportContext::database].
21006    ///
21007    /// # Example
21008    /// ```ignore,no_run
21009    /// # use google_cloud_sql_v1::model::ImportContext;
21010    /// let x = ImportContext::new().set_database("example");
21011    /// ```
21012    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21013        self.database = v.into();
21014        self
21015    }
21016
21017    /// Sets the value of [kind][crate::model::ImportContext::kind].
21018    ///
21019    /// # Example
21020    /// ```ignore,no_run
21021    /// # use google_cloud_sql_v1::model::ImportContext;
21022    /// let x = ImportContext::new().set_kind("example");
21023    /// ```
21024    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21025        self.kind = v.into();
21026        self
21027    }
21028
21029    /// Sets the value of [file_type][crate::model::ImportContext::file_type].
21030    ///
21031    /// # Example
21032    /// ```ignore,no_run
21033    /// # use google_cloud_sql_v1::model::ImportContext;
21034    /// use google_cloud_sql_v1::model::SqlFileType;
21035    /// let x0 = ImportContext::new().set_file_type(SqlFileType::Sql);
21036    /// let x1 = ImportContext::new().set_file_type(SqlFileType::Csv);
21037    /// let x2 = ImportContext::new().set_file_type(SqlFileType::Bak);
21038    /// ```
21039    pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
21040        self.file_type = v.into();
21041        self
21042    }
21043
21044    /// Sets the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
21045    ///
21046    /// # Example
21047    /// ```ignore,no_run
21048    /// # use google_cloud_sql_v1::model::ImportContext;
21049    /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21050    /// let x = ImportContext::new().set_csv_import_options(SqlCsvImportOptions::default()/* use setters */);
21051    /// ```
21052    pub fn set_csv_import_options<T>(mut self, v: T) -> Self
21053    where
21054        T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
21055    {
21056        self.csv_import_options = std::option::Option::Some(v.into());
21057        self
21058    }
21059
21060    /// Sets or clears the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
21061    ///
21062    /// # Example
21063    /// ```ignore,no_run
21064    /// # use google_cloud_sql_v1::model::ImportContext;
21065    /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21066    /// let x = ImportContext::new().set_or_clear_csv_import_options(Some(SqlCsvImportOptions::default()/* use setters */));
21067    /// let x = ImportContext::new().set_or_clear_csv_import_options(None::<SqlCsvImportOptions>);
21068    /// ```
21069    pub fn set_or_clear_csv_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21070    where
21071        T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
21072    {
21073        self.csv_import_options = v.map(|x| x.into());
21074        self
21075    }
21076
21077    /// Sets the value of [import_user][crate::model::ImportContext::import_user].
21078    ///
21079    /// # Example
21080    /// ```ignore,no_run
21081    /// # use google_cloud_sql_v1::model::ImportContext;
21082    /// let x = ImportContext::new().set_import_user("example");
21083    /// ```
21084    pub fn set_import_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21085        self.import_user = v.into();
21086        self
21087    }
21088
21089    /// Sets the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
21090    ///
21091    /// # Example
21092    /// ```ignore,no_run
21093    /// # use google_cloud_sql_v1::model::ImportContext;
21094    /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21095    /// let x = ImportContext::new().set_bak_import_options(SqlBakImportOptions::default()/* use setters */);
21096    /// ```
21097    pub fn set_bak_import_options<T>(mut self, v: T) -> Self
21098    where
21099        T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
21100    {
21101        self.bak_import_options = std::option::Option::Some(v.into());
21102        self
21103    }
21104
21105    /// Sets or clears the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
21106    ///
21107    /// # Example
21108    /// ```ignore,no_run
21109    /// # use google_cloud_sql_v1::model::ImportContext;
21110    /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21111    /// let x = ImportContext::new().set_or_clear_bak_import_options(Some(SqlBakImportOptions::default()/* use setters */));
21112    /// let x = ImportContext::new().set_or_clear_bak_import_options(None::<SqlBakImportOptions>);
21113    /// ```
21114    pub fn set_or_clear_bak_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21115    where
21116        T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
21117    {
21118        self.bak_import_options = v.map(|x| x.into());
21119        self
21120    }
21121
21122    /// Sets the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
21123    ///
21124    /// # Example
21125    /// ```ignore,no_run
21126    /// # use google_cloud_sql_v1::model::ImportContext;
21127    /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21128    /// let x = ImportContext::new().set_sql_import_options(SqlImportOptions::default()/* use setters */);
21129    /// ```
21130    pub fn set_sql_import_options<T>(mut self, v: T) -> Self
21131    where
21132        T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
21133    {
21134        self.sql_import_options = std::option::Option::Some(v.into());
21135        self
21136    }
21137
21138    /// Sets or clears the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
21139    ///
21140    /// # Example
21141    /// ```ignore,no_run
21142    /// # use google_cloud_sql_v1::model::ImportContext;
21143    /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21144    /// let x = ImportContext::new().set_or_clear_sql_import_options(Some(SqlImportOptions::default()/* use setters */));
21145    /// let x = ImportContext::new().set_or_clear_sql_import_options(None::<SqlImportOptions>);
21146    /// ```
21147    pub fn set_or_clear_sql_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21148    where
21149        T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
21150    {
21151        self.sql_import_options = v.map(|x| x.into());
21152        self
21153    }
21154
21155    /// Sets the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
21156    ///
21157    /// # Example
21158    /// ```ignore,no_run
21159    /// # use google_cloud_sql_v1::model::ImportContext;
21160    /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21161    /// let x = ImportContext::new().set_tde_import_options(SqlTdeImportOptions::default()/* use setters */);
21162    /// ```
21163    pub fn set_tde_import_options<T>(mut self, v: T) -> Self
21164    where
21165        T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
21166    {
21167        self.tde_import_options = std::option::Option::Some(v.into());
21168        self
21169    }
21170
21171    /// Sets or clears the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
21172    ///
21173    /// # Example
21174    /// ```ignore,no_run
21175    /// # use google_cloud_sql_v1::model::ImportContext;
21176    /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21177    /// let x = ImportContext::new().set_or_clear_tde_import_options(Some(SqlTdeImportOptions::default()/* use setters */));
21178    /// let x = ImportContext::new().set_or_clear_tde_import_options(None::<SqlTdeImportOptions>);
21179    /// ```
21180    pub fn set_or_clear_tde_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21181    where
21182        T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
21183    {
21184        self.tde_import_options = v.map(|x| x.into());
21185        self
21186    }
21187}
21188
21189impl wkt::message::Message for ImportContext {
21190    fn typename() -> &'static str {
21191        "type.googleapis.com/google.cloud.sql.v1.ImportContext"
21192    }
21193}
21194
21195/// Defines additional types related to [ImportContext].
21196pub mod import_context {
21197    #[allow(unused_imports)]
21198    use super::*;
21199
21200    #[allow(missing_docs)]
21201    #[derive(Clone, Default, PartialEq)]
21202    #[non_exhaustive]
21203    pub struct SqlImportOptions {
21204        /// Optional. The number of threads to use for parallel import.
21205        pub threads: std::option::Option<wkt::Int32Value>,
21206
21207        /// Optional. Whether or not the import should be parallel.
21208        pub parallel: std::option::Option<wkt::BoolValue>,
21209
21210        /// Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
21211        pub postgres_import_options: std::option::Option<
21212            crate::model::import_context::sql_import_options::PostgresImportOptions,
21213        >,
21214
21215        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21216    }
21217
21218    impl SqlImportOptions {
21219        /// Creates a new default instance.
21220        pub fn new() -> Self {
21221            std::default::Default::default()
21222        }
21223
21224        /// Sets the value of [threads][crate::model::import_context::SqlImportOptions::threads].
21225        ///
21226        /// # Example
21227        /// ```ignore,no_run
21228        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21229        /// use wkt::Int32Value;
21230        /// let x = SqlImportOptions::new().set_threads(Int32Value::default()/* use setters */);
21231        /// ```
21232        pub fn set_threads<T>(mut self, v: T) -> Self
21233        where
21234            T: std::convert::Into<wkt::Int32Value>,
21235        {
21236            self.threads = std::option::Option::Some(v.into());
21237            self
21238        }
21239
21240        /// Sets or clears the value of [threads][crate::model::import_context::SqlImportOptions::threads].
21241        ///
21242        /// # Example
21243        /// ```ignore,no_run
21244        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21245        /// use wkt::Int32Value;
21246        /// let x = SqlImportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
21247        /// let x = SqlImportOptions::new().set_or_clear_threads(None::<Int32Value>);
21248        /// ```
21249        pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
21250        where
21251            T: std::convert::Into<wkt::Int32Value>,
21252        {
21253            self.threads = v.map(|x| x.into());
21254            self
21255        }
21256
21257        /// Sets the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
21258        ///
21259        /// # Example
21260        /// ```ignore,no_run
21261        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21262        /// use wkt::BoolValue;
21263        /// let x = SqlImportOptions::new().set_parallel(BoolValue::default()/* use setters */);
21264        /// ```
21265        pub fn set_parallel<T>(mut self, v: T) -> Self
21266        where
21267            T: std::convert::Into<wkt::BoolValue>,
21268        {
21269            self.parallel = std::option::Option::Some(v.into());
21270            self
21271        }
21272
21273        /// Sets or clears the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
21274        ///
21275        /// # Example
21276        /// ```ignore,no_run
21277        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21278        /// use wkt::BoolValue;
21279        /// let x = SqlImportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
21280        /// let x = SqlImportOptions::new().set_or_clear_parallel(None::<BoolValue>);
21281        /// ```
21282        pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
21283        where
21284            T: std::convert::Into<wkt::BoolValue>,
21285        {
21286            self.parallel = v.map(|x| x.into());
21287            self
21288        }
21289
21290        /// Sets the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
21291        ///
21292        /// # Example
21293        /// ```ignore,no_run
21294        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21295        /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21296        /// let x = SqlImportOptions::new().set_postgres_import_options(PostgresImportOptions::default()/* use setters */);
21297        /// ```
21298        pub fn set_postgres_import_options<T>(mut self, v: T) -> Self
21299        where
21300            T: std::convert::Into<
21301                    crate::model::import_context::sql_import_options::PostgresImportOptions,
21302                >,
21303        {
21304            self.postgres_import_options = std::option::Option::Some(v.into());
21305            self
21306        }
21307
21308        /// Sets or clears the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
21309        ///
21310        /// # Example
21311        /// ```ignore,no_run
21312        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21313        /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21314        /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(Some(PostgresImportOptions::default()/* use setters */));
21315        /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(None::<PostgresImportOptions>);
21316        /// ```
21317        pub fn set_or_clear_postgres_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21318        where
21319            T: std::convert::Into<
21320                    crate::model::import_context::sql_import_options::PostgresImportOptions,
21321                >,
21322        {
21323            self.postgres_import_options = v.map(|x| x.into());
21324            self
21325        }
21326    }
21327
21328    impl wkt::message::Message for SqlImportOptions {
21329        fn typename() -> &'static str {
21330            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions"
21331        }
21332    }
21333
21334    /// Defines additional types related to [SqlImportOptions].
21335    pub mod sql_import_options {
21336        #[allow(unused_imports)]
21337        use super::*;
21338
21339        #[allow(missing_docs)]
21340        #[derive(Clone, Default, PartialEq)]
21341        #[non_exhaustive]
21342        pub struct PostgresImportOptions {
21343            /// Optional. The --clean flag for the pg_restore utility. This flag
21344            /// applies only if you enabled Cloud SQL to import files in parallel.
21345            pub clean: std::option::Option<wkt::BoolValue>,
21346
21347            /// Optional. The --if-exists flag for the pg_restore utility. This flag
21348            /// applies only if you enabled Cloud SQL to import files in parallel.
21349            pub if_exists: std::option::Option<wkt::BoolValue>,
21350
21351            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21352        }
21353
21354        impl PostgresImportOptions {
21355            /// Creates a new default instance.
21356            pub fn new() -> Self {
21357                std::default::Default::default()
21358            }
21359
21360            /// Sets the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
21361            ///
21362            /// # Example
21363            /// ```ignore,no_run
21364            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21365            /// use wkt::BoolValue;
21366            /// let x = PostgresImportOptions::new().set_clean(BoolValue::default()/* use setters */);
21367            /// ```
21368            pub fn set_clean<T>(mut self, v: T) -> Self
21369            where
21370                T: std::convert::Into<wkt::BoolValue>,
21371            {
21372                self.clean = std::option::Option::Some(v.into());
21373                self
21374            }
21375
21376            /// Sets or clears the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
21377            ///
21378            /// # Example
21379            /// ```ignore,no_run
21380            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21381            /// use wkt::BoolValue;
21382            /// let x = PostgresImportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
21383            /// let x = PostgresImportOptions::new().set_or_clear_clean(None::<BoolValue>);
21384            /// ```
21385            pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
21386            where
21387                T: std::convert::Into<wkt::BoolValue>,
21388            {
21389                self.clean = v.map(|x| x.into());
21390                self
21391            }
21392
21393            /// Sets the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
21394            ///
21395            /// # Example
21396            /// ```ignore,no_run
21397            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21398            /// use wkt::BoolValue;
21399            /// let x = PostgresImportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
21400            /// ```
21401            pub fn set_if_exists<T>(mut self, v: T) -> Self
21402            where
21403                T: std::convert::Into<wkt::BoolValue>,
21404            {
21405                self.if_exists = std::option::Option::Some(v.into());
21406                self
21407            }
21408
21409            /// Sets or clears the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
21410            ///
21411            /// # Example
21412            /// ```ignore,no_run
21413            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21414            /// use wkt::BoolValue;
21415            /// let x = PostgresImportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
21416            /// let x = PostgresImportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
21417            /// ```
21418            pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
21419            where
21420                T: std::convert::Into<wkt::BoolValue>,
21421            {
21422                self.if_exists = v.map(|x| x.into());
21423                self
21424            }
21425        }
21426
21427        impl wkt::message::Message for PostgresImportOptions {
21428            fn typename() -> &'static str {
21429                "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions"
21430            }
21431        }
21432    }
21433
21434    #[allow(missing_docs)]
21435    #[derive(Clone, Default, PartialEq)]
21436    #[non_exhaustive]
21437    pub struct SqlCsvImportOptions {
21438        /// The table to which CSV data is imported.
21439        pub table: std::string::String,
21440
21441        /// The columns to which CSV data is imported. If not specified, all columns
21442        /// of the database table are loaded with CSV data.
21443        pub columns: std::vec::Vec<std::string::String>,
21444
21445        /// Specifies the character that should appear before a data character that
21446        /// needs to be escaped.
21447        pub escape_character: std::string::String,
21448
21449        /// Specifies the quoting character to be used when a data value is quoted.
21450        pub quote_character: std::string::String,
21451
21452        /// Specifies the character that separates columns within each row (line) of
21453        /// the file.
21454        pub fields_terminated_by: std::string::String,
21455
21456        /// This is used to separate lines. If a line does not contain all fields,
21457        /// the rest of the columns are set to their default values.
21458        pub lines_terminated_by: std::string::String,
21459
21460        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21461    }
21462
21463    impl SqlCsvImportOptions {
21464        /// Creates a new default instance.
21465        pub fn new() -> Self {
21466            std::default::Default::default()
21467        }
21468
21469        /// Sets the value of [table][crate::model::import_context::SqlCsvImportOptions::table].
21470        ///
21471        /// # Example
21472        /// ```ignore,no_run
21473        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21474        /// let x = SqlCsvImportOptions::new().set_table("example");
21475        /// ```
21476        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21477            self.table = v.into();
21478            self
21479        }
21480
21481        /// Sets the value of [columns][crate::model::import_context::SqlCsvImportOptions::columns].
21482        ///
21483        /// # Example
21484        /// ```ignore,no_run
21485        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21486        /// let x = SqlCsvImportOptions::new().set_columns(["a", "b", "c"]);
21487        /// ```
21488        pub fn set_columns<T, V>(mut self, v: T) -> Self
21489        where
21490            T: std::iter::IntoIterator<Item = V>,
21491            V: std::convert::Into<std::string::String>,
21492        {
21493            use std::iter::Iterator;
21494            self.columns = v.into_iter().map(|i| i.into()).collect();
21495            self
21496        }
21497
21498        /// Sets the value of [escape_character][crate::model::import_context::SqlCsvImportOptions::escape_character].
21499        ///
21500        /// # Example
21501        /// ```ignore,no_run
21502        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21503        /// let x = SqlCsvImportOptions::new().set_escape_character("example");
21504        /// ```
21505        pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
21506            mut self,
21507            v: T,
21508        ) -> Self {
21509            self.escape_character = v.into();
21510            self
21511        }
21512
21513        /// Sets the value of [quote_character][crate::model::import_context::SqlCsvImportOptions::quote_character].
21514        ///
21515        /// # Example
21516        /// ```ignore,no_run
21517        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21518        /// let x = SqlCsvImportOptions::new().set_quote_character("example");
21519        /// ```
21520        pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
21521            mut self,
21522            v: T,
21523        ) -> Self {
21524            self.quote_character = v.into();
21525            self
21526        }
21527
21528        /// Sets the value of [fields_terminated_by][crate::model::import_context::SqlCsvImportOptions::fields_terminated_by].
21529        ///
21530        /// # Example
21531        /// ```ignore,no_run
21532        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21533        /// let x = SqlCsvImportOptions::new().set_fields_terminated_by("example");
21534        /// ```
21535        pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
21536            mut self,
21537            v: T,
21538        ) -> Self {
21539            self.fields_terminated_by = v.into();
21540            self
21541        }
21542
21543        /// Sets the value of [lines_terminated_by][crate::model::import_context::SqlCsvImportOptions::lines_terminated_by].
21544        ///
21545        /// # Example
21546        /// ```ignore,no_run
21547        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21548        /// let x = SqlCsvImportOptions::new().set_lines_terminated_by("example");
21549        /// ```
21550        pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
21551            mut self,
21552            v: T,
21553        ) -> Self {
21554            self.lines_terminated_by = v.into();
21555            self
21556        }
21557    }
21558
21559    impl wkt::message::Message for SqlCsvImportOptions {
21560        fn typename() -> &'static str {
21561            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlCsvImportOptions"
21562        }
21563    }
21564
21565    #[allow(missing_docs)]
21566    #[derive(Clone, Default, PartialEq)]
21567    #[non_exhaustive]
21568    pub struct SqlBakImportOptions {
21569        #[allow(missing_docs)]
21570        pub encryption_options: std::option::Option<
21571            crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21572        >,
21573
21574        /// Whether or not the backup set being restored is striped.
21575        /// Applies only to Cloud SQL for SQL Server.
21576        pub striped: std::option::Option<wkt::BoolValue>,
21577
21578        /// Whether or not the backup importing will restore database
21579        /// with NORECOVERY option.
21580        /// Applies only to Cloud SQL for SQL Server.
21581        pub no_recovery: std::option::Option<wkt::BoolValue>,
21582
21583        /// Whether or not the backup importing request will just bring database
21584        /// online without downloading Bak content only one of "no_recovery" and
21585        /// "recovery_only" can be true otherwise error will return. Applies only to
21586        /// Cloud SQL for SQL Server.
21587        pub recovery_only: std::option::Option<wkt::BoolValue>,
21588
21589        /// Type of the bak content, FULL or DIFF
21590        pub bak_type: crate::model::BakType,
21591
21592        /// Optional. The timestamp when the import should stop. This timestamp is in
21593        /// the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
21594        /// `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
21595        /// keyword and applies to Cloud SQL for SQL Server only.
21596        pub stop_at: std::option::Option<wkt::Timestamp>,
21597
21598        /// Optional. The marked transaction where the import should stop. This field
21599        /// is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
21600        /// Server only.
21601        pub stop_at_mark: std::string::String,
21602
21603        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21604    }
21605
21606    impl SqlBakImportOptions {
21607        /// Creates a new default instance.
21608        pub fn new() -> Self {
21609            std::default::Default::default()
21610        }
21611
21612        /// Sets the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
21613        ///
21614        /// # Example
21615        /// ```ignore,no_run
21616        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21617        /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21618        /// let x = SqlBakImportOptions::new().set_encryption_options(EncryptionOptions::default()/* use setters */);
21619        /// ```
21620        pub fn set_encryption_options<T>(mut self, v: T) -> Self
21621        where
21622            T: std::convert::Into<
21623                    crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21624                >,
21625        {
21626            self.encryption_options = std::option::Option::Some(v.into());
21627            self
21628        }
21629
21630        /// Sets or clears the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
21631        ///
21632        /// # Example
21633        /// ```ignore,no_run
21634        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21635        /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21636        /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(Some(EncryptionOptions::default()/* use setters */));
21637        /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(None::<EncryptionOptions>);
21638        /// ```
21639        pub fn set_or_clear_encryption_options<T>(mut self, v: std::option::Option<T>) -> Self
21640        where
21641            T: std::convert::Into<
21642                    crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21643                >,
21644        {
21645            self.encryption_options = v.map(|x| x.into());
21646            self
21647        }
21648
21649        /// Sets the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
21650        ///
21651        /// # Example
21652        /// ```ignore,no_run
21653        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21654        /// use wkt::BoolValue;
21655        /// let x = SqlBakImportOptions::new().set_striped(BoolValue::default()/* use setters */);
21656        /// ```
21657        pub fn set_striped<T>(mut self, v: T) -> Self
21658        where
21659            T: std::convert::Into<wkt::BoolValue>,
21660        {
21661            self.striped = std::option::Option::Some(v.into());
21662            self
21663        }
21664
21665        /// Sets or clears the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
21666        ///
21667        /// # Example
21668        /// ```ignore,no_run
21669        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21670        /// use wkt::BoolValue;
21671        /// let x = SqlBakImportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
21672        /// let x = SqlBakImportOptions::new().set_or_clear_striped(None::<BoolValue>);
21673        /// ```
21674        pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
21675        where
21676            T: std::convert::Into<wkt::BoolValue>,
21677        {
21678            self.striped = v.map(|x| x.into());
21679            self
21680        }
21681
21682        /// Sets the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
21683        ///
21684        /// # Example
21685        /// ```ignore,no_run
21686        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21687        /// use wkt::BoolValue;
21688        /// let x = SqlBakImportOptions::new().set_no_recovery(BoolValue::default()/* use setters */);
21689        /// ```
21690        pub fn set_no_recovery<T>(mut self, v: T) -> Self
21691        where
21692            T: std::convert::Into<wkt::BoolValue>,
21693        {
21694            self.no_recovery = std::option::Option::Some(v.into());
21695            self
21696        }
21697
21698        /// Sets or clears the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
21699        ///
21700        /// # Example
21701        /// ```ignore,no_run
21702        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21703        /// use wkt::BoolValue;
21704        /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(Some(BoolValue::default()/* use setters */));
21705        /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(None::<BoolValue>);
21706        /// ```
21707        pub fn set_or_clear_no_recovery<T>(mut self, v: std::option::Option<T>) -> Self
21708        where
21709            T: std::convert::Into<wkt::BoolValue>,
21710        {
21711            self.no_recovery = v.map(|x| x.into());
21712            self
21713        }
21714
21715        /// Sets the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
21716        ///
21717        /// # Example
21718        /// ```ignore,no_run
21719        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21720        /// use wkt::BoolValue;
21721        /// let x = SqlBakImportOptions::new().set_recovery_only(BoolValue::default()/* use setters */);
21722        /// ```
21723        pub fn set_recovery_only<T>(mut self, v: T) -> Self
21724        where
21725            T: std::convert::Into<wkt::BoolValue>,
21726        {
21727            self.recovery_only = std::option::Option::Some(v.into());
21728            self
21729        }
21730
21731        /// Sets or clears the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
21732        ///
21733        /// # Example
21734        /// ```ignore,no_run
21735        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21736        /// use wkt::BoolValue;
21737        /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(Some(BoolValue::default()/* use setters */));
21738        /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(None::<BoolValue>);
21739        /// ```
21740        pub fn set_or_clear_recovery_only<T>(mut self, v: std::option::Option<T>) -> Self
21741        where
21742            T: std::convert::Into<wkt::BoolValue>,
21743        {
21744            self.recovery_only = v.map(|x| x.into());
21745            self
21746        }
21747
21748        /// Sets the value of [bak_type][crate::model::import_context::SqlBakImportOptions::bak_type].
21749        ///
21750        /// # Example
21751        /// ```ignore,no_run
21752        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21753        /// use google_cloud_sql_v1::model::BakType;
21754        /// let x0 = SqlBakImportOptions::new().set_bak_type(BakType::Full);
21755        /// let x1 = SqlBakImportOptions::new().set_bak_type(BakType::Diff);
21756        /// let x2 = SqlBakImportOptions::new().set_bak_type(BakType::Tlog);
21757        /// ```
21758        pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
21759            self.bak_type = v.into();
21760            self
21761        }
21762
21763        /// Sets the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
21764        ///
21765        /// # Example
21766        /// ```ignore,no_run
21767        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21768        /// use wkt::Timestamp;
21769        /// let x = SqlBakImportOptions::new().set_stop_at(Timestamp::default()/* use setters */);
21770        /// ```
21771        pub fn set_stop_at<T>(mut self, v: T) -> Self
21772        where
21773            T: std::convert::Into<wkt::Timestamp>,
21774        {
21775            self.stop_at = std::option::Option::Some(v.into());
21776            self
21777        }
21778
21779        /// Sets or clears the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
21780        ///
21781        /// # Example
21782        /// ```ignore,no_run
21783        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21784        /// use wkt::Timestamp;
21785        /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(Some(Timestamp::default()/* use setters */));
21786        /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(None::<Timestamp>);
21787        /// ```
21788        pub fn set_or_clear_stop_at<T>(mut self, v: std::option::Option<T>) -> Self
21789        where
21790            T: std::convert::Into<wkt::Timestamp>,
21791        {
21792            self.stop_at = v.map(|x| x.into());
21793            self
21794        }
21795
21796        /// Sets the value of [stop_at_mark][crate::model::import_context::SqlBakImportOptions::stop_at_mark].
21797        ///
21798        /// # Example
21799        /// ```ignore,no_run
21800        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21801        /// let x = SqlBakImportOptions::new().set_stop_at_mark("example");
21802        /// ```
21803        pub fn set_stop_at_mark<T: std::convert::Into<std::string::String>>(
21804            mut self,
21805            v: T,
21806        ) -> Self {
21807            self.stop_at_mark = v.into();
21808            self
21809        }
21810    }
21811
21812    impl wkt::message::Message for SqlBakImportOptions {
21813        fn typename() -> &'static str {
21814            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions"
21815        }
21816    }
21817
21818    /// Defines additional types related to [SqlBakImportOptions].
21819    pub mod sql_bak_import_options {
21820        #[allow(unused_imports)]
21821        use super::*;
21822
21823        #[allow(missing_docs)]
21824        #[derive(Clone, Default, PartialEq)]
21825        #[non_exhaustive]
21826        pub struct EncryptionOptions {
21827            /// Path to the Certificate (.cer) in Cloud Storage, in the form
21828            /// `gs://bucketName/fileName`. The instance must have
21829            /// write permissions to the bucket and read access to the file.
21830            pub cert_path: std::string::String,
21831
21832            /// Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
21833            /// form `gs://bucketName/fileName`. The instance must have
21834            /// write permissions to the bucket and read access to the file.
21835            pub pvk_path: std::string::String,
21836
21837            /// Password that encrypts the private key
21838            pub pvk_password: std::string::String,
21839
21840            /// Optional. Whether the imported file remains encrypted.
21841            pub keep_encrypted: std::option::Option<wkt::BoolValue>,
21842
21843            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21844        }
21845
21846        impl EncryptionOptions {
21847            /// Creates a new default instance.
21848            pub fn new() -> Self {
21849                std::default::Default::default()
21850            }
21851
21852            /// Sets the value of [cert_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::cert_path].
21853            ///
21854            /// # Example
21855            /// ```ignore,no_run
21856            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21857            /// let x = EncryptionOptions::new().set_cert_path("example");
21858            /// ```
21859            pub fn set_cert_path<T: std::convert::Into<std::string::String>>(
21860                mut self,
21861                v: T,
21862            ) -> Self {
21863                self.cert_path = v.into();
21864                self
21865            }
21866
21867            /// Sets the value of [pvk_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_path].
21868            ///
21869            /// # Example
21870            /// ```ignore,no_run
21871            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21872            /// let x = EncryptionOptions::new().set_pvk_path("example");
21873            /// ```
21874            pub fn set_pvk_path<T: std::convert::Into<std::string::String>>(
21875                mut self,
21876                v: T,
21877            ) -> Self {
21878                self.pvk_path = v.into();
21879                self
21880            }
21881
21882            /// Sets the value of [pvk_password][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_password].
21883            ///
21884            /// # Example
21885            /// ```ignore,no_run
21886            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21887            /// let x = EncryptionOptions::new().set_pvk_password("example");
21888            /// ```
21889            pub fn set_pvk_password<T: std::convert::Into<std::string::String>>(
21890                mut self,
21891                v: T,
21892            ) -> Self {
21893                self.pvk_password = v.into();
21894                self
21895            }
21896
21897            /// Sets the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
21898            ///
21899            /// # Example
21900            /// ```ignore,no_run
21901            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21902            /// use wkt::BoolValue;
21903            /// let x = EncryptionOptions::new().set_keep_encrypted(BoolValue::default()/* use setters */);
21904            /// ```
21905            pub fn set_keep_encrypted<T>(mut self, v: T) -> Self
21906            where
21907                T: std::convert::Into<wkt::BoolValue>,
21908            {
21909                self.keep_encrypted = std::option::Option::Some(v.into());
21910                self
21911            }
21912
21913            /// Sets or clears the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
21914            ///
21915            /// # Example
21916            /// ```ignore,no_run
21917            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21918            /// use wkt::BoolValue;
21919            /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(Some(BoolValue::default()/* use setters */));
21920            /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(None::<BoolValue>);
21921            /// ```
21922            pub fn set_or_clear_keep_encrypted<T>(mut self, v: std::option::Option<T>) -> Self
21923            where
21924                T: std::convert::Into<wkt::BoolValue>,
21925            {
21926                self.keep_encrypted = v.map(|x| x.into());
21927                self
21928            }
21929        }
21930
21931        impl wkt::message::Message for EncryptionOptions {
21932            fn typename() -> &'static str {
21933                "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions"
21934            }
21935        }
21936    }
21937
21938    #[allow(missing_docs)]
21939    #[derive(Clone, Default, PartialEq)]
21940    #[non_exhaustive]
21941    pub struct SqlTdeImportOptions {
21942        /// Required. Path to the TDE certificate public key
21943        /// in the form gs://bucketName/fileName.
21944        /// The instance must have read access to the file.
21945        /// Applicable only for SQL Server instances.
21946        pub certificate_path: std::string::String,
21947
21948        /// Required. Path to the TDE certificate private key
21949        /// in the form gs://bucketName/fileName.
21950        /// The instance must have read access to the file.
21951        /// Applicable only for SQL Server instances.
21952        pub private_key_path: std::string::String,
21953
21954        /// Required. Password that encrypts the private key.
21955        pub private_key_password: std::string::String,
21956
21957        /// Required. Certificate name.
21958        /// Applicable only for SQL Server instances.
21959        pub name: std::string::String,
21960
21961        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21962    }
21963
21964    impl SqlTdeImportOptions {
21965        /// Creates a new default instance.
21966        pub fn new() -> Self {
21967            std::default::Default::default()
21968        }
21969
21970        /// Sets the value of [certificate_path][crate::model::import_context::SqlTdeImportOptions::certificate_path].
21971        ///
21972        /// # Example
21973        /// ```ignore,no_run
21974        /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21975        /// let x = SqlTdeImportOptions::new().set_certificate_path("example");
21976        /// ```
21977        pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
21978            mut self,
21979            v: T,
21980        ) -> Self {
21981            self.certificate_path = v.into();
21982            self
21983        }
21984
21985        /// Sets the value of [private_key_path][crate::model::import_context::SqlTdeImportOptions::private_key_path].
21986        ///
21987        /// # Example
21988        /// ```ignore,no_run
21989        /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21990        /// let x = SqlTdeImportOptions::new().set_private_key_path("example");
21991        /// ```
21992        pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
21993            mut self,
21994            v: T,
21995        ) -> Self {
21996            self.private_key_path = v.into();
21997            self
21998        }
21999
22000        /// Sets the value of [private_key_password][crate::model::import_context::SqlTdeImportOptions::private_key_password].
22001        ///
22002        /// # Example
22003        /// ```ignore,no_run
22004        /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
22005        /// let x = SqlTdeImportOptions::new().set_private_key_password("example");
22006        /// ```
22007        pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
22008            mut self,
22009            v: T,
22010        ) -> Self {
22011            self.private_key_password = v.into();
22012            self
22013        }
22014
22015        /// Sets the value of [name][crate::model::import_context::SqlTdeImportOptions::name].
22016        ///
22017        /// # Example
22018        /// ```ignore,no_run
22019        /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
22020        /// let x = SqlTdeImportOptions::new().set_name("example");
22021        /// ```
22022        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22023            self.name = v.into();
22024            self
22025        }
22026    }
22027
22028    impl wkt::message::Message for SqlTdeImportOptions {
22029        fn typename() -> &'static str {
22030            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlTdeImportOptions"
22031        }
22032    }
22033}
22034
22035/// IP Management configuration.
22036#[derive(Clone, Default, PartialEq)]
22037#[non_exhaustive]
22038pub struct IpConfiguration {
22039    /// Whether the instance is assigned a public IP address or not.
22040    pub ipv4_enabled: std::option::Option<wkt::BoolValue>,
22041
22042    /// The resource link for the VPC network from which the Cloud SQL instance is
22043    /// accessible for private IP. For example,
22044    /// `/projects/myProject/global/networks/default`. This setting can
22045    /// be updated, but it cannot be removed after it is set.
22046    pub private_network: std::string::String,
22047
22048    /// Use `ssl_mode` instead.
22049    ///
22050    /// Whether SSL/TLS connections over IP are enforced.
22051    /// If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
22052    /// For SSL/TLS connections, the client certificate won't be verified. If
22053    /// set to true, then only allow connections encrypted with SSL/TLS and with
22054    /// valid client certificates. If you want to enforce SSL/TLS without enforcing
22055    /// the requirement for valid client certificates, then use the `ssl_mode` flag
22056    /// instead of the `require_ssl` flag.
22057    pub require_ssl: std::option::Option<wkt::BoolValue>,
22058
22059    /// The list of external networks that are allowed to connect to the instance
22060    /// using the IP. In 'CIDR' notation, also known as 'slash' notation (for
22061    /// example: `157.197.200.0/24`).
22062    pub authorized_networks: std::vec::Vec<crate::model::AclEntry>,
22063
22064    /// The name of the allocated ip range for the private ip Cloud SQL instance.
22065    /// For example: "google-managed-services-default". If set, the instance ip
22066    /// will be created in the allocated range. The range name must comply with
22067    /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
22068    /// must be 1-63 characters long and match the regular expression
22069    /// `[a-z]([-a-z0-9]*[a-z0-9])?.`
22070    pub allocated_ip_range: std::string::String,
22071
22072    /// Controls connectivity to private IP instances from Google services,
22073    /// such as BigQuery.
22074    pub enable_private_path_for_google_cloud_services: std::option::Option<wkt::BoolValue>,
22075
22076    /// Specify how SSL/TLS is enforced in database connections. If you must use
22077    /// the `require_ssl` flag for backward compatibility, then only the following
22078    /// value pairs are valid:
22079    ///
22080    /// For PostgreSQL and MySQL:
22081    ///
22082    /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
22083    /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
22084    /// * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
22085    ///
22086    /// For SQL Server:
22087    ///
22088    /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
22089    /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
22090    ///
22091    /// The value of `ssl_mode` has priority over the value of `require_ssl`.
22092    ///
22093    /// For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
22094    /// `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
22095    /// connections, while `require_ssl=false` means accept both non-SSL
22096    /// and SSL connections. In this case, MySQL and PostgreSQL databases respect
22097    /// `ssl_mode` and accepts only SSL connections.
22098    pub ssl_mode: crate::model::ip_configuration::SslMode,
22099
22100    /// PSC settings for this instance.
22101    pub psc_config: std::option::Option<crate::model::PscConfig>,
22102
22103    /// Specify what type of CA is used for the server certificate.
22104    pub server_ca_mode: std::option::Option<crate::model::ip_configuration::CaMode>,
22105
22106    /// Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
22107    pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
22108
22109    /// Optional. The resource name of the server CA pool for an instance with
22110    /// `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
22111    /// Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
22112    pub server_ca_pool: std::option::Option<std::string::String>,
22113
22114    /// Optional. Controls the automatic server certificate rotation feature. This
22115    /// feature is disabled by default. When enabled, the server certificate will
22116    /// be automatically rotated during Cloud SQL scheduled maintenance or
22117    /// self-service maintenance updates up to six months before it expires. This
22118    /// setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
22119    /// or CUSTOMER_MANAGED_CAS_CA.
22120    pub server_certificate_rotation_mode:
22121        std::option::Option<crate::model::ip_configuration::ServerCertificateRotationMode>,
22122
22123    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22124}
22125
22126impl IpConfiguration {
22127    /// Creates a new default instance.
22128    pub fn new() -> Self {
22129        std::default::Default::default()
22130    }
22131
22132    /// Sets the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
22133    ///
22134    /// # Example
22135    /// ```ignore,no_run
22136    /// # use google_cloud_sql_v1::model::IpConfiguration;
22137    /// use wkt::BoolValue;
22138    /// let x = IpConfiguration::new().set_ipv4_enabled(BoolValue::default()/* use setters */);
22139    /// ```
22140    pub fn set_ipv4_enabled<T>(mut self, v: T) -> Self
22141    where
22142        T: std::convert::Into<wkt::BoolValue>,
22143    {
22144        self.ipv4_enabled = std::option::Option::Some(v.into());
22145        self
22146    }
22147
22148    /// Sets or clears the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
22149    ///
22150    /// # Example
22151    /// ```ignore,no_run
22152    /// # use google_cloud_sql_v1::model::IpConfiguration;
22153    /// use wkt::BoolValue;
22154    /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(Some(BoolValue::default()/* use setters */));
22155    /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(None::<BoolValue>);
22156    /// ```
22157    pub fn set_or_clear_ipv4_enabled<T>(mut self, v: std::option::Option<T>) -> Self
22158    where
22159        T: std::convert::Into<wkt::BoolValue>,
22160    {
22161        self.ipv4_enabled = v.map(|x| x.into());
22162        self
22163    }
22164
22165    /// Sets the value of [private_network][crate::model::IpConfiguration::private_network].
22166    ///
22167    /// # Example
22168    /// ```ignore,no_run
22169    /// # use google_cloud_sql_v1::model::IpConfiguration;
22170    /// let x = IpConfiguration::new().set_private_network("example");
22171    /// ```
22172    pub fn set_private_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22173        self.private_network = v.into();
22174        self
22175    }
22176
22177    /// Sets the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
22178    ///
22179    /// # Example
22180    /// ```ignore,no_run
22181    /// # use google_cloud_sql_v1::model::IpConfiguration;
22182    /// use wkt::BoolValue;
22183    /// let x = IpConfiguration::new().set_require_ssl(BoolValue::default()/* use setters */);
22184    /// ```
22185    pub fn set_require_ssl<T>(mut self, v: T) -> Self
22186    where
22187        T: std::convert::Into<wkt::BoolValue>,
22188    {
22189        self.require_ssl = std::option::Option::Some(v.into());
22190        self
22191    }
22192
22193    /// Sets or clears the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
22194    ///
22195    /// # Example
22196    /// ```ignore,no_run
22197    /// # use google_cloud_sql_v1::model::IpConfiguration;
22198    /// use wkt::BoolValue;
22199    /// let x = IpConfiguration::new().set_or_clear_require_ssl(Some(BoolValue::default()/* use setters */));
22200    /// let x = IpConfiguration::new().set_or_clear_require_ssl(None::<BoolValue>);
22201    /// ```
22202    pub fn set_or_clear_require_ssl<T>(mut self, v: std::option::Option<T>) -> Self
22203    where
22204        T: std::convert::Into<wkt::BoolValue>,
22205    {
22206        self.require_ssl = v.map(|x| x.into());
22207        self
22208    }
22209
22210    /// Sets the value of [authorized_networks][crate::model::IpConfiguration::authorized_networks].
22211    ///
22212    /// # Example
22213    /// ```ignore,no_run
22214    /// # use google_cloud_sql_v1::model::IpConfiguration;
22215    /// use google_cloud_sql_v1::model::AclEntry;
22216    /// let x = IpConfiguration::new()
22217    ///     .set_authorized_networks([
22218    ///         AclEntry::default()/* use setters */,
22219    ///         AclEntry::default()/* use (different) setters */,
22220    ///     ]);
22221    /// ```
22222    pub fn set_authorized_networks<T, V>(mut self, v: T) -> Self
22223    where
22224        T: std::iter::IntoIterator<Item = V>,
22225        V: std::convert::Into<crate::model::AclEntry>,
22226    {
22227        use std::iter::Iterator;
22228        self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
22229        self
22230    }
22231
22232    /// Sets the value of [allocated_ip_range][crate::model::IpConfiguration::allocated_ip_range].
22233    ///
22234    /// # Example
22235    /// ```ignore,no_run
22236    /// # use google_cloud_sql_v1::model::IpConfiguration;
22237    /// let x = IpConfiguration::new().set_allocated_ip_range("example");
22238    /// ```
22239    pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
22240        mut self,
22241        v: T,
22242    ) -> Self {
22243        self.allocated_ip_range = v.into();
22244        self
22245    }
22246
22247    /// Sets the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
22248    ///
22249    /// # Example
22250    /// ```ignore,no_run
22251    /// # use google_cloud_sql_v1::model::IpConfiguration;
22252    /// use wkt::BoolValue;
22253    /// let x = IpConfiguration::new().set_enable_private_path_for_google_cloud_services(BoolValue::default()/* use setters */);
22254    /// ```
22255    pub fn set_enable_private_path_for_google_cloud_services<T>(mut self, v: T) -> Self
22256    where
22257        T: std::convert::Into<wkt::BoolValue>,
22258    {
22259        self.enable_private_path_for_google_cloud_services = std::option::Option::Some(v.into());
22260        self
22261    }
22262
22263    /// Sets or clears the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
22264    ///
22265    /// # Example
22266    /// ```ignore,no_run
22267    /// # use google_cloud_sql_v1::model::IpConfiguration;
22268    /// use wkt::BoolValue;
22269    /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(Some(BoolValue::default()/* use setters */));
22270    /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(None::<BoolValue>);
22271    /// ```
22272    pub fn set_or_clear_enable_private_path_for_google_cloud_services<T>(
22273        mut self,
22274        v: std::option::Option<T>,
22275    ) -> Self
22276    where
22277        T: std::convert::Into<wkt::BoolValue>,
22278    {
22279        self.enable_private_path_for_google_cloud_services = v.map(|x| x.into());
22280        self
22281    }
22282
22283    /// Sets the value of [ssl_mode][crate::model::IpConfiguration::ssl_mode].
22284    ///
22285    /// # Example
22286    /// ```ignore,no_run
22287    /// # use google_cloud_sql_v1::model::IpConfiguration;
22288    /// use google_cloud_sql_v1::model::ip_configuration::SslMode;
22289    /// let x0 = IpConfiguration::new().set_ssl_mode(SslMode::AllowUnencryptedAndEncrypted);
22290    /// let x1 = IpConfiguration::new().set_ssl_mode(SslMode::EncryptedOnly);
22291    /// let x2 = IpConfiguration::new().set_ssl_mode(SslMode::TrustedClientCertificateRequired);
22292    /// ```
22293    pub fn set_ssl_mode<T: std::convert::Into<crate::model::ip_configuration::SslMode>>(
22294        mut self,
22295        v: T,
22296    ) -> Self {
22297        self.ssl_mode = v.into();
22298        self
22299    }
22300
22301    /// Sets the value of [psc_config][crate::model::IpConfiguration::psc_config].
22302    ///
22303    /// # Example
22304    /// ```ignore,no_run
22305    /// # use google_cloud_sql_v1::model::IpConfiguration;
22306    /// use google_cloud_sql_v1::model::PscConfig;
22307    /// let x = IpConfiguration::new().set_psc_config(PscConfig::default()/* use setters */);
22308    /// ```
22309    pub fn set_psc_config<T>(mut self, v: T) -> Self
22310    where
22311        T: std::convert::Into<crate::model::PscConfig>,
22312    {
22313        self.psc_config = std::option::Option::Some(v.into());
22314        self
22315    }
22316
22317    /// Sets or clears the value of [psc_config][crate::model::IpConfiguration::psc_config].
22318    ///
22319    /// # Example
22320    /// ```ignore,no_run
22321    /// # use google_cloud_sql_v1::model::IpConfiguration;
22322    /// use google_cloud_sql_v1::model::PscConfig;
22323    /// let x = IpConfiguration::new().set_or_clear_psc_config(Some(PscConfig::default()/* use setters */));
22324    /// let x = IpConfiguration::new().set_or_clear_psc_config(None::<PscConfig>);
22325    /// ```
22326    pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
22327    where
22328        T: std::convert::Into<crate::model::PscConfig>,
22329    {
22330        self.psc_config = v.map(|x| x.into());
22331        self
22332    }
22333
22334    /// Sets the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
22335    ///
22336    /// # Example
22337    /// ```ignore,no_run
22338    /// # use google_cloud_sql_v1::model::IpConfiguration;
22339    /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
22340    /// let x0 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
22341    /// let x1 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
22342    /// let x2 = IpConfiguration::new().set_server_ca_mode(CaMode::CustomerManagedCasCa);
22343    /// ```
22344    pub fn set_server_ca_mode<T>(mut self, v: T) -> Self
22345    where
22346        T: std::convert::Into<crate::model::ip_configuration::CaMode>,
22347    {
22348        self.server_ca_mode = std::option::Option::Some(v.into());
22349        self
22350    }
22351
22352    /// Sets or clears the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
22353    ///
22354    /// # Example
22355    /// ```ignore,no_run
22356    /// # use google_cloud_sql_v1::model::IpConfiguration;
22357    /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
22358    /// let x0 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedInternalCa));
22359    /// let x1 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedCasCa));
22360    /// let x2 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::CustomerManagedCasCa));
22361    /// let x_none = IpConfiguration::new().set_or_clear_server_ca_mode(None::<CaMode>);
22362    /// ```
22363    pub fn set_or_clear_server_ca_mode<T>(mut self, v: std::option::Option<T>) -> Self
22364    where
22365        T: std::convert::Into<crate::model::ip_configuration::CaMode>,
22366    {
22367        self.server_ca_mode = v.map(|x| x.into());
22368        self
22369    }
22370
22371    /// Sets the value of [custom_subject_alternative_names][crate::model::IpConfiguration::custom_subject_alternative_names].
22372    ///
22373    /// # Example
22374    /// ```ignore,no_run
22375    /// # use google_cloud_sql_v1::model::IpConfiguration;
22376    /// let x = IpConfiguration::new().set_custom_subject_alternative_names(["a", "b", "c"]);
22377    /// ```
22378    pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
22379    where
22380        T: std::iter::IntoIterator<Item = V>,
22381        V: std::convert::Into<std::string::String>,
22382    {
22383        use std::iter::Iterator;
22384        self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
22385        self
22386    }
22387
22388    /// Sets the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
22389    ///
22390    /// # Example
22391    /// ```ignore,no_run
22392    /// # use google_cloud_sql_v1::model::IpConfiguration;
22393    /// let x = IpConfiguration::new().set_server_ca_pool("example");
22394    /// ```
22395    pub fn set_server_ca_pool<T>(mut self, v: T) -> Self
22396    where
22397        T: std::convert::Into<std::string::String>,
22398    {
22399        self.server_ca_pool = std::option::Option::Some(v.into());
22400        self
22401    }
22402
22403    /// Sets or clears the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
22404    ///
22405    /// # Example
22406    /// ```ignore,no_run
22407    /// # use google_cloud_sql_v1::model::IpConfiguration;
22408    /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(Some("example"));
22409    /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(None::<String>);
22410    /// ```
22411    pub fn set_or_clear_server_ca_pool<T>(mut self, v: std::option::Option<T>) -> Self
22412    where
22413        T: std::convert::Into<std::string::String>,
22414    {
22415        self.server_ca_pool = v.map(|x| x.into());
22416        self
22417    }
22418
22419    /// Sets the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
22420    ///
22421    /// # Example
22422    /// ```ignore,no_run
22423    /// # use google_cloud_sql_v1::model::IpConfiguration;
22424    /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
22425    /// let x0 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::NoAutomaticRotation);
22426    /// let x1 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance);
22427    /// ```
22428    pub fn set_server_certificate_rotation_mode<T>(mut self, v: T) -> Self
22429    where
22430        T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
22431    {
22432        self.server_certificate_rotation_mode = std::option::Option::Some(v.into());
22433        self
22434    }
22435
22436    /// Sets or clears the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
22437    ///
22438    /// # Example
22439    /// ```ignore,no_run
22440    /// # use google_cloud_sql_v1::model::IpConfiguration;
22441    /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
22442    /// let x0 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::NoAutomaticRotation));
22443    /// let x1 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance));
22444    /// let x_none = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(None::<ServerCertificateRotationMode>);
22445    /// ```
22446    pub fn set_or_clear_server_certificate_rotation_mode<T>(
22447        mut self,
22448        v: std::option::Option<T>,
22449    ) -> Self
22450    where
22451        T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
22452    {
22453        self.server_certificate_rotation_mode = v.map(|x| x.into());
22454        self
22455    }
22456}
22457
22458impl wkt::message::Message for IpConfiguration {
22459    fn typename() -> &'static str {
22460        "type.googleapis.com/google.cloud.sql.v1.IpConfiguration"
22461    }
22462}
22463
22464/// Defines additional types related to [IpConfiguration].
22465pub mod ip_configuration {
22466    #[allow(unused_imports)]
22467    use super::*;
22468
22469    /// The SSL options for database connections.
22470    ///
22471    /// # Working with unknown values
22472    ///
22473    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22474    /// additional enum variants at any time. Adding new variants is not considered
22475    /// a breaking change. Applications should write their code in anticipation of:
22476    ///
22477    /// - New values appearing in future releases of the client library, **and**
22478    /// - New values received dynamically, without application changes.
22479    ///
22480    /// Please consult the [Working with enums] section in the user guide for some
22481    /// guidelines.
22482    ///
22483    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22484    #[derive(Clone, Debug, PartialEq)]
22485    #[non_exhaustive]
22486    pub enum SslMode {
22487        /// The SSL mode is unknown.
22488        Unspecified,
22489        /// Allow non-SSL/non-TLS and SSL/TLS connections.
22490        /// For SSL connections to MySQL and PostgreSQL, the client certificate
22491        /// isn't verified.
22492        ///
22493        /// When this value is used, the legacy `require_ssl` flag must be false or
22494        /// cleared to avoid a conflict between the values of the two flags.
22495        AllowUnencryptedAndEncrypted,
22496        /// Only allow connections encrypted with SSL/TLS.
22497        /// For SSL connections to MySQL and PostgreSQL, the client certificate
22498        /// isn't verified.
22499        ///
22500        /// When this value is used, the legacy `require_ssl` flag must be false or
22501        /// cleared to avoid a conflict between the values of the two flags.
22502        EncryptedOnly,
22503        /// Only allow connections encrypted with SSL/TLS and with valid
22504        /// client certificates.
22505        ///
22506        /// When this value is used, the legacy `require_ssl` flag must be true or
22507        /// cleared to avoid the conflict between values of two flags.
22508        /// PostgreSQL clients or users that connect using IAM database
22509        /// authentication must use either the
22510        /// [Cloud SQL Auth
22511        /// Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
22512        /// [Cloud SQL
22513        /// Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
22514        /// to enforce client identity verification.
22515        ///
22516        /// Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
22517        TrustedClientCertificateRequired,
22518        /// If set, the enum was initialized with an unknown value.
22519        ///
22520        /// Applications can examine the value using [SslMode::value] or
22521        /// [SslMode::name].
22522        UnknownValue(ssl_mode::UnknownValue),
22523    }
22524
22525    #[doc(hidden)]
22526    pub mod ssl_mode {
22527        #[allow(unused_imports)]
22528        use super::*;
22529        #[derive(Clone, Debug, PartialEq)]
22530        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22531    }
22532
22533    impl SslMode {
22534        /// Gets the enum value.
22535        ///
22536        /// Returns `None` if the enum contains an unknown value deserialized from
22537        /// the string representation of enums.
22538        pub fn value(&self) -> std::option::Option<i32> {
22539            match self {
22540                Self::Unspecified => std::option::Option::Some(0),
22541                Self::AllowUnencryptedAndEncrypted => std::option::Option::Some(1),
22542                Self::EncryptedOnly => std::option::Option::Some(2),
22543                Self::TrustedClientCertificateRequired => std::option::Option::Some(3),
22544                Self::UnknownValue(u) => u.0.value(),
22545            }
22546        }
22547
22548        /// Gets the enum value as a string.
22549        ///
22550        /// Returns `None` if the enum contains an unknown value deserialized from
22551        /// the integer representation of enums.
22552        pub fn name(&self) -> std::option::Option<&str> {
22553            match self {
22554                Self::Unspecified => std::option::Option::Some("SSL_MODE_UNSPECIFIED"),
22555                Self::AllowUnencryptedAndEncrypted => {
22556                    std::option::Option::Some("ALLOW_UNENCRYPTED_AND_ENCRYPTED")
22557                }
22558                Self::EncryptedOnly => std::option::Option::Some("ENCRYPTED_ONLY"),
22559                Self::TrustedClientCertificateRequired => {
22560                    std::option::Option::Some("TRUSTED_CLIENT_CERTIFICATE_REQUIRED")
22561                }
22562                Self::UnknownValue(u) => u.0.name(),
22563            }
22564        }
22565    }
22566
22567    impl std::default::Default for SslMode {
22568        fn default() -> Self {
22569            use std::convert::From;
22570            Self::from(0)
22571        }
22572    }
22573
22574    impl std::fmt::Display for SslMode {
22575        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22576            wkt::internal::display_enum(f, self.name(), self.value())
22577        }
22578    }
22579
22580    impl std::convert::From<i32> for SslMode {
22581        fn from(value: i32) -> Self {
22582            match value {
22583                0 => Self::Unspecified,
22584                1 => Self::AllowUnencryptedAndEncrypted,
22585                2 => Self::EncryptedOnly,
22586                3 => Self::TrustedClientCertificateRequired,
22587                _ => Self::UnknownValue(ssl_mode::UnknownValue(
22588                    wkt::internal::UnknownEnumValue::Integer(value),
22589                )),
22590            }
22591        }
22592    }
22593
22594    impl std::convert::From<&str> for SslMode {
22595        fn from(value: &str) -> Self {
22596            use std::string::ToString;
22597            match value {
22598                "SSL_MODE_UNSPECIFIED" => Self::Unspecified,
22599                "ALLOW_UNENCRYPTED_AND_ENCRYPTED" => Self::AllowUnencryptedAndEncrypted,
22600                "ENCRYPTED_ONLY" => Self::EncryptedOnly,
22601                "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" => Self::TrustedClientCertificateRequired,
22602                _ => Self::UnknownValue(ssl_mode::UnknownValue(
22603                    wkt::internal::UnknownEnumValue::String(value.to_string()),
22604                )),
22605            }
22606        }
22607    }
22608
22609    impl serde::ser::Serialize for SslMode {
22610        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22611        where
22612            S: serde::Serializer,
22613        {
22614            match self {
22615                Self::Unspecified => serializer.serialize_i32(0),
22616                Self::AllowUnencryptedAndEncrypted => serializer.serialize_i32(1),
22617                Self::EncryptedOnly => serializer.serialize_i32(2),
22618                Self::TrustedClientCertificateRequired => serializer.serialize_i32(3),
22619                Self::UnknownValue(u) => u.0.serialize(serializer),
22620            }
22621        }
22622    }
22623
22624    impl<'de> serde::de::Deserialize<'de> for SslMode {
22625        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22626        where
22627            D: serde::Deserializer<'de>,
22628        {
22629            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslMode>::new(
22630                ".google.cloud.sql.v1.IpConfiguration.SslMode",
22631            ))
22632        }
22633    }
22634
22635    /// Various Certificate Authority (CA) modes for certificate signing.
22636    ///
22637    /// # Working with unknown values
22638    ///
22639    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22640    /// additional enum variants at any time. Adding new variants is not considered
22641    /// a breaking change. Applications should write their code in anticipation of:
22642    ///
22643    /// - New values appearing in future releases of the client library, **and**
22644    /// - New values received dynamically, without application changes.
22645    ///
22646    /// Please consult the [Working with enums] section in the user guide for some
22647    /// guidelines.
22648    ///
22649    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22650    #[derive(Clone, Debug, PartialEq)]
22651    #[non_exhaustive]
22652    pub enum CaMode {
22653        /// CA mode is unspecified. It is effectively the same as
22654        /// `GOOGLE_MANAGED_INTERNAL_CA`.
22655        Unspecified,
22656        /// Google-managed self-signed internal CA.
22657        GoogleManagedInternalCa,
22658        /// Google-managed regional CA part of root CA hierarchy hosted on Google
22659        /// Cloud's Certificate Authority Service (CAS).
22660        GoogleManagedCasCa,
22661        /// Customer-managed CA hosted on Google Cloud's Certificate Authority
22662        /// Service (CAS).
22663        CustomerManagedCasCa,
22664        /// If set, the enum was initialized with an unknown value.
22665        ///
22666        /// Applications can examine the value using [CaMode::value] or
22667        /// [CaMode::name].
22668        UnknownValue(ca_mode::UnknownValue),
22669    }
22670
22671    #[doc(hidden)]
22672    pub mod ca_mode {
22673        #[allow(unused_imports)]
22674        use super::*;
22675        #[derive(Clone, Debug, PartialEq)]
22676        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22677    }
22678
22679    impl CaMode {
22680        /// Gets the enum value.
22681        ///
22682        /// Returns `None` if the enum contains an unknown value deserialized from
22683        /// the string representation of enums.
22684        pub fn value(&self) -> std::option::Option<i32> {
22685            match self {
22686                Self::Unspecified => std::option::Option::Some(0),
22687                Self::GoogleManagedInternalCa => std::option::Option::Some(1),
22688                Self::GoogleManagedCasCa => std::option::Option::Some(2),
22689                Self::CustomerManagedCasCa => std::option::Option::Some(3),
22690                Self::UnknownValue(u) => u.0.value(),
22691            }
22692        }
22693
22694        /// Gets the enum value as a string.
22695        ///
22696        /// Returns `None` if the enum contains an unknown value deserialized from
22697        /// the integer representation of enums.
22698        pub fn name(&self) -> std::option::Option<&str> {
22699            match self {
22700                Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
22701                Self::GoogleManagedInternalCa => {
22702                    std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
22703                }
22704                Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
22705                Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
22706                Self::UnknownValue(u) => u.0.name(),
22707            }
22708        }
22709    }
22710
22711    impl std::default::Default for CaMode {
22712        fn default() -> Self {
22713            use std::convert::From;
22714            Self::from(0)
22715        }
22716    }
22717
22718    impl std::fmt::Display for CaMode {
22719        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22720            wkt::internal::display_enum(f, self.name(), self.value())
22721        }
22722    }
22723
22724    impl std::convert::From<i32> for CaMode {
22725        fn from(value: i32) -> Self {
22726            match value {
22727                0 => Self::Unspecified,
22728                1 => Self::GoogleManagedInternalCa,
22729                2 => Self::GoogleManagedCasCa,
22730                3 => Self::CustomerManagedCasCa,
22731                _ => Self::UnknownValue(ca_mode::UnknownValue(
22732                    wkt::internal::UnknownEnumValue::Integer(value),
22733                )),
22734            }
22735        }
22736    }
22737
22738    impl std::convert::From<&str> for CaMode {
22739        fn from(value: &str) -> Self {
22740            use std::string::ToString;
22741            match value {
22742                "CA_MODE_UNSPECIFIED" => Self::Unspecified,
22743                "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
22744                "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
22745                "CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
22746                _ => Self::UnknownValue(ca_mode::UnknownValue(
22747                    wkt::internal::UnknownEnumValue::String(value.to_string()),
22748                )),
22749            }
22750        }
22751    }
22752
22753    impl serde::ser::Serialize for CaMode {
22754        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22755        where
22756            S: serde::Serializer,
22757        {
22758            match self {
22759                Self::Unspecified => serializer.serialize_i32(0),
22760                Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
22761                Self::GoogleManagedCasCa => serializer.serialize_i32(2),
22762                Self::CustomerManagedCasCa => serializer.serialize_i32(3),
22763                Self::UnknownValue(u) => u.0.serialize(serializer),
22764            }
22765        }
22766    }
22767
22768    impl<'de> serde::de::Deserialize<'de> for CaMode {
22769        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22770        where
22771            D: serde::Deserializer<'de>,
22772        {
22773            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
22774                ".google.cloud.sql.v1.IpConfiguration.CaMode",
22775            ))
22776        }
22777    }
22778
22779    /// Settings for automatic server certificate rotation.
22780    ///
22781    /// # Working with unknown values
22782    ///
22783    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22784    /// additional enum variants at any time. Adding new variants is not considered
22785    /// a breaking change. Applications should write their code in anticipation of:
22786    ///
22787    /// - New values appearing in future releases of the client library, **and**
22788    /// - New values received dynamically, without application changes.
22789    ///
22790    /// Please consult the [Working with enums] section in the user guide for some
22791    /// guidelines.
22792    ///
22793    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22794    #[derive(Clone, Debug, PartialEq)]
22795    #[non_exhaustive]
22796    pub enum ServerCertificateRotationMode {
22797        /// Unspecified: no automatic server certificate rotation.
22798        Unspecified,
22799        /// No automatic server certificate rotation. The user must [manage server
22800        /// certificate
22801        /// rotation](/sql/docs/mysql/manage-ssl-instance#rotate-server-certificate-cas)
22802        /// on their side.
22803        NoAutomaticRotation,
22804        /// Automatic server certificate rotation during Cloud SQL scheduled
22805        /// maintenance or self-service maintenance updates. Requires
22806        /// `server_ca_mode` to be `GOOGLE_MANAGED_CAS_CA` or
22807        /// `CUSTOMER_MANAGED_CAS_CA`.
22808        AutomaticRotationDuringMaintenance,
22809        /// If set, the enum was initialized with an unknown value.
22810        ///
22811        /// Applications can examine the value using [ServerCertificateRotationMode::value] or
22812        /// [ServerCertificateRotationMode::name].
22813        UnknownValue(server_certificate_rotation_mode::UnknownValue),
22814    }
22815
22816    #[doc(hidden)]
22817    pub mod server_certificate_rotation_mode {
22818        #[allow(unused_imports)]
22819        use super::*;
22820        #[derive(Clone, Debug, PartialEq)]
22821        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22822    }
22823
22824    impl ServerCertificateRotationMode {
22825        /// Gets the enum value.
22826        ///
22827        /// Returns `None` if the enum contains an unknown value deserialized from
22828        /// the string representation of enums.
22829        pub fn value(&self) -> std::option::Option<i32> {
22830            match self {
22831                Self::Unspecified => std::option::Option::Some(0),
22832                Self::NoAutomaticRotation => std::option::Option::Some(1),
22833                Self::AutomaticRotationDuringMaintenance => std::option::Option::Some(2),
22834                Self::UnknownValue(u) => u.0.value(),
22835            }
22836        }
22837
22838        /// Gets the enum value as a string.
22839        ///
22840        /// Returns `None` if the enum contains an unknown value deserialized from
22841        /// the integer representation of enums.
22842        pub fn name(&self) -> std::option::Option<&str> {
22843            match self {
22844                Self::Unspecified => {
22845                    std::option::Option::Some("SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED")
22846                }
22847                Self::NoAutomaticRotation => std::option::Option::Some("NO_AUTOMATIC_ROTATION"),
22848                Self::AutomaticRotationDuringMaintenance => {
22849                    std::option::Option::Some("AUTOMATIC_ROTATION_DURING_MAINTENANCE")
22850                }
22851                Self::UnknownValue(u) => u.0.name(),
22852            }
22853        }
22854    }
22855
22856    impl std::default::Default for ServerCertificateRotationMode {
22857        fn default() -> Self {
22858            use std::convert::From;
22859            Self::from(0)
22860        }
22861    }
22862
22863    impl std::fmt::Display for ServerCertificateRotationMode {
22864        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22865            wkt::internal::display_enum(f, self.name(), self.value())
22866        }
22867    }
22868
22869    impl std::convert::From<i32> for ServerCertificateRotationMode {
22870        fn from(value: i32) -> Self {
22871            match value {
22872                0 => Self::Unspecified,
22873                1 => Self::NoAutomaticRotation,
22874                2 => Self::AutomaticRotationDuringMaintenance,
22875                _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
22876                    wkt::internal::UnknownEnumValue::Integer(value),
22877                )),
22878            }
22879        }
22880    }
22881
22882    impl std::convert::From<&str> for ServerCertificateRotationMode {
22883        fn from(value: &str) -> Self {
22884            use std::string::ToString;
22885            match value {
22886                "SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED" => Self::Unspecified,
22887                "NO_AUTOMATIC_ROTATION" => Self::NoAutomaticRotation,
22888                "AUTOMATIC_ROTATION_DURING_MAINTENANCE" => Self::AutomaticRotationDuringMaintenance,
22889                _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
22890                    wkt::internal::UnknownEnumValue::String(value.to_string()),
22891                )),
22892            }
22893        }
22894    }
22895
22896    impl serde::ser::Serialize for ServerCertificateRotationMode {
22897        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22898        where
22899            S: serde::Serializer,
22900        {
22901            match self {
22902                Self::Unspecified => serializer.serialize_i32(0),
22903                Self::NoAutomaticRotation => serializer.serialize_i32(1),
22904                Self::AutomaticRotationDuringMaintenance => serializer.serialize_i32(2),
22905                Self::UnknownValue(u) => u.0.serialize(serializer),
22906            }
22907        }
22908    }
22909
22910    impl<'de> serde::de::Deserialize<'de> for ServerCertificateRotationMode {
22911        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22912        where
22913            D: serde::Deserializer<'de>,
22914        {
22915            deserializer.deserialize_any(
22916                wkt::internal::EnumVisitor::<ServerCertificateRotationMode>::new(
22917                    ".google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode",
22918                ),
22919            )
22920        }
22921    }
22922}
22923
22924/// PSC settings for a Cloud SQL instance.
22925#[derive(Clone, Default, PartialEq)]
22926#[non_exhaustive]
22927pub struct PscConfig {
22928    /// Whether PSC connectivity is enabled for this instance.
22929    pub psc_enabled: std::option::Option<bool>,
22930
22931    /// Optional. The list of consumer projects that are allow-listed for PSC
22932    /// connections to this instance. This instance can be connected to with PSC
22933    /// from any network in these projects.
22934    ///
22935    /// Each consumer project in this list may be represented by a project number
22936    /// (numeric) or by a project id (alphanumeric).
22937    pub allowed_consumer_projects: std::vec::Vec<std::string::String>,
22938
22939    /// Optional. The list of settings for requested Private Service Connect
22940    /// consumer endpoints that can be used to connect to this Cloud SQL instance.
22941    pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
22942
22943    /// Optional. The network attachment of the consumer network that the
22944    /// Private Service Connect enabled Cloud SQL instance is
22945    /// authorized to connect via PSC interface.
22946    /// format: projects/PROJECT/regions/REGION/networkAttachments/ID
22947    pub network_attachment_uri: std::string::String,
22948
22949    /// Optional. Indicates whether PSC DNS automation is enabled for this
22950    /// instance. When enabled, Cloud SQL provisions a universal DNS record across
22951    /// all networks configured with Private Service Connect (PSC)
22952    /// auto-connections. This will default to true for new instances when Private
22953    /// Service Connect is enabled.
22954    pub psc_auto_dns_enabled: std::option::Option<bool>,
22955
22956    /// Optional. Indicates whether PSC write endpoint DNS automation is enabled
22957    /// for this instance. When enabled, Cloud SQL provisions a universal global
22958    /// DNS record across all networks configured with Private Service Connect
22959    /// (PSC) auto-connections that always points to the cluster primary instance.
22960    /// This feature is only supported for Enterprise Plus edition.
22961    /// This will default to true for new Enterprise Plus instances when
22962    /// `psc_auto_dns_enabled` is enabled.
22963    pub psc_write_endpoint_dns_enabled: std::option::Option<bool>,
22964
22965    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22966}
22967
22968impl PscConfig {
22969    /// Creates a new default instance.
22970    pub fn new() -> Self {
22971        std::default::Default::default()
22972    }
22973
22974    /// Sets the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
22975    ///
22976    /// # Example
22977    /// ```ignore,no_run
22978    /// # use google_cloud_sql_v1::model::PscConfig;
22979    /// let x = PscConfig::new().set_psc_enabled(true);
22980    /// ```
22981    pub fn set_psc_enabled<T>(mut self, v: T) -> Self
22982    where
22983        T: std::convert::Into<bool>,
22984    {
22985        self.psc_enabled = std::option::Option::Some(v.into());
22986        self
22987    }
22988
22989    /// Sets or clears the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
22990    ///
22991    /// # Example
22992    /// ```ignore,no_run
22993    /// # use google_cloud_sql_v1::model::PscConfig;
22994    /// let x = PscConfig::new().set_or_clear_psc_enabled(Some(false));
22995    /// let x = PscConfig::new().set_or_clear_psc_enabled(None::<bool>);
22996    /// ```
22997    pub fn set_or_clear_psc_enabled<T>(mut self, v: std::option::Option<T>) -> Self
22998    where
22999        T: std::convert::Into<bool>,
23000    {
23001        self.psc_enabled = v.map(|x| x.into());
23002        self
23003    }
23004
23005    /// Sets the value of [allowed_consumer_projects][crate::model::PscConfig::allowed_consumer_projects].
23006    ///
23007    /// # Example
23008    /// ```ignore,no_run
23009    /// # use google_cloud_sql_v1::model::PscConfig;
23010    /// let x = PscConfig::new().set_allowed_consumer_projects(["a", "b", "c"]);
23011    /// ```
23012    pub fn set_allowed_consumer_projects<T, V>(mut self, v: T) -> Self
23013    where
23014        T: std::iter::IntoIterator<Item = V>,
23015        V: std::convert::Into<std::string::String>,
23016    {
23017        use std::iter::Iterator;
23018        self.allowed_consumer_projects = v.into_iter().map(|i| i.into()).collect();
23019        self
23020    }
23021
23022    /// Sets the value of [psc_auto_connections][crate::model::PscConfig::psc_auto_connections].
23023    ///
23024    /// # Example
23025    /// ```ignore,no_run
23026    /// # use google_cloud_sql_v1::model::PscConfig;
23027    /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23028    /// let x = PscConfig::new()
23029    ///     .set_psc_auto_connections([
23030    ///         PscAutoConnectionConfig::default()/* use setters */,
23031    ///         PscAutoConnectionConfig::default()/* use (different) setters */,
23032    ///     ]);
23033    /// ```
23034    pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
23035    where
23036        T: std::iter::IntoIterator<Item = V>,
23037        V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
23038    {
23039        use std::iter::Iterator;
23040        self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
23041        self
23042    }
23043
23044    /// Sets the value of [network_attachment_uri][crate::model::PscConfig::network_attachment_uri].
23045    ///
23046    /// # Example
23047    /// ```ignore,no_run
23048    /// # use google_cloud_sql_v1::model::PscConfig;
23049    /// let x = PscConfig::new().set_network_attachment_uri("example");
23050    /// ```
23051    pub fn set_network_attachment_uri<T: std::convert::Into<std::string::String>>(
23052        mut self,
23053        v: T,
23054    ) -> Self {
23055        self.network_attachment_uri = v.into();
23056        self
23057    }
23058
23059    /// Sets the value of [psc_auto_dns_enabled][crate::model::PscConfig::psc_auto_dns_enabled].
23060    ///
23061    /// # Example
23062    /// ```ignore,no_run
23063    /// # use google_cloud_sql_v1::model::PscConfig;
23064    /// let x = PscConfig::new().set_psc_auto_dns_enabled(true);
23065    /// ```
23066    pub fn set_psc_auto_dns_enabled<T>(mut self, v: T) -> Self
23067    where
23068        T: std::convert::Into<bool>,
23069    {
23070        self.psc_auto_dns_enabled = std::option::Option::Some(v.into());
23071        self
23072    }
23073
23074    /// Sets or clears the value of [psc_auto_dns_enabled][crate::model::PscConfig::psc_auto_dns_enabled].
23075    ///
23076    /// # Example
23077    /// ```ignore,no_run
23078    /// # use google_cloud_sql_v1::model::PscConfig;
23079    /// let x = PscConfig::new().set_or_clear_psc_auto_dns_enabled(Some(false));
23080    /// let x = PscConfig::new().set_or_clear_psc_auto_dns_enabled(None::<bool>);
23081    /// ```
23082    pub fn set_or_clear_psc_auto_dns_enabled<T>(mut self, v: std::option::Option<T>) -> Self
23083    where
23084        T: std::convert::Into<bool>,
23085    {
23086        self.psc_auto_dns_enabled = v.map(|x| x.into());
23087        self
23088    }
23089
23090    /// Sets the value of [psc_write_endpoint_dns_enabled][crate::model::PscConfig::psc_write_endpoint_dns_enabled].
23091    ///
23092    /// # Example
23093    /// ```ignore,no_run
23094    /// # use google_cloud_sql_v1::model::PscConfig;
23095    /// let x = PscConfig::new().set_psc_write_endpoint_dns_enabled(true);
23096    /// ```
23097    pub fn set_psc_write_endpoint_dns_enabled<T>(mut self, v: T) -> Self
23098    where
23099        T: std::convert::Into<bool>,
23100    {
23101        self.psc_write_endpoint_dns_enabled = std::option::Option::Some(v.into());
23102        self
23103    }
23104
23105    /// Sets or clears the value of [psc_write_endpoint_dns_enabled][crate::model::PscConfig::psc_write_endpoint_dns_enabled].
23106    ///
23107    /// # Example
23108    /// ```ignore,no_run
23109    /// # use google_cloud_sql_v1::model::PscConfig;
23110    /// let x = PscConfig::new().set_or_clear_psc_write_endpoint_dns_enabled(Some(false));
23111    /// let x = PscConfig::new().set_or_clear_psc_write_endpoint_dns_enabled(None::<bool>);
23112    /// ```
23113    pub fn set_or_clear_psc_write_endpoint_dns_enabled<T>(
23114        mut self,
23115        v: std::option::Option<T>,
23116    ) -> Self
23117    where
23118        T: std::convert::Into<bool>,
23119    {
23120        self.psc_write_endpoint_dns_enabled = v.map(|x| x.into());
23121        self
23122    }
23123}
23124
23125impl wkt::message::Message for PscConfig {
23126    fn typename() -> &'static str {
23127        "type.googleapis.com/google.cloud.sql.v1.PscConfig"
23128    }
23129}
23130
23131/// Settings for an automatically-setup Private Service Connect consumer endpoint
23132/// that is used to connect to a Cloud SQL instance.
23133#[derive(Clone, Default, PartialEq)]
23134#[non_exhaustive]
23135pub struct PscAutoConnectionConfig {
23136    /// Optional. This is the project ID of consumer service project of this
23137    /// consumer endpoint.
23138    ///
23139    /// This is only applicable if `consumer_network` is a shared VPC
23140    /// network.
23141    pub consumer_project: std::string::String,
23142
23143    /// Optional. The consumer network of this consumer endpoint. This must be a
23144    /// resource path that includes both the host project and the network name.
23145    ///
23146    /// For example, `projects/project1/global/networks/network1`.
23147    ///
23148    /// The consumer host project of this network might be different from the
23149    /// consumer service project.
23150    pub consumer_network: std::string::String,
23151
23152    /// The IP address of the consumer endpoint.
23153    pub ip_address: std::option::Option<std::string::String>,
23154
23155    /// The connection status of the consumer endpoint.
23156    pub status: std::option::Option<std::string::String>,
23157
23158    /// The connection policy status of the consumer network.
23159    pub consumer_network_status: std::option::Option<std::string::String>,
23160
23161    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23162}
23163
23164impl PscAutoConnectionConfig {
23165    /// Creates a new default instance.
23166    pub fn new() -> Self {
23167        std::default::Default::default()
23168    }
23169
23170    /// Sets the value of [consumer_project][crate::model::PscAutoConnectionConfig::consumer_project].
23171    ///
23172    /// # Example
23173    /// ```ignore,no_run
23174    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23175    /// let x = PscAutoConnectionConfig::new().set_consumer_project("example");
23176    /// ```
23177    pub fn set_consumer_project<T: std::convert::Into<std::string::String>>(
23178        mut self,
23179        v: T,
23180    ) -> Self {
23181        self.consumer_project = v.into();
23182        self
23183    }
23184
23185    /// Sets the value of [consumer_network][crate::model::PscAutoConnectionConfig::consumer_network].
23186    ///
23187    /// # Example
23188    /// ```ignore,no_run
23189    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23190    /// let x = PscAutoConnectionConfig::new().set_consumer_network("example");
23191    /// ```
23192    pub fn set_consumer_network<T: std::convert::Into<std::string::String>>(
23193        mut self,
23194        v: T,
23195    ) -> Self {
23196        self.consumer_network = v.into();
23197        self
23198    }
23199
23200    /// Sets the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
23201    ///
23202    /// # Example
23203    /// ```ignore,no_run
23204    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23205    /// let x = PscAutoConnectionConfig::new().set_ip_address("example");
23206    /// ```
23207    pub fn set_ip_address<T>(mut self, v: T) -> Self
23208    where
23209        T: std::convert::Into<std::string::String>,
23210    {
23211        self.ip_address = std::option::Option::Some(v.into());
23212        self
23213    }
23214
23215    /// Sets or clears the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
23216    ///
23217    /// # Example
23218    /// ```ignore,no_run
23219    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23220    /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(Some("example"));
23221    /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(None::<String>);
23222    /// ```
23223    pub fn set_or_clear_ip_address<T>(mut self, v: std::option::Option<T>) -> Self
23224    where
23225        T: std::convert::Into<std::string::String>,
23226    {
23227        self.ip_address = v.map(|x| x.into());
23228        self
23229    }
23230
23231    /// Sets the value of [status][crate::model::PscAutoConnectionConfig::status].
23232    ///
23233    /// # Example
23234    /// ```ignore,no_run
23235    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23236    /// let x = PscAutoConnectionConfig::new().set_status("example");
23237    /// ```
23238    pub fn set_status<T>(mut self, v: T) -> Self
23239    where
23240        T: std::convert::Into<std::string::String>,
23241    {
23242        self.status = std::option::Option::Some(v.into());
23243        self
23244    }
23245
23246    /// Sets or clears the value of [status][crate::model::PscAutoConnectionConfig::status].
23247    ///
23248    /// # Example
23249    /// ```ignore,no_run
23250    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23251    /// let x = PscAutoConnectionConfig::new().set_or_clear_status(Some("example"));
23252    /// let x = PscAutoConnectionConfig::new().set_or_clear_status(None::<String>);
23253    /// ```
23254    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
23255    where
23256        T: std::convert::Into<std::string::String>,
23257    {
23258        self.status = v.map(|x| x.into());
23259        self
23260    }
23261
23262    /// Sets the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
23263    ///
23264    /// # Example
23265    /// ```ignore,no_run
23266    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23267    /// let x = PscAutoConnectionConfig::new().set_consumer_network_status("example");
23268    /// ```
23269    pub fn set_consumer_network_status<T>(mut self, v: T) -> Self
23270    where
23271        T: std::convert::Into<std::string::String>,
23272    {
23273        self.consumer_network_status = std::option::Option::Some(v.into());
23274        self
23275    }
23276
23277    /// Sets or clears the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
23278    ///
23279    /// # Example
23280    /// ```ignore,no_run
23281    /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23282    /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(Some("example"));
23283    /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(None::<String>);
23284    /// ```
23285    pub fn set_or_clear_consumer_network_status<T>(mut self, v: std::option::Option<T>) -> Self
23286    where
23287        T: std::convert::Into<std::string::String>,
23288    {
23289        self.consumer_network_status = v.map(|x| x.into());
23290        self
23291    }
23292}
23293
23294impl wkt::message::Message for PscAutoConnectionConfig {
23295    fn typename() -> &'static str {
23296        "type.googleapis.com/google.cloud.sql.v1.PscAutoConnectionConfig"
23297    }
23298}
23299
23300/// Preferred location. This specifies where a Cloud SQL instance is located.
23301/// Note that if the preferred location is not available, the instance will be
23302/// located as close as possible within the region. Only one location may be
23303/// specified.
23304#[derive(Clone, Default, PartialEq)]
23305#[non_exhaustive]
23306pub struct LocationPreference {
23307    /// The App Engine application to follow, it must be in the same region as the
23308    /// Cloud SQL instance. WARNING: Changing this might restart the instance.
23309    #[deprecated]
23310    pub follow_gae_application: std::string::String,
23311
23312    /// The preferred Compute Engine zone (for example: us-central1-a,
23313    /// us-central1-b, etc.). WARNING: Changing this might restart the instance.
23314    pub zone: std::string::String,
23315
23316    /// The preferred Compute Engine zone for the secondary/failover
23317    /// (for example: us-central1-a, us-central1-b, etc.).
23318    /// To disable this field, set it to 'no_secondary_zone'.
23319    pub secondary_zone: std::string::String,
23320
23321    /// This is always `sql#locationPreference`.
23322    pub kind: std::string::String,
23323
23324    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23325}
23326
23327impl LocationPreference {
23328    /// Creates a new default instance.
23329    pub fn new() -> Self {
23330        std::default::Default::default()
23331    }
23332
23333    /// Sets the value of [follow_gae_application][crate::model::LocationPreference::follow_gae_application].
23334    ///
23335    /// # Example
23336    /// ```ignore,no_run
23337    /// # use google_cloud_sql_v1::model::LocationPreference;
23338    /// let x = LocationPreference::new().set_follow_gae_application("example");
23339    /// ```
23340    #[deprecated]
23341    pub fn set_follow_gae_application<T: std::convert::Into<std::string::String>>(
23342        mut self,
23343        v: T,
23344    ) -> Self {
23345        self.follow_gae_application = v.into();
23346        self
23347    }
23348
23349    /// Sets the value of [zone][crate::model::LocationPreference::zone].
23350    ///
23351    /// # Example
23352    /// ```ignore,no_run
23353    /// # use google_cloud_sql_v1::model::LocationPreference;
23354    /// let x = LocationPreference::new().set_zone("example");
23355    /// ```
23356    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23357        self.zone = v.into();
23358        self
23359    }
23360
23361    /// Sets the value of [secondary_zone][crate::model::LocationPreference::secondary_zone].
23362    ///
23363    /// # Example
23364    /// ```ignore,no_run
23365    /// # use google_cloud_sql_v1::model::LocationPreference;
23366    /// let x = LocationPreference::new().set_secondary_zone("example");
23367    /// ```
23368    pub fn set_secondary_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23369        self.secondary_zone = v.into();
23370        self
23371    }
23372
23373    /// Sets the value of [kind][crate::model::LocationPreference::kind].
23374    ///
23375    /// # Example
23376    /// ```ignore,no_run
23377    /// # use google_cloud_sql_v1::model::LocationPreference;
23378    /// let x = LocationPreference::new().set_kind("example");
23379    /// ```
23380    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23381        self.kind = v.into();
23382        self
23383    }
23384}
23385
23386impl wkt::message::Message for LocationPreference {
23387    fn typename() -> &'static str {
23388        "type.googleapis.com/google.cloud.sql.v1.LocationPreference"
23389    }
23390}
23391
23392/// Maintenance window. This specifies when a Cloud SQL instance is
23393/// restarted for system maintenance purposes.
23394#[derive(Clone, Default, PartialEq)]
23395#[non_exhaustive]
23396pub struct MaintenanceWindow {
23397    /// Hour of day - 0 to 23. Specify in the UTC time zone.
23398    pub hour: std::option::Option<wkt::Int32Value>,
23399
23400    /// Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
23401    /// `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
23402    /// Returned in output as an integer, 1 to 7, where `1` equals Monday.
23403    pub day: std::option::Option<wkt::Int32Value>,
23404
23405    /// Maintenance timing settings: `canary`, `stable`, or `week5`.
23406    /// For more information, see [About maintenance on Cloud SQL
23407    /// instances](https://cloud.google.com/sql/docs/mysql/maintenance).
23408    pub update_track: crate::model::SqlUpdateTrack,
23409
23410    /// This is always `sql#maintenanceWindow`.
23411    pub kind: std::string::String,
23412
23413    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23414}
23415
23416impl MaintenanceWindow {
23417    /// Creates a new default instance.
23418    pub fn new() -> Self {
23419        std::default::Default::default()
23420    }
23421
23422    /// Sets the value of [hour][crate::model::MaintenanceWindow::hour].
23423    ///
23424    /// # Example
23425    /// ```ignore,no_run
23426    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23427    /// use wkt::Int32Value;
23428    /// let x = MaintenanceWindow::new().set_hour(Int32Value::default()/* use setters */);
23429    /// ```
23430    pub fn set_hour<T>(mut self, v: T) -> Self
23431    where
23432        T: std::convert::Into<wkt::Int32Value>,
23433    {
23434        self.hour = std::option::Option::Some(v.into());
23435        self
23436    }
23437
23438    /// Sets or clears the value of [hour][crate::model::MaintenanceWindow::hour].
23439    ///
23440    /// # Example
23441    /// ```ignore,no_run
23442    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23443    /// use wkt::Int32Value;
23444    /// let x = MaintenanceWindow::new().set_or_clear_hour(Some(Int32Value::default()/* use setters */));
23445    /// let x = MaintenanceWindow::new().set_or_clear_hour(None::<Int32Value>);
23446    /// ```
23447    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
23448    where
23449        T: std::convert::Into<wkt::Int32Value>,
23450    {
23451        self.hour = v.map(|x| x.into());
23452        self
23453    }
23454
23455    /// Sets the value of [day][crate::model::MaintenanceWindow::day].
23456    ///
23457    /// # Example
23458    /// ```ignore,no_run
23459    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23460    /// use wkt::Int32Value;
23461    /// let x = MaintenanceWindow::new().set_day(Int32Value::default()/* use setters */);
23462    /// ```
23463    pub fn set_day<T>(mut self, v: T) -> Self
23464    where
23465        T: std::convert::Into<wkt::Int32Value>,
23466    {
23467        self.day = std::option::Option::Some(v.into());
23468        self
23469    }
23470
23471    /// Sets or clears the value of [day][crate::model::MaintenanceWindow::day].
23472    ///
23473    /// # Example
23474    /// ```ignore,no_run
23475    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23476    /// use wkt::Int32Value;
23477    /// let x = MaintenanceWindow::new().set_or_clear_day(Some(Int32Value::default()/* use setters */));
23478    /// let x = MaintenanceWindow::new().set_or_clear_day(None::<Int32Value>);
23479    /// ```
23480    pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
23481    where
23482        T: std::convert::Into<wkt::Int32Value>,
23483    {
23484        self.day = v.map(|x| x.into());
23485        self
23486    }
23487
23488    /// Sets the value of [update_track][crate::model::MaintenanceWindow::update_track].
23489    ///
23490    /// # Example
23491    /// ```ignore,no_run
23492    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23493    /// use google_cloud_sql_v1::model::SqlUpdateTrack;
23494    /// let x0 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Canary);
23495    /// let x1 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Stable);
23496    /// let x2 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Week5);
23497    /// ```
23498    pub fn set_update_track<T: std::convert::Into<crate::model::SqlUpdateTrack>>(
23499        mut self,
23500        v: T,
23501    ) -> Self {
23502        self.update_track = v.into();
23503        self
23504    }
23505
23506    /// Sets the value of [kind][crate::model::MaintenanceWindow::kind].
23507    ///
23508    /// # Example
23509    /// ```ignore,no_run
23510    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23511    /// let x = MaintenanceWindow::new().set_kind("example");
23512    /// ```
23513    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23514        self.kind = v.into();
23515        self
23516    }
23517}
23518
23519impl wkt::message::Message for MaintenanceWindow {
23520    fn typename() -> &'static str {
23521        "type.googleapis.com/google.cloud.sql.v1.MaintenanceWindow"
23522    }
23523}
23524
23525/// Deny maintenance Periods. This specifies a date range during when all CSA
23526/// rollout will be denied.
23527#[derive(Clone, Default, PartialEq)]
23528#[non_exhaustive]
23529pub struct DenyMaintenancePeriod {
23530    /// "deny maintenance period" start date. If the year of the start date is
23531    /// empty, the year of the end date also must be empty. In this case, it means
23532    /// the deny maintenance period recurs every year. The date is in format
23533    /// yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
23534    pub start_date: std::string::String,
23535
23536    /// "deny maintenance period" end date. If the year of the end date is empty,
23537    /// the year of the start date also must be empty. In this case, it means the
23538    /// no maintenance interval recurs every year. The date is in format yyyy-mm-dd
23539    /// i.e., 2020-11-01, or mm-dd, i.e., 11-01
23540    pub end_date: std::string::String,
23541
23542    /// Time in UTC when the "deny maintenance period" starts on start_date and
23543    /// ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
23544    pub time: std::string::String,
23545
23546    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23547}
23548
23549impl DenyMaintenancePeriod {
23550    /// Creates a new default instance.
23551    pub fn new() -> Self {
23552        std::default::Default::default()
23553    }
23554
23555    /// Sets the value of [start_date][crate::model::DenyMaintenancePeriod::start_date].
23556    ///
23557    /// # Example
23558    /// ```ignore,no_run
23559    /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23560    /// let x = DenyMaintenancePeriod::new().set_start_date("example");
23561    /// ```
23562    pub fn set_start_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23563        self.start_date = v.into();
23564        self
23565    }
23566
23567    /// Sets the value of [end_date][crate::model::DenyMaintenancePeriod::end_date].
23568    ///
23569    /// # Example
23570    /// ```ignore,no_run
23571    /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23572    /// let x = DenyMaintenancePeriod::new().set_end_date("example");
23573    /// ```
23574    pub fn set_end_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23575        self.end_date = v.into();
23576        self
23577    }
23578
23579    /// Sets the value of [time][crate::model::DenyMaintenancePeriod::time].
23580    ///
23581    /// # Example
23582    /// ```ignore,no_run
23583    /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23584    /// let x = DenyMaintenancePeriod::new().set_time("example");
23585    /// ```
23586    pub fn set_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23587        self.time = v.into();
23588        self
23589    }
23590}
23591
23592impl wkt::message::Message for DenyMaintenancePeriod {
23593    fn typename() -> &'static str {
23594        "type.googleapis.com/google.cloud.sql.v1.DenyMaintenancePeriod"
23595    }
23596}
23597
23598/// Insights configuration. This specifies when Cloud SQL Insights feature is
23599/// enabled and optional configuration.
23600#[derive(Clone, Default, PartialEq)]
23601#[non_exhaustive]
23602pub struct InsightsConfig {
23603    /// Whether Query Insights feature is enabled.
23604    pub query_insights_enabled: bool,
23605
23606    /// Whether Query Insights will record client address when enabled.
23607    pub record_client_address: bool,
23608
23609    /// Whether Query Insights will record application tags from query when
23610    /// enabled.
23611    pub record_application_tags: bool,
23612
23613    /// Maximum query length stored in bytes. Default value: 1024 bytes.
23614    /// Range: 256-4500 bytes. Query lengths greater than this field value will be
23615    /// truncated to this value. When unset, query length will be the default
23616    /// value. Changing query length will restart the database.
23617    pub query_string_length: std::option::Option<wkt::Int32Value>,
23618
23619    /// Number of query execution plans captured by Insights per minute
23620    /// for all queries combined. Default is 5.
23621    pub query_plans_per_minute: std::option::Option<wkt::Int32Value>,
23622
23623    /// Optional. Whether enhanced query insights feature is enabled.
23624    pub enhanced_query_insights_enabled: std::option::Option<wkt::BoolValue>,
23625
23626    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23627}
23628
23629impl InsightsConfig {
23630    /// Creates a new default instance.
23631    pub fn new() -> Self {
23632        std::default::Default::default()
23633    }
23634
23635    /// Sets the value of [query_insights_enabled][crate::model::InsightsConfig::query_insights_enabled].
23636    ///
23637    /// # Example
23638    /// ```ignore,no_run
23639    /// # use google_cloud_sql_v1::model::InsightsConfig;
23640    /// let x = InsightsConfig::new().set_query_insights_enabled(true);
23641    /// ```
23642    pub fn set_query_insights_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23643        self.query_insights_enabled = v.into();
23644        self
23645    }
23646
23647    /// Sets the value of [record_client_address][crate::model::InsightsConfig::record_client_address].
23648    ///
23649    /// # Example
23650    /// ```ignore,no_run
23651    /// # use google_cloud_sql_v1::model::InsightsConfig;
23652    /// let x = InsightsConfig::new().set_record_client_address(true);
23653    /// ```
23654    pub fn set_record_client_address<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23655        self.record_client_address = v.into();
23656        self
23657    }
23658
23659    /// Sets the value of [record_application_tags][crate::model::InsightsConfig::record_application_tags].
23660    ///
23661    /// # Example
23662    /// ```ignore,no_run
23663    /// # use google_cloud_sql_v1::model::InsightsConfig;
23664    /// let x = InsightsConfig::new().set_record_application_tags(true);
23665    /// ```
23666    pub fn set_record_application_tags<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23667        self.record_application_tags = v.into();
23668        self
23669    }
23670
23671    /// Sets the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
23672    ///
23673    /// # Example
23674    /// ```ignore,no_run
23675    /// # use google_cloud_sql_v1::model::InsightsConfig;
23676    /// use wkt::Int32Value;
23677    /// let x = InsightsConfig::new().set_query_string_length(Int32Value::default()/* use setters */);
23678    /// ```
23679    pub fn set_query_string_length<T>(mut self, v: T) -> Self
23680    where
23681        T: std::convert::Into<wkt::Int32Value>,
23682    {
23683        self.query_string_length = std::option::Option::Some(v.into());
23684        self
23685    }
23686
23687    /// Sets or clears the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
23688    ///
23689    /// # Example
23690    /// ```ignore,no_run
23691    /// # use google_cloud_sql_v1::model::InsightsConfig;
23692    /// use wkt::Int32Value;
23693    /// let x = InsightsConfig::new().set_or_clear_query_string_length(Some(Int32Value::default()/* use setters */));
23694    /// let x = InsightsConfig::new().set_or_clear_query_string_length(None::<Int32Value>);
23695    /// ```
23696    pub fn set_or_clear_query_string_length<T>(mut self, v: std::option::Option<T>) -> Self
23697    where
23698        T: std::convert::Into<wkt::Int32Value>,
23699    {
23700        self.query_string_length = v.map(|x| x.into());
23701        self
23702    }
23703
23704    /// Sets the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
23705    ///
23706    /// # Example
23707    /// ```ignore,no_run
23708    /// # use google_cloud_sql_v1::model::InsightsConfig;
23709    /// use wkt::Int32Value;
23710    /// let x = InsightsConfig::new().set_query_plans_per_minute(Int32Value::default()/* use setters */);
23711    /// ```
23712    pub fn set_query_plans_per_minute<T>(mut self, v: T) -> Self
23713    where
23714        T: std::convert::Into<wkt::Int32Value>,
23715    {
23716        self.query_plans_per_minute = std::option::Option::Some(v.into());
23717        self
23718    }
23719
23720    /// Sets or clears the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
23721    ///
23722    /// # Example
23723    /// ```ignore,no_run
23724    /// # use google_cloud_sql_v1::model::InsightsConfig;
23725    /// use wkt::Int32Value;
23726    /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(Some(Int32Value::default()/* use setters */));
23727    /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(None::<Int32Value>);
23728    /// ```
23729    pub fn set_or_clear_query_plans_per_minute<T>(mut self, v: std::option::Option<T>) -> Self
23730    where
23731        T: std::convert::Into<wkt::Int32Value>,
23732    {
23733        self.query_plans_per_minute = v.map(|x| x.into());
23734        self
23735    }
23736
23737    /// Sets the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
23738    ///
23739    /// # Example
23740    /// ```ignore,no_run
23741    /// # use google_cloud_sql_v1::model::InsightsConfig;
23742    /// use wkt::BoolValue;
23743    /// let x = InsightsConfig::new().set_enhanced_query_insights_enabled(BoolValue::default()/* use setters */);
23744    /// ```
23745    pub fn set_enhanced_query_insights_enabled<T>(mut self, v: T) -> Self
23746    where
23747        T: std::convert::Into<wkt::BoolValue>,
23748    {
23749        self.enhanced_query_insights_enabled = std::option::Option::Some(v.into());
23750        self
23751    }
23752
23753    /// Sets or clears the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
23754    ///
23755    /// # Example
23756    /// ```ignore,no_run
23757    /// # use google_cloud_sql_v1::model::InsightsConfig;
23758    /// use wkt::BoolValue;
23759    /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(Some(BoolValue::default()/* use setters */));
23760    /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(None::<BoolValue>);
23761    /// ```
23762    pub fn set_or_clear_enhanced_query_insights_enabled<T>(
23763        mut self,
23764        v: std::option::Option<T>,
23765    ) -> Self
23766    where
23767        T: std::convert::Into<wkt::BoolValue>,
23768    {
23769        self.enhanced_query_insights_enabled = v.map(|x| x.into());
23770        self
23771    }
23772}
23773
23774impl wkt::message::Message for InsightsConfig {
23775    fn typename() -> &'static str {
23776        "type.googleapis.com/google.cloud.sql.v1.InsightsConfig"
23777    }
23778}
23779
23780/// Read-replica configuration specific to MySQL databases.
23781#[derive(Clone, Default, PartialEq)]
23782#[non_exhaustive]
23783pub struct MySqlReplicaConfiguration {
23784    /// Path to a SQL dump file in Google Cloud Storage from which the replica
23785    /// instance is to be created. The URI is in the form gs://bucketName/fileName.
23786    /// Compressed gzip files (.gz) are also supported.
23787    /// Dumps have the binlog co-ordinates from which replication
23788    /// begins. This can be accomplished by setting --master-data to 1 when using
23789    /// mysqldump.
23790    pub dump_file_path: std::string::String,
23791
23792    /// The username for the replication connection.
23793    pub username: std::string::String,
23794
23795    /// The password for the replication connection.
23796    pub password: std::string::String,
23797
23798    /// Seconds to wait between connect retries. MySQL's default is 60 seconds.
23799    pub connect_retry_interval: std::option::Option<wkt::Int32Value>,
23800
23801    /// Interval in milliseconds between replication heartbeats.
23802    pub master_heartbeat_period: std::option::Option<wkt::Int64Value>,
23803
23804    /// PEM representation of the trusted CA's x509 certificate.
23805    pub ca_certificate: std::string::String,
23806
23807    /// PEM representation of the replica's x509 certificate.
23808    pub client_certificate: std::string::String,
23809
23810    /// PEM representation of the replica's private key. The corresponding public
23811    /// key is encoded in the client's certificate.
23812    pub client_key: std::string::String,
23813
23814    /// A list of permissible ciphers to use for SSL encryption.
23815    pub ssl_cipher: std::string::String,
23816
23817    /// Whether or not to check the primary instance's Common Name value in the
23818    /// certificate that it sends during the SSL handshake.
23819    pub verify_server_certificate: std::option::Option<wkt::BoolValue>,
23820
23821    /// This is always `sql#mysqlReplicaConfiguration`.
23822    pub kind: std::string::String,
23823
23824    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23825}
23826
23827impl MySqlReplicaConfiguration {
23828    /// Creates a new default instance.
23829    pub fn new() -> Self {
23830        std::default::Default::default()
23831    }
23832
23833    /// Sets the value of [dump_file_path][crate::model::MySqlReplicaConfiguration::dump_file_path].
23834    ///
23835    /// # Example
23836    /// ```ignore,no_run
23837    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23838    /// let x = MySqlReplicaConfiguration::new().set_dump_file_path("example");
23839    /// ```
23840    pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23841        self.dump_file_path = v.into();
23842        self
23843    }
23844
23845    /// Sets the value of [username][crate::model::MySqlReplicaConfiguration::username].
23846    ///
23847    /// # Example
23848    /// ```ignore,no_run
23849    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23850    /// let x = MySqlReplicaConfiguration::new().set_username("example");
23851    /// ```
23852    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23853        self.username = v.into();
23854        self
23855    }
23856
23857    /// Sets the value of [password][crate::model::MySqlReplicaConfiguration::password].
23858    ///
23859    /// # Example
23860    /// ```ignore,no_run
23861    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23862    /// let x = MySqlReplicaConfiguration::new().set_password("example");
23863    /// ```
23864    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23865        self.password = v.into();
23866        self
23867    }
23868
23869    /// Sets the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
23870    ///
23871    /// # Example
23872    /// ```ignore,no_run
23873    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23874    /// use wkt::Int32Value;
23875    /// let x = MySqlReplicaConfiguration::new().set_connect_retry_interval(Int32Value::default()/* use setters */);
23876    /// ```
23877    pub fn set_connect_retry_interval<T>(mut self, v: T) -> Self
23878    where
23879        T: std::convert::Into<wkt::Int32Value>,
23880    {
23881        self.connect_retry_interval = std::option::Option::Some(v.into());
23882        self
23883    }
23884
23885    /// Sets or clears the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
23886    ///
23887    /// # Example
23888    /// ```ignore,no_run
23889    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23890    /// use wkt::Int32Value;
23891    /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(Some(Int32Value::default()/* use setters */));
23892    /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(None::<Int32Value>);
23893    /// ```
23894    pub fn set_or_clear_connect_retry_interval<T>(mut self, v: std::option::Option<T>) -> Self
23895    where
23896        T: std::convert::Into<wkt::Int32Value>,
23897    {
23898        self.connect_retry_interval = v.map(|x| x.into());
23899        self
23900    }
23901
23902    /// Sets the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
23903    ///
23904    /// # Example
23905    /// ```ignore,no_run
23906    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23907    /// use wkt::Int64Value;
23908    /// let x = MySqlReplicaConfiguration::new().set_master_heartbeat_period(Int64Value::default()/* use setters */);
23909    /// ```
23910    pub fn set_master_heartbeat_period<T>(mut self, v: T) -> Self
23911    where
23912        T: std::convert::Into<wkt::Int64Value>,
23913    {
23914        self.master_heartbeat_period = std::option::Option::Some(v.into());
23915        self
23916    }
23917
23918    /// Sets or clears the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
23919    ///
23920    /// # Example
23921    /// ```ignore,no_run
23922    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23923    /// use wkt::Int64Value;
23924    /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(Some(Int64Value::default()/* use setters */));
23925    /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(None::<Int64Value>);
23926    /// ```
23927    pub fn set_or_clear_master_heartbeat_period<T>(mut self, v: std::option::Option<T>) -> Self
23928    where
23929        T: std::convert::Into<wkt::Int64Value>,
23930    {
23931        self.master_heartbeat_period = v.map(|x| x.into());
23932        self
23933    }
23934
23935    /// Sets the value of [ca_certificate][crate::model::MySqlReplicaConfiguration::ca_certificate].
23936    ///
23937    /// # Example
23938    /// ```ignore,no_run
23939    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23940    /// let x = MySqlReplicaConfiguration::new().set_ca_certificate("example");
23941    /// ```
23942    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23943        self.ca_certificate = v.into();
23944        self
23945    }
23946
23947    /// Sets the value of [client_certificate][crate::model::MySqlReplicaConfiguration::client_certificate].
23948    ///
23949    /// # Example
23950    /// ```ignore,no_run
23951    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23952    /// let x = MySqlReplicaConfiguration::new().set_client_certificate("example");
23953    /// ```
23954    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
23955        mut self,
23956        v: T,
23957    ) -> Self {
23958        self.client_certificate = v.into();
23959        self
23960    }
23961
23962    /// Sets the value of [client_key][crate::model::MySqlReplicaConfiguration::client_key].
23963    ///
23964    /// # Example
23965    /// ```ignore,no_run
23966    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23967    /// let x = MySqlReplicaConfiguration::new().set_client_key("example");
23968    /// ```
23969    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23970        self.client_key = v.into();
23971        self
23972    }
23973
23974    /// Sets the value of [ssl_cipher][crate::model::MySqlReplicaConfiguration::ssl_cipher].
23975    ///
23976    /// # Example
23977    /// ```ignore,no_run
23978    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23979    /// let x = MySqlReplicaConfiguration::new().set_ssl_cipher("example");
23980    /// ```
23981    pub fn set_ssl_cipher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23982        self.ssl_cipher = v.into();
23983        self
23984    }
23985
23986    /// Sets the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
23987    ///
23988    /// # Example
23989    /// ```ignore,no_run
23990    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23991    /// use wkt::BoolValue;
23992    /// let x = MySqlReplicaConfiguration::new().set_verify_server_certificate(BoolValue::default()/* use setters */);
23993    /// ```
23994    pub fn set_verify_server_certificate<T>(mut self, v: T) -> Self
23995    where
23996        T: std::convert::Into<wkt::BoolValue>,
23997    {
23998        self.verify_server_certificate = std::option::Option::Some(v.into());
23999        self
24000    }
24001
24002    /// Sets or clears the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
24003    ///
24004    /// # Example
24005    /// ```ignore,no_run
24006    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24007    /// use wkt::BoolValue;
24008    /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(Some(BoolValue::default()/* use setters */));
24009    /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(None::<BoolValue>);
24010    /// ```
24011    pub fn set_or_clear_verify_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
24012    where
24013        T: std::convert::Into<wkt::BoolValue>,
24014    {
24015        self.verify_server_certificate = v.map(|x| x.into());
24016        self
24017    }
24018
24019    /// Sets the value of [kind][crate::model::MySqlReplicaConfiguration::kind].
24020    ///
24021    /// # Example
24022    /// ```ignore,no_run
24023    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24024    /// let x = MySqlReplicaConfiguration::new().set_kind("example");
24025    /// ```
24026    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24027        self.kind = v.into();
24028        self
24029    }
24030}
24031
24032impl wkt::message::Message for MySqlReplicaConfiguration {
24033    fn typename() -> &'static str {
24034        "type.googleapis.com/google.cloud.sql.v1.MySqlReplicaConfiguration"
24035    }
24036}
24037
24038/// Disk encryption configuration for an instance.
24039#[derive(Clone, Default, PartialEq)]
24040#[non_exhaustive]
24041pub struct DiskEncryptionConfiguration {
24042    /// Resource name of KMS key for disk encryption
24043    pub kms_key_name: std::string::String,
24044
24045    /// This is always `sql#diskEncryptionConfiguration`.
24046    pub kind: std::string::String,
24047
24048    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24049}
24050
24051impl DiskEncryptionConfiguration {
24052    /// Creates a new default instance.
24053    pub fn new() -> Self {
24054        std::default::Default::default()
24055    }
24056
24057    /// Sets the value of [kms_key_name][crate::model::DiskEncryptionConfiguration::kms_key_name].
24058    ///
24059    /// # Example
24060    /// ```ignore,no_run
24061    /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
24062    /// let x = DiskEncryptionConfiguration::new().set_kms_key_name("example");
24063    /// ```
24064    pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24065        self.kms_key_name = v.into();
24066        self
24067    }
24068
24069    /// Sets the value of [kind][crate::model::DiskEncryptionConfiguration::kind].
24070    ///
24071    /// # Example
24072    /// ```ignore,no_run
24073    /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
24074    /// let x = DiskEncryptionConfiguration::new().set_kind("example");
24075    /// ```
24076    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24077        self.kind = v.into();
24078        self
24079    }
24080}
24081
24082impl wkt::message::Message for DiskEncryptionConfiguration {
24083    fn typename() -> &'static str {
24084        "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionConfiguration"
24085    }
24086}
24087
24088/// Disk encryption status for an instance.
24089#[derive(Clone, Default, PartialEq)]
24090#[non_exhaustive]
24091pub struct DiskEncryptionStatus {
24092    /// KMS key version used to encrypt the Cloud SQL instance resource
24093    pub kms_key_version_name: std::string::String,
24094
24095    /// This is always `sql#diskEncryptionStatus`.
24096    pub kind: std::string::String,
24097
24098    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24099}
24100
24101impl DiskEncryptionStatus {
24102    /// Creates a new default instance.
24103    pub fn new() -> Self {
24104        std::default::Default::default()
24105    }
24106
24107    /// Sets the value of [kms_key_version_name][crate::model::DiskEncryptionStatus::kms_key_version_name].
24108    ///
24109    /// # Example
24110    /// ```ignore,no_run
24111    /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
24112    /// let x = DiskEncryptionStatus::new().set_kms_key_version_name("example");
24113    /// ```
24114    pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
24115        mut self,
24116        v: T,
24117    ) -> Self {
24118        self.kms_key_version_name = v.into();
24119        self
24120    }
24121
24122    /// Sets the value of [kind][crate::model::DiskEncryptionStatus::kind].
24123    ///
24124    /// # Example
24125    /// ```ignore,no_run
24126    /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
24127    /// let x = DiskEncryptionStatus::new().set_kind("example");
24128    /// ```
24129    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24130        self.kind = v.into();
24131        self
24132    }
24133}
24134
24135impl wkt::message::Message for DiskEncryptionStatus {
24136    fn typename() -> &'static str {
24137        "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionStatus"
24138    }
24139}
24140
24141/// Database instance IP mapping
24142#[derive(Clone, Default, PartialEq)]
24143#[non_exhaustive]
24144pub struct IpMapping {
24145    /// The type of this IP address. A `PRIMARY` address is a public address that
24146    /// can accept incoming connections. A `PRIVATE` address is a private address
24147    /// that can accept incoming connections. An `OUTGOING` address is the source
24148    /// address of connections originating from the instance, if supported.
24149    pub r#type: crate::model::SqlIpAddressType,
24150
24151    /// The IP address assigned.
24152    pub ip_address: std::string::String,
24153
24154    /// The due time for this IP to be retired in
24155    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
24156    /// `2012-11-15T16:19:00.094Z`. This field is only available when
24157    /// the IP is scheduled to be retired.
24158    pub time_to_retire: std::option::Option<wkt::Timestamp>,
24159
24160    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24161}
24162
24163impl IpMapping {
24164    /// Creates a new default instance.
24165    pub fn new() -> Self {
24166        std::default::Default::default()
24167    }
24168
24169    /// Sets the value of [r#type][crate::model::IpMapping::type].
24170    ///
24171    /// # Example
24172    /// ```ignore,no_run
24173    /// # use google_cloud_sql_v1::model::IpMapping;
24174    /// use google_cloud_sql_v1::model::SqlIpAddressType;
24175    /// let x0 = IpMapping::new().set_type(SqlIpAddressType::Primary);
24176    /// let x1 = IpMapping::new().set_type(SqlIpAddressType::Outgoing);
24177    /// let x2 = IpMapping::new().set_type(SqlIpAddressType::Private);
24178    /// ```
24179    pub fn set_type<T: std::convert::Into<crate::model::SqlIpAddressType>>(mut self, v: T) -> Self {
24180        self.r#type = v.into();
24181        self
24182    }
24183
24184    /// Sets the value of [ip_address][crate::model::IpMapping::ip_address].
24185    ///
24186    /// # Example
24187    /// ```ignore,no_run
24188    /// # use google_cloud_sql_v1::model::IpMapping;
24189    /// let x = IpMapping::new().set_ip_address("example");
24190    /// ```
24191    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24192        self.ip_address = v.into();
24193        self
24194    }
24195
24196    /// Sets the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
24197    ///
24198    /// # Example
24199    /// ```ignore,no_run
24200    /// # use google_cloud_sql_v1::model::IpMapping;
24201    /// use wkt::Timestamp;
24202    /// let x = IpMapping::new().set_time_to_retire(Timestamp::default()/* use setters */);
24203    /// ```
24204    pub fn set_time_to_retire<T>(mut self, v: T) -> Self
24205    where
24206        T: std::convert::Into<wkt::Timestamp>,
24207    {
24208        self.time_to_retire = std::option::Option::Some(v.into());
24209        self
24210    }
24211
24212    /// Sets or clears the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
24213    ///
24214    /// # Example
24215    /// ```ignore,no_run
24216    /// # use google_cloud_sql_v1::model::IpMapping;
24217    /// use wkt::Timestamp;
24218    /// let x = IpMapping::new().set_or_clear_time_to_retire(Some(Timestamp::default()/* use setters */));
24219    /// let x = IpMapping::new().set_or_clear_time_to_retire(None::<Timestamp>);
24220    /// ```
24221    pub fn set_or_clear_time_to_retire<T>(mut self, v: std::option::Option<T>) -> Self
24222    where
24223        T: std::convert::Into<wkt::Timestamp>,
24224    {
24225        self.time_to_retire = v.map(|x| x.into());
24226        self
24227    }
24228}
24229
24230impl wkt::message::Message for IpMapping {
24231    fn typename() -> &'static str {
24232        "type.googleapis.com/google.cloud.sql.v1.IpMapping"
24233    }
24234}
24235
24236/// The sub operation type based on the operation type.
24237#[derive(Clone, Default, PartialEq)]
24238#[non_exhaustive]
24239pub struct SqlSubOperationType {
24240    /// Sub operation details corresponding to the operation type.
24241    pub sub_operation_details:
24242        std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
24243
24244    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24245}
24246
24247impl SqlSubOperationType {
24248    /// Creates a new default instance.
24249    pub fn new() -> Self {
24250        std::default::Default::default()
24251    }
24252
24253    /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details].
24254    ///
24255    /// Note that all the setters affecting `sub_operation_details` are mutually
24256    /// exclusive.
24257    ///
24258    /// # Example
24259    /// ```ignore,no_run
24260    /// # use google_cloud_sql_v1::model::SqlSubOperationType;
24261    /// use google_cloud_sql_v1::model::SqlMaintenanceType;
24262    /// let x0 = SqlSubOperationType::new().set_sub_operation_details(Some(
24263    ///     google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceMaintenance)));
24264    /// let x1 = SqlSubOperationType::new().set_sub_operation_details(Some(
24265    ///     google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::ReplicaIncludedMaintenance)));
24266    /// let x2 = SqlSubOperationType::new().set_sub_operation_details(Some(
24267    ///     google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceSelfServiceMaintenance)));
24268    /// ```
24269    pub fn set_sub_operation_details<
24270        T: std::convert::Into<
24271                std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
24272            >,
24273    >(
24274        mut self,
24275        v: T,
24276    ) -> Self {
24277        self.sub_operation_details = v.into();
24278        self
24279    }
24280
24281    /// The value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
24282    /// if it holds a `MaintenanceType`, `None` if the field is not set or
24283    /// holds a different branch.
24284    pub fn maintenance_type(&self) -> std::option::Option<&crate::model::SqlMaintenanceType> {
24285        #[allow(unreachable_patterns)]
24286        self.sub_operation_details.as_ref().and_then(|v| match v {
24287            crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v) => {
24288                std::option::Option::Some(v)
24289            }
24290            _ => std::option::Option::None,
24291        })
24292    }
24293
24294    /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
24295    /// to hold a `MaintenanceType`.
24296    ///
24297    /// Note that all the setters affecting `sub_operation_details` are
24298    /// mutually exclusive.
24299    ///
24300    /// # Example
24301    /// ```ignore,no_run
24302    /// # use google_cloud_sql_v1::model::SqlSubOperationType;
24303    /// use google_cloud_sql_v1::model::SqlMaintenanceType;
24304    /// let x0 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceMaintenance);
24305    /// let x1 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::ReplicaIncludedMaintenance);
24306    /// let x2 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceSelfServiceMaintenance);
24307    /// assert!(x0.maintenance_type().is_some());
24308    /// assert!(x1.maintenance_type().is_some());
24309    /// assert!(x2.maintenance_type().is_some());
24310    /// ```
24311    pub fn set_maintenance_type<T: std::convert::Into<crate::model::SqlMaintenanceType>>(
24312        mut self,
24313        v: T,
24314    ) -> Self {
24315        self.sub_operation_details = std::option::Option::Some(
24316            crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v.into()),
24317        );
24318        self
24319    }
24320}
24321
24322impl wkt::message::Message for SqlSubOperationType {
24323    fn typename() -> &'static str {
24324        "type.googleapis.com/google.cloud.sql.v1.SqlSubOperationType"
24325    }
24326}
24327
24328/// Defines additional types related to [SqlSubOperationType].
24329pub mod sql_sub_operation_type {
24330    #[allow(unused_imports)]
24331    use super::*;
24332
24333    /// Sub operation details corresponding to the operation type.
24334    #[derive(Clone, Debug, PartialEq)]
24335    #[non_exhaustive]
24336    pub enum SubOperationDetails {
24337        /// The type of maintenance to be performed on the instance.
24338        MaintenanceType(crate::model::SqlMaintenanceType),
24339    }
24340}
24341
24342/// An Operation resource.&nbsp;For successful operations that return an
24343/// Operation resource, only the fields relevant to the operation are populated
24344/// in the resource.
24345#[derive(Clone, Default, PartialEq)]
24346#[non_exhaustive]
24347pub struct Operation {
24348    /// This is always `sql#operation`.
24349    pub kind: std::string::String,
24350
24351    #[allow(missing_docs)]
24352    pub target_link: std::string::String,
24353
24354    /// The status of an operation.
24355    pub status: crate::model::operation::SqlOperationStatus,
24356
24357    /// The email address of the user who initiated this operation.
24358    pub user: std::string::String,
24359
24360    /// The time this operation was enqueued in UTC timezone in [RFC
24361    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
24362    /// `2012-11-15T16:19:00.094Z`.
24363    pub insert_time: std::option::Option<wkt::Timestamp>,
24364
24365    /// The time this operation actually started in UTC timezone in [RFC
24366    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
24367    /// `2012-11-15T16:19:00.094Z`.
24368    pub start_time: std::option::Option<wkt::Timestamp>,
24369
24370    /// The time this operation finished in UTC timezone in [RFC
24371    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
24372    /// `2012-11-15T16:19:00.094Z`.
24373    pub end_time: std::option::Option<wkt::Timestamp>,
24374
24375    /// If errors occurred during processing of this operation, this field will be
24376    /// populated.
24377    pub error: std::option::Option<crate::model::OperationErrors>,
24378
24379    /// An Admin API warning message.
24380    pub api_warning: std::option::Option<crate::model::ApiWarning>,
24381
24382    /// The type of the operation. Valid values are:
24383    ///
24384    /// * `CREATE`
24385    /// * `DELETE`
24386    /// * `UPDATE`
24387    /// * `RESTART`
24388    /// * `IMPORT`
24389    /// * `EXPORT`
24390    /// * `BACKUP_VOLUME`
24391    /// * `RESTORE_VOLUME`
24392    /// * `CREATE_USER`
24393    /// * `DELETE_USER`
24394    /// * `CREATE_DATABASE`
24395    /// * `DELETE_DATABASE`
24396    pub operation_type: crate::model::operation::SqlOperationType,
24397
24398    /// The context for import operation, if applicable.
24399    pub import_context: std::option::Option<crate::model::ImportContext>,
24400
24401    /// The context for export operation, if applicable.
24402    pub export_context: std::option::Option<crate::model::ExportContext>,
24403
24404    /// The context for backup operation, if applicable.
24405    pub backup_context: std::option::Option<crate::model::BackupContext>,
24406
24407    /// This field is only populated when the operation_type is
24408    /// PRE_CHECK_MAJOR_VERSION_UPGRADE.
24409    /// The PreCheckMajorVersionUpgradeContext message itself contains the details
24410    /// for that pre-check, such as the target database version for the upgrade
24411    /// and the results of the check (including any warnings or errors found).
24412    pub pre_check_major_version_upgrade_context:
24413        std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
24414
24415    /// An identifier that uniquely identifies the operation. You can use this
24416    /// identifier to retrieve the Operations resource that has information about
24417    /// the operation.
24418    pub name: std::string::String,
24419
24420    /// Name of the resource on which this operation runs.
24421    pub target_id: std::string::String,
24422
24423    /// The URI of this resource.
24424    pub self_link: std::string::String,
24425
24426    /// The project ID of the target instance related to this operation.
24427    pub target_project: std::string::String,
24428
24429    /// The context for acquire SSRS lease operation, if applicable.
24430    pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
24431
24432    /// Optional. The sub operation based on the operation type.
24433    pub sub_operation_type: std::option::Option<crate::model::SqlSubOperationType>,
24434
24435    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24436}
24437
24438impl Operation {
24439    /// Creates a new default instance.
24440    pub fn new() -> Self {
24441        std::default::Default::default()
24442    }
24443
24444    /// Sets the value of [kind][crate::model::Operation::kind].
24445    ///
24446    /// # Example
24447    /// ```ignore,no_run
24448    /// # use google_cloud_sql_v1::model::Operation;
24449    /// let x = Operation::new().set_kind("example");
24450    /// ```
24451    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24452        self.kind = v.into();
24453        self
24454    }
24455
24456    /// Sets the value of [target_link][crate::model::Operation::target_link].
24457    ///
24458    /// # Example
24459    /// ```ignore,no_run
24460    /// # use google_cloud_sql_v1::model::Operation;
24461    /// let x = Operation::new().set_target_link("example");
24462    /// ```
24463    pub fn set_target_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24464        self.target_link = v.into();
24465        self
24466    }
24467
24468    /// Sets the value of [status][crate::model::Operation::status].
24469    ///
24470    /// # Example
24471    /// ```ignore,no_run
24472    /// # use google_cloud_sql_v1::model::Operation;
24473    /// use google_cloud_sql_v1::model::operation::SqlOperationStatus;
24474    /// let x0 = Operation::new().set_status(SqlOperationStatus::Pending);
24475    /// let x1 = Operation::new().set_status(SqlOperationStatus::Running);
24476    /// let x2 = Operation::new().set_status(SqlOperationStatus::Done);
24477    /// ```
24478    pub fn set_status<T: std::convert::Into<crate::model::operation::SqlOperationStatus>>(
24479        mut self,
24480        v: T,
24481    ) -> Self {
24482        self.status = v.into();
24483        self
24484    }
24485
24486    /// Sets the value of [user][crate::model::Operation::user].
24487    ///
24488    /// # Example
24489    /// ```ignore,no_run
24490    /// # use google_cloud_sql_v1::model::Operation;
24491    /// let x = Operation::new().set_user("example");
24492    /// ```
24493    pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24494        self.user = v.into();
24495        self
24496    }
24497
24498    /// Sets the value of [insert_time][crate::model::Operation::insert_time].
24499    ///
24500    /// # Example
24501    /// ```ignore,no_run
24502    /// # use google_cloud_sql_v1::model::Operation;
24503    /// use wkt::Timestamp;
24504    /// let x = Operation::new().set_insert_time(Timestamp::default()/* use setters */);
24505    /// ```
24506    pub fn set_insert_time<T>(mut self, v: T) -> Self
24507    where
24508        T: std::convert::Into<wkt::Timestamp>,
24509    {
24510        self.insert_time = std::option::Option::Some(v.into());
24511        self
24512    }
24513
24514    /// Sets or clears the value of [insert_time][crate::model::Operation::insert_time].
24515    ///
24516    /// # Example
24517    /// ```ignore,no_run
24518    /// # use google_cloud_sql_v1::model::Operation;
24519    /// use wkt::Timestamp;
24520    /// let x = Operation::new().set_or_clear_insert_time(Some(Timestamp::default()/* use setters */));
24521    /// let x = Operation::new().set_or_clear_insert_time(None::<Timestamp>);
24522    /// ```
24523    pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
24524    where
24525        T: std::convert::Into<wkt::Timestamp>,
24526    {
24527        self.insert_time = v.map(|x| x.into());
24528        self
24529    }
24530
24531    /// Sets the value of [start_time][crate::model::Operation::start_time].
24532    ///
24533    /// # Example
24534    /// ```ignore,no_run
24535    /// # use google_cloud_sql_v1::model::Operation;
24536    /// use wkt::Timestamp;
24537    /// let x = Operation::new().set_start_time(Timestamp::default()/* use setters */);
24538    /// ```
24539    pub fn set_start_time<T>(mut self, v: T) -> Self
24540    where
24541        T: std::convert::Into<wkt::Timestamp>,
24542    {
24543        self.start_time = std::option::Option::Some(v.into());
24544        self
24545    }
24546
24547    /// Sets or clears the value of [start_time][crate::model::Operation::start_time].
24548    ///
24549    /// # Example
24550    /// ```ignore,no_run
24551    /// # use google_cloud_sql_v1::model::Operation;
24552    /// use wkt::Timestamp;
24553    /// let x = Operation::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
24554    /// let x = Operation::new().set_or_clear_start_time(None::<Timestamp>);
24555    /// ```
24556    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
24557    where
24558        T: std::convert::Into<wkt::Timestamp>,
24559    {
24560        self.start_time = v.map(|x| x.into());
24561        self
24562    }
24563
24564    /// Sets the value of [end_time][crate::model::Operation::end_time].
24565    ///
24566    /// # Example
24567    /// ```ignore,no_run
24568    /// # use google_cloud_sql_v1::model::Operation;
24569    /// use wkt::Timestamp;
24570    /// let x = Operation::new().set_end_time(Timestamp::default()/* use setters */);
24571    /// ```
24572    pub fn set_end_time<T>(mut self, v: T) -> Self
24573    where
24574        T: std::convert::Into<wkt::Timestamp>,
24575    {
24576        self.end_time = std::option::Option::Some(v.into());
24577        self
24578    }
24579
24580    /// Sets or clears the value of [end_time][crate::model::Operation::end_time].
24581    ///
24582    /// # Example
24583    /// ```ignore,no_run
24584    /// # use google_cloud_sql_v1::model::Operation;
24585    /// use wkt::Timestamp;
24586    /// let x = Operation::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
24587    /// let x = Operation::new().set_or_clear_end_time(None::<Timestamp>);
24588    /// ```
24589    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
24590    where
24591        T: std::convert::Into<wkt::Timestamp>,
24592    {
24593        self.end_time = v.map(|x| x.into());
24594        self
24595    }
24596
24597    /// Sets the value of [error][crate::model::Operation::error].
24598    ///
24599    /// # Example
24600    /// ```ignore,no_run
24601    /// # use google_cloud_sql_v1::model::Operation;
24602    /// use google_cloud_sql_v1::model::OperationErrors;
24603    /// let x = Operation::new().set_error(OperationErrors::default()/* use setters */);
24604    /// ```
24605    pub fn set_error<T>(mut self, v: T) -> Self
24606    where
24607        T: std::convert::Into<crate::model::OperationErrors>,
24608    {
24609        self.error = std::option::Option::Some(v.into());
24610        self
24611    }
24612
24613    /// Sets or clears the value of [error][crate::model::Operation::error].
24614    ///
24615    /// # Example
24616    /// ```ignore,no_run
24617    /// # use google_cloud_sql_v1::model::Operation;
24618    /// use google_cloud_sql_v1::model::OperationErrors;
24619    /// let x = Operation::new().set_or_clear_error(Some(OperationErrors::default()/* use setters */));
24620    /// let x = Operation::new().set_or_clear_error(None::<OperationErrors>);
24621    /// ```
24622    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
24623    where
24624        T: std::convert::Into<crate::model::OperationErrors>,
24625    {
24626        self.error = v.map(|x| x.into());
24627        self
24628    }
24629
24630    /// Sets the value of [api_warning][crate::model::Operation::api_warning].
24631    ///
24632    /// # Example
24633    /// ```ignore,no_run
24634    /// # use google_cloud_sql_v1::model::Operation;
24635    /// use google_cloud_sql_v1::model::ApiWarning;
24636    /// let x = Operation::new().set_api_warning(ApiWarning::default()/* use setters */);
24637    /// ```
24638    pub fn set_api_warning<T>(mut self, v: T) -> Self
24639    where
24640        T: std::convert::Into<crate::model::ApiWarning>,
24641    {
24642        self.api_warning = std::option::Option::Some(v.into());
24643        self
24644    }
24645
24646    /// Sets or clears the value of [api_warning][crate::model::Operation::api_warning].
24647    ///
24648    /// # Example
24649    /// ```ignore,no_run
24650    /// # use google_cloud_sql_v1::model::Operation;
24651    /// use google_cloud_sql_v1::model::ApiWarning;
24652    /// let x = Operation::new().set_or_clear_api_warning(Some(ApiWarning::default()/* use setters */));
24653    /// let x = Operation::new().set_or_clear_api_warning(None::<ApiWarning>);
24654    /// ```
24655    pub fn set_or_clear_api_warning<T>(mut self, v: std::option::Option<T>) -> Self
24656    where
24657        T: std::convert::Into<crate::model::ApiWarning>,
24658    {
24659        self.api_warning = v.map(|x| x.into());
24660        self
24661    }
24662
24663    /// Sets the value of [operation_type][crate::model::Operation::operation_type].
24664    ///
24665    /// # Example
24666    /// ```ignore,no_run
24667    /// # use google_cloud_sql_v1::model::Operation;
24668    /// use google_cloud_sql_v1::model::operation::SqlOperationType;
24669    /// let x0 = Operation::new().set_operation_type(SqlOperationType::Import);
24670    /// let x1 = Operation::new().set_operation_type(SqlOperationType::Export);
24671    /// let x2 = Operation::new().set_operation_type(SqlOperationType::Create);
24672    /// ```
24673    pub fn set_operation_type<T: std::convert::Into<crate::model::operation::SqlOperationType>>(
24674        mut self,
24675        v: T,
24676    ) -> Self {
24677        self.operation_type = v.into();
24678        self
24679    }
24680
24681    /// Sets the value of [import_context][crate::model::Operation::import_context].
24682    ///
24683    /// # Example
24684    /// ```ignore,no_run
24685    /// # use google_cloud_sql_v1::model::Operation;
24686    /// use google_cloud_sql_v1::model::ImportContext;
24687    /// let x = Operation::new().set_import_context(ImportContext::default()/* use setters */);
24688    /// ```
24689    pub fn set_import_context<T>(mut self, v: T) -> Self
24690    where
24691        T: std::convert::Into<crate::model::ImportContext>,
24692    {
24693        self.import_context = std::option::Option::Some(v.into());
24694        self
24695    }
24696
24697    /// Sets or clears the value of [import_context][crate::model::Operation::import_context].
24698    ///
24699    /// # Example
24700    /// ```ignore,no_run
24701    /// # use google_cloud_sql_v1::model::Operation;
24702    /// use google_cloud_sql_v1::model::ImportContext;
24703    /// let x = Operation::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
24704    /// let x = Operation::new().set_or_clear_import_context(None::<ImportContext>);
24705    /// ```
24706    pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
24707    where
24708        T: std::convert::Into<crate::model::ImportContext>,
24709    {
24710        self.import_context = v.map(|x| x.into());
24711        self
24712    }
24713
24714    /// Sets the value of [export_context][crate::model::Operation::export_context].
24715    ///
24716    /// # Example
24717    /// ```ignore,no_run
24718    /// # use google_cloud_sql_v1::model::Operation;
24719    /// use google_cloud_sql_v1::model::ExportContext;
24720    /// let x = Operation::new().set_export_context(ExportContext::default()/* use setters */);
24721    /// ```
24722    pub fn set_export_context<T>(mut self, v: T) -> Self
24723    where
24724        T: std::convert::Into<crate::model::ExportContext>,
24725    {
24726        self.export_context = std::option::Option::Some(v.into());
24727        self
24728    }
24729
24730    /// Sets or clears the value of [export_context][crate::model::Operation::export_context].
24731    ///
24732    /// # Example
24733    /// ```ignore,no_run
24734    /// # use google_cloud_sql_v1::model::Operation;
24735    /// use google_cloud_sql_v1::model::ExportContext;
24736    /// let x = Operation::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
24737    /// let x = Operation::new().set_or_clear_export_context(None::<ExportContext>);
24738    /// ```
24739    pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
24740    where
24741        T: std::convert::Into<crate::model::ExportContext>,
24742    {
24743        self.export_context = v.map(|x| x.into());
24744        self
24745    }
24746
24747    /// Sets the value of [backup_context][crate::model::Operation::backup_context].
24748    ///
24749    /// # Example
24750    /// ```ignore,no_run
24751    /// # use google_cloud_sql_v1::model::Operation;
24752    /// use google_cloud_sql_v1::model::BackupContext;
24753    /// let x = Operation::new().set_backup_context(BackupContext::default()/* use setters */);
24754    /// ```
24755    pub fn set_backup_context<T>(mut self, v: T) -> Self
24756    where
24757        T: std::convert::Into<crate::model::BackupContext>,
24758    {
24759        self.backup_context = std::option::Option::Some(v.into());
24760        self
24761    }
24762
24763    /// Sets or clears the value of [backup_context][crate::model::Operation::backup_context].
24764    ///
24765    /// # Example
24766    /// ```ignore,no_run
24767    /// # use google_cloud_sql_v1::model::Operation;
24768    /// use google_cloud_sql_v1::model::BackupContext;
24769    /// let x = Operation::new().set_or_clear_backup_context(Some(BackupContext::default()/* use setters */));
24770    /// let x = Operation::new().set_or_clear_backup_context(None::<BackupContext>);
24771    /// ```
24772    pub fn set_or_clear_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
24773    where
24774        T: std::convert::Into<crate::model::BackupContext>,
24775    {
24776        self.backup_context = v.map(|x| x.into());
24777        self
24778    }
24779
24780    /// Sets the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
24781    ///
24782    /// # Example
24783    /// ```ignore,no_run
24784    /// # use google_cloud_sql_v1::model::Operation;
24785    /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
24786    /// let x = Operation::new().set_pre_check_major_version_upgrade_context(PreCheckMajorVersionUpgradeContext::default()/* use setters */);
24787    /// ```
24788    pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
24789    where
24790        T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
24791    {
24792        self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
24793        self
24794    }
24795
24796    /// Sets or clears the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
24797    ///
24798    /// # Example
24799    /// ```ignore,no_run
24800    /// # use google_cloud_sql_v1::model::Operation;
24801    /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
24802    /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(Some(PreCheckMajorVersionUpgradeContext::default()/* use setters */));
24803    /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(None::<PreCheckMajorVersionUpgradeContext>);
24804    /// ```
24805    pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
24806        mut self,
24807        v: std::option::Option<T>,
24808    ) -> Self
24809    where
24810        T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
24811    {
24812        self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
24813        self
24814    }
24815
24816    /// Sets the value of [name][crate::model::Operation::name].
24817    ///
24818    /// # Example
24819    /// ```ignore,no_run
24820    /// # use google_cloud_sql_v1::model::Operation;
24821    /// let x = Operation::new().set_name("example");
24822    /// ```
24823    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24824        self.name = v.into();
24825        self
24826    }
24827
24828    /// Sets the value of [target_id][crate::model::Operation::target_id].
24829    ///
24830    /// # Example
24831    /// ```ignore,no_run
24832    /// # use google_cloud_sql_v1::model::Operation;
24833    /// let x = Operation::new().set_target_id("example");
24834    /// ```
24835    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24836        self.target_id = v.into();
24837        self
24838    }
24839
24840    /// Sets the value of [self_link][crate::model::Operation::self_link].
24841    ///
24842    /// # Example
24843    /// ```ignore,no_run
24844    /// # use google_cloud_sql_v1::model::Operation;
24845    /// let x = Operation::new().set_self_link("example");
24846    /// ```
24847    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24848        self.self_link = v.into();
24849        self
24850    }
24851
24852    /// Sets the value of [target_project][crate::model::Operation::target_project].
24853    ///
24854    /// # Example
24855    /// ```ignore,no_run
24856    /// # use google_cloud_sql_v1::model::Operation;
24857    /// let x = Operation::new().set_target_project("example");
24858    /// ```
24859    pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24860        self.target_project = v.into();
24861        self
24862    }
24863
24864    /// Sets the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
24865    ///
24866    /// # Example
24867    /// ```ignore,no_run
24868    /// # use google_cloud_sql_v1::model::Operation;
24869    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
24870    /// let x = Operation::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
24871    /// ```
24872    pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
24873    where
24874        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
24875    {
24876        self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
24877        self
24878    }
24879
24880    /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
24881    ///
24882    /// # Example
24883    /// ```ignore,no_run
24884    /// # use google_cloud_sql_v1::model::Operation;
24885    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
24886    /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
24887    /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
24888    /// ```
24889    pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
24890    where
24891        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
24892    {
24893        self.acquire_ssrs_lease_context = v.map(|x| x.into());
24894        self
24895    }
24896
24897    /// Sets the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
24898    ///
24899    /// # Example
24900    /// ```ignore,no_run
24901    /// # use google_cloud_sql_v1::model::Operation;
24902    /// use google_cloud_sql_v1::model::SqlSubOperationType;
24903    /// let x = Operation::new().set_sub_operation_type(SqlSubOperationType::default()/* use setters */);
24904    /// ```
24905    pub fn set_sub_operation_type<T>(mut self, v: T) -> Self
24906    where
24907        T: std::convert::Into<crate::model::SqlSubOperationType>,
24908    {
24909        self.sub_operation_type = std::option::Option::Some(v.into());
24910        self
24911    }
24912
24913    /// Sets or clears the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
24914    ///
24915    /// # Example
24916    /// ```ignore,no_run
24917    /// # use google_cloud_sql_v1::model::Operation;
24918    /// use google_cloud_sql_v1::model::SqlSubOperationType;
24919    /// let x = Operation::new().set_or_clear_sub_operation_type(Some(SqlSubOperationType::default()/* use setters */));
24920    /// let x = Operation::new().set_or_clear_sub_operation_type(None::<SqlSubOperationType>);
24921    /// ```
24922    pub fn set_or_clear_sub_operation_type<T>(mut self, v: std::option::Option<T>) -> Self
24923    where
24924        T: std::convert::Into<crate::model::SqlSubOperationType>,
24925    {
24926        self.sub_operation_type = v.map(|x| x.into());
24927        self
24928    }
24929}
24930
24931impl wkt::message::Message for Operation {
24932    fn typename() -> &'static str {
24933        "type.googleapis.com/google.cloud.sql.v1.Operation"
24934    }
24935}
24936
24937/// Defines additional types related to [Operation].
24938pub mod operation {
24939    #[allow(unused_imports)]
24940    use super::*;
24941
24942    /// The type of Cloud SQL operation.
24943    ///
24944    /// # Working with unknown values
24945    ///
24946    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24947    /// additional enum variants at any time. Adding new variants is not considered
24948    /// a breaking change. Applications should write their code in anticipation of:
24949    ///
24950    /// - New values appearing in future releases of the client library, **and**
24951    /// - New values received dynamically, without application changes.
24952    ///
24953    /// Please consult the [Working with enums] section in the user guide for some
24954    /// guidelines.
24955    ///
24956    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24957    #[derive(Clone, Debug, PartialEq)]
24958    #[non_exhaustive]
24959    pub enum SqlOperationType {
24960        /// Unknown operation type.
24961        Unspecified,
24962        /// Imports data into a Cloud SQL instance.
24963        Import,
24964        /// Exports data from a Cloud SQL instance to a Cloud Storage
24965        /// bucket.
24966        Export,
24967        /// Creates a new Cloud SQL instance.
24968        Create,
24969        /// Updates the settings of a Cloud SQL instance.
24970        Update,
24971        /// Deletes a Cloud SQL instance.
24972        Delete,
24973        /// Restarts the Cloud SQL instance.
24974        Restart,
24975        #[allow(missing_docs)]
24976        #[deprecated]
24977        Backup,
24978        #[allow(missing_docs)]
24979        #[deprecated]
24980        Snapshot,
24981        /// Performs instance backup.
24982        BackupVolume,
24983        /// Deletes an instance backup.
24984        DeleteVolume,
24985        /// Restores an instance backup.
24986        RestoreVolume,
24987        /// Injects a privileged user in mysql for MOB instances.
24988        InjectUser,
24989        /// Clones a Cloud SQL instance.
24990        Clone,
24991        /// Stops replication on a Cloud SQL read replica instance.
24992        StopReplica,
24993        /// Starts replication on a Cloud SQL read replica instance.
24994        StartReplica,
24995        /// Promotes a Cloud SQL replica instance.
24996        PromoteReplica,
24997        /// Creates a Cloud SQL replica instance.
24998        CreateReplica,
24999        /// Creates a new user in a Cloud SQL instance.
25000        CreateUser,
25001        /// Deletes a user from a Cloud SQL instance.
25002        DeleteUser,
25003        /// Updates an existing user in a Cloud SQL instance. If a user with the
25004        /// specified username doesn't exist, a new user is created.
25005        UpdateUser,
25006        /// Creates a database in the Cloud SQL instance.
25007        CreateDatabase,
25008        /// Deletes a database in the Cloud SQL instance.
25009        DeleteDatabase,
25010        /// Updates a database in the Cloud SQL instance.
25011        UpdateDatabase,
25012        /// Performs failover of an HA-enabled Cloud SQL
25013        /// failover replica.
25014        Failover,
25015        /// Deletes the backup taken by a backup run.
25016        DeleteBackup,
25017        #[allow(missing_docs)]
25018        RecreateReplica,
25019        /// Truncates a general or slow log table in MySQL.
25020        TruncateLog,
25021        /// Demotes the stand-alone instance to be a Cloud SQL
25022        /// read replica for an external database server.
25023        DemoteMaster,
25024        /// Indicates that the instance is currently in maintenance. Maintenance
25025        /// typically causes the instance to be unavailable for 1-3 minutes.
25026        Maintenance,
25027        /// This field is deprecated, and will be removed in future version of API.
25028        #[deprecated]
25029        EnablePrivateIp,
25030        #[allow(missing_docs)]
25031        #[deprecated]
25032        DeferMaintenance,
25033        /// Creates clone instance.
25034        #[deprecated]
25035        CreateClone,
25036        /// Reschedule maintenance to another time.
25037        RescheduleMaintenance,
25038        /// Starts external sync of a Cloud SQL EM replica to an external primary
25039        /// instance.
25040        StartExternalSync,
25041        /// Recovers logs from an instance's old data disk.
25042        LogCleanup,
25043        /// Performs auto-restart of an HA-enabled Cloud SQL database for auto
25044        /// recovery.
25045        AutoRestart,
25046        /// Re-encrypts CMEK instances with latest key version.
25047        Reencrypt,
25048        /// Switches the roles of the primary and replica pair. The target instance
25049        /// should be the replica.
25050        Switchover,
25051        /// Update a backup.
25052        UpdateBackup,
25053        /// Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
25054        AcquireSsrsLease,
25055        /// Release a lease for the setup of SQL Server Reporting Services (SSRS).
25056        ReleaseSsrsLease,
25057        /// Reconfigures old primary after a promote replica operation. Effect of a
25058        /// promote operation to the old primary is executed in this operation,
25059        /// asynchronously from the promote replica operation executed to the
25060        /// replica.
25061        ReconfigureOldPrimary,
25062        /// Indicates that the instance, its read replicas, and its cascading
25063        /// replicas are in maintenance. Maintenance typically gets initiated on
25064        /// groups of replicas first, followed by the primary instance. For each
25065        /// instance, maintenance typically causes the instance to be unavailable for
25066        /// 1-3 minutes.
25067        #[deprecated]
25068        ClusterMaintenance,
25069        /// Indicates that the instance (and any of its replicas) are currently in
25070        /// maintenance. This is initiated as a self-service request by using SSM.
25071        /// Maintenance typically causes the instance to be unavailable for 1-3
25072        /// minutes.
25073        #[deprecated]
25074        SelfServiceMaintenance,
25075        /// Switches a primary instance to a replica. This operation runs as part of
25076        /// a switchover operation to the original primary instance.
25077        SwitchoverToReplica,
25078        /// Updates the major version of a Cloud SQL instance.
25079        MajorVersionUpgrade,
25080        /// Deprecated: ADVANCED_BACKUP is deprecated. Use ENHANCED_BACKUP instead.
25081        #[deprecated]
25082        AdvancedBackup,
25083        /// Changes the BackupTier of a Cloud SQL instance.
25084        ManageBackup,
25085        /// Creates a backup for an Enhanced BackupTier Cloud SQL instance.
25086        EnhancedBackup,
25087        /// Repairs entire read pool or specified read pool nodes in the read pool.
25088        RepairReadPool,
25089        /// Creates a Cloud SQL read pool instance.
25090        CreateReadPool,
25091        /// Pre-checks the major version upgrade operation.
25092        PreCheckMajorVersionUpgrade,
25093        /// If set, the enum was initialized with an unknown value.
25094        ///
25095        /// Applications can examine the value using [SqlOperationType::value] or
25096        /// [SqlOperationType::name].
25097        UnknownValue(sql_operation_type::UnknownValue),
25098    }
25099
25100    #[doc(hidden)]
25101    pub mod sql_operation_type {
25102        #[allow(unused_imports)]
25103        use super::*;
25104        #[derive(Clone, Debug, PartialEq)]
25105        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25106    }
25107
25108    impl SqlOperationType {
25109        /// Gets the enum value.
25110        ///
25111        /// Returns `None` if the enum contains an unknown value deserialized from
25112        /// the string representation of enums.
25113        pub fn value(&self) -> std::option::Option<i32> {
25114            match self {
25115                Self::Unspecified => std::option::Option::Some(0),
25116                Self::Import => std::option::Option::Some(1),
25117                Self::Export => std::option::Option::Some(2),
25118                Self::Create => std::option::Option::Some(3),
25119                Self::Update => std::option::Option::Some(4),
25120                Self::Delete => std::option::Option::Some(5),
25121                Self::Restart => std::option::Option::Some(6),
25122                Self::Backup => std::option::Option::Some(7),
25123                Self::Snapshot => std::option::Option::Some(8),
25124                Self::BackupVolume => std::option::Option::Some(9),
25125                Self::DeleteVolume => std::option::Option::Some(10),
25126                Self::RestoreVolume => std::option::Option::Some(11),
25127                Self::InjectUser => std::option::Option::Some(12),
25128                Self::Clone => std::option::Option::Some(14),
25129                Self::StopReplica => std::option::Option::Some(15),
25130                Self::StartReplica => std::option::Option::Some(16),
25131                Self::PromoteReplica => std::option::Option::Some(17),
25132                Self::CreateReplica => std::option::Option::Some(18),
25133                Self::CreateUser => std::option::Option::Some(19),
25134                Self::DeleteUser => std::option::Option::Some(20),
25135                Self::UpdateUser => std::option::Option::Some(21),
25136                Self::CreateDatabase => std::option::Option::Some(22),
25137                Self::DeleteDatabase => std::option::Option::Some(23),
25138                Self::UpdateDatabase => std::option::Option::Some(24),
25139                Self::Failover => std::option::Option::Some(25),
25140                Self::DeleteBackup => std::option::Option::Some(26),
25141                Self::RecreateReplica => std::option::Option::Some(27),
25142                Self::TruncateLog => std::option::Option::Some(28),
25143                Self::DemoteMaster => std::option::Option::Some(29),
25144                Self::Maintenance => std::option::Option::Some(30),
25145                Self::EnablePrivateIp => std::option::Option::Some(31),
25146                Self::DeferMaintenance => std::option::Option::Some(32),
25147                Self::CreateClone => std::option::Option::Some(33),
25148                Self::RescheduleMaintenance => std::option::Option::Some(34),
25149                Self::StartExternalSync => std::option::Option::Some(35),
25150                Self::LogCleanup => std::option::Option::Some(36),
25151                Self::AutoRestart => std::option::Option::Some(37),
25152                Self::Reencrypt => std::option::Option::Some(38),
25153                Self::Switchover => std::option::Option::Some(39),
25154                Self::UpdateBackup => std::option::Option::Some(40),
25155                Self::AcquireSsrsLease => std::option::Option::Some(42),
25156                Self::ReleaseSsrsLease => std::option::Option::Some(43),
25157                Self::ReconfigureOldPrimary => std::option::Option::Some(44),
25158                Self::ClusterMaintenance => std::option::Option::Some(45),
25159                Self::SelfServiceMaintenance => std::option::Option::Some(46),
25160                Self::SwitchoverToReplica => std::option::Option::Some(47),
25161                Self::MajorVersionUpgrade => std::option::Option::Some(48),
25162                Self::AdvancedBackup => std::option::Option::Some(49),
25163                Self::ManageBackup => std::option::Option::Some(50),
25164                Self::EnhancedBackup => std::option::Option::Some(51),
25165                Self::RepairReadPool => std::option::Option::Some(52),
25166                Self::CreateReadPool => std::option::Option::Some(53),
25167                Self::PreCheckMajorVersionUpgrade => std::option::Option::Some(54),
25168                Self::UnknownValue(u) => u.0.value(),
25169            }
25170        }
25171
25172        /// Gets the enum value as a string.
25173        ///
25174        /// Returns `None` if the enum contains an unknown value deserialized from
25175        /// the integer representation of enums.
25176        pub fn name(&self) -> std::option::Option<&str> {
25177            match self {
25178                Self::Unspecified => std::option::Option::Some("SQL_OPERATION_TYPE_UNSPECIFIED"),
25179                Self::Import => std::option::Option::Some("IMPORT"),
25180                Self::Export => std::option::Option::Some("EXPORT"),
25181                Self::Create => std::option::Option::Some("CREATE"),
25182                Self::Update => std::option::Option::Some("UPDATE"),
25183                Self::Delete => std::option::Option::Some("DELETE"),
25184                Self::Restart => std::option::Option::Some("RESTART"),
25185                Self::Backup => std::option::Option::Some("BACKUP"),
25186                Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
25187                Self::BackupVolume => std::option::Option::Some("BACKUP_VOLUME"),
25188                Self::DeleteVolume => std::option::Option::Some("DELETE_VOLUME"),
25189                Self::RestoreVolume => std::option::Option::Some("RESTORE_VOLUME"),
25190                Self::InjectUser => std::option::Option::Some("INJECT_USER"),
25191                Self::Clone => std::option::Option::Some("CLONE"),
25192                Self::StopReplica => std::option::Option::Some("STOP_REPLICA"),
25193                Self::StartReplica => std::option::Option::Some("START_REPLICA"),
25194                Self::PromoteReplica => std::option::Option::Some("PROMOTE_REPLICA"),
25195                Self::CreateReplica => std::option::Option::Some("CREATE_REPLICA"),
25196                Self::CreateUser => std::option::Option::Some("CREATE_USER"),
25197                Self::DeleteUser => std::option::Option::Some("DELETE_USER"),
25198                Self::UpdateUser => std::option::Option::Some("UPDATE_USER"),
25199                Self::CreateDatabase => std::option::Option::Some("CREATE_DATABASE"),
25200                Self::DeleteDatabase => std::option::Option::Some("DELETE_DATABASE"),
25201                Self::UpdateDatabase => std::option::Option::Some("UPDATE_DATABASE"),
25202                Self::Failover => std::option::Option::Some("FAILOVER"),
25203                Self::DeleteBackup => std::option::Option::Some("DELETE_BACKUP"),
25204                Self::RecreateReplica => std::option::Option::Some("RECREATE_REPLICA"),
25205                Self::TruncateLog => std::option::Option::Some("TRUNCATE_LOG"),
25206                Self::DemoteMaster => std::option::Option::Some("DEMOTE_MASTER"),
25207                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
25208                Self::EnablePrivateIp => std::option::Option::Some("ENABLE_PRIVATE_IP"),
25209                Self::DeferMaintenance => std::option::Option::Some("DEFER_MAINTENANCE"),
25210                Self::CreateClone => std::option::Option::Some("CREATE_CLONE"),
25211                Self::RescheduleMaintenance => std::option::Option::Some("RESCHEDULE_MAINTENANCE"),
25212                Self::StartExternalSync => std::option::Option::Some("START_EXTERNAL_SYNC"),
25213                Self::LogCleanup => std::option::Option::Some("LOG_CLEANUP"),
25214                Self::AutoRestart => std::option::Option::Some("AUTO_RESTART"),
25215                Self::Reencrypt => std::option::Option::Some("REENCRYPT"),
25216                Self::Switchover => std::option::Option::Some("SWITCHOVER"),
25217                Self::UpdateBackup => std::option::Option::Some("UPDATE_BACKUP"),
25218                Self::AcquireSsrsLease => std::option::Option::Some("ACQUIRE_SSRS_LEASE"),
25219                Self::ReleaseSsrsLease => std::option::Option::Some("RELEASE_SSRS_LEASE"),
25220                Self::ReconfigureOldPrimary => std::option::Option::Some("RECONFIGURE_OLD_PRIMARY"),
25221                Self::ClusterMaintenance => std::option::Option::Some("CLUSTER_MAINTENANCE"),
25222                Self::SelfServiceMaintenance => {
25223                    std::option::Option::Some("SELF_SERVICE_MAINTENANCE")
25224                }
25225                Self::SwitchoverToReplica => std::option::Option::Some("SWITCHOVER_TO_REPLICA"),
25226                Self::MajorVersionUpgrade => std::option::Option::Some("MAJOR_VERSION_UPGRADE"),
25227                Self::AdvancedBackup => std::option::Option::Some("ADVANCED_BACKUP"),
25228                Self::ManageBackup => std::option::Option::Some("MANAGE_BACKUP"),
25229                Self::EnhancedBackup => std::option::Option::Some("ENHANCED_BACKUP"),
25230                Self::RepairReadPool => std::option::Option::Some("REPAIR_READ_POOL"),
25231                Self::CreateReadPool => std::option::Option::Some("CREATE_READ_POOL"),
25232                Self::PreCheckMajorVersionUpgrade => {
25233                    std::option::Option::Some("PRE_CHECK_MAJOR_VERSION_UPGRADE")
25234                }
25235                Self::UnknownValue(u) => u.0.name(),
25236            }
25237        }
25238    }
25239
25240    impl std::default::Default for SqlOperationType {
25241        fn default() -> Self {
25242            use std::convert::From;
25243            Self::from(0)
25244        }
25245    }
25246
25247    impl std::fmt::Display for SqlOperationType {
25248        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25249            wkt::internal::display_enum(f, self.name(), self.value())
25250        }
25251    }
25252
25253    impl std::convert::From<i32> for SqlOperationType {
25254        fn from(value: i32) -> Self {
25255            match value {
25256                0 => Self::Unspecified,
25257                1 => Self::Import,
25258                2 => Self::Export,
25259                3 => Self::Create,
25260                4 => Self::Update,
25261                5 => Self::Delete,
25262                6 => Self::Restart,
25263                7 => Self::Backup,
25264                8 => Self::Snapshot,
25265                9 => Self::BackupVolume,
25266                10 => Self::DeleteVolume,
25267                11 => Self::RestoreVolume,
25268                12 => Self::InjectUser,
25269                14 => Self::Clone,
25270                15 => Self::StopReplica,
25271                16 => Self::StartReplica,
25272                17 => Self::PromoteReplica,
25273                18 => Self::CreateReplica,
25274                19 => Self::CreateUser,
25275                20 => Self::DeleteUser,
25276                21 => Self::UpdateUser,
25277                22 => Self::CreateDatabase,
25278                23 => Self::DeleteDatabase,
25279                24 => Self::UpdateDatabase,
25280                25 => Self::Failover,
25281                26 => Self::DeleteBackup,
25282                27 => Self::RecreateReplica,
25283                28 => Self::TruncateLog,
25284                29 => Self::DemoteMaster,
25285                30 => Self::Maintenance,
25286                31 => Self::EnablePrivateIp,
25287                32 => Self::DeferMaintenance,
25288                33 => Self::CreateClone,
25289                34 => Self::RescheduleMaintenance,
25290                35 => Self::StartExternalSync,
25291                36 => Self::LogCleanup,
25292                37 => Self::AutoRestart,
25293                38 => Self::Reencrypt,
25294                39 => Self::Switchover,
25295                40 => Self::UpdateBackup,
25296                42 => Self::AcquireSsrsLease,
25297                43 => Self::ReleaseSsrsLease,
25298                44 => Self::ReconfigureOldPrimary,
25299                45 => Self::ClusterMaintenance,
25300                46 => Self::SelfServiceMaintenance,
25301                47 => Self::SwitchoverToReplica,
25302                48 => Self::MajorVersionUpgrade,
25303                49 => Self::AdvancedBackup,
25304                50 => Self::ManageBackup,
25305                51 => Self::EnhancedBackup,
25306                52 => Self::RepairReadPool,
25307                53 => Self::CreateReadPool,
25308                54 => Self::PreCheckMajorVersionUpgrade,
25309                _ => Self::UnknownValue(sql_operation_type::UnknownValue(
25310                    wkt::internal::UnknownEnumValue::Integer(value),
25311                )),
25312            }
25313        }
25314    }
25315
25316    impl std::convert::From<&str> for SqlOperationType {
25317        fn from(value: &str) -> Self {
25318            use std::string::ToString;
25319            match value {
25320                "SQL_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
25321                "IMPORT" => Self::Import,
25322                "EXPORT" => Self::Export,
25323                "CREATE" => Self::Create,
25324                "UPDATE" => Self::Update,
25325                "DELETE" => Self::Delete,
25326                "RESTART" => Self::Restart,
25327                "BACKUP" => Self::Backup,
25328                "SNAPSHOT" => Self::Snapshot,
25329                "BACKUP_VOLUME" => Self::BackupVolume,
25330                "DELETE_VOLUME" => Self::DeleteVolume,
25331                "RESTORE_VOLUME" => Self::RestoreVolume,
25332                "INJECT_USER" => Self::InjectUser,
25333                "CLONE" => Self::Clone,
25334                "STOP_REPLICA" => Self::StopReplica,
25335                "START_REPLICA" => Self::StartReplica,
25336                "PROMOTE_REPLICA" => Self::PromoteReplica,
25337                "CREATE_REPLICA" => Self::CreateReplica,
25338                "CREATE_USER" => Self::CreateUser,
25339                "DELETE_USER" => Self::DeleteUser,
25340                "UPDATE_USER" => Self::UpdateUser,
25341                "CREATE_DATABASE" => Self::CreateDatabase,
25342                "DELETE_DATABASE" => Self::DeleteDatabase,
25343                "UPDATE_DATABASE" => Self::UpdateDatabase,
25344                "FAILOVER" => Self::Failover,
25345                "DELETE_BACKUP" => Self::DeleteBackup,
25346                "RECREATE_REPLICA" => Self::RecreateReplica,
25347                "TRUNCATE_LOG" => Self::TruncateLog,
25348                "DEMOTE_MASTER" => Self::DemoteMaster,
25349                "MAINTENANCE" => Self::Maintenance,
25350                "ENABLE_PRIVATE_IP" => Self::EnablePrivateIp,
25351                "DEFER_MAINTENANCE" => Self::DeferMaintenance,
25352                "CREATE_CLONE" => Self::CreateClone,
25353                "RESCHEDULE_MAINTENANCE" => Self::RescheduleMaintenance,
25354                "START_EXTERNAL_SYNC" => Self::StartExternalSync,
25355                "LOG_CLEANUP" => Self::LogCleanup,
25356                "AUTO_RESTART" => Self::AutoRestart,
25357                "REENCRYPT" => Self::Reencrypt,
25358                "SWITCHOVER" => Self::Switchover,
25359                "UPDATE_BACKUP" => Self::UpdateBackup,
25360                "ACQUIRE_SSRS_LEASE" => Self::AcquireSsrsLease,
25361                "RELEASE_SSRS_LEASE" => Self::ReleaseSsrsLease,
25362                "RECONFIGURE_OLD_PRIMARY" => Self::ReconfigureOldPrimary,
25363                "CLUSTER_MAINTENANCE" => Self::ClusterMaintenance,
25364                "SELF_SERVICE_MAINTENANCE" => Self::SelfServiceMaintenance,
25365                "SWITCHOVER_TO_REPLICA" => Self::SwitchoverToReplica,
25366                "MAJOR_VERSION_UPGRADE" => Self::MajorVersionUpgrade,
25367                "ADVANCED_BACKUP" => Self::AdvancedBackup,
25368                "MANAGE_BACKUP" => Self::ManageBackup,
25369                "ENHANCED_BACKUP" => Self::EnhancedBackup,
25370                "REPAIR_READ_POOL" => Self::RepairReadPool,
25371                "CREATE_READ_POOL" => Self::CreateReadPool,
25372                "PRE_CHECK_MAJOR_VERSION_UPGRADE" => Self::PreCheckMajorVersionUpgrade,
25373                _ => Self::UnknownValue(sql_operation_type::UnknownValue(
25374                    wkt::internal::UnknownEnumValue::String(value.to_string()),
25375                )),
25376            }
25377        }
25378    }
25379
25380    impl serde::ser::Serialize for SqlOperationType {
25381        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25382        where
25383            S: serde::Serializer,
25384        {
25385            match self {
25386                Self::Unspecified => serializer.serialize_i32(0),
25387                Self::Import => serializer.serialize_i32(1),
25388                Self::Export => serializer.serialize_i32(2),
25389                Self::Create => serializer.serialize_i32(3),
25390                Self::Update => serializer.serialize_i32(4),
25391                Self::Delete => serializer.serialize_i32(5),
25392                Self::Restart => serializer.serialize_i32(6),
25393                Self::Backup => serializer.serialize_i32(7),
25394                Self::Snapshot => serializer.serialize_i32(8),
25395                Self::BackupVolume => serializer.serialize_i32(9),
25396                Self::DeleteVolume => serializer.serialize_i32(10),
25397                Self::RestoreVolume => serializer.serialize_i32(11),
25398                Self::InjectUser => serializer.serialize_i32(12),
25399                Self::Clone => serializer.serialize_i32(14),
25400                Self::StopReplica => serializer.serialize_i32(15),
25401                Self::StartReplica => serializer.serialize_i32(16),
25402                Self::PromoteReplica => serializer.serialize_i32(17),
25403                Self::CreateReplica => serializer.serialize_i32(18),
25404                Self::CreateUser => serializer.serialize_i32(19),
25405                Self::DeleteUser => serializer.serialize_i32(20),
25406                Self::UpdateUser => serializer.serialize_i32(21),
25407                Self::CreateDatabase => serializer.serialize_i32(22),
25408                Self::DeleteDatabase => serializer.serialize_i32(23),
25409                Self::UpdateDatabase => serializer.serialize_i32(24),
25410                Self::Failover => serializer.serialize_i32(25),
25411                Self::DeleteBackup => serializer.serialize_i32(26),
25412                Self::RecreateReplica => serializer.serialize_i32(27),
25413                Self::TruncateLog => serializer.serialize_i32(28),
25414                Self::DemoteMaster => serializer.serialize_i32(29),
25415                Self::Maintenance => serializer.serialize_i32(30),
25416                Self::EnablePrivateIp => serializer.serialize_i32(31),
25417                Self::DeferMaintenance => serializer.serialize_i32(32),
25418                Self::CreateClone => serializer.serialize_i32(33),
25419                Self::RescheduleMaintenance => serializer.serialize_i32(34),
25420                Self::StartExternalSync => serializer.serialize_i32(35),
25421                Self::LogCleanup => serializer.serialize_i32(36),
25422                Self::AutoRestart => serializer.serialize_i32(37),
25423                Self::Reencrypt => serializer.serialize_i32(38),
25424                Self::Switchover => serializer.serialize_i32(39),
25425                Self::UpdateBackup => serializer.serialize_i32(40),
25426                Self::AcquireSsrsLease => serializer.serialize_i32(42),
25427                Self::ReleaseSsrsLease => serializer.serialize_i32(43),
25428                Self::ReconfigureOldPrimary => serializer.serialize_i32(44),
25429                Self::ClusterMaintenance => serializer.serialize_i32(45),
25430                Self::SelfServiceMaintenance => serializer.serialize_i32(46),
25431                Self::SwitchoverToReplica => serializer.serialize_i32(47),
25432                Self::MajorVersionUpgrade => serializer.serialize_i32(48),
25433                Self::AdvancedBackup => serializer.serialize_i32(49),
25434                Self::ManageBackup => serializer.serialize_i32(50),
25435                Self::EnhancedBackup => serializer.serialize_i32(51),
25436                Self::RepairReadPool => serializer.serialize_i32(52),
25437                Self::CreateReadPool => serializer.serialize_i32(53),
25438                Self::PreCheckMajorVersionUpgrade => serializer.serialize_i32(54),
25439                Self::UnknownValue(u) => u.0.serialize(serializer),
25440            }
25441        }
25442    }
25443
25444    impl<'de> serde::de::Deserialize<'de> for SqlOperationType {
25445        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25446        where
25447            D: serde::Deserializer<'de>,
25448        {
25449            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationType>::new(
25450                ".google.cloud.sql.v1.Operation.SqlOperationType",
25451            ))
25452        }
25453    }
25454
25455    /// The status of an operation.
25456    ///
25457    /// # Working with unknown values
25458    ///
25459    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25460    /// additional enum variants at any time. Adding new variants is not considered
25461    /// a breaking change. Applications should write their code in anticipation of:
25462    ///
25463    /// - New values appearing in future releases of the client library, **and**
25464    /// - New values received dynamically, without application changes.
25465    ///
25466    /// Please consult the [Working with enums] section in the user guide for some
25467    /// guidelines.
25468    ///
25469    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
25470    #[derive(Clone, Debug, PartialEq)]
25471    #[non_exhaustive]
25472    pub enum SqlOperationStatus {
25473        /// The state of the operation is unknown.
25474        Unspecified,
25475        /// The operation has been queued, but has not started yet.
25476        Pending,
25477        /// The operation is running.
25478        Running,
25479        /// The operation completed.
25480        Done,
25481        /// If set, the enum was initialized with an unknown value.
25482        ///
25483        /// Applications can examine the value using [SqlOperationStatus::value] or
25484        /// [SqlOperationStatus::name].
25485        UnknownValue(sql_operation_status::UnknownValue),
25486    }
25487
25488    #[doc(hidden)]
25489    pub mod sql_operation_status {
25490        #[allow(unused_imports)]
25491        use super::*;
25492        #[derive(Clone, Debug, PartialEq)]
25493        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25494    }
25495
25496    impl SqlOperationStatus {
25497        /// Gets the enum value.
25498        ///
25499        /// Returns `None` if the enum contains an unknown value deserialized from
25500        /// the string representation of enums.
25501        pub fn value(&self) -> std::option::Option<i32> {
25502            match self {
25503                Self::Unspecified => std::option::Option::Some(0),
25504                Self::Pending => std::option::Option::Some(1),
25505                Self::Running => std::option::Option::Some(2),
25506                Self::Done => std::option::Option::Some(3),
25507                Self::UnknownValue(u) => u.0.value(),
25508            }
25509        }
25510
25511        /// Gets the enum value as a string.
25512        ///
25513        /// Returns `None` if the enum contains an unknown value deserialized from
25514        /// the integer representation of enums.
25515        pub fn name(&self) -> std::option::Option<&str> {
25516            match self {
25517                Self::Unspecified => std::option::Option::Some("SQL_OPERATION_STATUS_UNSPECIFIED"),
25518                Self::Pending => std::option::Option::Some("PENDING"),
25519                Self::Running => std::option::Option::Some("RUNNING"),
25520                Self::Done => std::option::Option::Some("DONE"),
25521                Self::UnknownValue(u) => u.0.name(),
25522            }
25523        }
25524    }
25525
25526    impl std::default::Default for SqlOperationStatus {
25527        fn default() -> Self {
25528            use std::convert::From;
25529            Self::from(0)
25530        }
25531    }
25532
25533    impl std::fmt::Display for SqlOperationStatus {
25534        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25535            wkt::internal::display_enum(f, self.name(), self.value())
25536        }
25537    }
25538
25539    impl std::convert::From<i32> for SqlOperationStatus {
25540        fn from(value: i32) -> Self {
25541            match value {
25542                0 => Self::Unspecified,
25543                1 => Self::Pending,
25544                2 => Self::Running,
25545                3 => Self::Done,
25546                _ => Self::UnknownValue(sql_operation_status::UnknownValue(
25547                    wkt::internal::UnknownEnumValue::Integer(value),
25548                )),
25549            }
25550        }
25551    }
25552
25553    impl std::convert::From<&str> for SqlOperationStatus {
25554        fn from(value: &str) -> Self {
25555            use std::string::ToString;
25556            match value {
25557                "SQL_OPERATION_STATUS_UNSPECIFIED" => Self::Unspecified,
25558                "PENDING" => Self::Pending,
25559                "RUNNING" => Self::Running,
25560                "DONE" => Self::Done,
25561                _ => Self::UnknownValue(sql_operation_status::UnknownValue(
25562                    wkt::internal::UnknownEnumValue::String(value.to_string()),
25563                )),
25564            }
25565        }
25566    }
25567
25568    impl serde::ser::Serialize for SqlOperationStatus {
25569        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25570        where
25571            S: serde::Serializer,
25572        {
25573            match self {
25574                Self::Unspecified => serializer.serialize_i32(0),
25575                Self::Pending => serializer.serialize_i32(1),
25576                Self::Running => serializer.serialize_i32(2),
25577                Self::Done => serializer.serialize_i32(3),
25578                Self::UnknownValue(u) => u.0.serialize(serializer),
25579            }
25580        }
25581    }
25582
25583    impl<'de> serde::de::Deserialize<'de> for SqlOperationStatus {
25584        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25585        where
25586            D: serde::Deserializer<'de>,
25587        {
25588            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationStatus>::new(
25589                ".google.cloud.sql.v1.Operation.SqlOperationStatus",
25590            ))
25591        }
25592    }
25593}
25594
25595/// Database instance operation error.
25596#[derive(Clone, Default, PartialEq)]
25597#[non_exhaustive]
25598pub struct OperationError {
25599    /// This is always `sql#operationError`.
25600    pub kind: std::string::String,
25601
25602    /// Identifies the specific error that occurred.
25603    pub code: std::string::String,
25604
25605    /// Additional information about the error encountered.
25606    pub message: std::string::String,
25607
25608    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25609}
25610
25611impl OperationError {
25612    /// Creates a new default instance.
25613    pub fn new() -> Self {
25614        std::default::Default::default()
25615    }
25616
25617    /// Sets the value of [kind][crate::model::OperationError::kind].
25618    ///
25619    /// # Example
25620    /// ```ignore,no_run
25621    /// # use google_cloud_sql_v1::model::OperationError;
25622    /// let x = OperationError::new().set_kind("example");
25623    /// ```
25624    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25625        self.kind = v.into();
25626        self
25627    }
25628
25629    /// Sets the value of [code][crate::model::OperationError::code].
25630    ///
25631    /// # Example
25632    /// ```ignore,no_run
25633    /// # use google_cloud_sql_v1::model::OperationError;
25634    /// let x = OperationError::new().set_code("example");
25635    /// ```
25636    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25637        self.code = v.into();
25638        self
25639    }
25640
25641    /// Sets the value of [message][crate::model::OperationError::message].
25642    ///
25643    /// # Example
25644    /// ```ignore,no_run
25645    /// # use google_cloud_sql_v1::model::OperationError;
25646    /// let x = OperationError::new().set_message("example");
25647    /// ```
25648    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25649        self.message = v.into();
25650        self
25651    }
25652}
25653
25654impl wkt::message::Message for OperationError {
25655    fn typename() -> &'static str {
25656        "type.googleapis.com/google.cloud.sql.v1.OperationError"
25657    }
25658}
25659
25660/// Database instance operation errors list wrapper.
25661#[derive(Clone, Default, PartialEq)]
25662#[non_exhaustive]
25663pub struct OperationErrors {
25664    /// This is always `sql#operationErrors`.
25665    pub kind: std::string::String,
25666
25667    /// The list of errors encountered while processing this operation.
25668    pub errors: std::vec::Vec<crate::model::OperationError>,
25669
25670    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25671}
25672
25673impl OperationErrors {
25674    /// Creates a new default instance.
25675    pub fn new() -> Self {
25676        std::default::Default::default()
25677    }
25678
25679    /// Sets the value of [kind][crate::model::OperationErrors::kind].
25680    ///
25681    /// # Example
25682    /// ```ignore,no_run
25683    /// # use google_cloud_sql_v1::model::OperationErrors;
25684    /// let x = OperationErrors::new().set_kind("example");
25685    /// ```
25686    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25687        self.kind = v.into();
25688        self
25689    }
25690
25691    /// Sets the value of [errors][crate::model::OperationErrors::errors].
25692    ///
25693    /// # Example
25694    /// ```ignore,no_run
25695    /// # use google_cloud_sql_v1::model::OperationErrors;
25696    /// use google_cloud_sql_v1::model::OperationError;
25697    /// let x = OperationErrors::new()
25698    ///     .set_errors([
25699    ///         OperationError::default()/* use setters */,
25700    ///         OperationError::default()/* use (different) setters */,
25701    ///     ]);
25702    /// ```
25703    pub fn set_errors<T, V>(mut self, v: T) -> Self
25704    where
25705        T: std::iter::IntoIterator<Item = V>,
25706        V: std::convert::Into<crate::model::OperationError>,
25707    {
25708        use std::iter::Iterator;
25709        self.errors = v.into_iter().map(|i| i.into()).collect();
25710        self
25711    }
25712}
25713
25714impl wkt::message::Message for OperationErrors {
25715    fn typename() -> &'static str {
25716        "type.googleapis.com/google.cloud.sql.v1.OperationErrors"
25717    }
25718}
25719
25720/// Database instance local user password validation policy.
25721/// This message defines the password policy for local database users.
25722/// When enabled, it enforces constraints on password complexity, length,
25723/// and reuse. Keep this policy enabled to help prevent unauthorized access.
25724#[derive(Clone, Default, PartialEq)]
25725#[non_exhaustive]
25726pub struct PasswordValidationPolicy {
25727    /// Minimum number of characters allowed.
25728    pub min_length: std::option::Option<wkt::Int32Value>,
25729
25730    /// The complexity of the password.
25731    pub complexity: crate::model::password_validation_policy::Complexity,
25732
25733    /// Number of previous passwords that cannot be reused.
25734    pub reuse_interval: std::option::Option<wkt::Int32Value>,
25735
25736    /// Disallow username as a part of the password.
25737    pub disallow_username_substring: std::option::Option<wkt::BoolValue>,
25738
25739    /// Minimum interval after which the password can be changed. This flag is only
25740    /// supported for PostgreSQL.
25741    pub password_change_interval: std::option::Option<wkt::Duration>,
25742
25743    /// Whether to enable the password policy or not. When enabled, passwords must
25744    /// meet complexity requirements. Keep this policy enabled to help prevent
25745    /// unauthorized access. Disabling this policy allows weak passwords.
25746    pub enable_password_policy: std::option::Option<wkt::BoolValue>,
25747
25748    /// This field is deprecated and will be removed in a future version of the
25749    /// API.
25750    #[deprecated]
25751    pub disallow_compromised_credentials: std::option::Option<wkt::BoolValue>,
25752
25753    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25754}
25755
25756impl PasswordValidationPolicy {
25757    /// Creates a new default instance.
25758    pub fn new() -> Self {
25759        std::default::Default::default()
25760    }
25761
25762    /// Sets the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
25763    ///
25764    /// # Example
25765    /// ```ignore,no_run
25766    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25767    /// use wkt::Int32Value;
25768    /// let x = PasswordValidationPolicy::new().set_min_length(Int32Value::default()/* use setters */);
25769    /// ```
25770    pub fn set_min_length<T>(mut self, v: T) -> Self
25771    where
25772        T: std::convert::Into<wkt::Int32Value>,
25773    {
25774        self.min_length = std::option::Option::Some(v.into());
25775        self
25776    }
25777
25778    /// Sets or clears the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
25779    ///
25780    /// # Example
25781    /// ```ignore,no_run
25782    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25783    /// use wkt::Int32Value;
25784    /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(Some(Int32Value::default()/* use setters */));
25785    /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(None::<Int32Value>);
25786    /// ```
25787    pub fn set_or_clear_min_length<T>(mut self, v: std::option::Option<T>) -> Self
25788    where
25789        T: std::convert::Into<wkt::Int32Value>,
25790    {
25791        self.min_length = v.map(|x| x.into());
25792        self
25793    }
25794
25795    /// Sets the value of [complexity][crate::model::PasswordValidationPolicy::complexity].
25796    ///
25797    /// # Example
25798    /// ```ignore,no_run
25799    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25800    /// use google_cloud_sql_v1::model::password_validation_policy::Complexity;
25801    /// let x0 = PasswordValidationPolicy::new().set_complexity(Complexity::Default);
25802    /// ```
25803    pub fn set_complexity<
25804        T: std::convert::Into<crate::model::password_validation_policy::Complexity>,
25805    >(
25806        mut self,
25807        v: T,
25808    ) -> Self {
25809        self.complexity = v.into();
25810        self
25811    }
25812
25813    /// Sets the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
25814    ///
25815    /// # Example
25816    /// ```ignore,no_run
25817    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25818    /// use wkt::Int32Value;
25819    /// let x = PasswordValidationPolicy::new().set_reuse_interval(Int32Value::default()/* use setters */);
25820    /// ```
25821    pub fn set_reuse_interval<T>(mut self, v: T) -> Self
25822    where
25823        T: std::convert::Into<wkt::Int32Value>,
25824    {
25825        self.reuse_interval = std::option::Option::Some(v.into());
25826        self
25827    }
25828
25829    /// Sets or clears the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
25830    ///
25831    /// # Example
25832    /// ```ignore,no_run
25833    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25834    /// use wkt::Int32Value;
25835    /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(Some(Int32Value::default()/* use setters */));
25836    /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(None::<Int32Value>);
25837    /// ```
25838    pub fn set_or_clear_reuse_interval<T>(mut self, v: std::option::Option<T>) -> Self
25839    where
25840        T: std::convert::Into<wkt::Int32Value>,
25841    {
25842        self.reuse_interval = v.map(|x| x.into());
25843        self
25844    }
25845
25846    /// Sets the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
25847    ///
25848    /// # Example
25849    /// ```ignore,no_run
25850    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25851    /// use wkt::BoolValue;
25852    /// let x = PasswordValidationPolicy::new().set_disallow_username_substring(BoolValue::default()/* use setters */);
25853    /// ```
25854    pub fn set_disallow_username_substring<T>(mut self, v: T) -> Self
25855    where
25856        T: std::convert::Into<wkt::BoolValue>,
25857    {
25858        self.disallow_username_substring = std::option::Option::Some(v.into());
25859        self
25860    }
25861
25862    /// Sets or clears the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
25863    ///
25864    /// # Example
25865    /// ```ignore,no_run
25866    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25867    /// use wkt::BoolValue;
25868    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(Some(BoolValue::default()/* use setters */));
25869    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(None::<BoolValue>);
25870    /// ```
25871    pub fn set_or_clear_disallow_username_substring<T>(mut self, v: std::option::Option<T>) -> Self
25872    where
25873        T: std::convert::Into<wkt::BoolValue>,
25874    {
25875        self.disallow_username_substring = v.map(|x| x.into());
25876        self
25877    }
25878
25879    /// Sets the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
25880    ///
25881    /// # Example
25882    /// ```ignore,no_run
25883    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25884    /// use wkt::Duration;
25885    /// let x = PasswordValidationPolicy::new().set_password_change_interval(Duration::default()/* use setters */);
25886    /// ```
25887    pub fn set_password_change_interval<T>(mut self, v: T) -> Self
25888    where
25889        T: std::convert::Into<wkt::Duration>,
25890    {
25891        self.password_change_interval = std::option::Option::Some(v.into());
25892        self
25893    }
25894
25895    /// Sets or clears the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
25896    ///
25897    /// # Example
25898    /// ```ignore,no_run
25899    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25900    /// use wkt::Duration;
25901    /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(Some(Duration::default()/* use setters */));
25902    /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(None::<Duration>);
25903    /// ```
25904    pub fn set_or_clear_password_change_interval<T>(mut self, v: std::option::Option<T>) -> Self
25905    where
25906        T: std::convert::Into<wkt::Duration>,
25907    {
25908        self.password_change_interval = v.map(|x| x.into());
25909        self
25910    }
25911
25912    /// Sets the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
25913    ///
25914    /// # Example
25915    /// ```ignore,no_run
25916    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25917    /// use wkt::BoolValue;
25918    /// let x = PasswordValidationPolicy::new().set_enable_password_policy(BoolValue::default()/* use setters */);
25919    /// ```
25920    pub fn set_enable_password_policy<T>(mut self, v: T) -> Self
25921    where
25922        T: std::convert::Into<wkt::BoolValue>,
25923    {
25924        self.enable_password_policy = std::option::Option::Some(v.into());
25925        self
25926    }
25927
25928    /// Sets or clears the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
25929    ///
25930    /// # Example
25931    /// ```ignore,no_run
25932    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25933    /// use wkt::BoolValue;
25934    /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(Some(BoolValue::default()/* use setters */));
25935    /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(None::<BoolValue>);
25936    /// ```
25937    pub fn set_or_clear_enable_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
25938    where
25939        T: std::convert::Into<wkt::BoolValue>,
25940    {
25941        self.enable_password_policy = v.map(|x| x.into());
25942        self
25943    }
25944
25945    /// Sets the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
25946    ///
25947    /// # Example
25948    /// ```ignore,no_run
25949    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25950    /// use wkt::BoolValue;
25951    /// let x = PasswordValidationPolicy::new().set_disallow_compromised_credentials(BoolValue::default()/* use setters */);
25952    /// ```
25953    #[deprecated]
25954    pub fn set_disallow_compromised_credentials<T>(mut self, v: T) -> Self
25955    where
25956        T: std::convert::Into<wkt::BoolValue>,
25957    {
25958        self.disallow_compromised_credentials = std::option::Option::Some(v.into());
25959        self
25960    }
25961
25962    /// Sets or clears the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
25963    ///
25964    /// # Example
25965    /// ```ignore,no_run
25966    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25967    /// use wkt::BoolValue;
25968    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(Some(BoolValue::default()/* use setters */));
25969    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(None::<BoolValue>);
25970    /// ```
25971    #[deprecated]
25972    pub fn set_or_clear_disallow_compromised_credentials<T>(
25973        mut self,
25974        v: std::option::Option<T>,
25975    ) -> Self
25976    where
25977        T: std::convert::Into<wkt::BoolValue>,
25978    {
25979        self.disallow_compromised_credentials = v.map(|x| x.into());
25980        self
25981    }
25982}
25983
25984impl wkt::message::Message for PasswordValidationPolicy {
25985    fn typename() -> &'static str {
25986        "type.googleapis.com/google.cloud.sql.v1.PasswordValidationPolicy"
25987    }
25988}
25989
25990/// Defines additional types related to [PasswordValidationPolicy].
25991pub mod password_validation_policy {
25992    #[allow(unused_imports)]
25993    use super::*;
25994
25995    /// The complexity choices of the password.
25996    ///
25997    /// # Working with unknown values
25998    ///
25999    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26000    /// additional enum variants at any time. Adding new variants is not considered
26001    /// a breaking change. Applications should write their code in anticipation of:
26002    ///
26003    /// - New values appearing in future releases of the client library, **and**
26004    /// - New values received dynamically, without application changes.
26005    ///
26006    /// Please consult the [Working with enums] section in the user guide for some
26007    /// guidelines.
26008    ///
26009    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26010    #[derive(Clone, Debug, PartialEq)]
26011    #[non_exhaustive]
26012    pub enum Complexity {
26013        /// Complexity check is not specified.
26014        Unspecified,
26015        /// A combination of lowercase, uppercase, numeric, and non-alphanumeric
26016        /// characters.
26017        Default,
26018        /// If set, the enum was initialized with an unknown value.
26019        ///
26020        /// Applications can examine the value using [Complexity::value] or
26021        /// [Complexity::name].
26022        UnknownValue(complexity::UnknownValue),
26023    }
26024
26025    #[doc(hidden)]
26026    pub mod complexity {
26027        #[allow(unused_imports)]
26028        use super::*;
26029        #[derive(Clone, Debug, PartialEq)]
26030        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26031    }
26032
26033    impl Complexity {
26034        /// Gets the enum value.
26035        ///
26036        /// Returns `None` if the enum contains an unknown value deserialized from
26037        /// the string representation of enums.
26038        pub fn value(&self) -> std::option::Option<i32> {
26039            match self {
26040                Self::Unspecified => std::option::Option::Some(0),
26041                Self::Default => std::option::Option::Some(1),
26042                Self::UnknownValue(u) => u.0.value(),
26043            }
26044        }
26045
26046        /// Gets the enum value as a string.
26047        ///
26048        /// Returns `None` if the enum contains an unknown value deserialized from
26049        /// the integer representation of enums.
26050        pub fn name(&self) -> std::option::Option<&str> {
26051            match self {
26052                Self::Unspecified => std::option::Option::Some("COMPLEXITY_UNSPECIFIED"),
26053                Self::Default => std::option::Option::Some("COMPLEXITY_DEFAULT"),
26054                Self::UnknownValue(u) => u.0.name(),
26055            }
26056        }
26057    }
26058
26059    impl std::default::Default for Complexity {
26060        fn default() -> Self {
26061            use std::convert::From;
26062            Self::from(0)
26063        }
26064    }
26065
26066    impl std::fmt::Display for Complexity {
26067        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26068            wkt::internal::display_enum(f, self.name(), self.value())
26069        }
26070    }
26071
26072    impl std::convert::From<i32> for Complexity {
26073        fn from(value: i32) -> Self {
26074            match value {
26075                0 => Self::Unspecified,
26076                1 => Self::Default,
26077                _ => Self::UnknownValue(complexity::UnknownValue(
26078                    wkt::internal::UnknownEnumValue::Integer(value),
26079                )),
26080            }
26081        }
26082    }
26083
26084    impl std::convert::From<&str> for Complexity {
26085        fn from(value: &str) -> Self {
26086            use std::string::ToString;
26087            match value {
26088                "COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
26089                "COMPLEXITY_DEFAULT" => Self::Default,
26090                _ => Self::UnknownValue(complexity::UnknownValue(
26091                    wkt::internal::UnknownEnumValue::String(value.to_string()),
26092                )),
26093            }
26094        }
26095    }
26096
26097    impl serde::ser::Serialize for Complexity {
26098        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26099        where
26100            S: serde::Serializer,
26101        {
26102            match self {
26103                Self::Unspecified => serializer.serialize_i32(0),
26104                Self::Default => serializer.serialize_i32(1),
26105                Self::UnknownValue(u) => u.0.serialize(serializer),
26106            }
26107        }
26108    }
26109
26110    impl<'de> serde::de::Deserialize<'de> for Complexity {
26111        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26112        where
26113            D: serde::Deserializer<'de>,
26114        {
26115            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Complexity>::new(
26116                ".google.cloud.sql.v1.PasswordValidationPolicy.Complexity",
26117            ))
26118        }
26119    }
26120}
26121
26122/// Data cache configurations.
26123#[derive(Clone, Default, PartialEq)]
26124#[non_exhaustive]
26125pub struct DataCacheConfig {
26126    /// Whether data cache is enabled for the instance.
26127    pub data_cache_enabled: bool,
26128
26129    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26130}
26131
26132impl DataCacheConfig {
26133    /// Creates a new default instance.
26134    pub fn new() -> Self {
26135        std::default::Default::default()
26136    }
26137
26138    /// Sets the value of [data_cache_enabled][crate::model::DataCacheConfig::data_cache_enabled].
26139    ///
26140    /// # Example
26141    /// ```ignore,no_run
26142    /// # use google_cloud_sql_v1::model::DataCacheConfig;
26143    /// let x = DataCacheConfig::new().set_data_cache_enabled(true);
26144    /// ```
26145    pub fn set_data_cache_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
26146        self.data_cache_enabled = v.into();
26147        self
26148    }
26149}
26150
26151impl wkt::message::Message for DataCacheConfig {
26152    fn typename() -> &'static str {
26153        "type.googleapis.com/google.cloud.sql.v1.DataCacheConfig"
26154    }
26155}
26156
26157/// Config used to determine the final backup settings for the instance.
26158#[derive(Clone, Default, PartialEq)]
26159#[non_exhaustive]
26160pub struct FinalBackupConfig {
26161    /// Whether the final backup is enabled for the instance.
26162    pub enabled: std::option::Option<bool>,
26163
26164    /// The number of days to retain the final backup after the instance deletion.
26165    /// The final backup will be purged at (time_of_instance_deletion +
26166    /// retention_days).
26167    pub retention_days: std::option::Option<i32>,
26168
26169    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26170}
26171
26172impl FinalBackupConfig {
26173    /// Creates a new default instance.
26174    pub fn new() -> Self {
26175        std::default::Default::default()
26176    }
26177
26178    /// Sets the value of [enabled][crate::model::FinalBackupConfig::enabled].
26179    ///
26180    /// # Example
26181    /// ```ignore,no_run
26182    /// # use google_cloud_sql_v1::model::FinalBackupConfig;
26183    /// let x = FinalBackupConfig::new().set_enabled(true);
26184    /// ```
26185    pub fn set_enabled<T>(mut self, v: T) -> Self
26186    where
26187        T: std::convert::Into<bool>,
26188    {
26189        self.enabled = std::option::Option::Some(v.into());
26190        self
26191    }
26192
26193    /// Sets or clears the value of [enabled][crate::model::FinalBackupConfig::enabled].
26194    ///
26195    /// # Example
26196    /// ```ignore,no_run
26197    /// # use google_cloud_sql_v1::model::FinalBackupConfig;
26198    /// let x = FinalBackupConfig::new().set_or_clear_enabled(Some(false));
26199    /// let x = FinalBackupConfig::new().set_or_clear_enabled(None::<bool>);
26200    /// ```
26201    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
26202    where
26203        T: std::convert::Into<bool>,
26204    {
26205        self.enabled = v.map(|x| x.into());
26206        self
26207    }
26208
26209    /// Sets the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
26210    ///
26211    /// # Example
26212    /// ```ignore,no_run
26213    /// # use google_cloud_sql_v1::model::FinalBackupConfig;
26214    /// let x = FinalBackupConfig::new().set_retention_days(42);
26215    /// ```
26216    pub fn set_retention_days<T>(mut self, v: T) -> Self
26217    where
26218        T: std::convert::Into<i32>,
26219    {
26220        self.retention_days = std::option::Option::Some(v.into());
26221        self
26222    }
26223
26224    /// Sets or clears the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
26225    ///
26226    /// # Example
26227    /// ```ignore,no_run
26228    /// # use google_cloud_sql_v1::model::FinalBackupConfig;
26229    /// let x = FinalBackupConfig::new().set_or_clear_retention_days(Some(42));
26230    /// let x = FinalBackupConfig::new().set_or_clear_retention_days(None::<i32>);
26231    /// ```
26232    pub fn set_or_clear_retention_days<T>(mut self, v: std::option::Option<T>) -> Self
26233    where
26234        T: std::convert::Into<i32>,
26235    {
26236        self.retention_days = v.map(|x| x.into());
26237        self
26238    }
26239}
26240
26241impl wkt::message::Message for FinalBackupConfig {
26242    fn typename() -> &'static str {
26243        "type.googleapis.com/google.cloud.sql.v1.FinalBackupConfig"
26244    }
26245}
26246
26247/// Database instance settings.
26248#[derive(Clone, Default, PartialEq)]
26249#[non_exhaustive]
26250pub struct Settings {
26251    /// The version of instance settings. This is a required field for update
26252    /// method to make sure concurrent updates are handled properly. During update,
26253    /// use the most recent settingsVersion value for this instance and do not try
26254    /// to update this value.
26255    pub settings_version: std::option::Option<wkt::Int64Value>,
26256
26257    /// The App Engine app IDs that can access this instance.
26258    /// (Deprecated) Applied to First Generation instances only.
26259    #[deprecated]
26260    pub authorized_gae_applications: std::vec::Vec<std::string::String>,
26261
26262    /// The tier (or machine type) for this instance, for example
26263    /// `db-custom-1-3840`. WARNING: Changing this restarts the instance.
26264    pub tier: std::string::String,
26265
26266    /// This is always `sql#settings`.
26267    pub kind: std::string::String,
26268
26269    /// User-provided labels, represented as a dictionary where each label is a
26270    /// single key value pair.
26271    pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
26272
26273    /// Availability type. Potential values:
26274    ///
26275    /// * `ZONAL`: The instance serves data from only one zone. Outages in that
26276    ///   zone affect data accessibility.
26277    /// * `REGIONAL`: The instance can serve data from more than one zone in a
26278    ///   region (it is highly available)./
26279    ///
26280    /// For more information, see [Overview of the High Availability
26281    /// Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
26282    pub availability_type: crate::model::SqlAvailabilityType,
26283
26284    /// The pricing plan for this instance. This can be either `PER_USE` or
26285    /// `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
26286    pub pricing_plan: crate::model::SqlPricingPlan,
26287
26288    /// The type of replication this instance uses. This can be either
26289    /// `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
26290    /// applicable to First Generation instances.
26291    #[deprecated]
26292    pub replication_type: crate::model::SqlReplicationType,
26293
26294    /// The maximum size to which storage capacity can be automatically increased.
26295    /// The default value is 0, which specifies that there is no limit.
26296    pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
26297
26298    /// The activation policy specifies when the instance is activated; it is
26299    /// applicable only when the instance state is RUNNABLE. Valid values:
26300    ///
26301    /// * `ALWAYS`: The instance is on, and remains so even in the absence of
26302    ///   connection requests.
26303    /// * `NEVER`: The instance is off; it is not activated, even if a
26304    ///   connection request arrives.
26305    pub activation_policy: crate::model::settings::SqlActivationPolicy,
26306
26307    /// The settings for IP Management. This allows to enable or disable the
26308    /// instance IP and manage which external networks can connect to the instance.
26309    /// The IPv4 address cannot be disabled for Second Generation instances.
26310    pub ip_configuration: std::option::Option<crate::model::IpConfiguration>,
26311
26312    /// Configuration to increase storage size automatically. The default value is
26313    /// true.
26314    pub storage_auto_resize: std::option::Option<wkt::BoolValue>,
26315
26316    /// The location preference settings. This allows the instance to be located as
26317    /// near as possible to either an App Engine app or Compute Engine zone for
26318    /// better performance. App Engine co-location was only applicable to First
26319    /// Generation instances.
26320    pub location_preference: std::option::Option<crate::model::LocationPreference>,
26321
26322    /// The database flags passed to the instance at startup.
26323    pub database_flags: std::vec::Vec<crate::model::DatabaseFlags>,
26324
26325    /// The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
26326    /// First Generation instances.
26327    pub data_disk_type: crate::model::SqlDataDiskType,
26328
26329    /// The maintenance window for this instance. This specifies when the instance
26330    /// can be restarted for maintenance purposes.
26331    pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,
26332
26333    /// The daily backup configuration for the instance.
26334    pub backup_configuration: std::option::Option<crate::model::BackupConfiguration>,
26335
26336    /// Configuration specific to read replica instances. Indicates whether
26337    /// replication is enabled or not. WARNING: Changing this restarts the
26338    /// instance.
26339    pub database_replication_enabled: std::option::Option<wkt::BoolValue>,
26340
26341    /// Configuration specific to read replica instances. Indicates whether
26342    /// database flags for crash-safe replication are enabled. This property was
26343    /// only applicable to First Generation instances.
26344    #[deprecated]
26345    pub crash_safe_replication_enabled: std::option::Option<wkt::BoolValue>,
26346
26347    /// The size of data disk, in GB. The data disk size minimum is 10GB.
26348    pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
26349
26350    /// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
26351    pub active_directory_config: std::option::Option<crate::model::SqlActiveDirectoryConfig>,
26352
26353    /// The name of server Instance collation.
26354    pub collation: std::string::String,
26355
26356    /// Deny maintenance periods
26357    pub deny_maintenance_periods: std::vec::Vec<crate::model::DenyMaintenancePeriod>,
26358
26359    /// Insights configuration, for now relevant only for Postgres.
26360    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
26361
26362    /// The local user password validation policy of the instance.
26363    pub password_validation_policy: std::option::Option<crate::model::PasswordValidationPolicy>,
26364
26365    /// SQL Server specific audit configuration.
26366    pub sql_server_audit_config: std::option::Option<crate::model::SqlServerAuditConfig>,
26367
26368    /// Optional. The edition of the instance.
26369    pub edition: crate::model::settings::Edition,
26370
26371    /// Specifies if connections must use Cloud SQL connectors.
26372    /// Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
26373    /// can be connected without Cloud SQL
26374    /// Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
26375    /// Connectors).
26376    ///
26377    /// Note that using REQUIRED disables all existing authorized networks. If
26378    /// this field is not specified when creating a new instance, NOT_REQUIRED is
26379    /// used. If this field is not specified when patching or updating an existing
26380    /// instance, it is left unchanged in the instance.
26381    pub connector_enforcement: crate::model::settings::ConnectorEnforcement,
26382
26383    /// Configuration to protect against accidental instance deletion.
26384    pub deletion_protection_enabled: std::option::Option<wkt::BoolValue>,
26385
26386    /// Server timezone, relevant only for Cloud SQL for SQL Server.
26387    pub time_zone: std::string::String,
26388
26389    /// Specifies advanced machine configuration for the instances relevant only
26390    /// for SQL Server.
26391    pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
26392
26393    /// Configuration for data cache.
26394    pub data_cache_config: std::option::Option<crate::model::DataCacheConfig>,
26395
26396    /// Optional. Configuration value for recreation of replica after certain
26397    /// replication lag
26398    pub replication_lag_max_seconds: std::option::Option<wkt::Int32Value>,
26399
26400    /// Optional. When this parameter is set to true, Cloud SQL instances can
26401    /// connect to Vertex AI to pass requests for real-time predictions and
26402    /// insights to the AI. The default value is false. This applies only to Cloud
26403    /// SQL for MySQL and Cloud SQL for PostgreSQL instances.
26404    pub enable_google_ml_integration: std::option::Option<wkt::BoolValue>,
26405
26406    /// Optional. By default, Cloud SQL instances have schema extraction disabled
26407    /// for Dataplex. When this parameter is set to true, schema extraction for
26408    /// Dataplex on Cloud SQL instances is activated.
26409    pub enable_dataplex_integration: std::option::Option<wkt::BoolValue>,
26410
26411    /// Optional. When this parameter is set to true, Cloud SQL retains backups of
26412    /// the instance even after the instance is deleted. The ON_DEMAND backup will
26413    /// be retained until customer deletes the backup or the project. The AUTOMATED
26414    /// backup will be retained based on the backups retention setting.
26415    pub retain_backups_on_delete: std::option::Option<wkt::BoolValue>,
26416
26417    /// Optional. Provisioned number of I/O operations per second for the data
26418    /// disk. This field is only used for hyperdisk-balanced disk types.
26419    pub data_disk_provisioned_iops: std::option::Option<i64>,
26420
26421    /// Optional. Provisioned throughput measured in MiB per second for the data
26422    /// disk. This field is only used for hyperdisk-balanced disk types.
26423    pub data_disk_provisioned_throughput: std::option::Option<i64>,
26424
26425    /// Optional. The managed connection pooling configuration for the instance.
26426    pub connection_pool_config: std::option::Option<crate::model::ConnectionPoolConfig>,
26427
26428    /// Optional. The final backup configuration for the instance.
26429    pub final_backup_config: std::option::Option<crate::model::FinalBackupConfig>,
26430
26431    /// Optional. The read pool auto-scale configuration for the instance.
26432    pub read_pool_auto_scale_config: std::option::Option<crate::model::ReadPoolAutoScaleConfig>,
26433
26434    /// Optional. Whether the replica is in accelerated mode. This feature is in
26435    /// private preview and requires allowlisting to take effect.
26436    pub accelerated_replica_mode: std::option::Option<wkt::BoolValue>,
26437
26438    /// Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
26439    /// parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
26440    /// versions. The MySQL version must be 8.0.35 or higher.
26441    pub auto_upgrade_enabled: std::option::Option<bool>,
26442
26443    /// Optional. The Microsoft Entra ID configuration for the SQL Server instance.
26444    pub entraid_config: std::option::Option<crate::model::SqlServerEntraIdConfig>,
26445
26446    /// This parameter controls whether to allow using ExecuteSql API to connect to
26447    /// the instance. Not allowed by default.
26448    pub data_api_access: std::option::Option<crate::model::settings::DataApiAccess>,
26449
26450    /// Optional. Configuration for Performance Capture, provides diagnostic
26451    /// metrics during high load situations.
26452    pub performance_capture_config: std::option::Option<crate::model::PerformanceCaptureConfig>,
26453
26454    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26455}
26456
26457impl Settings {
26458    /// Creates a new default instance.
26459    pub fn new() -> Self {
26460        std::default::Default::default()
26461    }
26462
26463    /// Sets the value of [settings_version][crate::model::Settings::settings_version].
26464    ///
26465    /// # Example
26466    /// ```ignore,no_run
26467    /// # use google_cloud_sql_v1::model::Settings;
26468    /// use wkt::Int64Value;
26469    /// let x = Settings::new().set_settings_version(Int64Value::default()/* use setters */);
26470    /// ```
26471    pub fn set_settings_version<T>(mut self, v: T) -> Self
26472    where
26473        T: std::convert::Into<wkt::Int64Value>,
26474    {
26475        self.settings_version = std::option::Option::Some(v.into());
26476        self
26477    }
26478
26479    /// Sets or clears the value of [settings_version][crate::model::Settings::settings_version].
26480    ///
26481    /// # Example
26482    /// ```ignore,no_run
26483    /// # use google_cloud_sql_v1::model::Settings;
26484    /// use wkt::Int64Value;
26485    /// let x = Settings::new().set_or_clear_settings_version(Some(Int64Value::default()/* use setters */));
26486    /// let x = Settings::new().set_or_clear_settings_version(None::<Int64Value>);
26487    /// ```
26488    pub fn set_or_clear_settings_version<T>(mut self, v: std::option::Option<T>) -> Self
26489    where
26490        T: std::convert::Into<wkt::Int64Value>,
26491    {
26492        self.settings_version = v.map(|x| x.into());
26493        self
26494    }
26495
26496    /// Sets the value of [authorized_gae_applications][crate::model::Settings::authorized_gae_applications].
26497    ///
26498    /// # Example
26499    /// ```ignore,no_run
26500    /// # use google_cloud_sql_v1::model::Settings;
26501    /// let x = Settings::new().set_authorized_gae_applications(["a", "b", "c"]);
26502    /// ```
26503    #[deprecated]
26504    pub fn set_authorized_gae_applications<T, V>(mut self, v: T) -> Self
26505    where
26506        T: std::iter::IntoIterator<Item = V>,
26507        V: std::convert::Into<std::string::String>,
26508    {
26509        use std::iter::Iterator;
26510        self.authorized_gae_applications = v.into_iter().map(|i| i.into()).collect();
26511        self
26512    }
26513
26514    /// Sets the value of [tier][crate::model::Settings::tier].
26515    ///
26516    /// # Example
26517    /// ```ignore,no_run
26518    /// # use google_cloud_sql_v1::model::Settings;
26519    /// let x = Settings::new().set_tier("example");
26520    /// ```
26521    pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26522        self.tier = v.into();
26523        self
26524    }
26525
26526    /// Sets the value of [kind][crate::model::Settings::kind].
26527    ///
26528    /// # Example
26529    /// ```ignore,no_run
26530    /// # use google_cloud_sql_v1::model::Settings;
26531    /// let x = Settings::new().set_kind("example");
26532    /// ```
26533    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26534        self.kind = v.into();
26535        self
26536    }
26537
26538    /// Sets the value of [user_labels][crate::model::Settings::user_labels].
26539    ///
26540    /// # Example
26541    /// ```ignore,no_run
26542    /// # use google_cloud_sql_v1::model::Settings;
26543    /// let x = Settings::new().set_user_labels([
26544    ///     ("key0", "abc"),
26545    ///     ("key1", "xyz"),
26546    /// ]);
26547    /// ```
26548    pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
26549    where
26550        T: std::iter::IntoIterator<Item = (K, V)>,
26551        K: std::convert::Into<std::string::String>,
26552        V: std::convert::Into<std::string::String>,
26553    {
26554        use std::iter::Iterator;
26555        self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
26556        self
26557    }
26558
26559    /// Sets the value of [availability_type][crate::model::Settings::availability_type].
26560    ///
26561    /// # Example
26562    /// ```ignore,no_run
26563    /// # use google_cloud_sql_v1::model::Settings;
26564    /// use google_cloud_sql_v1::model::SqlAvailabilityType;
26565    /// let x0 = Settings::new().set_availability_type(SqlAvailabilityType::Zonal);
26566    /// let x1 = Settings::new().set_availability_type(SqlAvailabilityType::Regional);
26567    /// ```
26568    pub fn set_availability_type<T: std::convert::Into<crate::model::SqlAvailabilityType>>(
26569        mut self,
26570        v: T,
26571    ) -> Self {
26572        self.availability_type = v.into();
26573        self
26574    }
26575
26576    /// Sets the value of [pricing_plan][crate::model::Settings::pricing_plan].
26577    ///
26578    /// # Example
26579    /// ```ignore,no_run
26580    /// # use google_cloud_sql_v1::model::Settings;
26581    /// use google_cloud_sql_v1::model::SqlPricingPlan;
26582    /// let x0 = Settings::new().set_pricing_plan(SqlPricingPlan::Package);
26583    /// let x1 = Settings::new().set_pricing_plan(SqlPricingPlan::PerUse);
26584    /// ```
26585    pub fn set_pricing_plan<T: std::convert::Into<crate::model::SqlPricingPlan>>(
26586        mut self,
26587        v: T,
26588    ) -> Self {
26589        self.pricing_plan = v.into();
26590        self
26591    }
26592
26593    /// Sets the value of [replication_type][crate::model::Settings::replication_type].
26594    ///
26595    /// # Example
26596    /// ```ignore,no_run
26597    /// # use google_cloud_sql_v1::model::Settings;
26598    /// use google_cloud_sql_v1::model::SqlReplicationType;
26599    /// let x0 = Settings::new().set_replication_type(SqlReplicationType::Synchronous);
26600    /// let x1 = Settings::new().set_replication_type(SqlReplicationType::Asynchronous);
26601    /// ```
26602    #[deprecated]
26603    pub fn set_replication_type<T: std::convert::Into<crate::model::SqlReplicationType>>(
26604        mut self,
26605        v: T,
26606    ) -> Self {
26607        self.replication_type = v.into();
26608        self
26609    }
26610
26611    /// Sets the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
26612    ///
26613    /// # Example
26614    /// ```ignore,no_run
26615    /// # use google_cloud_sql_v1::model::Settings;
26616    /// use wkt::Int64Value;
26617    /// let x = Settings::new().set_storage_auto_resize_limit(Int64Value::default()/* use setters */);
26618    /// ```
26619    pub fn set_storage_auto_resize_limit<T>(mut self, v: T) -> Self
26620    where
26621        T: std::convert::Into<wkt::Int64Value>,
26622    {
26623        self.storage_auto_resize_limit = std::option::Option::Some(v.into());
26624        self
26625    }
26626
26627    /// Sets or clears the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
26628    ///
26629    /// # Example
26630    /// ```ignore,no_run
26631    /// # use google_cloud_sql_v1::model::Settings;
26632    /// use wkt::Int64Value;
26633    /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(Some(Int64Value::default()/* use setters */));
26634    /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(None::<Int64Value>);
26635    /// ```
26636    pub fn set_or_clear_storage_auto_resize_limit<T>(mut self, v: std::option::Option<T>) -> Self
26637    where
26638        T: std::convert::Into<wkt::Int64Value>,
26639    {
26640        self.storage_auto_resize_limit = v.map(|x| x.into());
26641        self
26642    }
26643
26644    /// Sets the value of [activation_policy][crate::model::Settings::activation_policy].
26645    ///
26646    /// # Example
26647    /// ```ignore,no_run
26648    /// # use google_cloud_sql_v1::model::Settings;
26649    /// use google_cloud_sql_v1::model::settings::SqlActivationPolicy;
26650    /// let x0 = Settings::new().set_activation_policy(SqlActivationPolicy::Always);
26651    /// let x1 = Settings::new().set_activation_policy(SqlActivationPolicy::Never);
26652    /// ```
26653    pub fn set_activation_policy<
26654        T: std::convert::Into<crate::model::settings::SqlActivationPolicy>,
26655    >(
26656        mut self,
26657        v: T,
26658    ) -> Self {
26659        self.activation_policy = v.into();
26660        self
26661    }
26662
26663    /// Sets the value of [ip_configuration][crate::model::Settings::ip_configuration].
26664    ///
26665    /// # Example
26666    /// ```ignore,no_run
26667    /// # use google_cloud_sql_v1::model::Settings;
26668    /// use google_cloud_sql_v1::model::IpConfiguration;
26669    /// let x = Settings::new().set_ip_configuration(IpConfiguration::default()/* use setters */);
26670    /// ```
26671    pub fn set_ip_configuration<T>(mut self, v: T) -> Self
26672    where
26673        T: std::convert::Into<crate::model::IpConfiguration>,
26674    {
26675        self.ip_configuration = std::option::Option::Some(v.into());
26676        self
26677    }
26678
26679    /// Sets or clears the value of [ip_configuration][crate::model::Settings::ip_configuration].
26680    ///
26681    /// # Example
26682    /// ```ignore,no_run
26683    /// # use google_cloud_sql_v1::model::Settings;
26684    /// use google_cloud_sql_v1::model::IpConfiguration;
26685    /// let x = Settings::new().set_or_clear_ip_configuration(Some(IpConfiguration::default()/* use setters */));
26686    /// let x = Settings::new().set_or_clear_ip_configuration(None::<IpConfiguration>);
26687    /// ```
26688    pub fn set_or_clear_ip_configuration<T>(mut self, v: std::option::Option<T>) -> Self
26689    where
26690        T: std::convert::Into<crate::model::IpConfiguration>,
26691    {
26692        self.ip_configuration = v.map(|x| x.into());
26693        self
26694    }
26695
26696    /// Sets the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
26697    ///
26698    /// # Example
26699    /// ```ignore,no_run
26700    /// # use google_cloud_sql_v1::model::Settings;
26701    /// use wkt::BoolValue;
26702    /// let x = Settings::new().set_storage_auto_resize(BoolValue::default()/* use setters */);
26703    /// ```
26704    pub fn set_storage_auto_resize<T>(mut self, v: T) -> Self
26705    where
26706        T: std::convert::Into<wkt::BoolValue>,
26707    {
26708        self.storage_auto_resize = std::option::Option::Some(v.into());
26709        self
26710    }
26711
26712    /// Sets or clears the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
26713    ///
26714    /// # Example
26715    /// ```ignore,no_run
26716    /// # use google_cloud_sql_v1::model::Settings;
26717    /// use wkt::BoolValue;
26718    /// let x = Settings::new().set_or_clear_storage_auto_resize(Some(BoolValue::default()/* use setters */));
26719    /// let x = Settings::new().set_or_clear_storage_auto_resize(None::<BoolValue>);
26720    /// ```
26721    pub fn set_or_clear_storage_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
26722    where
26723        T: std::convert::Into<wkt::BoolValue>,
26724    {
26725        self.storage_auto_resize = v.map(|x| x.into());
26726        self
26727    }
26728
26729    /// Sets the value of [location_preference][crate::model::Settings::location_preference].
26730    ///
26731    /// # Example
26732    /// ```ignore,no_run
26733    /// # use google_cloud_sql_v1::model::Settings;
26734    /// use google_cloud_sql_v1::model::LocationPreference;
26735    /// let x = Settings::new().set_location_preference(LocationPreference::default()/* use setters */);
26736    /// ```
26737    pub fn set_location_preference<T>(mut self, v: T) -> Self
26738    where
26739        T: std::convert::Into<crate::model::LocationPreference>,
26740    {
26741        self.location_preference = std::option::Option::Some(v.into());
26742        self
26743    }
26744
26745    /// Sets or clears the value of [location_preference][crate::model::Settings::location_preference].
26746    ///
26747    /// # Example
26748    /// ```ignore,no_run
26749    /// # use google_cloud_sql_v1::model::Settings;
26750    /// use google_cloud_sql_v1::model::LocationPreference;
26751    /// let x = Settings::new().set_or_clear_location_preference(Some(LocationPreference::default()/* use setters */));
26752    /// let x = Settings::new().set_or_clear_location_preference(None::<LocationPreference>);
26753    /// ```
26754    pub fn set_or_clear_location_preference<T>(mut self, v: std::option::Option<T>) -> Self
26755    where
26756        T: std::convert::Into<crate::model::LocationPreference>,
26757    {
26758        self.location_preference = v.map(|x| x.into());
26759        self
26760    }
26761
26762    /// Sets the value of [database_flags][crate::model::Settings::database_flags].
26763    ///
26764    /// # Example
26765    /// ```ignore,no_run
26766    /// # use google_cloud_sql_v1::model::Settings;
26767    /// use google_cloud_sql_v1::model::DatabaseFlags;
26768    /// let x = Settings::new()
26769    ///     .set_database_flags([
26770    ///         DatabaseFlags::default()/* use setters */,
26771    ///         DatabaseFlags::default()/* use (different) setters */,
26772    ///     ]);
26773    /// ```
26774    pub fn set_database_flags<T, V>(mut self, v: T) -> Self
26775    where
26776        T: std::iter::IntoIterator<Item = V>,
26777        V: std::convert::Into<crate::model::DatabaseFlags>,
26778    {
26779        use std::iter::Iterator;
26780        self.database_flags = v.into_iter().map(|i| i.into()).collect();
26781        self
26782    }
26783
26784    /// Sets the value of [data_disk_type][crate::model::Settings::data_disk_type].
26785    ///
26786    /// # Example
26787    /// ```ignore,no_run
26788    /// # use google_cloud_sql_v1::model::Settings;
26789    /// use google_cloud_sql_v1::model::SqlDataDiskType;
26790    /// let x0 = Settings::new().set_data_disk_type(SqlDataDiskType::PdSsd);
26791    /// let x1 = Settings::new().set_data_disk_type(SqlDataDiskType::PdHdd);
26792    /// let x2 = Settings::new().set_data_disk_type(SqlDataDiskType::HyperdiskBalanced);
26793    /// ```
26794    pub fn set_data_disk_type<T: std::convert::Into<crate::model::SqlDataDiskType>>(
26795        mut self,
26796        v: T,
26797    ) -> Self {
26798        self.data_disk_type = v.into();
26799        self
26800    }
26801
26802    /// Sets the value of [maintenance_window][crate::model::Settings::maintenance_window].
26803    ///
26804    /// # Example
26805    /// ```ignore,no_run
26806    /// # use google_cloud_sql_v1::model::Settings;
26807    /// use google_cloud_sql_v1::model::MaintenanceWindow;
26808    /// let x = Settings::new().set_maintenance_window(MaintenanceWindow::default()/* use setters */);
26809    /// ```
26810    pub fn set_maintenance_window<T>(mut self, v: T) -> Self
26811    where
26812        T: std::convert::Into<crate::model::MaintenanceWindow>,
26813    {
26814        self.maintenance_window = std::option::Option::Some(v.into());
26815        self
26816    }
26817
26818    /// Sets or clears the value of [maintenance_window][crate::model::Settings::maintenance_window].
26819    ///
26820    /// # Example
26821    /// ```ignore,no_run
26822    /// # use google_cloud_sql_v1::model::Settings;
26823    /// use google_cloud_sql_v1::model::MaintenanceWindow;
26824    /// let x = Settings::new().set_or_clear_maintenance_window(Some(MaintenanceWindow::default()/* use setters */));
26825    /// let x = Settings::new().set_or_clear_maintenance_window(None::<MaintenanceWindow>);
26826    /// ```
26827    pub fn set_or_clear_maintenance_window<T>(mut self, v: std::option::Option<T>) -> Self
26828    where
26829        T: std::convert::Into<crate::model::MaintenanceWindow>,
26830    {
26831        self.maintenance_window = v.map(|x| x.into());
26832        self
26833    }
26834
26835    /// Sets the value of [backup_configuration][crate::model::Settings::backup_configuration].
26836    ///
26837    /// # Example
26838    /// ```ignore,no_run
26839    /// # use google_cloud_sql_v1::model::Settings;
26840    /// use google_cloud_sql_v1::model::BackupConfiguration;
26841    /// let x = Settings::new().set_backup_configuration(BackupConfiguration::default()/* use setters */);
26842    /// ```
26843    pub fn set_backup_configuration<T>(mut self, v: T) -> Self
26844    where
26845        T: std::convert::Into<crate::model::BackupConfiguration>,
26846    {
26847        self.backup_configuration = std::option::Option::Some(v.into());
26848        self
26849    }
26850
26851    /// Sets or clears the value of [backup_configuration][crate::model::Settings::backup_configuration].
26852    ///
26853    /// # Example
26854    /// ```ignore,no_run
26855    /// # use google_cloud_sql_v1::model::Settings;
26856    /// use google_cloud_sql_v1::model::BackupConfiguration;
26857    /// let x = Settings::new().set_or_clear_backup_configuration(Some(BackupConfiguration::default()/* use setters */));
26858    /// let x = Settings::new().set_or_clear_backup_configuration(None::<BackupConfiguration>);
26859    /// ```
26860    pub fn set_or_clear_backup_configuration<T>(mut self, v: std::option::Option<T>) -> Self
26861    where
26862        T: std::convert::Into<crate::model::BackupConfiguration>,
26863    {
26864        self.backup_configuration = v.map(|x| x.into());
26865        self
26866    }
26867
26868    /// Sets the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
26869    ///
26870    /// # Example
26871    /// ```ignore,no_run
26872    /// # use google_cloud_sql_v1::model::Settings;
26873    /// use wkt::BoolValue;
26874    /// let x = Settings::new().set_database_replication_enabled(BoolValue::default()/* use setters */);
26875    /// ```
26876    pub fn set_database_replication_enabled<T>(mut self, v: T) -> Self
26877    where
26878        T: std::convert::Into<wkt::BoolValue>,
26879    {
26880        self.database_replication_enabled = std::option::Option::Some(v.into());
26881        self
26882    }
26883
26884    /// Sets or clears the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
26885    ///
26886    /// # Example
26887    /// ```ignore,no_run
26888    /// # use google_cloud_sql_v1::model::Settings;
26889    /// use wkt::BoolValue;
26890    /// let x = Settings::new().set_or_clear_database_replication_enabled(Some(BoolValue::default()/* use setters */));
26891    /// let x = Settings::new().set_or_clear_database_replication_enabled(None::<BoolValue>);
26892    /// ```
26893    pub fn set_or_clear_database_replication_enabled<T>(mut self, v: std::option::Option<T>) -> Self
26894    where
26895        T: std::convert::Into<wkt::BoolValue>,
26896    {
26897        self.database_replication_enabled = v.map(|x| x.into());
26898        self
26899    }
26900
26901    /// Sets the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
26902    ///
26903    /// # Example
26904    /// ```ignore,no_run
26905    /// # use google_cloud_sql_v1::model::Settings;
26906    /// use wkt::BoolValue;
26907    /// let x = Settings::new().set_crash_safe_replication_enabled(BoolValue::default()/* use setters */);
26908    /// ```
26909    #[deprecated]
26910    pub fn set_crash_safe_replication_enabled<T>(mut self, v: T) -> Self
26911    where
26912        T: std::convert::Into<wkt::BoolValue>,
26913    {
26914        self.crash_safe_replication_enabled = std::option::Option::Some(v.into());
26915        self
26916    }
26917
26918    /// Sets or clears the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
26919    ///
26920    /// # Example
26921    /// ```ignore,no_run
26922    /// # use google_cloud_sql_v1::model::Settings;
26923    /// use wkt::BoolValue;
26924    /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(Some(BoolValue::default()/* use setters */));
26925    /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(None::<BoolValue>);
26926    /// ```
26927    #[deprecated]
26928    pub fn set_or_clear_crash_safe_replication_enabled<T>(
26929        mut self,
26930        v: std::option::Option<T>,
26931    ) -> Self
26932    where
26933        T: std::convert::Into<wkt::BoolValue>,
26934    {
26935        self.crash_safe_replication_enabled = v.map(|x| x.into());
26936        self
26937    }
26938
26939    /// Sets the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
26940    ///
26941    /// # Example
26942    /// ```ignore,no_run
26943    /// # use google_cloud_sql_v1::model::Settings;
26944    /// use wkt::Int64Value;
26945    /// let x = Settings::new().set_data_disk_size_gb(Int64Value::default()/* use setters */);
26946    /// ```
26947    pub fn set_data_disk_size_gb<T>(mut self, v: T) -> Self
26948    where
26949        T: std::convert::Into<wkt::Int64Value>,
26950    {
26951        self.data_disk_size_gb = std::option::Option::Some(v.into());
26952        self
26953    }
26954
26955    /// Sets or clears the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
26956    ///
26957    /// # Example
26958    /// ```ignore,no_run
26959    /// # use google_cloud_sql_v1::model::Settings;
26960    /// use wkt::Int64Value;
26961    /// let x = Settings::new().set_or_clear_data_disk_size_gb(Some(Int64Value::default()/* use setters */));
26962    /// let x = Settings::new().set_or_clear_data_disk_size_gb(None::<Int64Value>);
26963    /// ```
26964    pub fn set_or_clear_data_disk_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
26965    where
26966        T: std::convert::Into<wkt::Int64Value>,
26967    {
26968        self.data_disk_size_gb = v.map(|x| x.into());
26969        self
26970    }
26971
26972    /// Sets the value of [active_directory_config][crate::model::Settings::active_directory_config].
26973    ///
26974    /// # Example
26975    /// ```ignore,no_run
26976    /// # use google_cloud_sql_v1::model::Settings;
26977    /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
26978    /// let x = Settings::new().set_active_directory_config(SqlActiveDirectoryConfig::default()/* use setters */);
26979    /// ```
26980    pub fn set_active_directory_config<T>(mut self, v: T) -> Self
26981    where
26982        T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
26983    {
26984        self.active_directory_config = std::option::Option::Some(v.into());
26985        self
26986    }
26987
26988    /// Sets or clears the value of [active_directory_config][crate::model::Settings::active_directory_config].
26989    ///
26990    /// # Example
26991    /// ```ignore,no_run
26992    /// # use google_cloud_sql_v1::model::Settings;
26993    /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
26994    /// let x = Settings::new().set_or_clear_active_directory_config(Some(SqlActiveDirectoryConfig::default()/* use setters */));
26995    /// let x = Settings::new().set_or_clear_active_directory_config(None::<SqlActiveDirectoryConfig>);
26996    /// ```
26997    pub fn set_or_clear_active_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
26998    where
26999        T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
27000    {
27001        self.active_directory_config = v.map(|x| x.into());
27002        self
27003    }
27004
27005    /// Sets the value of [collation][crate::model::Settings::collation].
27006    ///
27007    /// # Example
27008    /// ```ignore,no_run
27009    /// # use google_cloud_sql_v1::model::Settings;
27010    /// let x = Settings::new().set_collation("example");
27011    /// ```
27012    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27013        self.collation = v.into();
27014        self
27015    }
27016
27017    /// Sets the value of [deny_maintenance_periods][crate::model::Settings::deny_maintenance_periods].
27018    ///
27019    /// # Example
27020    /// ```ignore,no_run
27021    /// # use google_cloud_sql_v1::model::Settings;
27022    /// use google_cloud_sql_v1::model::DenyMaintenancePeriod;
27023    /// let x = Settings::new()
27024    ///     .set_deny_maintenance_periods([
27025    ///         DenyMaintenancePeriod::default()/* use setters */,
27026    ///         DenyMaintenancePeriod::default()/* use (different) setters */,
27027    ///     ]);
27028    /// ```
27029    pub fn set_deny_maintenance_periods<T, V>(mut self, v: T) -> Self
27030    where
27031        T: std::iter::IntoIterator<Item = V>,
27032        V: std::convert::Into<crate::model::DenyMaintenancePeriod>,
27033    {
27034        use std::iter::Iterator;
27035        self.deny_maintenance_periods = v.into_iter().map(|i| i.into()).collect();
27036        self
27037    }
27038
27039    /// Sets the value of [insights_config][crate::model::Settings::insights_config].
27040    ///
27041    /// # Example
27042    /// ```ignore,no_run
27043    /// # use google_cloud_sql_v1::model::Settings;
27044    /// use google_cloud_sql_v1::model::InsightsConfig;
27045    /// let x = Settings::new().set_insights_config(InsightsConfig::default()/* use setters */);
27046    /// ```
27047    pub fn set_insights_config<T>(mut self, v: T) -> Self
27048    where
27049        T: std::convert::Into<crate::model::InsightsConfig>,
27050    {
27051        self.insights_config = std::option::Option::Some(v.into());
27052        self
27053    }
27054
27055    /// Sets or clears the value of [insights_config][crate::model::Settings::insights_config].
27056    ///
27057    /// # Example
27058    /// ```ignore,no_run
27059    /// # use google_cloud_sql_v1::model::Settings;
27060    /// use google_cloud_sql_v1::model::InsightsConfig;
27061    /// let x = Settings::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
27062    /// let x = Settings::new().set_or_clear_insights_config(None::<InsightsConfig>);
27063    /// ```
27064    pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
27065    where
27066        T: std::convert::Into<crate::model::InsightsConfig>,
27067    {
27068        self.insights_config = v.map(|x| x.into());
27069        self
27070    }
27071
27072    /// Sets the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
27073    ///
27074    /// # Example
27075    /// ```ignore,no_run
27076    /// # use google_cloud_sql_v1::model::Settings;
27077    /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
27078    /// let x = Settings::new().set_password_validation_policy(PasswordValidationPolicy::default()/* use setters */);
27079    /// ```
27080    pub fn set_password_validation_policy<T>(mut self, v: T) -> Self
27081    where
27082        T: std::convert::Into<crate::model::PasswordValidationPolicy>,
27083    {
27084        self.password_validation_policy = std::option::Option::Some(v.into());
27085        self
27086    }
27087
27088    /// Sets or clears the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
27089    ///
27090    /// # Example
27091    /// ```ignore,no_run
27092    /// # use google_cloud_sql_v1::model::Settings;
27093    /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
27094    /// let x = Settings::new().set_or_clear_password_validation_policy(Some(PasswordValidationPolicy::default()/* use setters */));
27095    /// let x = Settings::new().set_or_clear_password_validation_policy(None::<PasswordValidationPolicy>);
27096    /// ```
27097    pub fn set_or_clear_password_validation_policy<T>(mut self, v: std::option::Option<T>) -> Self
27098    where
27099        T: std::convert::Into<crate::model::PasswordValidationPolicy>,
27100    {
27101        self.password_validation_policy = v.map(|x| x.into());
27102        self
27103    }
27104
27105    /// Sets the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
27106    ///
27107    /// # Example
27108    /// ```ignore,no_run
27109    /// # use google_cloud_sql_v1::model::Settings;
27110    /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
27111    /// let x = Settings::new().set_sql_server_audit_config(SqlServerAuditConfig::default()/* use setters */);
27112    /// ```
27113    pub fn set_sql_server_audit_config<T>(mut self, v: T) -> Self
27114    where
27115        T: std::convert::Into<crate::model::SqlServerAuditConfig>,
27116    {
27117        self.sql_server_audit_config = std::option::Option::Some(v.into());
27118        self
27119    }
27120
27121    /// Sets or clears the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
27122    ///
27123    /// # Example
27124    /// ```ignore,no_run
27125    /// # use google_cloud_sql_v1::model::Settings;
27126    /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
27127    /// let x = Settings::new().set_or_clear_sql_server_audit_config(Some(SqlServerAuditConfig::default()/* use setters */));
27128    /// let x = Settings::new().set_or_clear_sql_server_audit_config(None::<SqlServerAuditConfig>);
27129    /// ```
27130    pub fn set_or_clear_sql_server_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
27131    where
27132        T: std::convert::Into<crate::model::SqlServerAuditConfig>,
27133    {
27134        self.sql_server_audit_config = v.map(|x| x.into());
27135        self
27136    }
27137
27138    /// Sets the value of [edition][crate::model::Settings::edition].
27139    ///
27140    /// # Example
27141    /// ```ignore,no_run
27142    /// # use google_cloud_sql_v1::model::Settings;
27143    /// use google_cloud_sql_v1::model::settings::Edition;
27144    /// let x0 = Settings::new().set_edition(Edition::Enterprise);
27145    /// let x1 = Settings::new().set_edition(Edition::EnterprisePlus);
27146    /// ```
27147    pub fn set_edition<T: std::convert::Into<crate::model::settings::Edition>>(
27148        mut self,
27149        v: T,
27150    ) -> Self {
27151        self.edition = v.into();
27152        self
27153    }
27154
27155    /// Sets the value of [connector_enforcement][crate::model::Settings::connector_enforcement].
27156    ///
27157    /// # Example
27158    /// ```ignore,no_run
27159    /// # use google_cloud_sql_v1::model::Settings;
27160    /// use google_cloud_sql_v1::model::settings::ConnectorEnforcement;
27161    /// let x0 = Settings::new().set_connector_enforcement(ConnectorEnforcement::NotRequired);
27162    /// let x1 = Settings::new().set_connector_enforcement(ConnectorEnforcement::Required);
27163    /// ```
27164    pub fn set_connector_enforcement<
27165        T: std::convert::Into<crate::model::settings::ConnectorEnforcement>,
27166    >(
27167        mut self,
27168        v: T,
27169    ) -> Self {
27170        self.connector_enforcement = v.into();
27171        self
27172    }
27173
27174    /// Sets the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
27175    ///
27176    /// # Example
27177    /// ```ignore,no_run
27178    /// # use google_cloud_sql_v1::model::Settings;
27179    /// use wkt::BoolValue;
27180    /// let x = Settings::new().set_deletion_protection_enabled(BoolValue::default()/* use setters */);
27181    /// ```
27182    pub fn set_deletion_protection_enabled<T>(mut self, v: T) -> Self
27183    where
27184        T: std::convert::Into<wkt::BoolValue>,
27185    {
27186        self.deletion_protection_enabled = std::option::Option::Some(v.into());
27187        self
27188    }
27189
27190    /// Sets or clears the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
27191    ///
27192    /// # Example
27193    /// ```ignore,no_run
27194    /// # use google_cloud_sql_v1::model::Settings;
27195    /// use wkt::BoolValue;
27196    /// let x = Settings::new().set_or_clear_deletion_protection_enabled(Some(BoolValue::default()/* use setters */));
27197    /// let x = Settings::new().set_or_clear_deletion_protection_enabled(None::<BoolValue>);
27198    /// ```
27199    pub fn set_or_clear_deletion_protection_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27200    where
27201        T: std::convert::Into<wkt::BoolValue>,
27202    {
27203        self.deletion_protection_enabled = v.map(|x| x.into());
27204        self
27205    }
27206
27207    /// Sets the value of [time_zone][crate::model::Settings::time_zone].
27208    ///
27209    /// # Example
27210    /// ```ignore,no_run
27211    /// # use google_cloud_sql_v1::model::Settings;
27212    /// let x = Settings::new().set_time_zone("example");
27213    /// ```
27214    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27215        self.time_zone = v.into();
27216        self
27217    }
27218
27219    /// Sets the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
27220    ///
27221    /// # Example
27222    /// ```ignore,no_run
27223    /// # use google_cloud_sql_v1::model::Settings;
27224    /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
27225    /// let x = Settings::new().set_advanced_machine_features(AdvancedMachineFeatures::default()/* use setters */);
27226    /// ```
27227    pub fn set_advanced_machine_features<T>(mut self, v: T) -> Self
27228    where
27229        T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
27230    {
27231        self.advanced_machine_features = std::option::Option::Some(v.into());
27232        self
27233    }
27234
27235    /// Sets or clears the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
27236    ///
27237    /// # Example
27238    /// ```ignore,no_run
27239    /// # use google_cloud_sql_v1::model::Settings;
27240    /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
27241    /// let x = Settings::new().set_or_clear_advanced_machine_features(Some(AdvancedMachineFeatures::default()/* use setters */));
27242    /// let x = Settings::new().set_or_clear_advanced_machine_features(None::<AdvancedMachineFeatures>);
27243    /// ```
27244    pub fn set_or_clear_advanced_machine_features<T>(mut self, v: std::option::Option<T>) -> Self
27245    where
27246        T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
27247    {
27248        self.advanced_machine_features = v.map(|x| x.into());
27249        self
27250    }
27251
27252    /// Sets the value of [data_cache_config][crate::model::Settings::data_cache_config].
27253    ///
27254    /// # Example
27255    /// ```ignore,no_run
27256    /// # use google_cloud_sql_v1::model::Settings;
27257    /// use google_cloud_sql_v1::model::DataCacheConfig;
27258    /// let x = Settings::new().set_data_cache_config(DataCacheConfig::default()/* use setters */);
27259    /// ```
27260    pub fn set_data_cache_config<T>(mut self, v: T) -> Self
27261    where
27262        T: std::convert::Into<crate::model::DataCacheConfig>,
27263    {
27264        self.data_cache_config = std::option::Option::Some(v.into());
27265        self
27266    }
27267
27268    /// Sets or clears the value of [data_cache_config][crate::model::Settings::data_cache_config].
27269    ///
27270    /// # Example
27271    /// ```ignore,no_run
27272    /// # use google_cloud_sql_v1::model::Settings;
27273    /// use google_cloud_sql_v1::model::DataCacheConfig;
27274    /// let x = Settings::new().set_or_clear_data_cache_config(Some(DataCacheConfig::default()/* use setters */));
27275    /// let x = Settings::new().set_or_clear_data_cache_config(None::<DataCacheConfig>);
27276    /// ```
27277    pub fn set_or_clear_data_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
27278    where
27279        T: std::convert::Into<crate::model::DataCacheConfig>,
27280    {
27281        self.data_cache_config = v.map(|x| x.into());
27282        self
27283    }
27284
27285    /// Sets the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
27286    ///
27287    /// # Example
27288    /// ```ignore,no_run
27289    /// # use google_cloud_sql_v1::model::Settings;
27290    /// use wkt::Int32Value;
27291    /// let x = Settings::new().set_replication_lag_max_seconds(Int32Value::default()/* use setters */);
27292    /// ```
27293    pub fn set_replication_lag_max_seconds<T>(mut self, v: T) -> Self
27294    where
27295        T: std::convert::Into<wkt::Int32Value>,
27296    {
27297        self.replication_lag_max_seconds = std::option::Option::Some(v.into());
27298        self
27299    }
27300
27301    /// Sets or clears the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
27302    ///
27303    /// # Example
27304    /// ```ignore,no_run
27305    /// # use google_cloud_sql_v1::model::Settings;
27306    /// use wkt::Int32Value;
27307    /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(Some(Int32Value::default()/* use setters */));
27308    /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(None::<Int32Value>);
27309    /// ```
27310    pub fn set_or_clear_replication_lag_max_seconds<T>(mut self, v: std::option::Option<T>) -> Self
27311    where
27312        T: std::convert::Into<wkt::Int32Value>,
27313    {
27314        self.replication_lag_max_seconds = v.map(|x| x.into());
27315        self
27316    }
27317
27318    /// Sets the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
27319    ///
27320    /// # Example
27321    /// ```ignore,no_run
27322    /// # use google_cloud_sql_v1::model::Settings;
27323    /// use wkt::BoolValue;
27324    /// let x = Settings::new().set_enable_google_ml_integration(BoolValue::default()/* use setters */);
27325    /// ```
27326    pub fn set_enable_google_ml_integration<T>(mut self, v: T) -> Self
27327    where
27328        T: std::convert::Into<wkt::BoolValue>,
27329    {
27330        self.enable_google_ml_integration = std::option::Option::Some(v.into());
27331        self
27332    }
27333
27334    /// Sets or clears the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
27335    ///
27336    /// # Example
27337    /// ```ignore,no_run
27338    /// # use google_cloud_sql_v1::model::Settings;
27339    /// use wkt::BoolValue;
27340    /// let x = Settings::new().set_or_clear_enable_google_ml_integration(Some(BoolValue::default()/* use setters */));
27341    /// let x = Settings::new().set_or_clear_enable_google_ml_integration(None::<BoolValue>);
27342    /// ```
27343    pub fn set_or_clear_enable_google_ml_integration<T>(mut self, v: std::option::Option<T>) -> Self
27344    where
27345        T: std::convert::Into<wkt::BoolValue>,
27346    {
27347        self.enable_google_ml_integration = v.map(|x| x.into());
27348        self
27349    }
27350
27351    /// Sets the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
27352    ///
27353    /// # Example
27354    /// ```ignore,no_run
27355    /// # use google_cloud_sql_v1::model::Settings;
27356    /// use wkt::BoolValue;
27357    /// let x = Settings::new().set_enable_dataplex_integration(BoolValue::default()/* use setters */);
27358    /// ```
27359    pub fn set_enable_dataplex_integration<T>(mut self, v: T) -> Self
27360    where
27361        T: std::convert::Into<wkt::BoolValue>,
27362    {
27363        self.enable_dataplex_integration = std::option::Option::Some(v.into());
27364        self
27365    }
27366
27367    /// Sets or clears the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
27368    ///
27369    /// # Example
27370    /// ```ignore,no_run
27371    /// # use google_cloud_sql_v1::model::Settings;
27372    /// use wkt::BoolValue;
27373    /// let x = Settings::new().set_or_clear_enable_dataplex_integration(Some(BoolValue::default()/* use setters */));
27374    /// let x = Settings::new().set_or_clear_enable_dataplex_integration(None::<BoolValue>);
27375    /// ```
27376    pub fn set_or_clear_enable_dataplex_integration<T>(mut self, v: std::option::Option<T>) -> Self
27377    where
27378        T: std::convert::Into<wkt::BoolValue>,
27379    {
27380        self.enable_dataplex_integration = v.map(|x| x.into());
27381        self
27382    }
27383
27384    /// Sets the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
27385    ///
27386    /// # Example
27387    /// ```ignore,no_run
27388    /// # use google_cloud_sql_v1::model::Settings;
27389    /// use wkt::BoolValue;
27390    /// let x = Settings::new().set_retain_backups_on_delete(BoolValue::default()/* use setters */);
27391    /// ```
27392    pub fn set_retain_backups_on_delete<T>(mut self, v: T) -> Self
27393    where
27394        T: std::convert::Into<wkt::BoolValue>,
27395    {
27396        self.retain_backups_on_delete = std::option::Option::Some(v.into());
27397        self
27398    }
27399
27400    /// Sets or clears the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
27401    ///
27402    /// # Example
27403    /// ```ignore,no_run
27404    /// # use google_cloud_sql_v1::model::Settings;
27405    /// use wkt::BoolValue;
27406    /// let x = Settings::new().set_or_clear_retain_backups_on_delete(Some(BoolValue::default()/* use setters */));
27407    /// let x = Settings::new().set_or_clear_retain_backups_on_delete(None::<BoolValue>);
27408    /// ```
27409    pub fn set_or_clear_retain_backups_on_delete<T>(mut self, v: std::option::Option<T>) -> Self
27410    where
27411        T: std::convert::Into<wkt::BoolValue>,
27412    {
27413        self.retain_backups_on_delete = v.map(|x| x.into());
27414        self
27415    }
27416
27417    /// Sets the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
27418    ///
27419    /// # Example
27420    /// ```ignore,no_run
27421    /// # use google_cloud_sql_v1::model::Settings;
27422    /// let x = Settings::new().set_data_disk_provisioned_iops(42);
27423    /// ```
27424    pub fn set_data_disk_provisioned_iops<T>(mut self, v: T) -> Self
27425    where
27426        T: std::convert::Into<i64>,
27427    {
27428        self.data_disk_provisioned_iops = std::option::Option::Some(v.into());
27429        self
27430    }
27431
27432    /// Sets or clears the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
27433    ///
27434    /// # Example
27435    /// ```ignore,no_run
27436    /// # use google_cloud_sql_v1::model::Settings;
27437    /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(Some(42));
27438    /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(None::<i32>);
27439    /// ```
27440    pub fn set_or_clear_data_disk_provisioned_iops<T>(mut self, v: std::option::Option<T>) -> Self
27441    where
27442        T: std::convert::Into<i64>,
27443    {
27444        self.data_disk_provisioned_iops = v.map(|x| x.into());
27445        self
27446    }
27447
27448    /// Sets the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
27449    ///
27450    /// # Example
27451    /// ```ignore,no_run
27452    /// # use google_cloud_sql_v1::model::Settings;
27453    /// let x = Settings::new().set_data_disk_provisioned_throughput(42);
27454    /// ```
27455    pub fn set_data_disk_provisioned_throughput<T>(mut self, v: T) -> Self
27456    where
27457        T: std::convert::Into<i64>,
27458    {
27459        self.data_disk_provisioned_throughput = std::option::Option::Some(v.into());
27460        self
27461    }
27462
27463    /// Sets or clears the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
27464    ///
27465    /// # Example
27466    /// ```ignore,no_run
27467    /// # use google_cloud_sql_v1::model::Settings;
27468    /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(Some(42));
27469    /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(None::<i32>);
27470    /// ```
27471    pub fn set_or_clear_data_disk_provisioned_throughput<T>(
27472        mut self,
27473        v: std::option::Option<T>,
27474    ) -> Self
27475    where
27476        T: std::convert::Into<i64>,
27477    {
27478        self.data_disk_provisioned_throughput = v.map(|x| x.into());
27479        self
27480    }
27481
27482    /// Sets the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
27483    ///
27484    /// # Example
27485    /// ```ignore,no_run
27486    /// # use google_cloud_sql_v1::model::Settings;
27487    /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
27488    /// let x = Settings::new().set_connection_pool_config(ConnectionPoolConfig::default()/* use setters */);
27489    /// ```
27490    pub fn set_connection_pool_config<T>(mut self, v: T) -> Self
27491    where
27492        T: std::convert::Into<crate::model::ConnectionPoolConfig>,
27493    {
27494        self.connection_pool_config = std::option::Option::Some(v.into());
27495        self
27496    }
27497
27498    /// Sets or clears the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
27499    ///
27500    /// # Example
27501    /// ```ignore,no_run
27502    /// # use google_cloud_sql_v1::model::Settings;
27503    /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
27504    /// let x = Settings::new().set_or_clear_connection_pool_config(Some(ConnectionPoolConfig::default()/* use setters */));
27505    /// let x = Settings::new().set_or_clear_connection_pool_config(None::<ConnectionPoolConfig>);
27506    /// ```
27507    pub fn set_or_clear_connection_pool_config<T>(mut self, v: std::option::Option<T>) -> Self
27508    where
27509        T: std::convert::Into<crate::model::ConnectionPoolConfig>,
27510    {
27511        self.connection_pool_config = v.map(|x| x.into());
27512        self
27513    }
27514
27515    /// Sets the value of [final_backup_config][crate::model::Settings::final_backup_config].
27516    ///
27517    /// # Example
27518    /// ```ignore,no_run
27519    /// # use google_cloud_sql_v1::model::Settings;
27520    /// use google_cloud_sql_v1::model::FinalBackupConfig;
27521    /// let x = Settings::new().set_final_backup_config(FinalBackupConfig::default()/* use setters */);
27522    /// ```
27523    pub fn set_final_backup_config<T>(mut self, v: T) -> Self
27524    where
27525        T: std::convert::Into<crate::model::FinalBackupConfig>,
27526    {
27527        self.final_backup_config = std::option::Option::Some(v.into());
27528        self
27529    }
27530
27531    /// Sets or clears the value of [final_backup_config][crate::model::Settings::final_backup_config].
27532    ///
27533    /// # Example
27534    /// ```ignore,no_run
27535    /// # use google_cloud_sql_v1::model::Settings;
27536    /// use google_cloud_sql_v1::model::FinalBackupConfig;
27537    /// let x = Settings::new().set_or_clear_final_backup_config(Some(FinalBackupConfig::default()/* use setters */));
27538    /// let x = Settings::new().set_or_clear_final_backup_config(None::<FinalBackupConfig>);
27539    /// ```
27540    pub fn set_or_clear_final_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
27541    where
27542        T: std::convert::Into<crate::model::FinalBackupConfig>,
27543    {
27544        self.final_backup_config = v.map(|x| x.into());
27545        self
27546    }
27547
27548    /// Sets the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
27549    ///
27550    /// # Example
27551    /// ```ignore,no_run
27552    /// # use google_cloud_sql_v1::model::Settings;
27553    /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
27554    /// let x = Settings::new().set_read_pool_auto_scale_config(ReadPoolAutoScaleConfig::default()/* use setters */);
27555    /// ```
27556    pub fn set_read_pool_auto_scale_config<T>(mut self, v: T) -> Self
27557    where
27558        T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
27559    {
27560        self.read_pool_auto_scale_config = std::option::Option::Some(v.into());
27561        self
27562    }
27563
27564    /// Sets or clears the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
27565    ///
27566    /// # Example
27567    /// ```ignore,no_run
27568    /// # use google_cloud_sql_v1::model::Settings;
27569    /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
27570    /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(Some(ReadPoolAutoScaleConfig::default()/* use setters */));
27571    /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(None::<ReadPoolAutoScaleConfig>);
27572    /// ```
27573    pub fn set_or_clear_read_pool_auto_scale_config<T>(mut self, v: std::option::Option<T>) -> Self
27574    where
27575        T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
27576    {
27577        self.read_pool_auto_scale_config = v.map(|x| x.into());
27578        self
27579    }
27580
27581    /// Sets the value of [accelerated_replica_mode][crate::model::Settings::accelerated_replica_mode].
27582    ///
27583    /// # Example
27584    /// ```ignore,no_run
27585    /// # use google_cloud_sql_v1::model::Settings;
27586    /// use wkt::BoolValue;
27587    /// let x = Settings::new().set_accelerated_replica_mode(BoolValue::default()/* use setters */);
27588    /// ```
27589    pub fn set_accelerated_replica_mode<T>(mut self, v: T) -> Self
27590    where
27591        T: std::convert::Into<wkt::BoolValue>,
27592    {
27593        self.accelerated_replica_mode = std::option::Option::Some(v.into());
27594        self
27595    }
27596
27597    /// Sets or clears the value of [accelerated_replica_mode][crate::model::Settings::accelerated_replica_mode].
27598    ///
27599    /// # Example
27600    /// ```ignore,no_run
27601    /// # use google_cloud_sql_v1::model::Settings;
27602    /// use wkt::BoolValue;
27603    /// let x = Settings::new().set_or_clear_accelerated_replica_mode(Some(BoolValue::default()/* use setters */));
27604    /// let x = Settings::new().set_or_clear_accelerated_replica_mode(None::<BoolValue>);
27605    /// ```
27606    pub fn set_or_clear_accelerated_replica_mode<T>(mut self, v: std::option::Option<T>) -> Self
27607    where
27608        T: std::convert::Into<wkt::BoolValue>,
27609    {
27610        self.accelerated_replica_mode = v.map(|x| x.into());
27611        self
27612    }
27613
27614    /// Sets the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
27615    ///
27616    /// # Example
27617    /// ```ignore,no_run
27618    /// # use google_cloud_sql_v1::model::Settings;
27619    /// let x = Settings::new().set_auto_upgrade_enabled(true);
27620    /// ```
27621    pub fn set_auto_upgrade_enabled<T>(mut self, v: T) -> Self
27622    where
27623        T: std::convert::Into<bool>,
27624    {
27625        self.auto_upgrade_enabled = std::option::Option::Some(v.into());
27626        self
27627    }
27628
27629    /// Sets or clears the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
27630    ///
27631    /// # Example
27632    /// ```ignore,no_run
27633    /// # use google_cloud_sql_v1::model::Settings;
27634    /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(Some(false));
27635    /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(None::<bool>);
27636    /// ```
27637    pub fn set_or_clear_auto_upgrade_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27638    where
27639        T: std::convert::Into<bool>,
27640    {
27641        self.auto_upgrade_enabled = v.map(|x| x.into());
27642        self
27643    }
27644
27645    /// Sets the value of [entraid_config][crate::model::Settings::entraid_config].
27646    ///
27647    /// # Example
27648    /// ```ignore,no_run
27649    /// # use google_cloud_sql_v1::model::Settings;
27650    /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
27651    /// let x = Settings::new().set_entraid_config(SqlServerEntraIdConfig::default()/* use setters */);
27652    /// ```
27653    pub fn set_entraid_config<T>(mut self, v: T) -> Self
27654    where
27655        T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
27656    {
27657        self.entraid_config = std::option::Option::Some(v.into());
27658        self
27659    }
27660
27661    /// Sets or clears the value of [entraid_config][crate::model::Settings::entraid_config].
27662    ///
27663    /// # Example
27664    /// ```ignore,no_run
27665    /// # use google_cloud_sql_v1::model::Settings;
27666    /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
27667    /// let x = Settings::new().set_or_clear_entraid_config(Some(SqlServerEntraIdConfig::default()/* use setters */));
27668    /// let x = Settings::new().set_or_clear_entraid_config(None::<SqlServerEntraIdConfig>);
27669    /// ```
27670    pub fn set_or_clear_entraid_config<T>(mut self, v: std::option::Option<T>) -> Self
27671    where
27672        T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
27673    {
27674        self.entraid_config = v.map(|x| x.into());
27675        self
27676    }
27677
27678    /// Sets the value of [data_api_access][crate::model::Settings::data_api_access].
27679    ///
27680    /// # Example
27681    /// ```ignore,no_run
27682    /// # use google_cloud_sql_v1::model::Settings;
27683    /// use google_cloud_sql_v1::model::settings::DataApiAccess;
27684    /// let x0 = Settings::new().set_data_api_access(DataApiAccess::DisallowDataApi);
27685    /// let x1 = Settings::new().set_data_api_access(DataApiAccess::AllowDataApi);
27686    /// ```
27687    pub fn set_data_api_access<T>(mut self, v: T) -> Self
27688    where
27689        T: std::convert::Into<crate::model::settings::DataApiAccess>,
27690    {
27691        self.data_api_access = std::option::Option::Some(v.into());
27692        self
27693    }
27694
27695    /// Sets or clears the value of [data_api_access][crate::model::Settings::data_api_access].
27696    ///
27697    /// # Example
27698    /// ```ignore,no_run
27699    /// # use google_cloud_sql_v1::model::Settings;
27700    /// use google_cloud_sql_v1::model::settings::DataApiAccess;
27701    /// let x0 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::DisallowDataApi));
27702    /// let x1 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::AllowDataApi));
27703    /// let x_none = Settings::new().set_or_clear_data_api_access(None::<DataApiAccess>);
27704    /// ```
27705    pub fn set_or_clear_data_api_access<T>(mut self, v: std::option::Option<T>) -> Self
27706    where
27707        T: std::convert::Into<crate::model::settings::DataApiAccess>,
27708    {
27709        self.data_api_access = v.map(|x| x.into());
27710        self
27711    }
27712
27713    /// Sets the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
27714    ///
27715    /// # Example
27716    /// ```ignore,no_run
27717    /// # use google_cloud_sql_v1::model::Settings;
27718    /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27719    /// let x = Settings::new().set_performance_capture_config(PerformanceCaptureConfig::default()/* use setters */);
27720    /// ```
27721    pub fn set_performance_capture_config<T>(mut self, v: T) -> Self
27722    where
27723        T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
27724    {
27725        self.performance_capture_config = std::option::Option::Some(v.into());
27726        self
27727    }
27728
27729    /// Sets or clears the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
27730    ///
27731    /// # Example
27732    /// ```ignore,no_run
27733    /// # use google_cloud_sql_v1::model::Settings;
27734    /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27735    /// let x = Settings::new().set_or_clear_performance_capture_config(Some(PerformanceCaptureConfig::default()/* use setters */));
27736    /// let x = Settings::new().set_or_clear_performance_capture_config(None::<PerformanceCaptureConfig>);
27737    /// ```
27738    pub fn set_or_clear_performance_capture_config<T>(mut self, v: std::option::Option<T>) -> Self
27739    where
27740        T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
27741    {
27742        self.performance_capture_config = v.map(|x| x.into());
27743        self
27744    }
27745}
27746
27747impl wkt::message::Message for Settings {
27748    fn typename() -> &'static str {
27749        "type.googleapis.com/google.cloud.sql.v1.Settings"
27750    }
27751}
27752
27753/// Defines additional types related to [Settings].
27754pub mod settings {
27755    #[allow(unused_imports)]
27756    use super::*;
27757
27758    /// Specifies when the instance is activated.
27759    ///
27760    /// # Working with unknown values
27761    ///
27762    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27763    /// additional enum variants at any time. Adding new variants is not considered
27764    /// a breaking change. Applications should write their code in anticipation of:
27765    ///
27766    /// - New values appearing in future releases of the client library, **and**
27767    /// - New values received dynamically, without application changes.
27768    ///
27769    /// Please consult the [Working with enums] section in the user guide for some
27770    /// guidelines.
27771    ///
27772    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27773    #[derive(Clone, Debug, PartialEq)]
27774    #[non_exhaustive]
27775    pub enum SqlActivationPolicy {
27776        /// Unknown activation plan.
27777        Unspecified,
27778        /// The instance is always up and running.
27779        Always,
27780        /// The instance never starts.
27781        Never,
27782        /// The instance starts upon receiving requests.
27783        #[deprecated]
27784        OnDemand,
27785        /// If set, the enum was initialized with an unknown value.
27786        ///
27787        /// Applications can examine the value using [SqlActivationPolicy::value] or
27788        /// [SqlActivationPolicy::name].
27789        UnknownValue(sql_activation_policy::UnknownValue),
27790    }
27791
27792    #[doc(hidden)]
27793    pub mod sql_activation_policy {
27794        #[allow(unused_imports)]
27795        use super::*;
27796        #[derive(Clone, Debug, PartialEq)]
27797        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27798    }
27799
27800    impl SqlActivationPolicy {
27801        /// Gets the enum value.
27802        ///
27803        /// Returns `None` if the enum contains an unknown value deserialized from
27804        /// the string representation of enums.
27805        pub fn value(&self) -> std::option::Option<i32> {
27806            match self {
27807                Self::Unspecified => std::option::Option::Some(0),
27808                Self::Always => std::option::Option::Some(1),
27809                Self::Never => std::option::Option::Some(2),
27810                Self::OnDemand => std::option::Option::Some(3),
27811                Self::UnknownValue(u) => u.0.value(),
27812            }
27813        }
27814
27815        /// Gets the enum value as a string.
27816        ///
27817        /// Returns `None` if the enum contains an unknown value deserialized from
27818        /// the integer representation of enums.
27819        pub fn name(&self) -> std::option::Option<&str> {
27820            match self {
27821                Self::Unspecified => std::option::Option::Some("SQL_ACTIVATION_POLICY_UNSPECIFIED"),
27822                Self::Always => std::option::Option::Some("ALWAYS"),
27823                Self::Never => std::option::Option::Some("NEVER"),
27824                Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
27825                Self::UnknownValue(u) => u.0.name(),
27826            }
27827        }
27828    }
27829
27830    impl std::default::Default for SqlActivationPolicy {
27831        fn default() -> Self {
27832            use std::convert::From;
27833            Self::from(0)
27834        }
27835    }
27836
27837    impl std::fmt::Display for SqlActivationPolicy {
27838        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27839            wkt::internal::display_enum(f, self.name(), self.value())
27840        }
27841    }
27842
27843    impl std::convert::From<i32> for SqlActivationPolicy {
27844        fn from(value: i32) -> Self {
27845            match value {
27846                0 => Self::Unspecified,
27847                1 => Self::Always,
27848                2 => Self::Never,
27849                3 => Self::OnDemand,
27850                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
27851                    wkt::internal::UnknownEnumValue::Integer(value),
27852                )),
27853            }
27854        }
27855    }
27856
27857    impl std::convert::From<&str> for SqlActivationPolicy {
27858        fn from(value: &str) -> Self {
27859            use std::string::ToString;
27860            match value {
27861                "SQL_ACTIVATION_POLICY_UNSPECIFIED" => Self::Unspecified,
27862                "ALWAYS" => Self::Always,
27863                "NEVER" => Self::Never,
27864                "ON_DEMAND" => Self::OnDemand,
27865                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
27866                    wkt::internal::UnknownEnumValue::String(value.to_string()),
27867                )),
27868            }
27869        }
27870    }
27871
27872    impl serde::ser::Serialize for SqlActivationPolicy {
27873        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27874        where
27875            S: serde::Serializer,
27876        {
27877            match self {
27878                Self::Unspecified => serializer.serialize_i32(0),
27879                Self::Always => serializer.serialize_i32(1),
27880                Self::Never => serializer.serialize_i32(2),
27881                Self::OnDemand => serializer.serialize_i32(3),
27882                Self::UnknownValue(u) => u.0.serialize(serializer),
27883            }
27884        }
27885    }
27886
27887    impl<'de> serde::de::Deserialize<'de> for SqlActivationPolicy {
27888        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27889        where
27890            D: serde::Deserializer<'de>,
27891        {
27892            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlActivationPolicy>::new(
27893                ".google.cloud.sql.v1.Settings.SqlActivationPolicy",
27894            ))
27895        }
27896    }
27897
27898    /// The edition of the instance.
27899    ///
27900    /// # Working with unknown values
27901    ///
27902    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27903    /// additional enum variants at any time. Adding new variants is not considered
27904    /// a breaking change. Applications should write their code in anticipation of:
27905    ///
27906    /// - New values appearing in future releases of the client library, **and**
27907    /// - New values received dynamically, without application changes.
27908    ///
27909    /// Please consult the [Working with enums] section in the user guide for some
27910    /// guidelines.
27911    ///
27912    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27913    #[derive(Clone, Debug, PartialEq)]
27914    #[non_exhaustive]
27915    pub enum Edition {
27916        /// The instance did not specify the edition.
27917        Unspecified,
27918        /// The instance is an enterprise edition.
27919        Enterprise,
27920        /// The instance is an Enterprise Plus edition.
27921        EnterprisePlus,
27922        /// If set, the enum was initialized with an unknown value.
27923        ///
27924        /// Applications can examine the value using [Edition::value] or
27925        /// [Edition::name].
27926        UnknownValue(edition::UnknownValue),
27927    }
27928
27929    #[doc(hidden)]
27930    pub mod edition {
27931        #[allow(unused_imports)]
27932        use super::*;
27933        #[derive(Clone, Debug, PartialEq)]
27934        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27935    }
27936
27937    impl Edition {
27938        /// Gets the enum value.
27939        ///
27940        /// Returns `None` if the enum contains an unknown value deserialized from
27941        /// the string representation of enums.
27942        pub fn value(&self) -> std::option::Option<i32> {
27943            match self {
27944                Self::Unspecified => std::option::Option::Some(0),
27945                Self::Enterprise => std::option::Option::Some(2),
27946                Self::EnterprisePlus => std::option::Option::Some(3),
27947                Self::UnknownValue(u) => u.0.value(),
27948            }
27949        }
27950
27951        /// Gets the enum value as a string.
27952        ///
27953        /// Returns `None` if the enum contains an unknown value deserialized from
27954        /// the integer representation of enums.
27955        pub fn name(&self) -> std::option::Option<&str> {
27956            match self {
27957                Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
27958                Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
27959                Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
27960                Self::UnknownValue(u) => u.0.name(),
27961            }
27962        }
27963    }
27964
27965    impl std::default::Default for Edition {
27966        fn default() -> Self {
27967            use std::convert::From;
27968            Self::from(0)
27969        }
27970    }
27971
27972    impl std::fmt::Display for Edition {
27973        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27974            wkt::internal::display_enum(f, self.name(), self.value())
27975        }
27976    }
27977
27978    impl std::convert::From<i32> for Edition {
27979        fn from(value: i32) -> Self {
27980            match value {
27981                0 => Self::Unspecified,
27982                2 => Self::Enterprise,
27983                3 => Self::EnterprisePlus,
27984                _ => Self::UnknownValue(edition::UnknownValue(
27985                    wkt::internal::UnknownEnumValue::Integer(value),
27986                )),
27987            }
27988        }
27989    }
27990
27991    impl std::convert::From<&str> for Edition {
27992        fn from(value: &str) -> Self {
27993            use std::string::ToString;
27994            match value {
27995                "EDITION_UNSPECIFIED" => Self::Unspecified,
27996                "ENTERPRISE" => Self::Enterprise,
27997                "ENTERPRISE_PLUS" => Self::EnterprisePlus,
27998                _ => Self::UnknownValue(edition::UnknownValue(
27999                    wkt::internal::UnknownEnumValue::String(value.to_string()),
28000                )),
28001            }
28002        }
28003    }
28004
28005    impl serde::ser::Serialize for Edition {
28006        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28007        where
28008            S: serde::Serializer,
28009        {
28010            match self {
28011                Self::Unspecified => serializer.serialize_i32(0),
28012                Self::Enterprise => serializer.serialize_i32(2),
28013                Self::EnterprisePlus => serializer.serialize_i32(3),
28014                Self::UnknownValue(u) => u.0.serialize(serializer),
28015            }
28016        }
28017    }
28018
28019    impl<'de> serde::de::Deserialize<'de> for Edition {
28020        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28021        where
28022            D: serde::Deserializer<'de>,
28023        {
28024            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
28025                ".google.cloud.sql.v1.Settings.Edition",
28026            ))
28027        }
28028    }
28029
28030    /// The options for enforcing Cloud SQL connectors in the instance.
28031    ///
28032    /// # Working with unknown values
28033    ///
28034    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28035    /// additional enum variants at any time. Adding new variants is not considered
28036    /// a breaking change. Applications should write their code in anticipation of:
28037    ///
28038    /// - New values appearing in future releases of the client library, **and**
28039    /// - New values received dynamically, without application changes.
28040    ///
28041    /// Please consult the [Working with enums] section in the user guide for some
28042    /// guidelines.
28043    ///
28044    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28045    #[derive(Clone, Debug, PartialEq)]
28046    #[non_exhaustive]
28047    pub enum ConnectorEnforcement {
28048        /// The requirement for Cloud SQL connectors is unknown.
28049        Unspecified,
28050        /// Do not require Cloud SQL connectors.
28051        NotRequired,
28052        /// Require all connections to use Cloud SQL connectors, including the
28053        /// Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
28054        /// Note: This disables all existing authorized networks.
28055        Required,
28056        /// If set, the enum was initialized with an unknown value.
28057        ///
28058        /// Applications can examine the value using [ConnectorEnforcement::value] or
28059        /// [ConnectorEnforcement::name].
28060        UnknownValue(connector_enforcement::UnknownValue),
28061    }
28062
28063    #[doc(hidden)]
28064    pub mod connector_enforcement {
28065        #[allow(unused_imports)]
28066        use super::*;
28067        #[derive(Clone, Debug, PartialEq)]
28068        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28069    }
28070
28071    impl ConnectorEnforcement {
28072        /// Gets the enum value.
28073        ///
28074        /// Returns `None` if the enum contains an unknown value deserialized from
28075        /// the string representation of enums.
28076        pub fn value(&self) -> std::option::Option<i32> {
28077            match self {
28078                Self::Unspecified => std::option::Option::Some(0),
28079                Self::NotRequired => std::option::Option::Some(1),
28080                Self::Required => std::option::Option::Some(2),
28081                Self::UnknownValue(u) => u.0.value(),
28082            }
28083        }
28084
28085        /// Gets the enum value as a string.
28086        ///
28087        /// Returns `None` if the enum contains an unknown value deserialized from
28088        /// the integer representation of enums.
28089        pub fn name(&self) -> std::option::Option<&str> {
28090            match self {
28091                Self::Unspecified => std::option::Option::Some("CONNECTOR_ENFORCEMENT_UNSPECIFIED"),
28092                Self::NotRequired => std::option::Option::Some("NOT_REQUIRED"),
28093                Self::Required => std::option::Option::Some("REQUIRED"),
28094                Self::UnknownValue(u) => u.0.name(),
28095            }
28096        }
28097    }
28098
28099    impl std::default::Default for ConnectorEnforcement {
28100        fn default() -> Self {
28101            use std::convert::From;
28102            Self::from(0)
28103        }
28104    }
28105
28106    impl std::fmt::Display for ConnectorEnforcement {
28107        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28108            wkt::internal::display_enum(f, self.name(), self.value())
28109        }
28110    }
28111
28112    impl std::convert::From<i32> for ConnectorEnforcement {
28113        fn from(value: i32) -> Self {
28114            match value {
28115                0 => Self::Unspecified,
28116                1 => Self::NotRequired,
28117                2 => Self::Required,
28118                _ => Self::UnknownValue(connector_enforcement::UnknownValue(
28119                    wkt::internal::UnknownEnumValue::Integer(value),
28120                )),
28121            }
28122        }
28123    }
28124
28125    impl std::convert::From<&str> for ConnectorEnforcement {
28126        fn from(value: &str) -> Self {
28127            use std::string::ToString;
28128            match value {
28129                "CONNECTOR_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
28130                "NOT_REQUIRED" => Self::NotRequired,
28131                "REQUIRED" => Self::Required,
28132                _ => Self::UnknownValue(connector_enforcement::UnknownValue(
28133                    wkt::internal::UnknownEnumValue::String(value.to_string()),
28134                )),
28135            }
28136        }
28137    }
28138
28139    impl serde::ser::Serialize for ConnectorEnforcement {
28140        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28141        where
28142            S: serde::Serializer,
28143        {
28144            match self {
28145                Self::Unspecified => serializer.serialize_i32(0),
28146                Self::NotRequired => serializer.serialize_i32(1),
28147                Self::Required => serializer.serialize_i32(2),
28148                Self::UnknownValue(u) => u.0.serialize(serializer),
28149            }
28150        }
28151    }
28152
28153    impl<'de> serde::de::Deserialize<'de> for ConnectorEnforcement {
28154        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28155        where
28156            D: serde::Deserializer<'de>,
28157        {
28158            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectorEnforcement>::new(
28159                ".google.cloud.sql.v1.Settings.ConnectorEnforcement",
28160            ))
28161        }
28162    }
28163
28164    /// ExecuteSql API's access to the instance.
28165    ///
28166    /// # Working with unknown values
28167    ///
28168    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28169    /// additional enum variants at any time. Adding new variants is not considered
28170    /// a breaking change. Applications should write their code in anticipation of:
28171    ///
28172    /// - New values appearing in future releases of the client library, **and**
28173    /// - New values received dynamically, without application changes.
28174    ///
28175    /// Please consult the [Working with enums] section in the user guide for some
28176    /// guidelines.
28177    ///
28178    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28179    #[derive(Clone, Debug, PartialEq)]
28180    #[non_exhaustive]
28181    pub enum DataApiAccess {
28182        /// Unspecified, effectively the same as `DISALLOW_DATA_API`.
28183        Unspecified,
28184        /// Disallow using ExecuteSql API to connect to the instance.
28185        DisallowDataApi,
28186        /// Allow using ExecuteSql API to connect to the instance. For private IP
28187        /// instances, this allows authorized users to access the instance from
28188        /// the public internet using ExecuteSql API.
28189        AllowDataApi,
28190        /// If set, the enum was initialized with an unknown value.
28191        ///
28192        /// Applications can examine the value using [DataApiAccess::value] or
28193        /// [DataApiAccess::name].
28194        UnknownValue(data_api_access::UnknownValue),
28195    }
28196
28197    #[doc(hidden)]
28198    pub mod data_api_access {
28199        #[allow(unused_imports)]
28200        use super::*;
28201        #[derive(Clone, Debug, PartialEq)]
28202        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28203    }
28204
28205    impl DataApiAccess {
28206        /// Gets the enum value.
28207        ///
28208        /// Returns `None` if the enum contains an unknown value deserialized from
28209        /// the string representation of enums.
28210        pub fn value(&self) -> std::option::Option<i32> {
28211            match self {
28212                Self::Unspecified => std::option::Option::Some(0),
28213                Self::DisallowDataApi => std::option::Option::Some(1),
28214                Self::AllowDataApi => std::option::Option::Some(2),
28215                Self::UnknownValue(u) => u.0.value(),
28216            }
28217        }
28218
28219        /// Gets the enum value as a string.
28220        ///
28221        /// Returns `None` if the enum contains an unknown value deserialized from
28222        /// the integer representation of enums.
28223        pub fn name(&self) -> std::option::Option<&str> {
28224            match self {
28225                Self::Unspecified => std::option::Option::Some("DATA_API_ACCESS_UNSPECIFIED"),
28226                Self::DisallowDataApi => std::option::Option::Some("DISALLOW_DATA_API"),
28227                Self::AllowDataApi => std::option::Option::Some("ALLOW_DATA_API"),
28228                Self::UnknownValue(u) => u.0.name(),
28229            }
28230        }
28231    }
28232
28233    impl std::default::Default for DataApiAccess {
28234        fn default() -> Self {
28235            use std::convert::From;
28236            Self::from(0)
28237        }
28238    }
28239
28240    impl std::fmt::Display for DataApiAccess {
28241        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28242            wkt::internal::display_enum(f, self.name(), self.value())
28243        }
28244    }
28245
28246    impl std::convert::From<i32> for DataApiAccess {
28247        fn from(value: i32) -> Self {
28248            match value {
28249                0 => Self::Unspecified,
28250                1 => Self::DisallowDataApi,
28251                2 => Self::AllowDataApi,
28252                _ => Self::UnknownValue(data_api_access::UnknownValue(
28253                    wkt::internal::UnknownEnumValue::Integer(value),
28254                )),
28255            }
28256        }
28257    }
28258
28259    impl std::convert::From<&str> for DataApiAccess {
28260        fn from(value: &str) -> Self {
28261            use std::string::ToString;
28262            match value {
28263                "DATA_API_ACCESS_UNSPECIFIED" => Self::Unspecified,
28264                "DISALLOW_DATA_API" => Self::DisallowDataApi,
28265                "ALLOW_DATA_API" => Self::AllowDataApi,
28266                _ => Self::UnknownValue(data_api_access::UnknownValue(
28267                    wkt::internal::UnknownEnumValue::String(value.to_string()),
28268                )),
28269            }
28270        }
28271    }
28272
28273    impl serde::ser::Serialize for DataApiAccess {
28274        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28275        where
28276            S: serde::Serializer,
28277        {
28278            match self {
28279                Self::Unspecified => serializer.serialize_i32(0),
28280                Self::DisallowDataApi => serializer.serialize_i32(1),
28281                Self::AllowDataApi => serializer.serialize_i32(2),
28282                Self::UnknownValue(u) => u.0.serialize(serializer),
28283            }
28284        }
28285    }
28286
28287    impl<'de> serde::de::Deserialize<'de> for DataApiAccess {
28288        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28289        where
28290            D: serde::Deserializer<'de>,
28291        {
28292            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataApiAccess>::new(
28293                ".google.cloud.sql.v1.Settings.DataApiAccess",
28294            ))
28295        }
28296    }
28297}
28298
28299/// Performance capture configuration.
28300#[derive(Clone, Default, PartialEq)]
28301#[non_exhaustive]
28302pub struct PerformanceCaptureConfig {
28303    /// Optional. Enables or disables the performance capture feature.
28304    pub enabled: std::option::Option<bool>,
28305
28306    /// Optional. Specifies the interval in seconds between consecutive probes that
28307    /// check if any trigger condition thresholds have been reached.
28308    pub probing_interval_seconds: std::option::Option<i32>,
28309
28310    /// Optional. Specifies the minimum number of consecutive probe threshold that
28311    /// triggers performance capture.
28312    pub probe_threshold: std::option::Option<i32>,
28313
28314    /// Optional. Specifies the minimum number of MySQL `Threads_running` to
28315    /// trigger the performance capture on the primary instance.
28316    pub running_threads_threshold: std::option::Option<i32>,
28317
28318    /// Optional. Specifies the minimum number of seconds replica must be lagging
28319    /// behind primary instance to trigger the performance capture on replica.
28320    pub seconds_behind_source_threshold: std::option::Option<i32>,
28321
28322    /// Optional. Specifies the amount of time in seconds that a transaction needs
28323    /// to have been open before the watcher starts recording it.
28324    pub transaction_duration_threshold: std::option::Option<i32>,
28325
28326    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28327}
28328
28329impl PerformanceCaptureConfig {
28330    /// Creates a new default instance.
28331    pub fn new() -> Self {
28332        std::default::Default::default()
28333    }
28334
28335    /// Sets the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
28336    ///
28337    /// # Example
28338    /// ```ignore,no_run
28339    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28340    /// let x = PerformanceCaptureConfig::new().set_enabled(true);
28341    /// ```
28342    pub fn set_enabled<T>(mut self, v: T) -> Self
28343    where
28344        T: std::convert::Into<bool>,
28345    {
28346        self.enabled = std::option::Option::Some(v.into());
28347        self
28348    }
28349
28350    /// Sets or clears the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
28351    ///
28352    /// # Example
28353    /// ```ignore,no_run
28354    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28355    /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(Some(false));
28356    /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(None::<bool>);
28357    /// ```
28358    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28359    where
28360        T: std::convert::Into<bool>,
28361    {
28362        self.enabled = v.map(|x| x.into());
28363        self
28364    }
28365
28366    /// Sets the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
28367    ///
28368    /// # Example
28369    /// ```ignore,no_run
28370    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28371    /// let x = PerformanceCaptureConfig::new().set_probing_interval_seconds(42);
28372    /// ```
28373    pub fn set_probing_interval_seconds<T>(mut self, v: T) -> Self
28374    where
28375        T: std::convert::Into<i32>,
28376    {
28377        self.probing_interval_seconds = std::option::Option::Some(v.into());
28378        self
28379    }
28380
28381    /// Sets or clears the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
28382    ///
28383    /// # Example
28384    /// ```ignore,no_run
28385    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28386    /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(Some(42));
28387    /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(None::<i32>);
28388    /// ```
28389    pub fn set_or_clear_probing_interval_seconds<T>(mut self, v: std::option::Option<T>) -> Self
28390    where
28391        T: std::convert::Into<i32>,
28392    {
28393        self.probing_interval_seconds = v.map(|x| x.into());
28394        self
28395    }
28396
28397    /// Sets the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
28398    ///
28399    /// # Example
28400    /// ```ignore,no_run
28401    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28402    /// let x = PerformanceCaptureConfig::new().set_probe_threshold(42);
28403    /// ```
28404    pub fn set_probe_threshold<T>(mut self, v: T) -> Self
28405    where
28406        T: std::convert::Into<i32>,
28407    {
28408        self.probe_threshold = std::option::Option::Some(v.into());
28409        self
28410    }
28411
28412    /// Sets or clears the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
28413    ///
28414    /// # Example
28415    /// ```ignore,no_run
28416    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28417    /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(Some(42));
28418    /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(None::<i32>);
28419    /// ```
28420    pub fn set_or_clear_probe_threshold<T>(mut self, v: std::option::Option<T>) -> Self
28421    where
28422        T: std::convert::Into<i32>,
28423    {
28424        self.probe_threshold = v.map(|x| x.into());
28425        self
28426    }
28427
28428    /// Sets the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
28429    ///
28430    /// # Example
28431    /// ```ignore,no_run
28432    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28433    /// let x = PerformanceCaptureConfig::new().set_running_threads_threshold(42);
28434    /// ```
28435    pub fn set_running_threads_threshold<T>(mut self, v: T) -> Self
28436    where
28437        T: std::convert::Into<i32>,
28438    {
28439        self.running_threads_threshold = std::option::Option::Some(v.into());
28440        self
28441    }
28442
28443    /// Sets or clears the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
28444    ///
28445    /// # Example
28446    /// ```ignore,no_run
28447    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28448    /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(Some(42));
28449    /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(None::<i32>);
28450    /// ```
28451    pub fn set_or_clear_running_threads_threshold<T>(mut self, v: std::option::Option<T>) -> Self
28452    where
28453        T: std::convert::Into<i32>,
28454    {
28455        self.running_threads_threshold = v.map(|x| x.into());
28456        self
28457    }
28458
28459    /// Sets the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
28460    ///
28461    /// # Example
28462    /// ```ignore,no_run
28463    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28464    /// let x = PerformanceCaptureConfig::new().set_seconds_behind_source_threshold(42);
28465    /// ```
28466    pub fn set_seconds_behind_source_threshold<T>(mut self, v: T) -> Self
28467    where
28468        T: std::convert::Into<i32>,
28469    {
28470        self.seconds_behind_source_threshold = std::option::Option::Some(v.into());
28471        self
28472    }
28473
28474    /// Sets or clears the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
28475    ///
28476    /// # Example
28477    /// ```ignore,no_run
28478    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28479    /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(Some(42));
28480    /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(None::<i32>);
28481    /// ```
28482    pub fn set_or_clear_seconds_behind_source_threshold<T>(
28483        mut self,
28484        v: std::option::Option<T>,
28485    ) -> Self
28486    where
28487        T: std::convert::Into<i32>,
28488    {
28489        self.seconds_behind_source_threshold = v.map(|x| x.into());
28490        self
28491    }
28492
28493    /// Sets the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
28494    ///
28495    /// # Example
28496    /// ```ignore,no_run
28497    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28498    /// let x = PerformanceCaptureConfig::new().set_transaction_duration_threshold(42);
28499    /// ```
28500    pub fn set_transaction_duration_threshold<T>(mut self, v: T) -> Self
28501    where
28502        T: std::convert::Into<i32>,
28503    {
28504        self.transaction_duration_threshold = std::option::Option::Some(v.into());
28505        self
28506    }
28507
28508    /// Sets or clears the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
28509    ///
28510    /// # Example
28511    /// ```ignore,no_run
28512    /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28513    /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(Some(42));
28514    /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(None::<i32>);
28515    /// ```
28516    pub fn set_or_clear_transaction_duration_threshold<T>(
28517        mut self,
28518        v: std::option::Option<T>,
28519    ) -> Self
28520    where
28521        T: std::convert::Into<i32>,
28522    {
28523        self.transaction_duration_threshold = v.map(|x| x.into());
28524        self
28525    }
28526}
28527
28528impl wkt::message::Message for PerformanceCaptureConfig {
28529    fn typename() -> &'static str {
28530        "type.googleapis.com/google.cloud.sql.v1.PerformanceCaptureConfig"
28531    }
28532}
28533
28534/// Connection pool flags for Cloud SQL instances managed connection pool
28535/// configuration.
28536#[derive(Clone, Default, PartialEq)]
28537#[non_exhaustive]
28538pub struct ConnectionPoolFlags {
28539    /// Required. The name of the flag.
28540    pub name: std::string::String,
28541
28542    /// Required. The value of the flag. Boolean flags are set to `on` for true
28543    /// and `off` for false. This field must be omitted if the flag
28544    /// doesn't take a value.
28545    pub value: std::string::String,
28546
28547    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28548}
28549
28550impl ConnectionPoolFlags {
28551    /// Creates a new default instance.
28552    pub fn new() -> Self {
28553        std::default::Default::default()
28554    }
28555
28556    /// Sets the value of [name][crate::model::ConnectionPoolFlags::name].
28557    ///
28558    /// # Example
28559    /// ```ignore,no_run
28560    /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
28561    /// let x = ConnectionPoolFlags::new().set_name("example");
28562    /// ```
28563    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28564        self.name = v.into();
28565        self
28566    }
28567
28568    /// Sets the value of [value][crate::model::ConnectionPoolFlags::value].
28569    ///
28570    /// # Example
28571    /// ```ignore,no_run
28572    /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
28573    /// let x = ConnectionPoolFlags::new().set_value("example");
28574    /// ```
28575    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28576        self.value = v.into();
28577        self
28578    }
28579}
28580
28581impl wkt::message::Message for ConnectionPoolFlags {
28582    fn typename() -> &'static str {
28583        "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolFlags"
28584    }
28585}
28586
28587/// The managed connection pooling configuration.
28588#[derive(Clone, Default, PartialEq)]
28589#[non_exhaustive]
28590pub struct ConnectionPoolConfig {
28591    /// Whether managed connection pooling is enabled.
28592    pub connection_pooling_enabled: std::option::Option<bool>,
28593
28594    /// Optional. List of connection pool configuration flags.
28595    pub flags: std::vec::Vec<crate::model::ConnectionPoolFlags>,
28596
28597    /// Output only. Number of connection poolers.
28598    pub pooler_count: std::option::Option<i32>,
28599
28600    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28601}
28602
28603impl ConnectionPoolConfig {
28604    /// Creates a new default instance.
28605    pub fn new() -> Self {
28606        std::default::Default::default()
28607    }
28608
28609    /// Sets the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
28610    ///
28611    /// # Example
28612    /// ```ignore,no_run
28613    /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28614    /// let x = ConnectionPoolConfig::new().set_connection_pooling_enabled(true);
28615    /// ```
28616    pub fn set_connection_pooling_enabled<T>(mut self, v: T) -> Self
28617    where
28618        T: std::convert::Into<bool>,
28619    {
28620        self.connection_pooling_enabled = std::option::Option::Some(v.into());
28621        self
28622    }
28623
28624    /// Sets or clears the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
28625    ///
28626    /// # Example
28627    /// ```ignore,no_run
28628    /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28629    /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(Some(false));
28630    /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(None::<bool>);
28631    /// ```
28632    pub fn set_or_clear_connection_pooling_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28633    where
28634        T: std::convert::Into<bool>,
28635    {
28636        self.connection_pooling_enabled = v.map(|x| x.into());
28637        self
28638    }
28639
28640    /// Sets the value of [flags][crate::model::ConnectionPoolConfig::flags].
28641    ///
28642    /// # Example
28643    /// ```ignore,no_run
28644    /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28645    /// use google_cloud_sql_v1::model::ConnectionPoolFlags;
28646    /// let x = ConnectionPoolConfig::new()
28647    ///     .set_flags([
28648    ///         ConnectionPoolFlags::default()/* use setters */,
28649    ///         ConnectionPoolFlags::default()/* use (different) setters */,
28650    ///     ]);
28651    /// ```
28652    pub fn set_flags<T, V>(mut self, v: T) -> Self
28653    where
28654        T: std::iter::IntoIterator<Item = V>,
28655        V: std::convert::Into<crate::model::ConnectionPoolFlags>,
28656    {
28657        use std::iter::Iterator;
28658        self.flags = v.into_iter().map(|i| i.into()).collect();
28659        self
28660    }
28661
28662    /// Sets the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
28663    ///
28664    /// # Example
28665    /// ```ignore,no_run
28666    /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28667    /// let x = ConnectionPoolConfig::new().set_pooler_count(42);
28668    /// ```
28669    pub fn set_pooler_count<T>(mut self, v: T) -> Self
28670    where
28671        T: std::convert::Into<i32>,
28672    {
28673        self.pooler_count = std::option::Option::Some(v.into());
28674        self
28675    }
28676
28677    /// Sets or clears the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
28678    ///
28679    /// # Example
28680    /// ```ignore,no_run
28681    /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28682    /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(Some(42));
28683    /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(None::<i32>);
28684    /// ```
28685    pub fn set_or_clear_pooler_count<T>(mut self, v: std::option::Option<T>) -> Self
28686    where
28687        T: std::convert::Into<i32>,
28688    {
28689        self.pooler_count = v.map(|x| x.into());
28690        self
28691    }
28692}
28693
28694impl wkt::message::Message for ConnectionPoolConfig {
28695    fn typename() -> &'static str {
28696        "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolConfig"
28697    }
28698}
28699
28700/// The read pool auto-scale configuration.
28701#[derive(Clone, Default, PartialEq)]
28702#[non_exhaustive]
28703pub struct ReadPoolAutoScaleConfig {
28704    /// Indicates whether read pool auto scaling is enabled.
28705    pub enabled: std::option::Option<bool>,
28706
28707    /// Minimum number of read pool nodes to be maintained.
28708    pub min_node_count: std::option::Option<i32>,
28709
28710    /// Maximum number of read pool nodes to be maintained.
28711    pub max_node_count: std::option::Option<i32>,
28712
28713    /// Optional. Target metrics for read pool auto scaling.
28714    pub target_metrics: std::vec::Vec<crate::model::read_pool_auto_scale_config::TargetMetric>,
28715
28716    /// Indicates whether read pool auto scaling supports scale in operations
28717    /// (removing nodes).
28718    pub disable_scale_in: std::option::Option<bool>,
28719
28720    /// The cooldown period for scale-in operations.
28721    pub scale_in_cooldown_seconds: std::option::Option<i32>,
28722
28723    /// The cooldown period for scale-out operations.
28724    pub scale_out_cooldown_seconds: std::option::Option<i32>,
28725
28726    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28727}
28728
28729impl ReadPoolAutoScaleConfig {
28730    /// Creates a new default instance.
28731    pub fn new() -> Self {
28732        std::default::Default::default()
28733    }
28734
28735    /// Sets the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
28736    ///
28737    /// # Example
28738    /// ```ignore,no_run
28739    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28740    /// let x = ReadPoolAutoScaleConfig::new().set_enabled(true);
28741    /// ```
28742    pub fn set_enabled<T>(mut self, v: T) -> Self
28743    where
28744        T: std::convert::Into<bool>,
28745    {
28746        self.enabled = std::option::Option::Some(v.into());
28747        self
28748    }
28749
28750    /// Sets or clears the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
28751    ///
28752    /// # Example
28753    /// ```ignore,no_run
28754    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28755    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(Some(false));
28756    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(None::<bool>);
28757    /// ```
28758    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28759    where
28760        T: std::convert::Into<bool>,
28761    {
28762        self.enabled = v.map(|x| x.into());
28763        self
28764    }
28765
28766    /// Sets the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
28767    ///
28768    /// # Example
28769    /// ```ignore,no_run
28770    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28771    /// let x = ReadPoolAutoScaleConfig::new().set_min_node_count(42);
28772    /// ```
28773    pub fn set_min_node_count<T>(mut self, v: T) -> Self
28774    where
28775        T: std::convert::Into<i32>,
28776    {
28777        self.min_node_count = std::option::Option::Some(v.into());
28778        self
28779    }
28780
28781    /// Sets or clears the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
28782    ///
28783    /// # Example
28784    /// ```ignore,no_run
28785    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28786    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(Some(42));
28787    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(None::<i32>);
28788    /// ```
28789    pub fn set_or_clear_min_node_count<T>(mut self, v: std::option::Option<T>) -> Self
28790    where
28791        T: std::convert::Into<i32>,
28792    {
28793        self.min_node_count = v.map(|x| x.into());
28794        self
28795    }
28796
28797    /// Sets the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
28798    ///
28799    /// # Example
28800    /// ```ignore,no_run
28801    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28802    /// let x = ReadPoolAutoScaleConfig::new().set_max_node_count(42);
28803    /// ```
28804    pub fn set_max_node_count<T>(mut self, v: T) -> Self
28805    where
28806        T: std::convert::Into<i32>,
28807    {
28808        self.max_node_count = std::option::Option::Some(v.into());
28809        self
28810    }
28811
28812    /// Sets or clears the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
28813    ///
28814    /// # Example
28815    /// ```ignore,no_run
28816    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28817    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(Some(42));
28818    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(None::<i32>);
28819    /// ```
28820    pub fn set_or_clear_max_node_count<T>(mut self, v: std::option::Option<T>) -> Self
28821    where
28822        T: std::convert::Into<i32>,
28823    {
28824        self.max_node_count = v.map(|x| x.into());
28825        self
28826    }
28827
28828    /// Sets the value of [target_metrics][crate::model::ReadPoolAutoScaleConfig::target_metrics].
28829    ///
28830    /// # Example
28831    /// ```ignore,no_run
28832    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28833    /// use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28834    /// let x = ReadPoolAutoScaleConfig::new()
28835    ///     .set_target_metrics([
28836    ///         TargetMetric::default()/* use setters */,
28837    ///         TargetMetric::default()/* use (different) setters */,
28838    ///     ]);
28839    /// ```
28840    pub fn set_target_metrics<T, V>(mut self, v: T) -> Self
28841    where
28842        T: std::iter::IntoIterator<Item = V>,
28843        V: std::convert::Into<crate::model::read_pool_auto_scale_config::TargetMetric>,
28844    {
28845        use std::iter::Iterator;
28846        self.target_metrics = v.into_iter().map(|i| i.into()).collect();
28847        self
28848    }
28849
28850    /// Sets the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
28851    ///
28852    /// # Example
28853    /// ```ignore,no_run
28854    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28855    /// let x = ReadPoolAutoScaleConfig::new().set_disable_scale_in(true);
28856    /// ```
28857    pub fn set_disable_scale_in<T>(mut self, v: T) -> Self
28858    where
28859        T: std::convert::Into<bool>,
28860    {
28861        self.disable_scale_in = std::option::Option::Some(v.into());
28862        self
28863    }
28864
28865    /// Sets or clears the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
28866    ///
28867    /// # Example
28868    /// ```ignore,no_run
28869    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28870    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(Some(false));
28871    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(None::<bool>);
28872    /// ```
28873    pub fn set_or_clear_disable_scale_in<T>(mut self, v: std::option::Option<T>) -> Self
28874    where
28875        T: std::convert::Into<bool>,
28876    {
28877        self.disable_scale_in = v.map(|x| x.into());
28878        self
28879    }
28880
28881    /// Sets the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
28882    ///
28883    /// # Example
28884    /// ```ignore,no_run
28885    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28886    /// let x = ReadPoolAutoScaleConfig::new().set_scale_in_cooldown_seconds(42);
28887    /// ```
28888    pub fn set_scale_in_cooldown_seconds<T>(mut self, v: T) -> Self
28889    where
28890        T: std::convert::Into<i32>,
28891    {
28892        self.scale_in_cooldown_seconds = std::option::Option::Some(v.into());
28893        self
28894    }
28895
28896    /// Sets or clears the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
28897    ///
28898    /// # Example
28899    /// ```ignore,no_run
28900    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28901    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(Some(42));
28902    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(None::<i32>);
28903    /// ```
28904    pub fn set_or_clear_scale_in_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
28905    where
28906        T: std::convert::Into<i32>,
28907    {
28908        self.scale_in_cooldown_seconds = v.map(|x| x.into());
28909        self
28910    }
28911
28912    /// Sets the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
28913    ///
28914    /// # Example
28915    /// ```ignore,no_run
28916    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28917    /// let x = ReadPoolAutoScaleConfig::new().set_scale_out_cooldown_seconds(42);
28918    /// ```
28919    pub fn set_scale_out_cooldown_seconds<T>(mut self, v: T) -> Self
28920    where
28921        T: std::convert::Into<i32>,
28922    {
28923        self.scale_out_cooldown_seconds = std::option::Option::Some(v.into());
28924        self
28925    }
28926
28927    /// Sets or clears the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
28928    ///
28929    /// # Example
28930    /// ```ignore,no_run
28931    /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28932    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(Some(42));
28933    /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(None::<i32>);
28934    /// ```
28935    pub fn set_or_clear_scale_out_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
28936    where
28937        T: std::convert::Into<i32>,
28938    {
28939        self.scale_out_cooldown_seconds = v.map(|x| x.into());
28940        self
28941    }
28942}
28943
28944impl wkt::message::Message for ReadPoolAutoScaleConfig {
28945    fn typename() -> &'static str {
28946        "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig"
28947    }
28948}
28949
28950/// Defines additional types related to [ReadPoolAutoScaleConfig].
28951pub mod read_pool_auto_scale_config {
28952    #[allow(unused_imports)]
28953    use super::*;
28954
28955    /// Target metric for read pool auto scaling.
28956    #[derive(Clone, Default, PartialEq)]
28957    #[non_exhaustive]
28958    pub struct TargetMetric {
28959        /// The metric name to be used for auto scaling.
28960        pub metric: std::option::Option<std::string::String>,
28961
28962        /// The target value for the metric.
28963        pub target_value: std::option::Option<f32>,
28964
28965        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28966    }
28967
28968    impl TargetMetric {
28969        /// Creates a new default instance.
28970        pub fn new() -> Self {
28971            std::default::Default::default()
28972        }
28973
28974        /// Sets the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
28975        ///
28976        /// # Example
28977        /// ```ignore,no_run
28978        /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28979        /// let x = TargetMetric::new().set_metric("example");
28980        /// ```
28981        pub fn set_metric<T>(mut self, v: T) -> Self
28982        where
28983            T: std::convert::Into<std::string::String>,
28984        {
28985            self.metric = std::option::Option::Some(v.into());
28986            self
28987        }
28988
28989        /// Sets or clears the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
28990        ///
28991        /// # Example
28992        /// ```ignore,no_run
28993        /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28994        /// let x = TargetMetric::new().set_or_clear_metric(Some("example"));
28995        /// let x = TargetMetric::new().set_or_clear_metric(None::<String>);
28996        /// ```
28997        pub fn set_or_clear_metric<T>(mut self, v: std::option::Option<T>) -> Self
28998        where
28999            T: std::convert::Into<std::string::String>,
29000        {
29001            self.metric = v.map(|x| x.into());
29002            self
29003        }
29004
29005        /// Sets the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
29006        ///
29007        /// # Example
29008        /// ```ignore,no_run
29009        /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
29010        /// let x = TargetMetric::new().set_target_value(42.0);
29011        /// ```
29012        pub fn set_target_value<T>(mut self, v: T) -> Self
29013        where
29014            T: std::convert::Into<f32>,
29015        {
29016            self.target_value = std::option::Option::Some(v.into());
29017            self
29018        }
29019
29020        /// Sets or clears the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
29021        ///
29022        /// # Example
29023        /// ```ignore,no_run
29024        /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
29025        /// let x = TargetMetric::new().set_or_clear_target_value(Some(42.0));
29026        /// let x = TargetMetric::new().set_or_clear_target_value(None::<f32>);
29027        /// ```
29028        pub fn set_or_clear_target_value<T>(mut self, v: std::option::Option<T>) -> Self
29029        where
29030            T: std::convert::Into<f32>,
29031        {
29032            self.target_value = v.map(|x| x.into());
29033            self
29034        }
29035    }
29036
29037    impl wkt::message::Message for TargetMetric {
29038        fn typename() -> &'static str {
29039            "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric"
29040        }
29041    }
29042}
29043
29044/// Specifies options for controlling advanced machine features.
29045#[derive(Clone, Default, PartialEq)]
29046#[non_exhaustive]
29047pub struct AdvancedMachineFeatures {
29048    /// The number of threads per physical core.
29049    pub threads_per_core: i32,
29050
29051    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29052}
29053
29054impl AdvancedMachineFeatures {
29055    /// Creates a new default instance.
29056    pub fn new() -> Self {
29057        std::default::Default::default()
29058    }
29059
29060    /// Sets the value of [threads_per_core][crate::model::AdvancedMachineFeatures::threads_per_core].
29061    ///
29062    /// # Example
29063    /// ```ignore,no_run
29064    /// # use google_cloud_sql_v1::model::AdvancedMachineFeatures;
29065    /// let x = AdvancedMachineFeatures::new().set_threads_per_core(42);
29066    /// ```
29067    pub fn set_threads_per_core<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
29068        self.threads_per_core = v.into();
29069        self
29070    }
29071}
29072
29073impl wkt::message::Message for AdvancedMachineFeatures {
29074    fn typename() -> &'static str {
29075        "type.googleapis.com/google.cloud.sql.v1.AdvancedMachineFeatures"
29076    }
29077}
29078
29079/// SslCerts Resource
29080#[derive(Clone, Default, PartialEq)]
29081#[non_exhaustive]
29082pub struct SslCert {
29083    /// This is always `sql#sslCert`.
29084    pub kind: std::string::String,
29085
29086    /// Serial number, as extracted from the certificate.
29087    pub cert_serial_number: std::string::String,
29088
29089    /// PEM representation.
29090    pub cert: std::string::String,
29091
29092    /// The time when the certificate was created in [RFC
29093    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
29094    /// `2012-11-15T16:19:00.094Z`
29095    pub create_time: std::option::Option<wkt::Timestamp>,
29096
29097    /// User supplied name.  Constrained to [a-zA-Z.-_ ]+.
29098    pub common_name: std::string::String,
29099
29100    /// The time when the certificate expires in [RFC
29101    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
29102    /// `2012-11-15T16:19:00.094Z`.
29103    pub expiration_time: std::option::Option<wkt::Timestamp>,
29104
29105    /// Sha1 Fingerprint.
29106    pub sha1_fingerprint: std::string::String,
29107
29108    /// Name of the database instance.
29109    pub instance: std::string::String,
29110
29111    /// The URI of this resource.
29112    pub self_link: std::string::String,
29113
29114    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29115}
29116
29117impl SslCert {
29118    /// Creates a new default instance.
29119    pub fn new() -> Self {
29120        std::default::Default::default()
29121    }
29122
29123    /// Sets the value of [kind][crate::model::SslCert::kind].
29124    ///
29125    /// # Example
29126    /// ```ignore,no_run
29127    /// # use google_cloud_sql_v1::model::SslCert;
29128    /// let x = SslCert::new().set_kind("example");
29129    /// ```
29130    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29131        self.kind = v.into();
29132        self
29133    }
29134
29135    /// Sets the value of [cert_serial_number][crate::model::SslCert::cert_serial_number].
29136    ///
29137    /// # Example
29138    /// ```ignore,no_run
29139    /// # use google_cloud_sql_v1::model::SslCert;
29140    /// let x = SslCert::new().set_cert_serial_number("example");
29141    /// ```
29142    pub fn set_cert_serial_number<T: std::convert::Into<std::string::String>>(
29143        mut self,
29144        v: T,
29145    ) -> Self {
29146        self.cert_serial_number = v.into();
29147        self
29148    }
29149
29150    /// Sets the value of [cert][crate::model::SslCert::cert].
29151    ///
29152    /// # Example
29153    /// ```ignore,no_run
29154    /// # use google_cloud_sql_v1::model::SslCert;
29155    /// let x = SslCert::new().set_cert("example");
29156    /// ```
29157    pub fn set_cert<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29158        self.cert = v.into();
29159        self
29160    }
29161
29162    /// Sets the value of [create_time][crate::model::SslCert::create_time].
29163    ///
29164    /// # Example
29165    /// ```ignore,no_run
29166    /// # use google_cloud_sql_v1::model::SslCert;
29167    /// use wkt::Timestamp;
29168    /// let x = SslCert::new().set_create_time(Timestamp::default()/* use setters */);
29169    /// ```
29170    pub fn set_create_time<T>(mut self, v: T) -> Self
29171    where
29172        T: std::convert::Into<wkt::Timestamp>,
29173    {
29174        self.create_time = std::option::Option::Some(v.into());
29175        self
29176    }
29177
29178    /// Sets or clears the value of [create_time][crate::model::SslCert::create_time].
29179    ///
29180    /// # Example
29181    /// ```ignore,no_run
29182    /// # use google_cloud_sql_v1::model::SslCert;
29183    /// use wkt::Timestamp;
29184    /// let x = SslCert::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
29185    /// let x = SslCert::new().set_or_clear_create_time(None::<Timestamp>);
29186    /// ```
29187    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
29188    where
29189        T: std::convert::Into<wkt::Timestamp>,
29190    {
29191        self.create_time = v.map(|x| x.into());
29192        self
29193    }
29194
29195    /// Sets the value of [common_name][crate::model::SslCert::common_name].
29196    ///
29197    /// # Example
29198    /// ```ignore,no_run
29199    /// # use google_cloud_sql_v1::model::SslCert;
29200    /// let x = SslCert::new().set_common_name("example");
29201    /// ```
29202    pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29203        self.common_name = v.into();
29204        self
29205    }
29206
29207    /// Sets the value of [expiration_time][crate::model::SslCert::expiration_time].
29208    ///
29209    /// # Example
29210    /// ```ignore,no_run
29211    /// # use google_cloud_sql_v1::model::SslCert;
29212    /// use wkt::Timestamp;
29213    /// let x = SslCert::new().set_expiration_time(Timestamp::default()/* use setters */);
29214    /// ```
29215    pub fn set_expiration_time<T>(mut self, v: T) -> Self
29216    where
29217        T: std::convert::Into<wkt::Timestamp>,
29218    {
29219        self.expiration_time = std::option::Option::Some(v.into());
29220        self
29221    }
29222
29223    /// Sets or clears the value of [expiration_time][crate::model::SslCert::expiration_time].
29224    ///
29225    /// # Example
29226    /// ```ignore,no_run
29227    /// # use google_cloud_sql_v1::model::SslCert;
29228    /// use wkt::Timestamp;
29229    /// let x = SslCert::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
29230    /// let x = SslCert::new().set_or_clear_expiration_time(None::<Timestamp>);
29231    /// ```
29232    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
29233    where
29234        T: std::convert::Into<wkt::Timestamp>,
29235    {
29236        self.expiration_time = v.map(|x| x.into());
29237        self
29238    }
29239
29240    /// Sets the value of [sha1_fingerprint][crate::model::SslCert::sha1_fingerprint].
29241    ///
29242    /// # Example
29243    /// ```ignore,no_run
29244    /// # use google_cloud_sql_v1::model::SslCert;
29245    /// let x = SslCert::new().set_sha1_fingerprint("example");
29246    /// ```
29247    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
29248        mut self,
29249        v: T,
29250    ) -> Self {
29251        self.sha1_fingerprint = v.into();
29252        self
29253    }
29254
29255    /// Sets the value of [instance][crate::model::SslCert::instance].
29256    ///
29257    /// # Example
29258    /// ```ignore,no_run
29259    /// # use google_cloud_sql_v1::model::SslCert;
29260    /// let x = SslCert::new().set_instance("example");
29261    /// ```
29262    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29263        self.instance = v.into();
29264        self
29265    }
29266
29267    /// Sets the value of [self_link][crate::model::SslCert::self_link].
29268    ///
29269    /// # Example
29270    /// ```ignore,no_run
29271    /// # use google_cloud_sql_v1::model::SslCert;
29272    /// let x = SslCert::new().set_self_link("example");
29273    /// ```
29274    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29275        self.self_link = v.into();
29276        self
29277    }
29278}
29279
29280impl wkt::message::Message for SslCert {
29281    fn typename() -> &'static str {
29282        "type.googleapis.com/google.cloud.sql.v1.SslCert"
29283    }
29284}
29285
29286/// SslCertDetail.
29287#[derive(Clone, Default, PartialEq)]
29288#[non_exhaustive]
29289pub struct SslCertDetail {
29290    /// The public information about the cert.
29291    pub cert_info: std::option::Option<crate::model::SslCert>,
29292
29293    /// The private key for the client cert, in pem format.  Keep private in order
29294    /// to protect your security.
29295    pub cert_private_key: std::string::String,
29296
29297    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29298}
29299
29300impl SslCertDetail {
29301    /// Creates a new default instance.
29302    pub fn new() -> Self {
29303        std::default::Default::default()
29304    }
29305
29306    /// Sets the value of [cert_info][crate::model::SslCertDetail::cert_info].
29307    ///
29308    /// # Example
29309    /// ```ignore,no_run
29310    /// # use google_cloud_sql_v1::model::SslCertDetail;
29311    /// use google_cloud_sql_v1::model::SslCert;
29312    /// let x = SslCertDetail::new().set_cert_info(SslCert::default()/* use setters */);
29313    /// ```
29314    pub fn set_cert_info<T>(mut self, v: T) -> Self
29315    where
29316        T: std::convert::Into<crate::model::SslCert>,
29317    {
29318        self.cert_info = std::option::Option::Some(v.into());
29319        self
29320    }
29321
29322    /// Sets or clears the value of [cert_info][crate::model::SslCertDetail::cert_info].
29323    ///
29324    /// # Example
29325    /// ```ignore,no_run
29326    /// # use google_cloud_sql_v1::model::SslCertDetail;
29327    /// use google_cloud_sql_v1::model::SslCert;
29328    /// let x = SslCertDetail::new().set_or_clear_cert_info(Some(SslCert::default()/* use setters */));
29329    /// let x = SslCertDetail::new().set_or_clear_cert_info(None::<SslCert>);
29330    /// ```
29331    pub fn set_or_clear_cert_info<T>(mut self, v: std::option::Option<T>) -> Self
29332    where
29333        T: std::convert::Into<crate::model::SslCert>,
29334    {
29335        self.cert_info = v.map(|x| x.into());
29336        self
29337    }
29338
29339    /// Sets the value of [cert_private_key][crate::model::SslCertDetail::cert_private_key].
29340    ///
29341    /// # Example
29342    /// ```ignore,no_run
29343    /// # use google_cloud_sql_v1::model::SslCertDetail;
29344    /// let x = SslCertDetail::new().set_cert_private_key("example");
29345    /// ```
29346    pub fn set_cert_private_key<T: std::convert::Into<std::string::String>>(
29347        mut self,
29348        v: T,
29349    ) -> Self {
29350        self.cert_private_key = v.into();
29351        self
29352    }
29353}
29354
29355impl wkt::message::Message for SslCertDetail {
29356    fn typename() -> &'static str {
29357        "type.googleapis.com/google.cloud.sql.v1.SslCertDetail"
29358    }
29359}
29360
29361/// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
29362#[derive(Clone, Default, PartialEq)]
29363#[non_exhaustive]
29364pub struct SqlActiveDirectoryConfig {
29365    /// This is always sql#activeDirectoryConfig.
29366    pub kind: std::string::String,
29367
29368    /// The name of the domain (e.g., mydomain.com).
29369    pub domain: std::string::String,
29370
29371    /// Optional. The mode of the Active Directory configuration.
29372    pub mode: crate::model::sql_active_directory_config::ActiveDirectoryMode,
29373
29374    /// Optional. Domain controller IPv4 addresses used to bootstrap Active
29375    /// Directory.
29376    pub dns_servers: std::vec::Vec<std::string::String>,
29377
29378    /// Optional. The secret manager key storing the administrator credential.
29379    /// (e.g., projects/{project}/secrets/{secret}).
29380    pub admin_credential_secret_name: std::string::String,
29381
29382    /// Optional. The organizational unit distinguished name. This is the full
29383    /// hierarchical path to the organizational unit.
29384    pub organizational_unit: std::string::String,
29385
29386    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29387}
29388
29389impl SqlActiveDirectoryConfig {
29390    /// Creates a new default instance.
29391    pub fn new() -> Self {
29392        std::default::Default::default()
29393    }
29394
29395    /// Sets the value of [kind][crate::model::SqlActiveDirectoryConfig::kind].
29396    ///
29397    /// # Example
29398    /// ```ignore,no_run
29399    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
29400    /// let x = SqlActiveDirectoryConfig::new().set_kind("example");
29401    /// ```
29402    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29403        self.kind = v.into();
29404        self
29405    }
29406
29407    /// Sets the value of [domain][crate::model::SqlActiveDirectoryConfig::domain].
29408    ///
29409    /// # Example
29410    /// ```ignore,no_run
29411    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
29412    /// let x = SqlActiveDirectoryConfig::new().set_domain("example");
29413    /// ```
29414    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29415        self.domain = v.into();
29416        self
29417    }
29418
29419    /// Sets the value of [mode][crate::model::SqlActiveDirectoryConfig::mode].
29420    ///
29421    /// # Example
29422    /// ```ignore,no_run
29423    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
29424    /// use google_cloud_sql_v1::model::sql_active_directory_config::ActiveDirectoryMode;
29425    /// let x0 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::ManagedActiveDirectory);
29426    /// let x1 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::CustomerManagedActiveDirectory);
29427    /// ```
29428    pub fn set_mode<
29429        T: std::convert::Into<crate::model::sql_active_directory_config::ActiveDirectoryMode>,
29430    >(
29431        mut self,
29432        v: T,
29433    ) -> Self {
29434        self.mode = v.into();
29435        self
29436    }
29437
29438    /// Sets the value of [dns_servers][crate::model::SqlActiveDirectoryConfig::dns_servers].
29439    ///
29440    /// # Example
29441    /// ```ignore,no_run
29442    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
29443    /// let x = SqlActiveDirectoryConfig::new().set_dns_servers(["a", "b", "c"]);
29444    /// ```
29445    pub fn set_dns_servers<T, V>(mut self, v: T) -> Self
29446    where
29447        T: std::iter::IntoIterator<Item = V>,
29448        V: std::convert::Into<std::string::String>,
29449    {
29450        use std::iter::Iterator;
29451        self.dns_servers = v.into_iter().map(|i| i.into()).collect();
29452        self
29453    }
29454
29455    /// Sets the value of [admin_credential_secret_name][crate::model::SqlActiveDirectoryConfig::admin_credential_secret_name].
29456    ///
29457    /// # Example
29458    /// ```ignore,no_run
29459    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
29460    /// let x = SqlActiveDirectoryConfig::new().set_admin_credential_secret_name("example");
29461    /// ```
29462    pub fn set_admin_credential_secret_name<T: std::convert::Into<std::string::String>>(
29463        mut self,
29464        v: T,
29465    ) -> Self {
29466        self.admin_credential_secret_name = v.into();
29467        self
29468    }
29469
29470    /// Sets the value of [organizational_unit][crate::model::SqlActiveDirectoryConfig::organizational_unit].
29471    ///
29472    /// # Example
29473    /// ```ignore,no_run
29474    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
29475    /// let x = SqlActiveDirectoryConfig::new().set_organizational_unit("example");
29476    /// ```
29477    pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
29478        mut self,
29479        v: T,
29480    ) -> Self {
29481        self.organizational_unit = v.into();
29482        self
29483    }
29484}
29485
29486impl wkt::message::Message for SqlActiveDirectoryConfig {
29487    fn typename() -> &'static str {
29488        "type.googleapis.com/google.cloud.sql.v1.SqlActiveDirectoryConfig"
29489    }
29490}
29491
29492/// Defines additional types related to [SqlActiveDirectoryConfig].
29493pub mod sql_active_directory_config {
29494    #[allow(unused_imports)]
29495    use super::*;
29496
29497    /// The modes of Active Directory configuration.
29498    ///
29499    /// # Working with unknown values
29500    ///
29501    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29502    /// additional enum variants at any time. Adding new variants is not considered
29503    /// a breaking change. Applications should write their code in anticipation of:
29504    ///
29505    /// - New values appearing in future releases of the client library, **and**
29506    /// - New values received dynamically, without application changes.
29507    ///
29508    /// Please consult the [Working with enums] section in the user guide for some
29509    /// guidelines.
29510    ///
29511    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
29512    #[derive(Clone, Debug, PartialEq)]
29513    #[non_exhaustive]
29514    pub enum ActiveDirectoryMode {
29515        /// Unspecified mode. Will default to MANAGED_ACTIVE_DIRECTORY if the mode is
29516        /// not specified to maintain backward compatibility.
29517        Unspecified,
29518        /// Managed Active Directory mode.
29519        ManagedActiveDirectory,
29520        /// Deprecated: Use CUSTOMER_MANAGED_ACTIVE_DIRECTORY instead.
29521        #[deprecated]
29522        SelfManagedActiveDirectory,
29523        /// Customer-managed Active Directory mode.
29524        CustomerManagedActiveDirectory,
29525        /// If set, the enum was initialized with an unknown value.
29526        ///
29527        /// Applications can examine the value using [ActiveDirectoryMode::value] or
29528        /// [ActiveDirectoryMode::name].
29529        UnknownValue(active_directory_mode::UnknownValue),
29530    }
29531
29532    #[doc(hidden)]
29533    pub mod active_directory_mode {
29534        #[allow(unused_imports)]
29535        use super::*;
29536        #[derive(Clone, Debug, PartialEq)]
29537        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29538    }
29539
29540    impl ActiveDirectoryMode {
29541        /// Gets the enum value.
29542        ///
29543        /// Returns `None` if the enum contains an unknown value deserialized from
29544        /// the string representation of enums.
29545        pub fn value(&self) -> std::option::Option<i32> {
29546            match self {
29547                Self::Unspecified => std::option::Option::Some(0),
29548                Self::ManagedActiveDirectory => std::option::Option::Some(1),
29549                Self::SelfManagedActiveDirectory => std::option::Option::Some(2),
29550                Self::CustomerManagedActiveDirectory => std::option::Option::Some(3),
29551                Self::UnknownValue(u) => u.0.value(),
29552            }
29553        }
29554
29555        /// Gets the enum value as a string.
29556        ///
29557        /// Returns `None` if the enum contains an unknown value deserialized from
29558        /// the integer representation of enums.
29559        pub fn name(&self) -> std::option::Option<&str> {
29560            match self {
29561                Self::Unspecified => std::option::Option::Some("ACTIVE_DIRECTORY_MODE_UNSPECIFIED"),
29562                Self::ManagedActiveDirectory => {
29563                    std::option::Option::Some("MANAGED_ACTIVE_DIRECTORY")
29564                }
29565                Self::SelfManagedActiveDirectory => {
29566                    std::option::Option::Some("SELF_MANAGED_ACTIVE_DIRECTORY")
29567                }
29568                Self::CustomerManagedActiveDirectory => {
29569                    std::option::Option::Some("CUSTOMER_MANAGED_ACTIVE_DIRECTORY")
29570                }
29571                Self::UnknownValue(u) => u.0.name(),
29572            }
29573        }
29574    }
29575
29576    impl std::default::Default for ActiveDirectoryMode {
29577        fn default() -> Self {
29578            use std::convert::From;
29579            Self::from(0)
29580        }
29581    }
29582
29583    impl std::fmt::Display for ActiveDirectoryMode {
29584        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29585            wkt::internal::display_enum(f, self.name(), self.value())
29586        }
29587    }
29588
29589    impl std::convert::From<i32> for ActiveDirectoryMode {
29590        fn from(value: i32) -> Self {
29591            match value {
29592                0 => Self::Unspecified,
29593                1 => Self::ManagedActiveDirectory,
29594                2 => Self::SelfManagedActiveDirectory,
29595                3 => Self::CustomerManagedActiveDirectory,
29596                _ => Self::UnknownValue(active_directory_mode::UnknownValue(
29597                    wkt::internal::UnknownEnumValue::Integer(value),
29598                )),
29599            }
29600        }
29601    }
29602
29603    impl std::convert::From<&str> for ActiveDirectoryMode {
29604        fn from(value: &str) -> Self {
29605            use std::string::ToString;
29606            match value {
29607                "ACTIVE_DIRECTORY_MODE_UNSPECIFIED" => Self::Unspecified,
29608                "MANAGED_ACTIVE_DIRECTORY" => Self::ManagedActiveDirectory,
29609                "SELF_MANAGED_ACTIVE_DIRECTORY" => Self::SelfManagedActiveDirectory,
29610                "CUSTOMER_MANAGED_ACTIVE_DIRECTORY" => Self::CustomerManagedActiveDirectory,
29611                _ => Self::UnknownValue(active_directory_mode::UnknownValue(
29612                    wkt::internal::UnknownEnumValue::String(value.to_string()),
29613                )),
29614            }
29615        }
29616    }
29617
29618    impl serde::ser::Serialize for ActiveDirectoryMode {
29619        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29620        where
29621            S: serde::Serializer,
29622        {
29623            match self {
29624                Self::Unspecified => serializer.serialize_i32(0),
29625                Self::ManagedActiveDirectory => serializer.serialize_i32(1),
29626                Self::SelfManagedActiveDirectory => serializer.serialize_i32(2),
29627                Self::CustomerManagedActiveDirectory => serializer.serialize_i32(3),
29628                Self::UnknownValue(u) => u.0.serialize(serializer),
29629            }
29630        }
29631    }
29632
29633    impl<'de> serde::de::Deserialize<'de> for ActiveDirectoryMode {
29634        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29635        where
29636            D: serde::Deserializer<'de>,
29637        {
29638            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActiveDirectoryMode>::new(
29639                ".google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode",
29640            ))
29641        }
29642    }
29643}
29644
29645/// SQL Server specific audit configuration.
29646#[derive(Clone, Default, PartialEq)]
29647#[non_exhaustive]
29648pub struct SqlServerAuditConfig {
29649    /// This is always sql#sqlServerAuditConfig
29650    pub kind: std::string::String,
29651
29652    /// The name of the destination bucket (e.g., gs://mybucket).
29653    pub bucket: std::string::String,
29654
29655    /// How long to keep generated audit files.
29656    pub retention_interval: std::option::Option<wkt::Duration>,
29657
29658    /// How often to upload generated audit files.
29659    pub upload_interval: std::option::Option<wkt::Duration>,
29660
29661    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29662}
29663
29664impl SqlServerAuditConfig {
29665    /// Creates a new default instance.
29666    pub fn new() -> Self {
29667        std::default::Default::default()
29668    }
29669
29670    /// Sets the value of [kind][crate::model::SqlServerAuditConfig::kind].
29671    ///
29672    /// # Example
29673    /// ```ignore,no_run
29674    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29675    /// let x = SqlServerAuditConfig::new().set_kind("example");
29676    /// ```
29677    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29678        self.kind = v.into();
29679        self
29680    }
29681
29682    /// Sets the value of [bucket][crate::model::SqlServerAuditConfig::bucket].
29683    ///
29684    /// # Example
29685    /// ```ignore,no_run
29686    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29687    /// let x = SqlServerAuditConfig::new().set_bucket("example");
29688    /// ```
29689    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29690        self.bucket = v.into();
29691        self
29692    }
29693
29694    /// Sets the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
29695    ///
29696    /// # Example
29697    /// ```ignore,no_run
29698    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29699    /// use wkt::Duration;
29700    /// let x = SqlServerAuditConfig::new().set_retention_interval(Duration::default()/* use setters */);
29701    /// ```
29702    pub fn set_retention_interval<T>(mut self, v: T) -> Self
29703    where
29704        T: std::convert::Into<wkt::Duration>,
29705    {
29706        self.retention_interval = std::option::Option::Some(v.into());
29707        self
29708    }
29709
29710    /// Sets or clears the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
29711    ///
29712    /// # Example
29713    /// ```ignore,no_run
29714    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29715    /// use wkt::Duration;
29716    /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(Some(Duration::default()/* use setters */));
29717    /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(None::<Duration>);
29718    /// ```
29719    pub fn set_or_clear_retention_interval<T>(mut self, v: std::option::Option<T>) -> Self
29720    where
29721        T: std::convert::Into<wkt::Duration>,
29722    {
29723        self.retention_interval = v.map(|x| x.into());
29724        self
29725    }
29726
29727    /// Sets the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
29728    ///
29729    /// # Example
29730    /// ```ignore,no_run
29731    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29732    /// use wkt::Duration;
29733    /// let x = SqlServerAuditConfig::new().set_upload_interval(Duration::default()/* use setters */);
29734    /// ```
29735    pub fn set_upload_interval<T>(mut self, v: T) -> Self
29736    where
29737        T: std::convert::Into<wkt::Duration>,
29738    {
29739        self.upload_interval = std::option::Option::Some(v.into());
29740        self
29741    }
29742
29743    /// Sets or clears the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
29744    ///
29745    /// # Example
29746    /// ```ignore,no_run
29747    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29748    /// use wkt::Duration;
29749    /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(Some(Duration::default()/* use setters */));
29750    /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(None::<Duration>);
29751    /// ```
29752    pub fn set_or_clear_upload_interval<T>(mut self, v: std::option::Option<T>) -> Self
29753    where
29754        T: std::convert::Into<wkt::Duration>,
29755    {
29756        self.upload_interval = v.map(|x| x.into());
29757        self
29758    }
29759}
29760
29761impl wkt::message::Message for SqlServerAuditConfig {
29762    fn typename() -> &'static str {
29763        "type.googleapis.com/google.cloud.sql.v1.SqlServerAuditConfig"
29764    }
29765}
29766
29767/// SQL Server Entra ID configuration.
29768#[derive(Clone, Default, PartialEq)]
29769#[non_exhaustive]
29770pub struct SqlServerEntraIdConfig {
29771    /// Output only. This is always sql#sqlServerEntraIdConfig
29772    pub kind: std::string::String,
29773
29774    /// Optional. The tenant ID for the Entra ID configuration.
29775    pub tenant_id: std::string::String,
29776
29777    /// Optional. The application ID for the Entra ID configuration.
29778    pub application_id: std::string::String,
29779
29780    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29781}
29782
29783impl SqlServerEntraIdConfig {
29784    /// Creates a new default instance.
29785    pub fn new() -> Self {
29786        std::default::Default::default()
29787    }
29788
29789    /// Sets the value of [kind][crate::model::SqlServerEntraIdConfig::kind].
29790    ///
29791    /// # Example
29792    /// ```ignore,no_run
29793    /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29794    /// let x = SqlServerEntraIdConfig::new().set_kind("example");
29795    /// ```
29796    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29797        self.kind = v.into();
29798        self
29799    }
29800
29801    /// Sets the value of [tenant_id][crate::model::SqlServerEntraIdConfig::tenant_id].
29802    ///
29803    /// # Example
29804    /// ```ignore,no_run
29805    /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29806    /// let x = SqlServerEntraIdConfig::new().set_tenant_id("example");
29807    /// ```
29808    pub fn set_tenant_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29809        self.tenant_id = v.into();
29810        self
29811    }
29812
29813    /// Sets the value of [application_id][crate::model::SqlServerEntraIdConfig::application_id].
29814    ///
29815    /// # Example
29816    /// ```ignore,no_run
29817    /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29818    /// let x = SqlServerEntraIdConfig::new().set_application_id("example");
29819    /// ```
29820    pub fn set_application_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29821        self.application_id = v.into();
29822        self
29823    }
29824}
29825
29826impl wkt::message::Message for SqlServerEntraIdConfig {
29827    fn typename() -> &'static str {
29828        "type.googleapis.com/google.cloud.sql.v1.SqlServerEntraIdConfig"
29829    }
29830}
29831
29832/// Acquire SSRS lease context.
29833#[derive(Clone, Default, PartialEq)]
29834#[non_exhaustive]
29835pub struct AcquireSsrsLeaseContext {
29836    /// The username to be used as the setup login to connect to the database
29837    /// server for SSRS setup.
29838    pub setup_login: std::option::Option<std::string::String>,
29839
29840    /// The username to be used as the service login to connect to the report
29841    /// database for SSRS setup.
29842    pub service_login: std::option::Option<std::string::String>,
29843
29844    /// The report database to be used for SSRS setup.
29845    pub report_database: std::option::Option<std::string::String>,
29846
29847    /// Lease duration needed for SSRS setup.
29848    pub duration: std::option::Option<wkt::Duration>,
29849
29850    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29851}
29852
29853impl AcquireSsrsLeaseContext {
29854    /// Creates a new default instance.
29855    pub fn new() -> Self {
29856        std::default::Default::default()
29857    }
29858
29859    /// Sets the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
29860    ///
29861    /// # Example
29862    /// ```ignore,no_run
29863    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29864    /// let x = AcquireSsrsLeaseContext::new().set_setup_login("example");
29865    /// ```
29866    pub fn set_setup_login<T>(mut self, v: T) -> Self
29867    where
29868        T: std::convert::Into<std::string::String>,
29869    {
29870        self.setup_login = std::option::Option::Some(v.into());
29871        self
29872    }
29873
29874    /// Sets or clears the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
29875    ///
29876    /// # Example
29877    /// ```ignore,no_run
29878    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29879    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(Some("example"));
29880    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(None::<String>);
29881    /// ```
29882    pub fn set_or_clear_setup_login<T>(mut self, v: std::option::Option<T>) -> Self
29883    where
29884        T: std::convert::Into<std::string::String>,
29885    {
29886        self.setup_login = v.map(|x| x.into());
29887        self
29888    }
29889
29890    /// Sets the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
29891    ///
29892    /// # Example
29893    /// ```ignore,no_run
29894    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29895    /// let x = AcquireSsrsLeaseContext::new().set_service_login("example");
29896    /// ```
29897    pub fn set_service_login<T>(mut self, v: T) -> Self
29898    where
29899        T: std::convert::Into<std::string::String>,
29900    {
29901        self.service_login = std::option::Option::Some(v.into());
29902        self
29903    }
29904
29905    /// Sets or clears the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
29906    ///
29907    /// # Example
29908    /// ```ignore,no_run
29909    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29910    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(Some("example"));
29911    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(None::<String>);
29912    /// ```
29913    pub fn set_or_clear_service_login<T>(mut self, v: std::option::Option<T>) -> Self
29914    where
29915        T: std::convert::Into<std::string::String>,
29916    {
29917        self.service_login = v.map(|x| x.into());
29918        self
29919    }
29920
29921    /// Sets the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
29922    ///
29923    /// # Example
29924    /// ```ignore,no_run
29925    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29926    /// let x = AcquireSsrsLeaseContext::new().set_report_database("example");
29927    /// ```
29928    pub fn set_report_database<T>(mut self, v: T) -> Self
29929    where
29930        T: std::convert::Into<std::string::String>,
29931    {
29932        self.report_database = std::option::Option::Some(v.into());
29933        self
29934    }
29935
29936    /// Sets or clears the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
29937    ///
29938    /// # Example
29939    /// ```ignore,no_run
29940    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29941    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(Some("example"));
29942    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(None::<String>);
29943    /// ```
29944    pub fn set_or_clear_report_database<T>(mut self, v: std::option::Option<T>) -> Self
29945    where
29946        T: std::convert::Into<std::string::String>,
29947    {
29948        self.report_database = v.map(|x| x.into());
29949        self
29950    }
29951
29952    /// Sets the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
29953    ///
29954    /// # Example
29955    /// ```ignore,no_run
29956    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29957    /// use wkt::Duration;
29958    /// let x = AcquireSsrsLeaseContext::new().set_duration(Duration::default()/* use setters */);
29959    /// ```
29960    pub fn set_duration<T>(mut self, v: T) -> Self
29961    where
29962        T: std::convert::Into<wkt::Duration>,
29963    {
29964        self.duration = std::option::Option::Some(v.into());
29965        self
29966    }
29967
29968    /// Sets or clears the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
29969    ///
29970    /// # Example
29971    /// ```ignore,no_run
29972    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29973    /// use wkt::Duration;
29974    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
29975    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(None::<Duration>);
29976    /// ```
29977    pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
29978    where
29979        T: std::convert::Into<wkt::Duration>,
29980    {
29981        self.duration = v.map(|x| x.into());
29982        self
29983    }
29984}
29985
29986impl wkt::message::Message for AcquireSsrsLeaseContext {
29987    fn typename() -> &'static str {
29988        "type.googleapis.com/google.cloud.sql.v1.AcquireSsrsLeaseContext"
29989    }
29990}
29991
29992/// DNS metadata.
29993#[derive(Clone, Default, PartialEq)]
29994#[non_exhaustive]
29995pub struct DnsNameMapping {
29996    /// Output only. The DNS name.
29997    pub name: std::string::String,
29998
29999    /// Output only. The connection type of the DNS name.
30000    pub connection_type: crate::model::dns_name_mapping::ConnectionType,
30001
30002    /// Output only. The scope that the DNS name applies to.
30003    pub dns_scope: crate::model::dns_name_mapping::DnsScope,
30004
30005    /// Output only. The manager for this DNS record.
30006    pub record_manager: crate::model::dns_name_mapping::RecordManager,
30007
30008    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30009}
30010
30011impl DnsNameMapping {
30012    /// Creates a new default instance.
30013    pub fn new() -> Self {
30014        std::default::Default::default()
30015    }
30016
30017    /// Sets the value of [name][crate::model::DnsNameMapping::name].
30018    ///
30019    /// # Example
30020    /// ```ignore,no_run
30021    /// # use google_cloud_sql_v1::model::DnsNameMapping;
30022    /// let x = DnsNameMapping::new().set_name("example");
30023    /// ```
30024    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30025        self.name = v.into();
30026        self
30027    }
30028
30029    /// Sets the value of [connection_type][crate::model::DnsNameMapping::connection_type].
30030    ///
30031    /// # Example
30032    /// ```ignore,no_run
30033    /// # use google_cloud_sql_v1::model::DnsNameMapping;
30034    /// use google_cloud_sql_v1::model::dns_name_mapping::ConnectionType;
30035    /// let x0 = DnsNameMapping::new().set_connection_type(ConnectionType::Public);
30036    /// let x1 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServicesAccess);
30037    /// let x2 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServiceConnect);
30038    /// ```
30039    pub fn set_connection_type<
30040        T: std::convert::Into<crate::model::dns_name_mapping::ConnectionType>,
30041    >(
30042        mut self,
30043        v: T,
30044    ) -> Self {
30045        self.connection_type = v.into();
30046        self
30047    }
30048
30049    /// Sets the value of [dns_scope][crate::model::DnsNameMapping::dns_scope].
30050    ///
30051    /// # Example
30052    /// ```ignore,no_run
30053    /// # use google_cloud_sql_v1::model::DnsNameMapping;
30054    /// use google_cloud_sql_v1::model::dns_name_mapping::DnsScope;
30055    /// let x0 = DnsNameMapping::new().set_dns_scope(DnsScope::Instance);
30056    /// let x1 = DnsNameMapping::new().set_dns_scope(DnsScope::Cluster);
30057    /// ```
30058    pub fn set_dns_scope<T: std::convert::Into<crate::model::dns_name_mapping::DnsScope>>(
30059        mut self,
30060        v: T,
30061    ) -> Self {
30062        self.dns_scope = v.into();
30063        self
30064    }
30065
30066    /// Sets the value of [record_manager][crate::model::DnsNameMapping::record_manager].
30067    ///
30068    /// # Example
30069    /// ```ignore,no_run
30070    /// # use google_cloud_sql_v1::model::DnsNameMapping;
30071    /// use google_cloud_sql_v1::model::dns_name_mapping::RecordManager;
30072    /// let x0 = DnsNameMapping::new().set_record_manager(RecordManager::Customer);
30073    /// let x1 = DnsNameMapping::new().set_record_manager(RecordManager::CloudSqlAutomation);
30074    /// ```
30075    pub fn set_record_manager<
30076        T: std::convert::Into<crate::model::dns_name_mapping::RecordManager>,
30077    >(
30078        mut self,
30079        v: T,
30080    ) -> Self {
30081        self.record_manager = v.into();
30082        self
30083    }
30084}
30085
30086impl wkt::message::Message for DnsNameMapping {
30087    fn typename() -> &'static str {
30088        "type.googleapis.com/google.cloud.sql.v1.DnsNameMapping"
30089    }
30090}
30091
30092/// Defines additional types related to [DnsNameMapping].
30093pub mod dns_name_mapping {
30094    #[allow(unused_imports)]
30095    use super::*;
30096
30097    /// The connection type of the DNS name.
30098    /// This enum is not frozen, and new values may be added in the future.
30099    ///
30100    /// # Working with unknown values
30101    ///
30102    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30103    /// additional enum variants at any time. Adding new variants is not considered
30104    /// a breaking change. Applications should write their code in anticipation of:
30105    ///
30106    /// - New values appearing in future releases of the client library, **and**
30107    /// - New values received dynamically, without application changes.
30108    ///
30109    /// Please consult the [Working with enums] section in the user guide for some
30110    /// guidelines.
30111    ///
30112    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
30113    #[derive(Clone, Debug, PartialEq)]
30114    #[non_exhaustive]
30115    pub enum ConnectionType {
30116        /// Unknown connection type.
30117        Unspecified,
30118        /// Public IP.
30119        Public,
30120        /// Private services access (private IP).
30121        PrivateServicesAccess,
30122        /// Private Service Connect.
30123        PrivateServiceConnect,
30124        /// If set, the enum was initialized with an unknown value.
30125        ///
30126        /// Applications can examine the value using [ConnectionType::value] or
30127        /// [ConnectionType::name].
30128        UnknownValue(connection_type::UnknownValue),
30129    }
30130
30131    #[doc(hidden)]
30132    pub mod connection_type {
30133        #[allow(unused_imports)]
30134        use super::*;
30135        #[derive(Clone, Debug, PartialEq)]
30136        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30137    }
30138
30139    impl ConnectionType {
30140        /// Gets the enum value.
30141        ///
30142        /// Returns `None` if the enum contains an unknown value deserialized from
30143        /// the string representation of enums.
30144        pub fn value(&self) -> std::option::Option<i32> {
30145            match self {
30146                Self::Unspecified => std::option::Option::Some(0),
30147                Self::Public => std::option::Option::Some(1),
30148                Self::PrivateServicesAccess => std::option::Option::Some(2),
30149                Self::PrivateServiceConnect => std::option::Option::Some(3),
30150                Self::UnknownValue(u) => u.0.value(),
30151            }
30152        }
30153
30154        /// Gets the enum value as a string.
30155        ///
30156        /// Returns `None` if the enum contains an unknown value deserialized from
30157        /// the integer representation of enums.
30158        pub fn name(&self) -> std::option::Option<&str> {
30159            match self {
30160                Self::Unspecified => std::option::Option::Some("CONNECTION_TYPE_UNSPECIFIED"),
30161                Self::Public => std::option::Option::Some("PUBLIC"),
30162                Self::PrivateServicesAccess => std::option::Option::Some("PRIVATE_SERVICES_ACCESS"),
30163                Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
30164                Self::UnknownValue(u) => u.0.name(),
30165            }
30166        }
30167    }
30168
30169    impl std::default::Default for ConnectionType {
30170        fn default() -> Self {
30171            use std::convert::From;
30172            Self::from(0)
30173        }
30174    }
30175
30176    impl std::fmt::Display for ConnectionType {
30177        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30178            wkt::internal::display_enum(f, self.name(), self.value())
30179        }
30180    }
30181
30182    impl std::convert::From<i32> for ConnectionType {
30183        fn from(value: i32) -> Self {
30184            match value {
30185                0 => Self::Unspecified,
30186                1 => Self::Public,
30187                2 => Self::PrivateServicesAccess,
30188                3 => Self::PrivateServiceConnect,
30189                _ => Self::UnknownValue(connection_type::UnknownValue(
30190                    wkt::internal::UnknownEnumValue::Integer(value),
30191                )),
30192            }
30193        }
30194    }
30195
30196    impl std::convert::From<&str> for ConnectionType {
30197        fn from(value: &str) -> Self {
30198            use std::string::ToString;
30199            match value {
30200                "CONNECTION_TYPE_UNSPECIFIED" => Self::Unspecified,
30201                "PUBLIC" => Self::Public,
30202                "PRIVATE_SERVICES_ACCESS" => Self::PrivateServicesAccess,
30203                "PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
30204                _ => Self::UnknownValue(connection_type::UnknownValue(
30205                    wkt::internal::UnknownEnumValue::String(value.to_string()),
30206                )),
30207            }
30208        }
30209    }
30210
30211    impl serde::ser::Serialize for ConnectionType {
30212        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30213        where
30214            S: serde::Serializer,
30215        {
30216            match self {
30217                Self::Unspecified => serializer.serialize_i32(0),
30218                Self::Public => serializer.serialize_i32(1),
30219                Self::PrivateServicesAccess => serializer.serialize_i32(2),
30220                Self::PrivateServiceConnect => serializer.serialize_i32(3),
30221                Self::UnknownValue(u) => u.0.serialize(serializer),
30222            }
30223        }
30224    }
30225
30226    impl<'de> serde::de::Deserialize<'de> for ConnectionType {
30227        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30228        where
30229            D: serde::Deserializer<'de>,
30230        {
30231            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionType>::new(
30232                ".google.cloud.sql.v1.DnsNameMapping.ConnectionType",
30233            ))
30234        }
30235    }
30236
30237    /// The scope that the DNS name applies to.
30238    ///
30239    /// # Working with unknown values
30240    ///
30241    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30242    /// additional enum variants at any time. Adding new variants is not considered
30243    /// a breaking change. Applications should write their code in anticipation of:
30244    ///
30245    /// - New values appearing in future releases of the client library, **and**
30246    /// - New values received dynamically, without application changes.
30247    ///
30248    /// Please consult the [Working with enums] section in the user guide for some
30249    /// guidelines.
30250    ///
30251    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
30252    #[derive(Clone, Debug, PartialEq)]
30253    #[non_exhaustive]
30254    pub enum DnsScope {
30255        /// DNS scope not set. This value should not be used.
30256        Unspecified,
30257        /// Indicates an instance-level DNS name.
30258        Instance,
30259        /// Indicates a cluster-level DNS name.
30260        Cluster,
30261        /// If set, the enum was initialized with an unknown value.
30262        ///
30263        /// Applications can examine the value using [DnsScope::value] or
30264        /// [DnsScope::name].
30265        UnknownValue(dns_scope::UnknownValue),
30266    }
30267
30268    #[doc(hidden)]
30269    pub mod dns_scope {
30270        #[allow(unused_imports)]
30271        use super::*;
30272        #[derive(Clone, Debug, PartialEq)]
30273        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30274    }
30275
30276    impl DnsScope {
30277        /// Gets the enum value.
30278        ///
30279        /// Returns `None` if the enum contains an unknown value deserialized from
30280        /// the string representation of enums.
30281        pub fn value(&self) -> std::option::Option<i32> {
30282            match self {
30283                Self::Unspecified => std::option::Option::Some(0),
30284                Self::Instance => std::option::Option::Some(1),
30285                Self::Cluster => std::option::Option::Some(2),
30286                Self::UnknownValue(u) => u.0.value(),
30287            }
30288        }
30289
30290        /// Gets the enum value as a string.
30291        ///
30292        /// Returns `None` if the enum contains an unknown value deserialized from
30293        /// the integer representation of enums.
30294        pub fn name(&self) -> std::option::Option<&str> {
30295            match self {
30296                Self::Unspecified => std::option::Option::Some("DNS_SCOPE_UNSPECIFIED"),
30297                Self::Instance => std::option::Option::Some("INSTANCE"),
30298                Self::Cluster => std::option::Option::Some("CLUSTER"),
30299                Self::UnknownValue(u) => u.0.name(),
30300            }
30301        }
30302    }
30303
30304    impl std::default::Default for DnsScope {
30305        fn default() -> Self {
30306            use std::convert::From;
30307            Self::from(0)
30308        }
30309    }
30310
30311    impl std::fmt::Display for DnsScope {
30312        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30313            wkt::internal::display_enum(f, self.name(), self.value())
30314        }
30315    }
30316
30317    impl std::convert::From<i32> for DnsScope {
30318        fn from(value: i32) -> Self {
30319            match value {
30320                0 => Self::Unspecified,
30321                1 => Self::Instance,
30322                2 => Self::Cluster,
30323                _ => Self::UnknownValue(dns_scope::UnknownValue(
30324                    wkt::internal::UnknownEnumValue::Integer(value),
30325                )),
30326            }
30327        }
30328    }
30329
30330    impl std::convert::From<&str> for DnsScope {
30331        fn from(value: &str) -> Self {
30332            use std::string::ToString;
30333            match value {
30334                "DNS_SCOPE_UNSPECIFIED" => Self::Unspecified,
30335                "INSTANCE" => Self::Instance,
30336                "CLUSTER" => Self::Cluster,
30337                _ => Self::UnknownValue(dns_scope::UnknownValue(
30338                    wkt::internal::UnknownEnumValue::String(value.to_string()),
30339                )),
30340            }
30341        }
30342    }
30343
30344    impl serde::ser::Serialize for DnsScope {
30345        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30346        where
30347            S: serde::Serializer,
30348        {
30349            match self {
30350                Self::Unspecified => serializer.serialize_i32(0),
30351                Self::Instance => serializer.serialize_i32(1),
30352                Self::Cluster => serializer.serialize_i32(2),
30353                Self::UnknownValue(u) => u.0.serialize(serializer),
30354            }
30355        }
30356    }
30357
30358    impl<'de> serde::de::Deserialize<'de> for DnsScope {
30359        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30360        where
30361            D: serde::Deserializer<'de>,
30362        {
30363            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DnsScope>::new(
30364                ".google.cloud.sql.v1.DnsNameMapping.DnsScope",
30365            ))
30366        }
30367    }
30368
30369    /// The system responsible for managing the DNS record.
30370    ///
30371    /// # Working with unknown values
30372    ///
30373    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30374    /// additional enum variants at any time. Adding new variants is not considered
30375    /// a breaking change. Applications should write their code in anticipation of:
30376    ///
30377    /// - New values appearing in future releases of the client library, **and**
30378    /// - New values received dynamically, without application changes.
30379    ///
30380    /// Please consult the [Working with enums] section in the user guide for some
30381    /// guidelines.
30382    ///
30383    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
30384    #[derive(Clone, Debug, PartialEq)]
30385    #[non_exhaustive]
30386    pub enum RecordManager {
30387        /// Record manager not set. This value should not be used.
30388        Unspecified,
30389        /// The record may be managed by the customer. It is not automatically
30390        /// managed by Cloud SQL automation.
30391        Customer,
30392        /// The record is managed by Cloud SQL, which will create, update,
30393        /// and delete the DNS records for the zone automatically when
30394        /// the Cloud SQL database instance is created or updated.
30395        CloudSqlAutomation,
30396        /// If set, the enum was initialized with an unknown value.
30397        ///
30398        /// Applications can examine the value using [RecordManager::value] or
30399        /// [RecordManager::name].
30400        UnknownValue(record_manager::UnknownValue),
30401    }
30402
30403    #[doc(hidden)]
30404    pub mod record_manager {
30405        #[allow(unused_imports)]
30406        use super::*;
30407        #[derive(Clone, Debug, PartialEq)]
30408        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30409    }
30410
30411    impl RecordManager {
30412        /// Gets the enum value.
30413        ///
30414        /// Returns `None` if the enum contains an unknown value deserialized from
30415        /// the string representation of enums.
30416        pub fn value(&self) -> std::option::Option<i32> {
30417            match self {
30418                Self::Unspecified => std::option::Option::Some(0),
30419                Self::Customer => std::option::Option::Some(1),
30420                Self::CloudSqlAutomation => std::option::Option::Some(2),
30421                Self::UnknownValue(u) => u.0.value(),
30422            }
30423        }
30424
30425        /// Gets the enum value as a string.
30426        ///
30427        /// Returns `None` if the enum contains an unknown value deserialized from
30428        /// the integer representation of enums.
30429        pub fn name(&self) -> std::option::Option<&str> {
30430            match self {
30431                Self::Unspecified => std::option::Option::Some("RECORD_MANAGER_UNSPECIFIED"),
30432                Self::Customer => std::option::Option::Some("CUSTOMER"),
30433                Self::CloudSqlAutomation => std::option::Option::Some("CLOUD_SQL_AUTOMATION"),
30434                Self::UnknownValue(u) => u.0.name(),
30435            }
30436        }
30437    }
30438
30439    impl std::default::Default for RecordManager {
30440        fn default() -> Self {
30441            use std::convert::From;
30442            Self::from(0)
30443        }
30444    }
30445
30446    impl std::fmt::Display for RecordManager {
30447        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30448            wkt::internal::display_enum(f, self.name(), self.value())
30449        }
30450    }
30451
30452    impl std::convert::From<i32> for RecordManager {
30453        fn from(value: i32) -> Self {
30454            match value {
30455                0 => Self::Unspecified,
30456                1 => Self::Customer,
30457                2 => Self::CloudSqlAutomation,
30458                _ => Self::UnknownValue(record_manager::UnknownValue(
30459                    wkt::internal::UnknownEnumValue::Integer(value),
30460                )),
30461            }
30462        }
30463    }
30464
30465    impl std::convert::From<&str> for RecordManager {
30466        fn from(value: &str) -> Self {
30467            use std::string::ToString;
30468            match value {
30469                "RECORD_MANAGER_UNSPECIFIED" => Self::Unspecified,
30470                "CUSTOMER" => Self::Customer,
30471                "CLOUD_SQL_AUTOMATION" => Self::CloudSqlAutomation,
30472                _ => Self::UnknownValue(record_manager::UnknownValue(
30473                    wkt::internal::UnknownEnumValue::String(value.to_string()),
30474                )),
30475            }
30476        }
30477    }
30478
30479    impl serde::ser::Serialize for RecordManager {
30480        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30481        where
30482            S: serde::Serializer,
30483        {
30484            match self {
30485                Self::Unspecified => serializer.serialize_i32(0),
30486                Self::Customer => serializer.serialize_i32(1),
30487                Self::CloudSqlAutomation => serializer.serialize_i32(2),
30488                Self::UnknownValue(u) => u.0.serialize(serializer),
30489            }
30490        }
30491    }
30492
30493    impl<'de> serde::de::Deserialize<'de> for RecordManager {
30494        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30495        where
30496            D: serde::Deserializer<'de>,
30497        {
30498            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RecordManager>::new(
30499                ".google.cloud.sql.v1.DnsNameMapping.RecordManager",
30500            ))
30501        }
30502    }
30503}
30504
30505#[allow(missing_docs)]
30506#[derive(Clone, Default, PartialEq)]
30507#[non_exhaustive]
30508pub struct SqlSslCertsDeleteRequest {
30509    /// Cloud SQL instance ID. This does not include the project ID.
30510    pub instance: std::string::String,
30511
30512    /// Project ID of the project that contains the instance.
30513    pub project: std::string::String,
30514
30515    /// Sha1 FingerPrint.
30516    pub sha1_fingerprint: std::string::String,
30517
30518    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30519}
30520
30521impl SqlSslCertsDeleteRequest {
30522    /// Creates a new default instance.
30523    pub fn new() -> Self {
30524        std::default::Default::default()
30525    }
30526
30527    /// Sets the value of [instance][crate::model::SqlSslCertsDeleteRequest::instance].
30528    ///
30529    /// # Example
30530    /// ```ignore,no_run
30531    /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
30532    /// let x = SqlSslCertsDeleteRequest::new().set_instance("example");
30533    /// ```
30534    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30535        self.instance = v.into();
30536        self
30537    }
30538
30539    /// Sets the value of [project][crate::model::SqlSslCertsDeleteRequest::project].
30540    ///
30541    /// # Example
30542    /// ```ignore,no_run
30543    /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
30544    /// let x = SqlSslCertsDeleteRequest::new().set_project("example");
30545    /// ```
30546    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30547        self.project = v.into();
30548        self
30549    }
30550
30551    /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsDeleteRequest::sha1_fingerprint].
30552    ///
30553    /// # Example
30554    /// ```ignore,no_run
30555    /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
30556    /// let x = SqlSslCertsDeleteRequest::new().set_sha1_fingerprint("example");
30557    /// ```
30558    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
30559        mut self,
30560        v: T,
30561    ) -> Self {
30562        self.sha1_fingerprint = v.into();
30563        self
30564    }
30565}
30566
30567impl wkt::message::Message for SqlSslCertsDeleteRequest {
30568    fn typename() -> &'static str {
30569        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsDeleteRequest"
30570    }
30571}
30572
30573#[allow(missing_docs)]
30574#[derive(Clone, Default, PartialEq)]
30575#[non_exhaustive]
30576pub struct SqlSslCertsGetRequest {
30577    /// Cloud SQL instance ID. This does not include the project ID.
30578    pub instance: std::string::String,
30579
30580    /// Project ID of the project that contains the instance.
30581    pub project: std::string::String,
30582
30583    /// Sha1 FingerPrint.
30584    pub sha1_fingerprint: std::string::String,
30585
30586    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30587}
30588
30589impl SqlSslCertsGetRequest {
30590    /// Creates a new default instance.
30591    pub fn new() -> Self {
30592        std::default::Default::default()
30593    }
30594
30595    /// Sets the value of [instance][crate::model::SqlSslCertsGetRequest::instance].
30596    ///
30597    /// # Example
30598    /// ```ignore,no_run
30599    /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
30600    /// let x = SqlSslCertsGetRequest::new().set_instance("example");
30601    /// ```
30602    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30603        self.instance = v.into();
30604        self
30605    }
30606
30607    /// Sets the value of [project][crate::model::SqlSslCertsGetRequest::project].
30608    ///
30609    /// # Example
30610    /// ```ignore,no_run
30611    /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
30612    /// let x = SqlSslCertsGetRequest::new().set_project("example");
30613    /// ```
30614    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30615        self.project = v.into();
30616        self
30617    }
30618
30619    /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsGetRequest::sha1_fingerprint].
30620    ///
30621    /// # Example
30622    /// ```ignore,no_run
30623    /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
30624    /// let x = SqlSslCertsGetRequest::new().set_sha1_fingerprint("example");
30625    /// ```
30626    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
30627        mut self,
30628        v: T,
30629    ) -> Self {
30630        self.sha1_fingerprint = v.into();
30631        self
30632    }
30633}
30634
30635impl wkt::message::Message for SqlSslCertsGetRequest {
30636    fn typename() -> &'static str {
30637        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsGetRequest"
30638    }
30639}
30640
30641#[allow(missing_docs)]
30642#[derive(Clone, Default, PartialEq)]
30643#[non_exhaustive]
30644pub struct SqlSslCertsInsertRequest {
30645    /// Cloud SQL instance ID. This does not include the project ID.
30646    pub instance: std::string::String,
30647
30648    /// Project ID of the project that contains the instance.
30649    pub project: std::string::String,
30650
30651    #[allow(missing_docs)]
30652    pub body: std::option::Option<crate::model::SslCertsInsertRequest>,
30653
30654    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30655}
30656
30657impl SqlSslCertsInsertRequest {
30658    /// Creates a new default instance.
30659    pub fn new() -> Self {
30660        std::default::Default::default()
30661    }
30662
30663    /// Sets the value of [instance][crate::model::SqlSslCertsInsertRequest::instance].
30664    ///
30665    /// # Example
30666    /// ```ignore,no_run
30667    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30668    /// let x = SqlSslCertsInsertRequest::new().set_instance("example");
30669    /// ```
30670    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30671        self.instance = v.into();
30672        self
30673    }
30674
30675    /// Sets the value of [project][crate::model::SqlSslCertsInsertRequest::project].
30676    ///
30677    /// # Example
30678    /// ```ignore,no_run
30679    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30680    /// let x = SqlSslCertsInsertRequest::new().set_project("example");
30681    /// ```
30682    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30683        self.project = v.into();
30684        self
30685    }
30686
30687    /// Sets the value of [body][crate::model::SqlSslCertsInsertRequest::body].
30688    ///
30689    /// # Example
30690    /// ```ignore,no_run
30691    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30692    /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
30693    /// let x = SqlSslCertsInsertRequest::new().set_body(SslCertsInsertRequest::default()/* use setters */);
30694    /// ```
30695    pub fn set_body<T>(mut self, v: T) -> Self
30696    where
30697        T: std::convert::Into<crate::model::SslCertsInsertRequest>,
30698    {
30699        self.body = std::option::Option::Some(v.into());
30700        self
30701    }
30702
30703    /// Sets or clears the value of [body][crate::model::SqlSslCertsInsertRequest::body].
30704    ///
30705    /// # Example
30706    /// ```ignore,no_run
30707    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30708    /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
30709    /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(Some(SslCertsInsertRequest::default()/* use setters */));
30710    /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(None::<SslCertsInsertRequest>);
30711    /// ```
30712    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
30713    where
30714        T: std::convert::Into<crate::model::SslCertsInsertRequest>,
30715    {
30716        self.body = v.map(|x| x.into());
30717        self
30718    }
30719}
30720
30721impl wkt::message::Message for SqlSslCertsInsertRequest {
30722    fn typename() -> &'static str {
30723        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsInsertRequest"
30724    }
30725}
30726
30727#[allow(missing_docs)]
30728#[derive(Clone, Default, PartialEq)]
30729#[non_exhaustive]
30730pub struct SqlSslCertsListRequest {
30731    /// Cloud SQL instance ID. This does not include the project ID.
30732    pub instance: std::string::String,
30733
30734    /// Project ID of the project that contains the instance.
30735    pub project: std::string::String,
30736
30737    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30738}
30739
30740impl SqlSslCertsListRequest {
30741    /// Creates a new default instance.
30742    pub fn new() -> Self {
30743        std::default::Default::default()
30744    }
30745
30746    /// Sets the value of [instance][crate::model::SqlSslCertsListRequest::instance].
30747    ///
30748    /// # Example
30749    /// ```ignore,no_run
30750    /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
30751    /// let x = SqlSslCertsListRequest::new().set_instance("example");
30752    /// ```
30753    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30754        self.instance = v.into();
30755        self
30756    }
30757
30758    /// Sets the value of [project][crate::model::SqlSslCertsListRequest::project].
30759    ///
30760    /// # Example
30761    /// ```ignore,no_run
30762    /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
30763    /// let x = SqlSslCertsListRequest::new().set_project("example");
30764    /// ```
30765    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30766        self.project = v.into();
30767        self
30768    }
30769}
30770
30771impl wkt::message::Message for SqlSslCertsListRequest {
30772    fn typename() -> &'static str {
30773        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsListRequest"
30774    }
30775}
30776
30777/// SslCerts insert request.
30778#[derive(Clone, Default, PartialEq)]
30779#[non_exhaustive]
30780pub struct SslCertsInsertRequest {
30781    /// User supplied name.  Must be a distinct name from the other certificates
30782    /// for this instance.
30783    pub common_name: std::string::String,
30784
30785    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30786}
30787
30788impl SslCertsInsertRequest {
30789    /// Creates a new default instance.
30790    pub fn new() -> Self {
30791        std::default::Default::default()
30792    }
30793
30794    /// Sets the value of [common_name][crate::model::SslCertsInsertRequest::common_name].
30795    ///
30796    /// # Example
30797    /// ```ignore,no_run
30798    /// # use google_cloud_sql_v1::model::SslCertsInsertRequest;
30799    /// let x = SslCertsInsertRequest::new().set_common_name("example");
30800    /// ```
30801    pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30802        self.common_name = v.into();
30803        self
30804    }
30805}
30806
30807impl wkt::message::Message for SslCertsInsertRequest {
30808    fn typename() -> &'static str {
30809        "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertRequest"
30810    }
30811}
30812
30813/// SslCert insert response.
30814#[derive(Clone, Default, PartialEq)]
30815#[non_exhaustive]
30816pub struct SslCertsInsertResponse {
30817    /// This is always `sql#sslCertsInsert`.
30818    pub kind: std::string::String,
30819
30820    /// The operation to track the ssl certs insert request.
30821    pub operation: std::option::Option<crate::model::Operation>,
30822
30823    /// The server Certificate Authority's certificate.  If this is missing you can
30824    /// force a new one to be generated by calling resetSslConfig method on
30825    /// instances resource.
30826    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
30827
30828    /// The new client certificate and private key.
30829    pub client_cert: std::option::Option<crate::model::SslCertDetail>,
30830
30831    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30832}
30833
30834impl SslCertsInsertResponse {
30835    /// Creates a new default instance.
30836    pub fn new() -> Self {
30837        std::default::Default::default()
30838    }
30839
30840    /// Sets the value of [kind][crate::model::SslCertsInsertResponse::kind].
30841    ///
30842    /// # Example
30843    /// ```ignore,no_run
30844    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30845    /// let x = SslCertsInsertResponse::new().set_kind("example");
30846    /// ```
30847    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30848        self.kind = v.into();
30849        self
30850    }
30851
30852    /// Sets the value of [operation][crate::model::SslCertsInsertResponse::operation].
30853    ///
30854    /// # Example
30855    /// ```ignore,no_run
30856    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30857    /// use google_cloud_sql_v1::model::Operation;
30858    /// let x = SslCertsInsertResponse::new().set_operation(Operation::default()/* use setters */);
30859    /// ```
30860    pub fn set_operation<T>(mut self, v: T) -> Self
30861    where
30862        T: std::convert::Into<crate::model::Operation>,
30863    {
30864        self.operation = std::option::Option::Some(v.into());
30865        self
30866    }
30867
30868    /// Sets or clears the value of [operation][crate::model::SslCertsInsertResponse::operation].
30869    ///
30870    /// # Example
30871    /// ```ignore,no_run
30872    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30873    /// use google_cloud_sql_v1::model::Operation;
30874    /// let x = SslCertsInsertResponse::new().set_or_clear_operation(Some(Operation::default()/* use setters */));
30875    /// let x = SslCertsInsertResponse::new().set_or_clear_operation(None::<Operation>);
30876    /// ```
30877    pub fn set_or_clear_operation<T>(mut self, v: std::option::Option<T>) -> Self
30878    where
30879        T: std::convert::Into<crate::model::Operation>,
30880    {
30881        self.operation = v.map(|x| x.into());
30882        self
30883    }
30884
30885    /// Sets the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
30886    ///
30887    /// # Example
30888    /// ```ignore,no_run
30889    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30890    /// use google_cloud_sql_v1::model::SslCert;
30891    /// let x = SslCertsInsertResponse::new().set_server_ca_cert(SslCert::default()/* use setters */);
30892    /// ```
30893    pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
30894    where
30895        T: std::convert::Into<crate::model::SslCert>,
30896    {
30897        self.server_ca_cert = std::option::Option::Some(v.into());
30898        self
30899    }
30900
30901    /// Sets or clears the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
30902    ///
30903    /// # Example
30904    /// ```ignore,no_run
30905    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30906    /// use google_cloud_sql_v1::model::SslCert;
30907    /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
30908    /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(None::<SslCert>);
30909    /// ```
30910    pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
30911    where
30912        T: std::convert::Into<crate::model::SslCert>,
30913    {
30914        self.server_ca_cert = v.map(|x| x.into());
30915        self
30916    }
30917
30918    /// Sets the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
30919    ///
30920    /// # Example
30921    /// ```ignore,no_run
30922    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30923    /// use google_cloud_sql_v1::model::SslCertDetail;
30924    /// let x = SslCertsInsertResponse::new().set_client_cert(SslCertDetail::default()/* use setters */);
30925    /// ```
30926    pub fn set_client_cert<T>(mut self, v: T) -> Self
30927    where
30928        T: std::convert::Into<crate::model::SslCertDetail>,
30929    {
30930        self.client_cert = std::option::Option::Some(v.into());
30931        self
30932    }
30933
30934    /// Sets or clears the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
30935    ///
30936    /// # Example
30937    /// ```ignore,no_run
30938    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30939    /// use google_cloud_sql_v1::model::SslCertDetail;
30940    /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(Some(SslCertDetail::default()/* use setters */));
30941    /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(None::<SslCertDetail>);
30942    /// ```
30943    pub fn set_or_clear_client_cert<T>(mut self, v: std::option::Option<T>) -> Self
30944    where
30945        T: std::convert::Into<crate::model::SslCertDetail>,
30946    {
30947        self.client_cert = v.map(|x| x.into());
30948        self
30949    }
30950}
30951
30952impl wkt::message::Message for SslCertsInsertResponse {
30953    fn typename() -> &'static str {
30954        "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertResponse"
30955    }
30956}
30957
30958/// SslCerts list response.
30959#[derive(Clone, Default, PartialEq)]
30960#[non_exhaustive]
30961pub struct SslCertsListResponse {
30962    /// This is always `sql#sslCertsList`.
30963    pub kind: std::string::String,
30964
30965    /// List of client certificates for the instance.
30966    pub items: std::vec::Vec<crate::model::SslCert>,
30967
30968    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30969}
30970
30971impl SslCertsListResponse {
30972    /// Creates a new default instance.
30973    pub fn new() -> Self {
30974        std::default::Default::default()
30975    }
30976
30977    /// Sets the value of [kind][crate::model::SslCertsListResponse::kind].
30978    ///
30979    /// # Example
30980    /// ```ignore,no_run
30981    /// # use google_cloud_sql_v1::model::SslCertsListResponse;
30982    /// let x = SslCertsListResponse::new().set_kind("example");
30983    /// ```
30984    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30985        self.kind = v.into();
30986        self
30987    }
30988
30989    /// Sets the value of [items][crate::model::SslCertsListResponse::items].
30990    ///
30991    /// # Example
30992    /// ```ignore,no_run
30993    /// # use google_cloud_sql_v1::model::SslCertsListResponse;
30994    /// use google_cloud_sql_v1::model::SslCert;
30995    /// let x = SslCertsListResponse::new()
30996    ///     .set_items([
30997    ///         SslCert::default()/* use setters */,
30998    ///         SslCert::default()/* use (different) setters */,
30999    ///     ]);
31000    /// ```
31001    pub fn set_items<T, V>(mut self, v: T) -> Self
31002    where
31003        T: std::iter::IntoIterator<Item = V>,
31004        V: std::convert::Into<crate::model::SslCert>,
31005    {
31006        use std::iter::Iterator;
31007        self.items = v.into_iter().map(|i| i.into()).collect();
31008        self
31009    }
31010}
31011
31012impl wkt::message::Message for SslCertsListResponse {
31013    fn typename() -> &'static str {
31014        "type.googleapis.com/google.cloud.sql.v1.SslCertsListResponse"
31015    }
31016}
31017
31018/// Tiers list request.
31019#[derive(Clone, Default, PartialEq)]
31020#[non_exhaustive]
31021pub struct SqlTiersListRequest {
31022    /// Project ID of the project for which to list tiers.
31023    pub project: std::string::String,
31024
31025    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31026}
31027
31028impl SqlTiersListRequest {
31029    /// Creates a new default instance.
31030    pub fn new() -> Self {
31031        std::default::Default::default()
31032    }
31033
31034    /// Sets the value of [project][crate::model::SqlTiersListRequest::project].
31035    ///
31036    /// # Example
31037    /// ```ignore,no_run
31038    /// # use google_cloud_sql_v1::model::SqlTiersListRequest;
31039    /// let x = SqlTiersListRequest::new().set_project("example");
31040    /// ```
31041    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31042        self.project = v.into();
31043        self
31044    }
31045}
31046
31047impl wkt::message::Message for SqlTiersListRequest {
31048    fn typename() -> &'static str {
31049        "type.googleapis.com/google.cloud.sql.v1.SqlTiersListRequest"
31050    }
31051}
31052
31053/// Tiers list response.
31054#[derive(Clone, Default, PartialEq)]
31055#[non_exhaustive]
31056pub struct TiersListResponse {
31057    /// This is always `sql#tiersList`.
31058    pub kind: std::string::String,
31059
31060    /// List of tiers.
31061    pub items: std::vec::Vec<crate::model::Tier>,
31062
31063    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31064}
31065
31066impl TiersListResponse {
31067    /// Creates a new default instance.
31068    pub fn new() -> Self {
31069        std::default::Default::default()
31070    }
31071
31072    /// Sets the value of [kind][crate::model::TiersListResponse::kind].
31073    ///
31074    /// # Example
31075    /// ```ignore,no_run
31076    /// # use google_cloud_sql_v1::model::TiersListResponse;
31077    /// let x = TiersListResponse::new().set_kind("example");
31078    /// ```
31079    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31080        self.kind = v.into();
31081        self
31082    }
31083
31084    /// Sets the value of [items][crate::model::TiersListResponse::items].
31085    ///
31086    /// # Example
31087    /// ```ignore,no_run
31088    /// # use google_cloud_sql_v1::model::TiersListResponse;
31089    /// use google_cloud_sql_v1::model::Tier;
31090    /// let x = TiersListResponse::new()
31091    ///     .set_items([
31092    ///         Tier::default()/* use setters */,
31093    ///         Tier::default()/* use (different) setters */,
31094    ///     ]);
31095    /// ```
31096    pub fn set_items<T, V>(mut self, v: T) -> Self
31097    where
31098        T: std::iter::IntoIterator<Item = V>,
31099        V: std::convert::Into<crate::model::Tier>,
31100    {
31101        use std::iter::Iterator;
31102        self.items = v.into_iter().map(|i| i.into()).collect();
31103        self
31104    }
31105}
31106
31107impl wkt::message::Message for TiersListResponse {
31108    fn typename() -> &'static str {
31109        "type.googleapis.com/google.cloud.sql.v1.TiersListResponse"
31110    }
31111}
31112
31113/// A Google Cloud SQL service tier resource.
31114#[derive(Clone, Default, PartialEq)]
31115#[non_exhaustive]
31116pub struct Tier {
31117    /// An identifier for the machine type, for example, `db-custom-1-3840`. For
31118    /// related information, see [Pricing](/sql/pricing).
31119    pub tier: std::string::String,
31120
31121    /// The maximum RAM usage of this tier in bytes.
31122    pub ram: i64,
31123
31124    /// This is always `sql#tier`.
31125    pub kind: std::string::String,
31126
31127    /// The maximum disk size of this tier in bytes.
31128    pub disk_quota: i64,
31129
31130    /// The applicable regions for this tier.
31131    pub region: std::vec::Vec<std::string::String>,
31132
31133    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31134}
31135
31136impl Tier {
31137    /// Creates a new default instance.
31138    pub fn new() -> Self {
31139        std::default::Default::default()
31140    }
31141
31142    /// Sets the value of [tier][crate::model::Tier::tier].
31143    ///
31144    /// # Example
31145    /// ```ignore,no_run
31146    /// # use google_cloud_sql_v1::model::Tier;
31147    /// let x = Tier::new().set_tier("example");
31148    /// ```
31149    pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31150        self.tier = v.into();
31151        self
31152    }
31153
31154    /// Sets the value of [ram][crate::model::Tier::ram].
31155    ///
31156    /// # Example
31157    /// ```ignore,no_run
31158    /// # use google_cloud_sql_v1::model::Tier;
31159    /// let x = Tier::new().set_ram(42);
31160    /// ```
31161    pub fn set_ram<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
31162        self.ram = v.into();
31163        self
31164    }
31165
31166    /// Sets the value of [kind][crate::model::Tier::kind].
31167    ///
31168    /// # Example
31169    /// ```ignore,no_run
31170    /// # use google_cloud_sql_v1::model::Tier;
31171    /// let x = Tier::new().set_kind("example");
31172    /// ```
31173    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31174        self.kind = v.into();
31175        self
31176    }
31177
31178    /// Sets the value of [disk_quota][crate::model::Tier::disk_quota].
31179    ///
31180    /// # Example
31181    /// ```ignore,no_run
31182    /// # use google_cloud_sql_v1::model::Tier;
31183    /// let x = Tier::new().set_disk_quota(42);
31184    /// ```
31185    pub fn set_disk_quota<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
31186        self.disk_quota = v.into();
31187        self
31188    }
31189
31190    /// Sets the value of [region][crate::model::Tier::region].
31191    ///
31192    /// # Example
31193    /// ```ignore,no_run
31194    /// # use google_cloud_sql_v1::model::Tier;
31195    /// let x = Tier::new().set_region(["a", "b", "c"]);
31196    /// ```
31197    pub fn set_region<T, V>(mut self, v: T) -> Self
31198    where
31199        T: std::iter::IntoIterator<Item = V>,
31200        V: std::convert::Into<std::string::String>,
31201    {
31202        use std::iter::Iterator;
31203        self.region = v.into_iter().map(|i| i.into()).collect();
31204        self
31205    }
31206}
31207
31208impl wkt::message::Message for Tier {
31209    fn typename() -> &'static str {
31210        "type.googleapis.com/google.cloud.sql.v1.Tier"
31211    }
31212}
31213
31214#[allow(missing_docs)]
31215#[derive(Clone, Default, PartialEq)]
31216#[non_exhaustive]
31217pub struct SqlUsersDeleteRequest {
31218    /// Host of the user in the instance.
31219    pub host: std::string::String,
31220
31221    /// Database instance ID. This does not include the project ID.
31222    pub instance: std::string::String,
31223
31224    /// Name of the user in the instance.
31225    pub name: std::string::String,
31226
31227    /// Project ID of the project that contains the instance.
31228    pub project: std::string::String,
31229
31230    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31231}
31232
31233impl SqlUsersDeleteRequest {
31234    /// Creates a new default instance.
31235    pub fn new() -> Self {
31236        std::default::Default::default()
31237    }
31238
31239    /// Sets the value of [host][crate::model::SqlUsersDeleteRequest::host].
31240    ///
31241    /// # Example
31242    /// ```ignore,no_run
31243    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
31244    /// let x = SqlUsersDeleteRequest::new().set_host("example");
31245    /// ```
31246    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31247        self.host = v.into();
31248        self
31249    }
31250
31251    /// Sets the value of [instance][crate::model::SqlUsersDeleteRequest::instance].
31252    ///
31253    /// # Example
31254    /// ```ignore,no_run
31255    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
31256    /// let x = SqlUsersDeleteRequest::new().set_instance("example");
31257    /// ```
31258    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31259        self.instance = v.into();
31260        self
31261    }
31262
31263    /// Sets the value of [name][crate::model::SqlUsersDeleteRequest::name].
31264    ///
31265    /// # Example
31266    /// ```ignore,no_run
31267    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
31268    /// let x = SqlUsersDeleteRequest::new().set_name("example");
31269    /// ```
31270    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31271        self.name = v.into();
31272        self
31273    }
31274
31275    /// Sets the value of [project][crate::model::SqlUsersDeleteRequest::project].
31276    ///
31277    /// # Example
31278    /// ```ignore,no_run
31279    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
31280    /// let x = SqlUsersDeleteRequest::new().set_project("example");
31281    /// ```
31282    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31283        self.project = v.into();
31284        self
31285    }
31286}
31287
31288impl wkt::message::Message for SqlUsersDeleteRequest {
31289    fn typename() -> &'static str {
31290        "type.googleapis.com/google.cloud.sql.v1.SqlUsersDeleteRequest"
31291    }
31292}
31293
31294/// Request message for Users Get RPC
31295#[derive(Clone, Default, PartialEq)]
31296#[non_exhaustive]
31297pub struct SqlUsersGetRequest {
31298    /// Database instance ID. This does not include the project ID.
31299    pub instance: std::string::String,
31300
31301    /// User of the instance.
31302    pub name: std::string::String,
31303
31304    /// Project ID of the project that contains the instance.
31305    pub project: std::string::String,
31306
31307    /// Host of a user of the instance.
31308    pub host: std::string::String,
31309
31310    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31311}
31312
31313impl SqlUsersGetRequest {
31314    /// Creates a new default instance.
31315    pub fn new() -> Self {
31316        std::default::Default::default()
31317    }
31318
31319    /// Sets the value of [instance][crate::model::SqlUsersGetRequest::instance].
31320    ///
31321    /// # Example
31322    /// ```ignore,no_run
31323    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
31324    /// let x = SqlUsersGetRequest::new().set_instance("example");
31325    /// ```
31326    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31327        self.instance = v.into();
31328        self
31329    }
31330
31331    /// Sets the value of [name][crate::model::SqlUsersGetRequest::name].
31332    ///
31333    /// # Example
31334    /// ```ignore,no_run
31335    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
31336    /// let x = SqlUsersGetRequest::new().set_name("example");
31337    /// ```
31338    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31339        self.name = v.into();
31340        self
31341    }
31342
31343    /// Sets the value of [project][crate::model::SqlUsersGetRequest::project].
31344    ///
31345    /// # Example
31346    /// ```ignore,no_run
31347    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
31348    /// let x = SqlUsersGetRequest::new().set_project("example");
31349    /// ```
31350    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31351        self.project = v.into();
31352        self
31353    }
31354
31355    /// Sets the value of [host][crate::model::SqlUsersGetRequest::host].
31356    ///
31357    /// # Example
31358    /// ```ignore,no_run
31359    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
31360    /// let x = SqlUsersGetRequest::new().set_host("example");
31361    /// ```
31362    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31363        self.host = v.into();
31364        self
31365    }
31366}
31367
31368impl wkt::message::Message for SqlUsersGetRequest {
31369    fn typename() -> &'static str {
31370        "type.googleapis.com/google.cloud.sql.v1.SqlUsersGetRequest"
31371    }
31372}
31373
31374#[allow(missing_docs)]
31375#[derive(Clone, Default, PartialEq)]
31376#[non_exhaustive]
31377pub struct SqlUsersInsertRequest {
31378    /// Database instance ID. This does not include the project ID.
31379    pub instance: std::string::String,
31380
31381    /// Project ID of the project that contains the instance.
31382    pub project: std::string::String,
31383
31384    #[allow(missing_docs)]
31385    pub body: std::option::Option<crate::model::User>,
31386
31387    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31388}
31389
31390impl SqlUsersInsertRequest {
31391    /// Creates a new default instance.
31392    pub fn new() -> Self {
31393        std::default::Default::default()
31394    }
31395
31396    /// Sets the value of [instance][crate::model::SqlUsersInsertRequest::instance].
31397    ///
31398    /// # Example
31399    /// ```ignore,no_run
31400    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
31401    /// let x = SqlUsersInsertRequest::new().set_instance("example");
31402    /// ```
31403    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31404        self.instance = v.into();
31405        self
31406    }
31407
31408    /// Sets the value of [project][crate::model::SqlUsersInsertRequest::project].
31409    ///
31410    /// # Example
31411    /// ```ignore,no_run
31412    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
31413    /// let x = SqlUsersInsertRequest::new().set_project("example");
31414    /// ```
31415    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31416        self.project = v.into();
31417        self
31418    }
31419
31420    /// Sets the value of [body][crate::model::SqlUsersInsertRequest::body].
31421    ///
31422    /// # Example
31423    /// ```ignore,no_run
31424    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
31425    /// use google_cloud_sql_v1::model::User;
31426    /// let x = SqlUsersInsertRequest::new().set_body(User::default()/* use setters */);
31427    /// ```
31428    pub fn set_body<T>(mut self, v: T) -> Self
31429    where
31430        T: std::convert::Into<crate::model::User>,
31431    {
31432        self.body = std::option::Option::Some(v.into());
31433        self
31434    }
31435
31436    /// Sets or clears the value of [body][crate::model::SqlUsersInsertRequest::body].
31437    ///
31438    /// # Example
31439    /// ```ignore,no_run
31440    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
31441    /// use google_cloud_sql_v1::model::User;
31442    /// let x = SqlUsersInsertRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
31443    /// let x = SqlUsersInsertRequest::new().set_or_clear_body(None::<User>);
31444    /// ```
31445    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
31446    where
31447        T: std::convert::Into<crate::model::User>,
31448    {
31449        self.body = v.map(|x| x.into());
31450        self
31451    }
31452}
31453
31454impl wkt::message::Message for SqlUsersInsertRequest {
31455    fn typename() -> &'static str {
31456        "type.googleapis.com/google.cloud.sql.v1.SqlUsersInsertRequest"
31457    }
31458}
31459
31460#[allow(missing_docs)]
31461#[derive(Clone, Default, PartialEq)]
31462#[non_exhaustive]
31463pub struct SqlUsersListRequest {
31464    /// Database instance ID. This does not include the project ID.
31465    pub instance: std::string::String,
31466
31467    /// Project ID of the project that contains the instance.
31468    pub project: std::string::String,
31469
31470    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31471}
31472
31473impl SqlUsersListRequest {
31474    /// Creates a new default instance.
31475    pub fn new() -> Self {
31476        std::default::Default::default()
31477    }
31478
31479    /// Sets the value of [instance][crate::model::SqlUsersListRequest::instance].
31480    ///
31481    /// # Example
31482    /// ```ignore,no_run
31483    /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
31484    /// let x = SqlUsersListRequest::new().set_instance("example");
31485    /// ```
31486    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31487        self.instance = v.into();
31488        self
31489    }
31490
31491    /// Sets the value of [project][crate::model::SqlUsersListRequest::project].
31492    ///
31493    /// # Example
31494    /// ```ignore,no_run
31495    /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
31496    /// let x = SqlUsersListRequest::new().set_project("example");
31497    /// ```
31498    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31499        self.project = v.into();
31500        self
31501    }
31502}
31503
31504impl wkt::message::Message for SqlUsersListRequest {
31505    fn typename() -> &'static str {
31506        "type.googleapis.com/google.cloud.sql.v1.SqlUsersListRequest"
31507    }
31508}
31509
31510#[allow(missing_docs)]
31511#[derive(Clone, Default, PartialEq)]
31512#[non_exhaustive]
31513pub struct SqlUsersUpdateRequest {
31514    /// Optional. Host of the user in the instance.
31515    pub host: std::string::String,
31516
31517    /// Database instance ID. This does not include the project ID.
31518    pub instance: std::string::String,
31519
31520    /// Name of the user in the instance.
31521    pub name: std::string::String,
31522
31523    /// Project ID of the project that contains the instance.
31524    pub project: std::string::String,
31525
31526    /// Optional. List of database roles to grant to the user. body.database_roles
31527    /// will be ignored for update request.
31528    pub database_roles: std::vec::Vec<std::string::String>,
31529
31530    /// Optional. Specifies whether to revoke existing roles that are not present
31531    /// in the `database_roles` field. If `false` or unset, the database roles
31532    /// specified in `database_roles` are added to the user's existing roles.
31533    pub revoke_existing_roles: std::option::Option<bool>,
31534
31535    #[allow(missing_docs)]
31536    pub body: std::option::Option<crate::model::User>,
31537
31538    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31539}
31540
31541impl SqlUsersUpdateRequest {
31542    /// Creates a new default instance.
31543    pub fn new() -> Self {
31544        std::default::Default::default()
31545    }
31546
31547    /// Sets the value of [host][crate::model::SqlUsersUpdateRequest::host].
31548    ///
31549    /// # Example
31550    /// ```ignore,no_run
31551    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31552    /// let x = SqlUsersUpdateRequest::new().set_host("example");
31553    /// ```
31554    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31555        self.host = v.into();
31556        self
31557    }
31558
31559    /// Sets the value of [instance][crate::model::SqlUsersUpdateRequest::instance].
31560    ///
31561    /// # Example
31562    /// ```ignore,no_run
31563    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31564    /// let x = SqlUsersUpdateRequest::new().set_instance("example");
31565    /// ```
31566    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31567        self.instance = v.into();
31568        self
31569    }
31570
31571    /// Sets the value of [name][crate::model::SqlUsersUpdateRequest::name].
31572    ///
31573    /// # Example
31574    /// ```ignore,no_run
31575    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31576    /// let x = SqlUsersUpdateRequest::new().set_name("example");
31577    /// ```
31578    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31579        self.name = v.into();
31580        self
31581    }
31582
31583    /// Sets the value of [project][crate::model::SqlUsersUpdateRequest::project].
31584    ///
31585    /// # Example
31586    /// ```ignore,no_run
31587    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31588    /// let x = SqlUsersUpdateRequest::new().set_project("example");
31589    /// ```
31590    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31591        self.project = v.into();
31592        self
31593    }
31594
31595    /// Sets the value of [database_roles][crate::model::SqlUsersUpdateRequest::database_roles].
31596    ///
31597    /// # Example
31598    /// ```ignore,no_run
31599    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31600    /// let x = SqlUsersUpdateRequest::new().set_database_roles(["a", "b", "c"]);
31601    /// ```
31602    pub fn set_database_roles<T, V>(mut self, v: T) -> Self
31603    where
31604        T: std::iter::IntoIterator<Item = V>,
31605        V: std::convert::Into<std::string::String>,
31606    {
31607        use std::iter::Iterator;
31608        self.database_roles = v.into_iter().map(|i| i.into()).collect();
31609        self
31610    }
31611
31612    /// Sets the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
31613    ///
31614    /// # Example
31615    /// ```ignore,no_run
31616    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31617    /// let x = SqlUsersUpdateRequest::new().set_revoke_existing_roles(true);
31618    /// ```
31619    pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
31620    where
31621        T: std::convert::Into<bool>,
31622    {
31623        self.revoke_existing_roles = std::option::Option::Some(v.into());
31624        self
31625    }
31626
31627    /// Sets or clears the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
31628    ///
31629    /// # Example
31630    /// ```ignore,no_run
31631    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31632    /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_roles(Some(false));
31633    /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_roles(None::<bool>);
31634    /// ```
31635    pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
31636    where
31637        T: std::convert::Into<bool>,
31638    {
31639        self.revoke_existing_roles = v.map(|x| x.into());
31640        self
31641    }
31642
31643    /// Sets the value of [body][crate::model::SqlUsersUpdateRequest::body].
31644    ///
31645    /// # Example
31646    /// ```ignore,no_run
31647    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31648    /// use google_cloud_sql_v1::model::User;
31649    /// let x = SqlUsersUpdateRequest::new().set_body(User::default()/* use setters */);
31650    /// ```
31651    pub fn set_body<T>(mut self, v: T) -> Self
31652    where
31653        T: std::convert::Into<crate::model::User>,
31654    {
31655        self.body = std::option::Option::Some(v.into());
31656        self
31657    }
31658
31659    /// Sets or clears the value of [body][crate::model::SqlUsersUpdateRequest::body].
31660    ///
31661    /// # Example
31662    /// ```ignore,no_run
31663    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31664    /// use google_cloud_sql_v1::model::User;
31665    /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
31666    /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(None::<User>);
31667    /// ```
31668    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
31669    where
31670        T: std::convert::Into<crate::model::User>,
31671    {
31672        self.body = v.map(|x| x.into());
31673        self
31674    }
31675}
31676
31677impl wkt::message::Message for SqlUsersUpdateRequest {
31678    fn typename() -> &'static str {
31679        "type.googleapis.com/google.cloud.sql.v1.SqlUsersUpdateRequest"
31680    }
31681}
31682
31683/// User level password validation policy.
31684#[derive(Clone, Default, PartialEq)]
31685#[non_exhaustive]
31686pub struct UserPasswordValidationPolicy {
31687    /// Number of failed login attempts allowed before user get locked.
31688    pub allowed_failed_attempts: i32,
31689
31690    /// Expiration duration after password is updated.
31691    pub password_expiration_duration: std::option::Option<wkt::Duration>,
31692
31693    /// If true, failed login attempts check will be enabled.
31694    pub enable_failed_attempts_check: bool,
31695
31696    /// Output only. Read-only password status.
31697    pub status: std::option::Option<crate::model::PasswordStatus>,
31698
31699    /// If true, the user must specify the current password before changing the
31700    /// password. This flag is supported only for MySQL.
31701    pub enable_password_verification: bool,
31702
31703    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31704}
31705
31706impl UserPasswordValidationPolicy {
31707    /// Creates a new default instance.
31708    pub fn new() -> Self {
31709        std::default::Default::default()
31710    }
31711
31712    /// Sets the value of [allowed_failed_attempts][crate::model::UserPasswordValidationPolicy::allowed_failed_attempts].
31713    ///
31714    /// # Example
31715    /// ```ignore,no_run
31716    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31717    /// let x = UserPasswordValidationPolicy::new().set_allowed_failed_attempts(42);
31718    /// ```
31719    pub fn set_allowed_failed_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
31720        self.allowed_failed_attempts = v.into();
31721        self
31722    }
31723
31724    /// Sets the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
31725    ///
31726    /// # Example
31727    /// ```ignore,no_run
31728    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31729    /// use wkt::Duration;
31730    /// let x = UserPasswordValidationPolicy::new().set_password_expiration_duration(Duration::default()/* use setters */);
31731    /// ```
31732    pub fn set_password_expiration_duration<T>(mut self, v: T) -> Self
31733    where
31734        T: std::convert::Into<wkt::Duration>,
31735    {
31736        self.password_expiration_duration = std::option::Option::Some(v.into());
31737        self
31738    }
31739
31740    /// Sets or clears the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
31741    ///
31742    /// # Example
31743    /// ```ignore,no_run
31744    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31745    /// use wkt::Duration;
31746    /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(Some(Duration::default()/* use setters */));
31747    /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(None::<Duration>);
31748    /// ```
31749    pub fn set_or_clear_password_expiration_duration<T>(mut self, v: std::option::Option<T>) -> Self
31750    where
31751        T: std::convert::Into<wkt::Duration>,
31752    {
31753        self.password_expiration_duration = v.map(|x| x.into());
31754        self
31755    }
31756
31757    /// Sets the value of [enable_failed_attempts_check][crate::model::UserPasswordValidationPolicy::enable_failed_attempts_check].
31758    ///
31759    /// # Example
31760    /// ```ignore,no_run
31761    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31762    /// let x = UserPasswordValidationPolicy::new().set_enable_failed_attempts_check(true);
31763    /// ```
31764    pub fn set_enable_failed_attempts_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31765        self.enable_failed_attempts_check = v.into();
31766        self
31767    }
31768
31769    /// Sets the value of [status][crate::model::UserPasswordValidationPolicy::status].
31770    ///
31771    /// # Example
31772    /// ```ignore,no_run
31773    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31774    /// use google_cloud_sql_v1::model::PasswordStatus;
31775    /// let x = UserPasswordValidationPolicy::new().set_status(PasswordStatus::default()/* use setters */);
31776    /// ```
31777    pub fn set_status<T>(mut self, v: T) -> Self
31778    where
31779        T: std::convert::Into<crate::model::PasswordStatus>,
31780    {
31781        self.status = std::option::Option::Some(v.into());
31782        self
31783    }
31784
31785    /// Sets or clears the value of [status][crate::model::UserPasswordValidationPolicy::status].
31786    ///
31787    /// # Example
31788    /// ```ignore,no_run
31789    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31790    /// use google_cloud_sql_v1::model::PasswordStatus;
31791    /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(Some(PasswordStatus::default()/* use setters */));
31792    /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(None::<PasswordStatus>);
31793    /// ```
31794    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
31795    where
31796        T: std::convert::Into<crate::model::PasswordStatus>,
31797    {
31798        self.status = v.map(|x| x.into());
31799        self
31800    }
31801
31802    /// Sets the value of [enable_password_verification][crate::model::UserPasswordValidationPolicy::enable_password_verification].
31803    ///
31804    /// # Example
31805    /// ```ignore,no_run
31806    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31807    /// let x = UserPasswordValidationPolicy::new().set_enable_password_verification(true);
31808    /// ```
31809    pub fn set_enable_password_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31810        self.enable_password_verification = v.into();
31811        self
31812    }
31813}
31814
31815impl wkt::message::Message for UserPasswordValidationPolicy {
31816    fn typename() -> &'static str {
31817        "type.googleapis.com/google.cloud.sql.v1.UserPasswordValidationPolicy"
31818    }
31819}
31820
31821/// Read-only password status.
31822#[derive(Clone, Default, PartialEq)]
31823#[non_exhaustive]
31824pub struct PasswordStatus {
31825    /// If true, user does not have login privileges.
31826    pub locked: bool,
31827
31828    /// The expiration time of the current password.
31829    pub password_expiration_time: std::option::Option<wkt::Timestamp>,
31830
31831    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31832}
31833
31834impl PasswordStatus {
31835    /// Creates a new default instance.
31836    pub fn new() -> Self {
31837        std::default::Default::default()
31838    }
31839
31840    /// Sets the value of [locked][crate::model::PasswordStatus::locked].
31841    ///
31842    /// # Example
31843    /// ```ignore,no_run
31844    /// # use google_cloud_sql_v1::model::PasswordStatus;
31845    /// let x = PasswordStatus::new().set_locked(true);
31846    /// ```
31847    pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31848        self.locked = v.into();
31849        self
31850    }
31851
31852    /// Sets the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
31853    ///
31854    /// # Example
31855    /// ```ignore,no_run
31856    /// # use google_cloud_sql_v1::model::PasswordStatus;
31857    /// use wkt::Timestamp;
31858    /// let x = PasswordStatus::new().set_password_expiration_time(Timestamp::default()/* use setters */);
31859    /// ```
31860    pub fn set_password_expiration_time<T>(mut self, v: T) -> Self
31861    where
31862        T: std::convert::Into<wkt::Timestamp>,
31863    {
31864        self.password_expiration_time = std::option::Option::Some(v.into());
31865        self
31866    }
31867
31868    /// Sets or clears the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
31869    ///
31870    /// # Example
31871    /// ```ignore,no_run
31872    /// # use google_cloud_sql_v1::model::PasswordStatus;
31873    /// use wkt::Timestamp;
31874    /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(Some(Timestamp::default()/* use setters */));
31875    /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(None::<Timestamp>);
31876    /// ```
31877    pub fn set_or_clear_password_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
31878    where
31879        T: std::convert::Into<wkt::Timestamp>,
31880    {
31881        self.password_expiration_time = v.map(|x| x.into());
31882        self
31883    }
31884}
31885
31886impl wkt::message::Message for PasswordStatus {
31887    fn typename() -> &'static str {
31888        "type.googleapis.com/google.cloud.sql.v1.PasswordStatus"
31889    }
31890}
31891
31892/// A Cloud SQL user resource.
31893#[derive(Clone, Default, PartialEq)]
31894#[non_exhaustive]
31895pub struct User {
31896    /// This is always `sql#user`.
31897    pub kind: std::string::String,
31898
31899    /// The password for the user.
31900    pub password: std::string::String,
31901
31902    /// This field is deprecated and will be removed from a future version of the
31903    /// API.
31904    pub etag: std::string::String,
31905
31906    /// The name of the user in the Cloud SQL instance. Can be omitted for
31907    /// `update` because it is already specified in the URL.
31908    pub name: std::string::String,
31909
31910    /// Optional. The host from which the user can connect. For `insert`
31911    /// operations, host defaults to an empty string. For `update`
31912    /// operations, host is specified as part of the request URL. The host name
31913    /// cannot be updated after insertion.  For a MySQL instance, it's required;
31914    /// for a PostgreSQL or SQL Server instance, it's optional.
31915    pub host: std::string::String,
31916
31917    /// The name of the Cloud SQL instance. This does not include the project ID.
31918    /// Can be omitted for `update` because it is already specified on the
31919    /// URL.
31920    pub instance: std::string::String,
31921
31922    /// The project ID of the project containing the Cloud SQL database. The Google
31923    /// apps domain is prefixed if applicable. Can be omitted for `update` because
31924    /// it is already specified on the URL.
31925    pub project: std::string::String,
31926
31927    /// The user type. It determines the method to authenticate the user during
31928    /// login. The default is the database's built-in user type.
31929    pub r#type: crate::model::user::SqlUserType,
31930
31931    /// Optional. The full email for an IAM user. For normal database users, this
31932    /// will not be filled. Only applicable to MySQL database users.
31933    pub iam_email: std::string::String,
31934
31935    /// User level password validation policy.
31936    pub password_policy: std::option::Option<crate::model::UserPasswordValidationPolicy>,
31937
31938    /// Dual password status for the user.
31939    pub dual_password_type: std::option::Option<crate::model::user::DualPasswordType>,
31940
31941    /// Indicates if a group is active or inactive for IAM database authentication.
31942    pub iam_status: std::option::Option<crate::model::user::IamStatus>,
31943
31944    /// Optional. Role memberships of the user
31945    pub database_roles: std::vec::Vec<std::string::String>,
31946
31947    /// User details for specific database type
31948    pub user_details: std::option::Option<crate::model::user::UserDetails>,
31949
31950    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31951}
31952
31953impl User {
31954    /// Creates a new default instance.
31955    pub fn new() -> Self {
31956        std::default::Default::default()
31957    }
31958
31959    /// Sets the value of [kind][crate::model::User::kind].
31960    ///
31961    /// # Example
31962    /// ```ignore,no_run
31963    /// # use google_cloud_sql_v1::model::User;
31964    /// let x = User::new().set_kind("example");
31965    /// ```
31966    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31967        self.kind = v.into();
31968        self
31969    }
31970
31971    /// Sets the value of [password][crate::model::User::password].
31972    ///
31973    /// # Example
31974    /// ```ignore,no_run
31975    /// # use google_cloud_sql_v1::model::User;
31976    /// let x = User::new().set_password("example");
31977    /// ```
31978    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31979        self.password = v.into();
31980        self
31981    }
31982
31983    /// Sets the value of [etag][crate::model::User::etag].
31984    ///
31985    /// # Example
31986    /// ```ignore,no_run
31987    /// # use google_cloud_sql_v1::model::User;
31988    /// let x = User::new().set_etag("example");
31989    /// ```
31990    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31991        self.etag = v.into();
31992        self
31993    }
31994
31995    /// Sets the value of [name][crate::model::User::name].
31996    ///
31997    /// # Example
31998    /// ```ignore,no_run
31999    /// # use google_cloud_sql_v1::model::User;
32000    /// let x = User::new().set_name("example");
32001    /// ```
32002    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32003        self.name = v.into();
32004        self
32005    }
32006
32007    /// Sets the value of [host][crate::model::User::host].
32008    ///
32009    /// # Example
32010    /// ```ignore,no_run
32011    /// # use google_cloud_sql_v1::model::User;
32012    /// let x = User::new().set_host("example");
32013    /// ```
32014    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32015        self.host = v.into();
32016        self
32017    }
32018
32019    /// Sets the value of [instance][crate::model::User::instance].
32020    ///
32021    /// # Example
32022    /// ```ignore,no_run
32023    /// # use google_cloud_sql_v1::model::User;
32024    /// let x = User::new().set_instance("example");
32025    /// ```
32026    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32027        self.instance = v.into();
32028        self
32029    }
32030
32031    /// Sets the value of [project][crate::model::User::project].
32032    ///
32033    /// # Example
32034    /// ```ignore,no_run
32035    /// # use google_cloud_sql_v1::model::User;
32036    /// let x = User::new().set_project("example");
32037    /// ```
32038    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32039        self.project = v.into();
32040        self
32041    }
32042
32043    /// Sets the value of [r#type][crate::model::User::type].
32044    ///
32045    /// # Example
32046    /// ```ignore,no_run
32047    /// # use google_cloud_sql_v1::model::User;
32048    /// use google_cloud_sql_v1::model::user::SqlUserType;
32049    /// let x0 = User::new().set_type(SqlUserType::CloudIamUser);
32050    /// let x1 = User::new().set_type(SqlUserType::CloudIamServiceAccount);
32051    /// let x2 = User::new().set_type(SqlUserType::CloudIamGroup);
32052    /// ```
32053    pub fn set_type<T: std::convert::Into<crate::model::user::SqlUserType>>(
32054        mut self,
32055        v: T,
32056    ) -> Self {
32057        self.r#type = v.into();
32058        self
32059    }
32060
32061    /// Sets the value of [iam_email][crate::model::User::iam_email].
32062    ///
32063    /// # Example
32064    /// ```ignore,no_run
32065    /// # use google_cloud_sql_v1::model::User;
32066    /// let x = User::new().set_iam_email("example");
32067    /// ```
32068    pub fn set_iam_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32069        self.iam_email = v.into();
32070        self
32071    }
32072
32073    /// Sets the value of [password_policy][crate::model::User::password_policy].
32074    ///
32075    /// # Example
32076    /// ```ignore,no_run
32077    /// # use google_cloud_sql_v1::model::User;
32078    /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32079    /// let x = User::new().set_password_policy(UserPasswordValidationPolicy::default()/* use setters */);
32080    /// ```
32081    pub fn set_password_policy<T>(mut self, v: T) -> Self
32082    where
32083        T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
32084    {
32085        self.password_policy = std::option::Option::Some(v.into());
32086        self
32087    }
32088
32089    /// Sets or clears the value of [password_policy][crate::model::User::password_policy].
32090    ///
32091    /// # Example
32092    /// ```ignore,no_run
32093    /// # use google_cloud_sql_v1::model::User;
32094    /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32095    /// let x = User::new().set_or_clear_password_policy(Some(UserPasswordValidationPolicy::default()/* use setters */));
32096    /// let x = User::new().set_or_clear_password_policy(None::<UserPasswordValidationPolicy>);
32097    /// ```
32098    pub fn set_or_clear_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
32099    where
32100        T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
32101    {
32102        self.password_policy = v.map(|x| x.into());
32103        self
32104    }
32105
32106    /// Sets the value of [dual_password_type][crate::model::User::dual_password_type].
32107    ///
32108    /// # Example
32109    /// ```ignore,no_run
32110    /// # use google_cloud_sql_v1::model::User;
32111    /// use google_cloud_sql_v1::model::user::DualPasswordType;
32112    /// let x0 = User::new().set_dual_password_type(DualPasswordType::NoModifyDualPassword);
32113    /// let x1 = User::new().set_dual_password_type(DualPasswordType::NoDualPassword);
32114    /// let x2 = User::new().set_dual_password_type(DualPasswordType::DualPassword);
32115    /// ```
32116    pub fn set_dual_password_type<T>(mut self, v: T) -> Self
32117    where
32118        T: std::convert::Into<crate::model::user::DualPasswordType>,
32119    {
32120        self.dual_password_type = std::option::Option::Some(v.into());
32121        self
32122    }
32123
32124    /// Sets or clears the value of [dual_password_type][crate::model::User::dual_password_type].
32125    ///
32126    /// # Example
32127    /// ```ignore,no_run
32128    /// # use google_cloud_sql_v1::model::User;
32129    /// use google_cloud_sql_v1::model::user::DualPasswordType;
32130    /// let x0 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoModifyDualPassword));
32131    /// let x1 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoDualPassword));
32132    /// let x2 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::DualPassword));
32133    /// let x_none = User::new().set_or_clear_dual_password_type(None::<DualPasswordType>);
32134    /// ```
32135    pub fn set_or_clear_dual_password_type<T>(mut self, v: std::option::Option<T>) -> Self
32136    where
32137        T: std::convert::Into<crate::model::user::DualPasswordType>,
32138    {
32139        self.dual_password_type = v.map(|x| x.into());
32140        self
32141    }
32142
32143    /// Sets the value of [iam_status][crate::model::User::iam_status].
32144    ///
32145    /// # Example
32146    /// ```ignore,no_run
32147    /// # use google_cloud_sql_v1::model::User;
32148    /// use google_cloud_sql_v1::model::user::IamStatus;
32149    /// let x0 = User::new().set_iam_status(IamStatus::Inactive);
32150    /// let x1 = User::new().set_iam_status(IamStatus::Active);
32151    /// ```
32152    pub fn set_iam_status<T>(mut self, v: T) -> Self
32153    where
32154        T: std::convert::Into<crate::model::user::IamStatus>,
32155    {
32156        self.iam_status = std::option::Option::Some(v.into());
32157        self
32158    }
32159
32160    /// Sets or clears the value of [iam_status][crate::model::User::iam_status].
32161    ///
32162    /// # Example
32163    /// ```ignore,no_run
32164    /// # use google_cloud_sql_v1::model::User;
32165    /// use google_cloud_sql_v1::model::user::IamStatus;
32166    /// let x0 = User::new().set_or_clear_iam_status(Some(IamStatus::Inactive));
32167    /// let x1 = User::new().set_or_clear_iam_status(Some(IamStatus::Active));
32168    /// let x_none = User::new().set_or_clear_iam_status(None::<IamStatus>);
32169    /// ```
32170    pub fn set_or_clear_iam_status<T>(mut self, v: std::option::Option<T>) -> Self
32171    where
32172        T: std::convert::Into<crate::model::user::IamStatus>,
32173    {
32174        self.iam_status = v.map(|x| x.into());
32175        self
32176    }
32177
32178    /// Sets the value of [database_roles][crate::model::User::database_roles].
32179    ///
32180    /// # Example
32181    /// ```ignore,no_run
32182    /// # use google_cloud_sql_v1::model::User;
32183    /// let x = User::new().set_database_roles(["a", "b", "c"]);
32184    /// ```
32185    pub fn set_database_roles<T, V>(mut self, v: T) -> Self
32186    where
32187        T: std::iter::IntoIterator<Item = V>,
32188        V: std::convert::Into<std::string::String>,
32189    {
32190        use std::iter::Iterator;
32191        self.database_roles = v.into_iter().map(|i| i.into()).collect();
32192        self
32193    }
32194
32195    /// Sets the value of [user_details][crate::model::User::user_details].
32196    ///
32197    /// Note that all the setters affecting `user_details` are mutually
32198    /// exclusive.
32199    ///
32200    /// # Example
32201    /// ```ignore,no_run
32202    /// # use google_cloud_sql_v1::model::User;
32203    /// use google_cloud_sql_v1::model::SqlServerUserDetails;
32204    /// let x = User::new().set_user_details(Some(
32205    ///     google_cloud_sql_v1::model::user::UserDetails::SqlserverUserDetails(SqlServerUserDetails::default().into())));
32206    /// ```
32207    pub fn set_user_details<
32208        T: std::convert::Into<std::option::Option<crate::model::user::UserDetails>>,
32209    >(
32210        mut self,
32211        v: T,
32212    ) -> Self {
32213        self.user_details = v.into();
32214        self
32215    }
32216
32217    /// The value of [user_details][crate::model::User::user_details]
32218    /// if it holds a `SqlserverUserDetails`, `None` if the field is not set or
32219    /// holds a different branch.
32220    pub fn sqlserver_user_details(
32221        &self,
32222    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerUserDetails>> {
32223        #[allow(unreachable_patterns)]
32224        self.user_details.as_ref().and_then(|v| match v {
32225            crate::model::user::UserDetails::SqlserverUserDetails(v) => {
32226                std::option::Option::Some(v)
32227            }
32228            _ => std::option::Option::None,
32229        })
32230    }
32231
32232    /// Sets the value of [user_details][crate::model::User::user_details]
32233    /// to hold a `SqlserverUserDetails`.
32234    ///
32235    /// Note that all the setters affecting `user_details` are
32236    /// mutually exclusive.
32237    ///
32238    /// # Example
32239    /// ```ignore,no_run
32240    /// # use google_cloud_sql_v1::model::User;
32241    /// use google_cloud_sql_v1::model::SqlServerUserDetails;
32242    /// let x = User::new().set_sqlserver_user_details(SqlServerUserDetails::default()/* use setters */);
32243    /// assert!(x.sqlserver_user_details().is_some());
32244    /// ```
32245    pub fn set_sqlserver_user_details<
32246        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerUserDetails>>,
32247    >(
32248        mut self,
32249        v: T,
32250    ) -> Self {
32251        self.user_details = std::option::Option::Some(
32252            crate::model::user::UserDetails::SqlserverUserDetails(v.into()),
32253        );
32254        self
32255    }
32256}
32257
32258impl wkt::message::Message for User {
32259    fn typename() -> &'static str {
32260        "type.googleapis.com/google.cloud.sql.v1.User"
32261    }
32262}
32263
32264/// Defines additional types related to [User].
32265pub mod user {
32266    #[allow(unused_imports)]
32267    use super::*;
32268
32269    /// The user type.
32270    ///
32271    /// # Working with unknown values
32272    ///
32273    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32274    /// additional enum variants at any time. Adding new variants is not considered
32275    /// a breaking change. Applications should write their code in anticipation of:
32276    ///
32277    /// - New values appearing in future releases of the client library, **and**
32278    /// - New values received dynamically, without application changes.
32279    ///
32280    /// Please consult the [Working with enums] section in the user guide for some
32281    /// guidelines.
32282    ///
32283    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32284    #[derive(Clone, Debug, PartialEq)]
32285    #[non_exhaustive]
32286    pub enum SqlUserType {
32287        /// The database's built-in user type.
32288        BuiltIn,
32289        /// Cloud IAM user.
32290        CloudIamUser,
32291        /// Cloud IAM service account.
32292        CloudIamServiceAccount,
32293        /// Cloud IAM group. Not used for login.
32294        CloudIamGroup,
32295        /// Read-only. Login for a user that belongs to the Cloud IAM group.
32296        CloudIamGroupUser,
32297        /// Read-only. Login for a service account that belongs to the
32298        /// Cloud IAM group.
32299        CloudIamGroupServiceAccount,
32300        /// Microsoft Entra ID user.
32301        EntraidUser,
32302        /// If set, the enum was initialized with an unknown value.
32303        ///
32304        /// Applications can examine the value using [SqlUserType::value] or
32305        /// [SqlUserType::name].
32306        UnknownValue(sql_user_type::UnknownValue),
32307    }
32308
32309    #[doc(hidden)]
32310    pub mod sql_user_type {
32311        #[allow(unused_imports)]
32312        use super::*;
32313        #[derive(Clone, Debug, PartialEq)]
32314        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32315    }
32316
32317    impl SqlUserType {
32318        /// Gets the enum value.
32319        ///
32320        /// Returns `None` if the enum contains an unknown value deserialized from
32321        /// the string representation of enums.
32322        pub fn value(&self) -> std::option::Option<i32> {
32323            match self {
32324                Self::BuiltIn => std::option::Option::Some(0),
32325                Self::CloudIamUser => std::option::Option::Some(1),
32326                Self::CloudIamServiceAccount => std::option::Option::Some(2),
32327                Self::CloudIamGroup => std::option::Option::Some(3),
32328                Self::CloudIamGroupUser => std::option::Option::Some(4),
32329                Self::CloudIamGroupServiceAccount => std::option::Option::Some(5),
32330                Self::EntraidUser => std::option::Option::Some(7),
32331                Self::UnknownValue(u) => u.0.value(),
32332            }
32333        }
32334
32335        /// Gets the enum value as a string.
32336        ///
32337        /// Returns `None` if the enum contains an unknown value deserialized from
32338        /// the integer representation of enums.
32339        pub fn name(&self) -> std::option::Option<&str> {
32340            match self {
32341                Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
32342                Self::CloudIamUser => std::option::Option::Some("CLOUD_IAM_USER"),
32343                Self::CloudIamServiceAccount => {
32344                    std::option::Option::Some("CLOUD_IAM_SERVICE_ACCOUNT")
32345                }
32346                Self::CloudIamGroup => std::option::Option::Some("CLOUD_IAM_GROUP"),
32347                Self::CloudIamGroupUser => std::option::Option::Some("CLOUD_IAM_GROUP_USER"),
32348                Self::CloudIamGroupServiceAccount => {
32349                    std::option::Option::Some("CLOUD_IAM_GROUP_SERVICE_ACCOUNT")
32350                }
32351                Self::EntraidUser => std::option::Option::Some("ENTRAID_USER"),
32352                Self::UnknownValue(u) => u.0.name(),
32353            }
32354        }
32355    }
32356
32357    impl std::default::Default for SqlUserType {
32358        fn default() -> Self {
32359            use std::convert::From;
32360            Self::from(0)
32361        }
32362    }
32363
32364    impl std::fmt::Display for SqlUserType {
32365        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32366            wkt::internal::display_enum(f, self.name(), self.value())
32367        }
32368    }
32369
32370    impl std::convert::From<i32> for SqlUserType {
32371        fn from(value: i32) -> Self {
32372            match value {
32373                0 => Self::BuiltIn,
32374                1 => Self::CloudIamUser,
32375                2 => Self::CloudIamServiceAccount,
32376                3 => Self::CloudIamGroup,
32377                4 => Self::CloudIamGroupUser,
32378                5 => Self::CloudIamGroupServiceAccount,
32379                7 => Self::EntraidUser,
32380                _ => Self::UnknownValue(sql_user_type::UnknownValue(
32381                    wkt::internal::UnknownEnumValue::Integer(value),
32382                )),
32383            }
32384        }
32385    }
32386
32387    impl std::convert::From<&str> for SqlUserType {
32388        fn from(value: &str) -> Self {
32389            use std::string::ToString;
32390            match value {
32391                "BUILT_IN" => Self::BuiltIn,
32392                "CLOUD_IAM_USER" => Self::CloudIamUser,
32393                "CLOUD_IAM_SERVICE_ACCOUNT" => Self::CloudIamServiceAccount,
32394                "CLOUD_IAM_GROUP" => Self::CloudIamGroup,
32395                "CLOUD_IAM_GROUP_USER" => Self::CloudIamGroupUser,
32396                "CLOUD_IAM_GROUP_SERVICE_ACCOUNT" => Self::CloudIamGroupServiceAccount,
32397                "ENTRAID_USER" => Self::EntraidUser,
32398                _ => Self::UnknownValue(sql_user_type::UnknownValue(
32399                    wkt::internal::UnknownEnumValue::String(value.to_string()),
32400                )),
32401            }
32402        }
32403    }
32404
32405    impl serde::ser::Serialize for SqlUserType {
32406        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32407        where
32408            S: serde::Serializer,
32409        {
32410            match self {
32411                Self::BuiltIn => serializer.serialize_i32(0),
32412                Self::CloudIamUser => serializer.serialize_i32(1),
32413                Self::CloudIamServiceAccount => serializer.serialize_i32(2),
32414                Self::CloudIamGroup => serializer.serialize_i32(3),
32415                Self::CloudIamGroupUser => serializer.serialize_i32(4),
32416                Self::CloudIamGroupServiceAccount => serializer.serialize_i32(5),
32417                Self::EntraidUser => serializer.serialize_i32(7),
32418                Self::UnknownValue(u) => u.0.serialize(serializer),
32419            }
32420        }
32421    }
32422
32423    impl<'de> serde::de::Deserialize<'de> for SqlUserType {
32424        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32425        where
32426            D: serde::Deserializer<'de>,
32427        {
32428            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUserType>::new(
32429                ".google.cloud.sql.v1.User.SqlUserType",
32430            ))
32431        }
32432    }
32433
32434    /// The type of retained password.
32435    ///
32436    /// # Working with unknown values
32437    ///
32438    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32439    /// additional enum variants at any time. Adding new variants is not considered
32440    /// a breaking change. Applications should write their code in anticipation of:
32441    ///
32442    /// - New values appearing in future releases of the client library, **and**
32443    /// - New values received dynamically, without application changes.
32444    ///
32445    /// Please consult the [Working with enums] section in the user guide for some
32446    /// guidelines.
32447    ///
32448    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32449    #[derive(Clone, Debug, PartialEq)]
32450    #[non_exhaustive]
32451    pub enum DualPasswordType {
32452        /// The default value.
32453        Unspecified,
32454        /// Do not update the user's dual password status.
32455        NoModifyDualPassword,
32456        /// No dual password usable for connecting using this user.
32457        NoDualPassword,
32458        /// Dual password usable for connecting using this user.
32459        DualPassword,
32460        /// If set, the enum was initialized with an unknown value.
32461        ///
32462        /// Applications can examine the value using [DualPasswordType::value] or
32463        /// [DualPasswordType::name].
32464        UnknownValue(dual_password_type::UnknownValue),
32465    }
32466
32467    #[doc(hidden)]
32468    pub mod dual_password_type {
32469        #[allow(unused_imports)]
32470        use super::*;
32471        #[derive(Clone, Debug, PartialEq)]
32472        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32473    }
32474
32475    impl DualPasswordType {
32476        /// Gets the enum value.
32477        ///
32478        /// Returns `None` if the enum contains an unknown value deserialized from
32479        /// the string representation of enums.
32480        pub fn value(&self) -> std::option::Option<i32> {
32481            match self {
32482                Self::Unspecified => std::option::Option::Some(0),
32483                Self::NoModifyDualPassword => std::option::Option::Some(1),
32484                Self::NoDualPassword => std::option::Option::Some(2),
32485                Self::DualPassword => std::option::Option::Some(3),
32486                Self::UnknownValue(u) => u.0.value(),
32487            }
32488        }
32489
32490        /// Gets the enum value as a string.
32491        ///
32492        /// Returns `None` if the enum contains an unknown value deserialized from
32493        /// the integer representation of enums.
32494        pub fn name(&self) -> std::option::Option<&str> {
32495            match self {
32496                Self::Unspecified => std::option::Option::Some("DUAL_PASSWORD_TYPE_UNSPECIFIED"),
32497                Self::NoModifyDualPassword => std::option::Option::Some("NO_MODIFY_DUAL_PASSWORD"),
32498                Self::NoDualPassword => std::option::Option::Some("NO_DUAL_PASSWORD"),
32499                Self::DualPassword => std::option::Option::Some("DUAL_PASSWORD"),
32500                Self::UnknownValue(u) => u.0.name(),
32501            }
32502        }
32503    }
32504
32505    impl std::default::Default for DualPasswordType {
32506        fn default() -> Self {
32507            use std::convert::From;
32508            Self::from(0)
32509        }
32510    }
32511
32512    impl std::fmt::Display for DualPasswordType {
32513        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32514            wkt::internal::display_enum(f, self.name(), self.value())
32515        }
32516    }
32517
32518    impl std::convert::From<i32> for DualPasswordType {
32519        fn from(value: i32) -> Self {
32520            match value {
32521                0 => Self::Unspecified,
32522                1 => Self::NoModifyDualPassword,
32523                2 => Self::NoDualPassword,
32524                3 => Self::DualPassword,
32525                _ => Self::UnknownValue(dual_password_type::UnknownValue(
32526                    wkt::internal::UnknownEnumValue::Integer(value),
32527                )),
32528            }
32529        }
32530    }
32531
32532    impl std::convert::From<&str> for DualPasswordType {
32533        fn from(value: &str) -> Self {
32534            use std::string::ToString;
32535            match value {
32536                "DUAL_PASSWORD_TYPE_UNSPECIFIED" => Self::Unspecified,
32537                "NO_MODIFY_DUAL_PASSWORD" => Self::NoModifyDualPassword,
32538                "NO_DUAL_PASSWORD" => Self::NoDualPassword,
32539                "DUAL_PASSWORD" => Self::DualPassword,
32540                _ => Self::UnknownValue(dual_password_type::UnknownValue(
32541                    wkt::internal::UnknownEnumValue::String(value.to_string()),
32542                )),
32543            }
32544        }
32545    }
32546
32547    impl serde::ser::Serialize for DualPasswordType {
32548        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32549        where
32550            S: serde::Serializer,
32551        {
32552            match self {
32553                Self::Unspecified => serializer.serialize_i32(0),
32554                Self::NoModifyDualPassword => serializer.serialize_i32(1),
32555                Self::NoDualPassword => serializer.serialize_i32(2),
32556                Self::DualPassword => serializer.serialize_i32(3),
32557                Self::UnknownValue(u) => u.0.serialize(serializer),
32558            }
32559        }
32560    }
32561
32562    impl<'de> serde::de::Deserialize<'de> for DualPasswordType {
32563        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32564        where
32565            D: serde::Deserializer<'de>,
32566        {
32567            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DualPasswordType>::new(
32568                ".google.cloud.sql.v1.User.DualPasswordType",
32569            ))
32570        }
32571    }
32572
32573    /// Indicates if a group is available for IAM database authentication.
32574    ///
32575    /// # Working with unknown values
32576    ///
32577    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32578    /// additional enum variants at any time. Adding new variants is not considered
32579    /// a breaking change. Applications should write their code in anticipation of:
32580    ///
32581    /// - New values appearing in future releases of the client library, **and**
32582    /// - New values received dynamically, without application changes.
32583    ///
32584    /// Please consult the [Working with enums] section in the user guide for some
32585    /// guidelines.
32586    ///
32587    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32588    #[derive(Clone, Debug, PartialEq)]
32589    #[non_exhaustive]
32590    pub enum IamStatus {
32591        /// The default value for users that are not of type CLOUD_IAM_GROUP.
32592        /// Only CLOUD_IAM_GROUP users will be inactive or active.
32593        /// Users with an IamStatus of IAM_STATUS_UNSPECIFIED will not
32594        /// display whether they are active or inactive as that is not applicable to
32595        /// them.
32596        Unspecified,
32597        /// INACTIVE indicates a group is not available for IAM database
32598        /// authentication.
32599        Inactive,
32600        /// ACTIVE indicates a group is available for IAM database authentication.
32601        Active,
32602        /// If set, the enum was initialized with an unknown value.
32603        ///
32604        /// Applications can examine the value using [IamStatus::value] or
32605        /// [IamStatus::name].
32606        UnknownValue(iam_status::UnknownValue),
32607    }
32608
32609    #[doc(hidden)]
32610    pub mod iam_status {
32611        #[allow(unused_imports)]
32612        use super::*;
32613        #[derive(Clone, Debug, PartialEq)]
32614        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32615    }
32616
32617    impl IamStatus {
32618        /// Gets the enum value.
32619        ///
32620        /// Returns `None` if the enum contains an unknown value deserialized from
32621        /// the string representation of enums.
32622        pub fn value(&self) -> std::option::Option<i32> {
32623            match self {
32624                Self::Unspecified => std::option::Option::Some(0),
32625                Self::Inactive => std::option::Option::Some(1),
32626                Self::Active => std::option::Option::Some(2),
32627                Self::UnknownValue(u) => u.0.value(),
32628            }
32629        }
32630
32631        /// Gets the enum value as a string.
32632        ///
32633        /// Returns `None` if the enum contains an unknown value deserialized from
32634        /// the integer representation of enums.
32635        pub fn name(&self) -> std::option::Option<&str> {
32636            match self {
32637                Self::Unspecified => std::option::Option::Some("IAM_STATUS_UNSPECIFIED"),
32638                Self::Inactive => std::option::Option::Some("INACTIVE"),
32639                Self::Active => std::option::Option::Some("ACTIVE"),
32640                Self::UnknownValue(u) => u.0.name(),
32641            }
32642        }
32643    }
32644
32645    impl std::default::Default for IamStatus {
32646        fn default() -> Self {
32647            use std::convert::From;
32648            Self::from(0)
32649        }
32650    }
32651
32652    impl std::fmt::Display for IamStatus {
32653        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32654            wkt::internal::display_enum(f, self.name(), self.value())
32655        }
32656    }
32657
32658    impl std::convert::From<i32> for IamStatus {
32659        fn from(value: i32) -> Self {
32660            match value {
32661                0 => Self::Unspecified,
32662                1 => Self::Inactive,
32663                2 => Self::Active,
32664                _ => Self::UnknownValue(iam_status::UnknownValue(
32665                    wkt::internal::UnknownEnumValue::Integer(value),
32666                )),
32667            }
32668        }
32669    }
32670
32671    impl std::convert::From<&str> for IamStatus {
32672        fn from(value: &str) -> Self {
32673            use std::string::ToString;
32674            match value {
32675                "IAM_STATUS_UNSPECIFIED" => Self::Unspecified,
32676                "INACTIVE" => Self::Inactive,
32677                "ACTIVE" => Self::Active,
32678                _ => Self::UnknownValue(iam_status::UnknownValue(
32679                    wkt::internal::UnknownEnumValue::String(value.to_string()),
32680                )),
32681            }
32682        }
32683    }
32684
32685    impl serde::ser::Serialize for IamStatus {
32686        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32687        where
32688            S: serde::Serializer,
32689        {
32690            match self {
32691                Self::Unspecified => serializer.serialize_i32(0),
32692                Self::Inactive => serializer.serialize_i32(1),
32693                Self::Active => serializer.serialize_i32(2),
32694                Self::UnknownValue(u) => u.0.serialize(serializer),
32695            }
32696        }
32697    }
32698
32699    impl<'de> serde::de::Deserialize<'de> for IamStatus {
32700        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32701        where
32702            D: serde::Deserializer<'de>,
32703        {
32704            deserializer.deserialize_any(wkt::internal::EnumVisitor::<IamStatus>::new(
32705                ".google.cloud.sql.v1.User.IamStatus",
32706            ))
32707        }
32708    }
32709
32710    /// User details for specific database type
32711    #[derive(Clone, Debug, PartialEq)]
32712    #[non_exhaustive]
32713    pub enum UserDetails {
32714        #[allow(missing_docs)]
32715        SqlserverUserDetails(std::boxed::Box<crate::model::SqlServerUserDetails>),
32716    }
32717}
32718
32719/// Represents a Sql Server user on the Cloud SQL instance.
32720#[derive(Clone, Default, PartialEq)]
32721#[non_exhaustive]
32722pub struct SqlServerUserDetails {
32723    /// If the user has been disabled
32724    pub disabled: bool,
32725
32726    /// The server roles for this user
32727    pub server_roles: std::vec::Vec<std::string::String>,
32728
32729    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32730}
32731
32732impl SqlServerUserDetails {
32733    /// Creates a new default instance.
32734    pub fn new() -> Self {
32735        std::default::Default::default()
32736    }
32737
32738    /// Sets the value of [disabled][crate::model::SqlServerUserDetails::disabled].
32739    ///
32740    /// # Example
32741    /// ```ignore,no_run
32742    /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
32743    /// let x = SqlServerUserDetails::new().set_disabled(true);
32744    /// ```
32745    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
32746        self.disabled = v.into();
32747        self
32748    }
32749
32750    /// Sets the value of [server_roles][crate::model::SqlServerUserDetails::server_roles].
32751    ///
32752    /// # Example
32753    /// ```ignore,no_run
32754    /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
32755    /// let x = SqlServerUserDetails::new().set_server_roles(["a", "b", "c"]);
32756    /// ```
32757    pub fn set_server_roles<T, V>(mut self, v: T) -> Self
32758    where
32759        T: std::iter::IntoIterator<Item = V>,
32760        V: std::convert::Into<std::string::String>,
32761    {
32762        use std::iter::Iterator;
32763        self.server_roles = v.into_iter().map(|i| i.into()).collect();
32764        self
32765    }
32766}
32767
32768impl wkt::message::Message for SqlServerUserDetails {
32769    fn typename() -> &'static str {
32770        "type.googleapis.com/google.cloud.sql.v1.SqlServerUserDetails"
32771    }
32772}
32773
32774/// User list response.
32775#[derive(Clone, Default, PartialEq)]
32776#[non_exhaustive]
32777pub struct UsersListResponse {
32778    /// This is always `sql#usersList`.
32779    pub kind: std::string::String,
32780
32781    /// List of user resources in the instance.
32782    pub items: std::vec::Vec<crate::model::User>,
32783
32784    /// Unused.
32785    #[deprecated]
32786    pub next_page_token: std::string::String,
32787
32788    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32789}
32790
32791impl UsersListResponse {
32792    /// Creates a new default instance.
32793    pub fn new() -> Self {
32794        std::default::Default::default()
32795    }
32796
32797    /// Sets the value of [kind][crate::model::UsersListResponse::kind].
32798    ///
32799    /// # Example
32800    /// ```ignore,no_run
32801    /// # use google_cloud_sql_v1::model::UsersListResponse;
32802    /// let x = UsersListResponse::new().set_kind("example");
32803    /// ```
32804    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32805        self.kind = v.into();
32806        self
32807    }
32808
32809    /// Sets the value of [items][crate::model::UsersListResponse::items].
32810    ///
32811    /// # Example
32812    /// ```ignore,no_run
32813    /// # use google_cloud_sql_v1::model::UsersListResponse;
32814    /// use google_cloud_sql_v1::model::User;
32815    /// let x = UsersListResponse::new()
32816    ///     .set_items([
32817    ///         User::default()/* use setters */,
32818    ///         User::default()/* use (different) setters */,
32819    ///     ]);
32820    /// ```
32821    pub fn set_items<T, V>(mut self, v: T) -> Self
32822    where
32823        T: std::iter::IntoIterator<Item = V>,
32824        V: std::convert::Into<crate::model::User>,
32825    {
32826        use std::iter::Iterator;
32827        self.items = v.into_iter().map(|i| i.into()).collect();
32828        self
32829    }
32830
32831    /// Sets the value of [next_page_token][crate::model::UsersListResponse::next_page_token].
32832    ///
32833    /// # Example
32834    /// ```ignore,no_run
32835    /// # use google_cloud_sql_v1::model::UsersListResponse;
32836    /// let x = UsersListResponse::new().set_next_page_token("example");
32837    /// ```
32838    #[deprecated]
32839    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32840        self.next_page_token = v.into();
32841        self
32842    }
32843}
32844
32845impl wkt::message::Message for UsersListResponse {
32846    fn typename() -> &'static str {
32847        "type.googleapis.com/google.cloud.sql.v1.UsersListResponse"
32848    }
32849}
32850
32851/// The status of a backup run.
32852///
32853/// # Working with unknown values
32854///
32855/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32856/// additional enum variants at any time. Adding new variants is not considered
32857/// a breaking change. Applications should write their code in anticipation of:
32858///
32859/// - New values appearing in future releases of the client library, **and**
32860/// - New values received dynamically, without application changes.
32861///
32862/// Please consult the [Working with enums] section in the user guide for some
32863/// guidelines.
32864///
32865/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32866#[derive(Clone, Debug, PartialEq)]
32867#[non_exhaustive]
32868pub enum SqlBackupRunStatus {
32869    /// The status of the run is unknown.
32870    Unspecified,
32871    /// The backup operation was enqueued.
32872    Enqueued,
32873    /// The backup is overdue across a given backup window. Indicates a
32874    /// problem. Example: Long-running operation in progress during
32875    /// the whole window.
32876    Overdue,
32877    /// The backup is in progress.
32878    Running,
32879    /// The backup failed.
32880    Failed,
32881    /// The backup was successful.
32882    Successful,
32883    /// The backup was skipped (without problems) for a given backup
32884    /// window. Example: Instance was idle.
32885    Skipped,
32886    /// The backup is about to be deleted.
32887    DeletionPending,
32888    /// The backup deletion failed.
32889    DeletionFailed,
32890    /// The backup has been deleted.
32891    Deleted,
32892    /// If set, the enum was initialized with an unknown value.
32893    ///
32894    /// Applications can examine the value using [SqlBackupRunStatus::value] or
32895    /// [SqlBackupRunStatus::name].
32896    UnknownValue(sql_backup_run_status::UnknownValue),
32897}
32898
32899#[doc(hidden)]
32900pub mod sql_backup_run_status {
32901    #[allow(unused_imports)]
32902    use super::*;
32903    #[derive(Clone, Debug, PartialEq)]
32904    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32905}
32906
32907impl SqlBackupRunStatus {
32908    /// Gets the enum value.
32909    ///
32910    /// Returns `None` if the enum contains an unknown value deserialized from
32911    /// the string representation of enums.
32912    pub fn value(&self) -> std::option::Option<i32> {
32913        match self {
32914            Self::Unspecified => std::option::Option::Some(0),
32915            Self::Enqueued => std::option::Option::Some(1),
32916            Self::Overdue => std::option::Option::Some(2),
32917            Self::Running => std::option::Option::Some(3),
32918            Self::Failed => std::option::Option::Some(4),
32919            Self::Successful => std::option::Option::Some(5),
32920            Self::Skipped => std::option::Option::Some(6),
32921            Self::DeletionPending => std::option::Option::Some(7),
32922            Self::DeletionFailed => std::option::Option::Some(8),
32923            Self::Deleted => std::option::Option::Some(9),
32924            Self::UnknownValue(u) => u.0.value(),
32925        }
32926    }
32927
32928    /// Gets the enum value as a string.
32929    ///
32930    /// Returns `None` if the enum contains an unknown value deserialized from
32931    /// the integer representation of enums.
32932    pub fn name(&self) -> std::option::Option<&str> {
32933        match self {
32934            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_STATUS_UNSPECIFIED"),
32935            Self::Enqueued => std::option::Option::Some("ENQUEUED"),
32936            Self::Overdue => std::option::Option::Some("OVERDUE"),
32937            Self::Running => std::option::Option::Some("RUNNING"),
32938            Self::Failed => std::option::Option::Some("FAILED"),
32939            Self::Successful => std::option::Option::Some("SUCCESSFUL"),
32940            Self::Skipped => std::option::Option::Some("SKIPPED"),
32941            Self::DeletionPending => std::option::Option::Some("DELETION_PENDING"),
32942            Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
32943            Self::Deleted => std::option::Option::Some("DELETED"),
32944            Self::UnknownValue(u) => u.0.name(),
32945        }
32946    }
32947}
32948
32949impl std::default::Default for SqlBackupRunStatus {
32950    fn default() -> Self {
32951        use std::convert::From;
32952        Self::from(0)
32953    }
32954}
32955
32956impl std::fmt::Display for SqlBackupRunStatus {
32957    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32958        wkt::internal::display_enum(f, self.name(), self.value())
32959    }
32960}
32961
32962impl std::convert::From<i32> for SqlBackupRunStatus {
32963    fn from(value: i32) -> Self {
32964        match value {
32965            0 => Self::Unspecified,
32966            1 => Self::Enqueued,
32967            2 => Self::Overdue,
32968            3 => Self::Running,
32969            4 => Self::Failed,
32970            5 => Self::Successful,
32971            6 => Self::Skipped,
32972            7 => Self::DeletionPending,
32973            8 => Self::DeletionFailed,
32974            9 => Self::Deleted,
32975            _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
32976                wkt::internal::UnknownEnumValue::Integer(value),
32977            )),
32978        }
32979    }
32980}
32981
32982impl std::convert::From<&str> for SqlBackupRunStatus {
32983    fn from(value: &str) -> Self {
32984        use std::string::ToString;
32985        match value {
32986            "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" => Self::Unspecified,
32987            "ENQUEUED" => Self::Enqueued,
32988            "OVERDUE" => Self::Overdue,
32989            "RUNNING" => Self::Running,
32990            "FAILED" => Self::Failed,
32991            "SUCCESSFUL" => Self::Successful,
32992            "SKIPPED" => Self::Skipped,
32993            "DELETION_PENDING" => Self::DeletionPending,
32994            "DELETION_FAILED" => Self::DeletionFailed,
32995            "DELETED" => Self::Deleted,
32996            _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
32997                wkt::internal::UnknownEnumValue::String(value.to_string()),
32998            )),
32999        }
33000    }
33001}
33002
33003impl serde::ser::Serialize for SqlBackupRunStatus {
33004    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33005    where
33006        S: serde::Serializer,
33007    {
33008        match self {
33009            Self::Unspecified => serializer.serialize_i32(0),
33010            Self::Enqueued => serializer.serialize_i32(1),
33011            Self::Overdue => serializer.serialize_i32(2),
33012            Self::Running => serializer.serialize_i32(3),
33013            Self::Failed => serializer.serialize_i32(4),
33014            Self::Successful => serializer.serialize_i32(5),
33015            Self::Skipped => serializer.serialize_i32(6),
33016            Self::DeletionPending => serializer.serialize_i32(7),
33017            Self::DeletionFailed => serializer.serialize_i32(8),
33018            Self::Deleted => serializer.serialize_i32(9),
33019            Self::UnknownValue(u) => u.0.serialize(serializer),
33020        }
33021    }
33022}
33023
33024impl<'de> serde::de::Deserialize<'de> for SqlBackupRunStatus {
33025    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33026    where
33027        D: serde::Deserializer<'de>,
33028    {
33029        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunStatus>::new(
33030            ".google.cloud.sql.v1.SqlBackupRunStatus",
33031        ))
33032    }
33033}
33034
33035/// Defines the supported backup kinds.
33036///
33037/// # Working with unknown values
33038///
33039/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33040/// additional enum variants at any time. Adding new variants is not considered
33041/// a breaking change. Applications should write their code in anticipation of:
33042///
33043/// - New values appearing in future releases of the client library, **and**
33044/// - New values received dynamically, without application changes.
33045///
33046/// Please consult the [Working with enums] section in the user guide for some
33047/// guidelines.
33048///
33049/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33050#[derive(Clone, Debug, PartialEq)]
33051#[non_exhaustive]
33052pub enum SqlBackupKind {
33053    /// This is an unknown BackupKind.
33054    Unspecified,
33055    /// Snapshot-based backups.
33056    Snapshot,
33057    /// Physical backups.
33058    Physical,
33059    /// If set, the enum was initialized with an unknown value.
33060    ///
33061    /// Applications can examine the value using [SqlBackupKind::value] or
33062    /// [SqlBackupKind::name].
33063    UnknownValue(sql_backup_kind::UnknownValue),
33064}
33065
33066#[doc(hidden)]
33067pub mod sql_backup_kind {
33068    #[allow(unused_imports)]
33069    use super::*;
33070    #[derive(Clone, Debug, PartialEq)]
33071    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33072}
33073
33074impl SqlBackupKind {
33075    /// Gets the enum value.
33076    ///
33077    /// Returns `None` if the enum contains an unknown value deserialized from
33078    /// the string representation of enums.
33079    pub fn value(&self) -> std::option::Option<i32> {
33080        match self {
33081            Self::Unspecified => std::option::Option::Some(0),
33082            Self::Snapshot => std::option::Option::Some(1),
33083            Self::Physical => std::option::Option::Some(2),
33084            Self::UnknownValue(u) => u.0.value(),
33085        }
33086    }
33087
33088    /// Gets the enum value as a string.
33089    ///
33090    /// Returns `None` if the enum contains an unknown value deserialized from
33091    /// the integer representation of enums.
33092    pub fn name(&self) -> std::option::Option<&str> {
33093        match self {
33094            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_KIND_UNSPECIFIED"),
33095            Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
33096            Self::Physical => std::option::Option::Some("PHYSICAL"),
33097            Self::UnknownValue(u) => u.0.name(),
33098        }
33099    }
33100}
33101
33102impl std::default::Default for SqlBackupKind {
33103    fn default() -> Self {
33104        use std::convert::From;
33105        Self::from(0)
33106    }
33107}
33108
33109impl std::fmt::Display for SqlBackupKind {
33110    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33111        wkt::internal::display_enum(f, self.name(), self.value())
33112    }
33113}
33114
33115impl std::convert::From<i32> for SqlBackupKind {
33116    fn from(value: i32) -> Self {
33117        match value {
33118            0 => Self::Unspecified,
33119            1 => Self::Snapshot,
33120            2 => Self::Physical,
33121            _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
33122                wkt::internal::UnknownEnumValue::Integer(value),
33123            )),
33124        }
33125    }
33126}
33127
33128impl std::convert::From<&str> for SqlBackupKind {
33129    fn from(value: &str) -> Self {
33130        use std::string::ToString;
33131        match value {
33132            "SQL_BACKUP_KIND_UNSPECIFIED" => Self::Unspecified,
33133            "SNAPSHOT" => Self::Snapshot,
33134            "PHYSICAL" => Self::Physical,
33135            _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
33136                wkt::internal::UnknownEnumValue::String(value.to_string()),
33137            )),
33138        }
33139    }
33140}
33141
33142impl serde::ser::Serialize for SqlBackupKind {
33143    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33144    where
33145        S: serde::Serializer,
33146    {
33147        match self {
33148            Self::Unspecified => serializer.serialize_i32(0),
33149            Self::Snapshot => serializer.serialize_i32(1),
33150            Self::Physical => serializer.serialize_i32(2),
33151            Self::UnknownValue(u) => u.0.serialize(serializer),
33152        }
33153    }
33154}
33155
33156impl<'de> serde::de::Deserialize<'de> for SqlBackupKind {
33157    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33158    where
33159        D: serde::Deserializer<'de>,
33160    {
33161        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupKind>::new(
33162            ".google.cloud.sql.v1.SqlBackupKind",
33163        ))
33164    }
33165}
33166
33167/// Type of backup (i.e. automated, on demand, etc).
33168///
33169/// # Working with unknown values
33170///
33171/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33172/// additional enum variants at any time. Adding new variants is not considered
33173/// a breaking change. Applications should write their code in anticipation of:
33174///
33175/// - New values appearing in future releases of the client library, **and**
33176/// - New values received dynamically, without application changes.
33177///
33178/// Please consult the [Working with enums] section in the user guide for some
33179/// guidelines.
33180///
33181/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33182#[derive(Clone, Debug, PartialEq)]
33183#[non_exhaustive]
33184pub enum SqlBackupRunType {
33185    /// This is an unknown BackupRun type.
33186    Unspecified,
33187    /// The backup schedule automatically triggers a backup.
33188    Automated,
33189    /// The user manually triggers a backup.
33190    OnDemand,
33191    /// If set, the enum was initialized with an unknown value.
33192    ///
33193    /// Applications can examine the value using [SqlBackupRunType::value] or
33194    /// [SqlBackupRunType::name].
33195    UnknownValue(sql_backup_run_type::UnknownValue),
33196}
33197
33198#[doc(hidden)]
33199pub mod sql_backup_run_type {
33200    #[allow(unused_imports)]
33201    use super::*;
33202    #[derive(Clone, Debug, PartialEq)]
33203    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33204}
33205
33206impl SqlBackupRunType {
33207    /// Gets the enum value.
33208    ///
33209    /// Returns `None` if the enum contains an unknown value deserialized from
33210    /// the string representation of enums.
33211    pub fn value(&self) -> std::option::Option<i32> {
33212        match self {
33213            Self::Unspecified => std::option::Option::Some(0),
33214            Self::Automated => std::option::Option::Some(1),
33215            Self::OnDemand => std::option::Option::Some(2),
33216            Self::UnknownValue(u) => u.0.value(),
33217        }
33218    }
33219
33220    /// Gets the enum value as a string.
33221    ///
33222    /// Returns `None` if the enum contains an unknown value deserialized from
33223    /// the integer representation of enums.
33224    pub fn name(&self) -> std::option::Option<&str> {
33225        match self {
33226            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_TYPE_UNSPECIFIED"),
33227            Self::Automated => std::option::Option::Some("AUTOMATED"),
33228            Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
33229            Self::UnknownValue(u) => u.0.name(),
33230        }
33231    }
33232}
33233
33234impl std::default::Default for SqlBackupRunType {
33235    fn default() -> Self {
33236        use std::convert::From;
33237        Self::from(0)
33238    }
33239}
33240
33241impl std::fmt::Display for SqlBackupRunType {
33242    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33243        wkt::internal::display_enum(f, self.name(), self.value())
33244    }
33245}
33246
33247impl std::convert::From<i32> for SqlBackupRunType {
33248    fn from(value: i32) -> Self {
33249        match value {
33250            0 => Self::Unspecified,
33251            1 => Self::Automated,
33252            2 => Self::OnDemand,
33253            _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
33254                wkt::internal::UnknownEnumValue::Integer(value),
33255            )),
33256        }
33257    }
33258}
33259
33260impl std::convert::From<&str> for SqlBackupRunType {
33261    fn from(value: &str) -> Self {
33262        use std::string::ToString;
33263        match value {
33264            "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" => Self::Unspecified,
33265            "AUTOMATED" => Self::Automated,
33266            "ON_DEMAND" => Self::OnDemand,
33267            _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
33268                wkt::internal::UnknownEnumValue::String(value.to_string()),
33269            )),
33270        }
33271    }
33272}
33273
33274impl serde::ser::Serialize for SqlBackupRunType {
33275    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33276    where
33277        S: serde::Serializer,
33278    {
33279        match self {
33280            Self::Unspecified => serializer.serialize_i32(0),
33281            Self::Automated => serializer.serialize_i32(1),
33282            Self::OnDemand => serializer.serialize_i32(2),
33283            Self::UnknownValue(u) => u.0.serialize(serializer),
33284        }
33285    }
33286}
33287
33288impl<'de> serde::de::Deserialize<'de> for SqlBackupRunType {
33289    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33290    where
33291        D: serde::Deserializer<'de>,
33292    {
33293        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunType>::new(
33294            ".google.cloud.sql.v1.SqlBackupRunType",
33295        ))
33296    }
33297}
33298
33299/// Enum for [SqlFlagType].
33300///
33301/// # Working with unknown values
33302///
33303/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33304/// additional enum variants at any time. Adding new variants is not considered
33305/// a breaking change. Applications should write their code in anticipation of:
33306///
33307/// - New values appearing in future releases of the client library, **and**
33308/// - New values received dynamically, without application changes.
33309///
33310/// Please consult the [Working with enums] section in the user guide for some
33311/// guidelines.
33312///
33313/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33314#[derive(Clone, Debug, PartialEq)]
33315#[non_exhaustive]
33316pub enum SqlFlagType {
33317    /// This is an unknown flag type.
33318    Unspecified,
33319    /// Boolean type flag.
33320    Boolean,
33321    /// String type flag.
33322    String,
33323    /// Integer type flag.
33324    Integer,
33325    /// Flag type used for a server startup option.
33326    None,
33327    /// Type introduced specially for MySQL TimeZone offset. Accept a string value
33328    /// with the format [-12:59, 13:00].
33329    MysqlTimezoneOffset,
33330    /// Float type flag.
33331    Float,
33332    /// Comma-separated list of the strings in a SqlFlagType enum.
33333    RepeatedString,
33334    /// If set, the enum was initialized with an unknown value.
33335    ///
33336    /// Applications can examine the value using [SqlFlagType::value] or
33337    /// [SqlFlagType::name].
33338    UnknownValue(sql_flag_type::UnknownValue),
33339}
33340
33341#[doc(hidden)]
33342pub mod sql_flag_type {
33343    #[allow(unused_imports)]
33344    use super::*;
33345    #[derive(Clone, Debug, PartialEq)]
33346    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33347}
33348
33349impl SqlFlagType {
33350    /// Gets the enum value.
33351    ///
33352    /// Returns `None` if the enum contains an unknown value deserialized from
33353    /// the string representation of enums.
33354    pub fn value(&self) -> std::option::Option<i32> {
33355        match self {
33356            Self::Unspecified => std::option::Option::Some(0),
33357            Self::Boolean => std::option::Option::Some(1),
33358            Self::String => std::option::Option::Some(2),
33359            Self::Integer => std::option::Option::Some(3),
33360            Self::None => std::option::Option::Some(4),
33361            Self::MysqlTimezoneOffset => std::option::Option::Some(5),
33362            Self::Float => std::option::Option::Some(6),
33363            Self::RepeatedString => std::option::Option::Some(7),
33364            Self::UnknownValue(u) => u.0.value(),
33365        }
33366    }
33367
33368    /// Gets the enum value as a string.
33369    ///
33370    /// Returns `None` if the enum contains an unknown value deserialized from
33371    /// the integer representation of enums.
33372    pub fn name(&self) -> std::option::Option<&str> {
33373        match self {
33374            Self::Unspecified => std::option::Option::Some("SQL_FLAG_TYPE_UNSPECIFIED"),
33375            Self::Boolean => std::option::Option::Some("BOOLEAN"),
33376            Self::String => std::option::Option::Some("STRING"),
33377            Self::Integer => std::option::Option::Some("INTEGER"),
33378            Self::None => std::option::Option::Some("NONE"),
33379            Self::MysqlTimezoneOffset => std::option::Option::Some("MYSQL_TIMEZONE_OFFSET"),
33380            Self::Float => std::option::Option::Some("FLOAT"),
33381            Self::RepeatedString => std::option::Option::Some("REPEATED_STRING"),
33382            Self::UnknownValue(u) => u.0.name(),
33383        }
33384    }
33385}
33386
33387impl std::default::Default for SqlFlagType {
33388    fn default() -> Self {
33389        use std::convert::From;
33390        Self::from(0)
33391    }
33392}
33393
33394impl std::fmt::Display for SqlFlagType {
33395    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33396        wkt::internal::display_enum(f, self.name(), self.value())
33397    }
33398}
33399
33400impl std::convert::From<i32> for SqlFlagType {
33401    fn from(value: i32) -> Self {
33402        match value {
33403            0 => Self::Unspecified,
33404            1 => Self::Boolean,
33405            2 => Self::String,
33406            3 => Self::Integer,
33407            4 => Self::None,
33408            5 => Self::MysqlTimezoneOffset,
33409            6 => Self::Float,
33410            7 => Self::RepeatedString,
33411            _ => Self::UnknownValue(sql_flag_type::UnknownValue(
33412                wkt::internal::UnknownEnumValue::Integer(value),
33413            )),
33414        }
33415    }
33416}
33417
33418impl std::convert::From<&str> for SqlFlagType {
33419    fn from(value: &str) -> Self {
33420        use std::string::ToString;
33421        match value {
33422            "SQL_FLAG_TYPE_UNSPECIFIED" => Self::Unspecified,
33423            "BOOLEAN" => Self::Boolean,
33424            "STRING" => Self::String,
33425            "INTEGER" => Self::Integer,
33426            "NONE" => Self::None,
33427            "MYSQL_TIMEZONE_OFFSET" => Self::MysqlTimezoneOffset,
33428            "FLOAT" => Self::Float,
33429            "REPEATED_STRING" => Self::RepeatedString,
33430            _ => Self::UnknownValue(sql_flag_type::UnknownValue(
33431                wkt::internal::UnknownEnumValue::String(value.to_string()),
33432            )),
33433        }
33434    }
33435}
33436
33437impl serde::ser::Serialize for SqlFlagType {
33438    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33439    where
33440        S: serde::Serializer,
33441    {
33442        match self {
33443            Self::Unspecified => serializer.serialize_i32(0),
33444            Self::Boolean => serializer.serialize_i32(1),
33445            Self::String => serializer.serialize_i32(2),
33446            Self::Integer => serializer.serialize_i32(3),
33447            Self::None => serializer.serialize_i32(4),
33448            Self::MysqlTimezoneOffset => serializer.serialize_i32(5),
33449            Self::Float => serializer.serialize_i32(6),
33450            Self::RepeatedString => serializer.serialize_i32(7),
33451            Self::UnknownValue(u) => u.0.serialize(serializer),
33452        }
33453    }
33454}
33455
33456impl<'de> serde::de::Deserialize<'de> for SqlFlagType {
33457    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33458    where
33459        D: serde::Deserializer<'de>,
33460    {
33461        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagType>::new(
33462            ".google.cloud.sql.v1.SqlFlagType",
33463        ))
33464    }
33465}
33466
33467/// Scopes of a flag describe where the flag is used.
33468///
33469/// # Working with unknown values
33470///
33471/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33472/// additional enum variants at any time. Adding new variants is not considered
33473/// a breaking change. Applications should write their code in anticipation of:
33474///
33475/// - New values appearing in future releases of the client library, **and**
33476/// - New values received dynamically, without application changes.
33477///
33478/// Please consult the [Working with enums] section in the user guide for some
33479/// guidelines.
33480///
33481/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33482#[derive(Clone, Debug, PartialEq)]
33483#[non_exhaustive]
33484pub enum SqlFlagScope {
33485    /// Assume database flags if unspecified
33486    Unspecified,
33487    /// database flags
33488    Database,
33489    /// connection pool configuration flags
33490    ConnectionPool,
33491    /// If set, the enum was initialized with an unknown value.
33492    ///
33493    /// Applications can examine the value using [SqlFlagScope::value] or
33494    /// [SqlFlagScope::name].
33495    UnknownValue(sql_flag_scope::UnknownValue),
33496}
33497
33498#[doc(hidden)]
33499pub mod sql_flag_scope {
33500    #[allow(unused_imports)]
33501    use super::*;
33502    #[derive(Clone, Debug, PartialEq)]
33503    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33504}
33505
33506impl SqlFlagScope {
33507    /// Gets the enum value.
33508    ///
33509    /// Returns `None` if the enum contains an unknown value deserialized from
33510    /// the string representation of enums.
33511    pub fn value(&self) -> std::option::Option<i32> {
33512        match self {
33513            Self::Unspecified => std::option::Option::Some(0),
33514            Self::Database => std::option::Option::Some(1),
33515            Self::ConnectionPool => std::option::Option::Some(2),
33516            Self::UnknownValue(u) => u.0.value(),
33517        }
33518    }
33519
33520    /// Gets the enum value as a string.
33521    ///
33522    /// Returns `None` if the enum contains an unknown value deserialized from
33523    /// the integer representation of enums.
33524    pub fn name(&self) -> std::option::Option<&str> {
33525        match self {
33526            Self::Unspecified => std::option::Option::Some("SQL_FLAG_SCOPE_UNSPECIFIED"),
33527            Self::Database => std::option::Option::Some("SQL_FLAG_SCOPE_DATABASE"),
33528            Self::ConnectionPool => std::option::Option::Some("SQL_FLAG_SCOPE_CONNECTION_POOL"),
33529            Self::UnknownValue(u) => u.0.name(),
33530        }
33531    }
33532}
33533
33534impl std::default::Default for SqlFlagScope {
33535    fn default() -> Self {
33536        use std::convert::From;
33537        Self::from(0)
33538    }
33539}
33540
33541impl std::fmt::Display for SqlFlagScope {
33542    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33543        wkt::internal::display_enum(f, self.name(), self.value())
33544    }
33545}
33546
33547impl std::convert::From<i32> for SqlFlagScope {
33548    fn from(value: i32) -> Self {
33549        match value {
33550            0 => Self::Unspecified,
33551            1 => Self::Database,
33552            2 => Self::ConnectionPool,
33553            _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
33554                wkt::internal::UnknownEnumValue::Integer(value),
33555            )),
33556        }
33557    }
33558}
33559
33560impl std::convert::From<&str> for SqlFlagScope {
33561    fn from(value: &str) -> Self {
33562        use std::string::ToString;
33563        match value {
33564            "SQL_FLAG_SCOPE_UNSPECIFIED" => Self::Unspecified,
33565            "SQL_FLAG_SCOPE_DATABASE" => Self::Database,
33566            "SQL_FLAG_SCOPE_CONNECTION_POOL" => Self::ConnectionPool,
33567            _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
33568                wkt::internal::UnknownEnumValue::String(value.to_string()),
33569            )),
33570        }
33571    }
33572}
33573
33574impl serde::ser::Serialize for SqlFlagScope {
33575    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33576    where
33577        S: serde::Serializer,
33578    {
33579        match self {
33580            Self::Unspecified => serializer.serialize_i32(0),
33581            Self::Database => serializer.serialize_i32(1),
33582            Self::ConnectionPool => serializer.serialize_i32(2),
33583            Self::UnknownValue(u) => u.0.serialize(serializer),
33584        }
33585    }
33586}
33587
33588impl<'de> serde::de::Deserialize<'de> for SqlFlagScope {
33589    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33590    where
33591        D: serde::Deserializer<'de>,
33592    {
33593        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagScope>::new(
33594            ".google.cloud.sql.v1.SqlFlagScope",
33595        ))
33596    }
33597}
33598
33599/// External Sync parallel level.
33600///
33601/// # Working with unknown values
33602///
33603/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33604/// additional enum variants at any time. Adding new variants is not considered
33605/// a breaking change. Applications should write their code in anticipation of:
33606///
33607/// - New values appearing in future releases of the client library, **and**
33608/// - New values received dynamically, without application changes.
33609///
33610/// Please consult the [Working with enums] section in the user guide for some
33611/// guidelines.
33612///
33613/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33614#[derive(Clone, Debug, PartialEq)]
33615#[non_exhaustive]
33616pub enum ExternalSyncParallelLevel {
33617    /// Unknown sync parallel level. Will be defaulted to OPTIMAL.
33618    Unspecified,
33619    /// Minimal parallel level.
33620    Min,
33621    /// Optimal parallel level.
33622    Optimal,
33623    /// Maximum parallel level.
33624    Max,
33625    /// If set, the enum was initialized with an unknown value.
33626    ///
33627    /// Applications can examine the value using [ExternalSyncParallelLevel::value] or
33628    /// [ExternalSyncParallelLevel::name].
33629    UnknownValue(external_sync_parallel_level::UnknownValue),
33630}
33631
33632#[doc(hidden)]
33633pub mod external_sync_parallel_level {
33634    #[allow(unused_imports)]
33635    use super::*;
33636    #[derive(Clone, Debug, PartialEq)]
33637    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33638}
33639
33640impl ExternalSyncParallelLevel {
33641    /// Gets the enum value.
33642    ///
33643    /// Returns `None` if the enum contains an unknown value deserialized from
33644    /// the string representation of enums.
33645    pub fn value(&self) -> std::option::Option<i32> {
33646        match self {
33647            Self::Unspecified => std::option::Option::Some(0),
33648            Self::Min => std::option::Option::Some(1),
33649            Self::Optimal => std::option::Option::Some(2),
33650            Self::Max => std::option::Option::Some(3),
33651            Self::UnknownValue(u) => u.0.value(),
33652        }
33653    }
33654
33655    /// Gets the enum value as a string.
33656    ///
33657    /// Returns `None` if the enum contains an unknown value deserialized from
33658    /// the integer representation of enums.
33659    pub fn name(&self) -> std::option::Option<&str> {
33660        match self {
33661            Self::Unspecified => {
33662                std::option::Option::Some("EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED")
33663            }
33664            Self::Min => std::option::Option::Some("MIN"),
33665            Self::Optimal => std::option::Option::Some("OPTIMAL"),
33666            Self::Max => std::option::Option::Some("MAX"),
33667            Self::UnknownValue(u) => u.0.name(),
33668        }
33669    }
33670}
33671
33672impl std::default::Default for ExternalSyncParallelLevel {
33673    fn default() -> Self {
33674        use std::convert::From;
33675        Self::from(0)
33676    }
33677}
33678
33679impl std::fmt::Display for ExternalSyncParallelLevel {
33680    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33681        wkt::internal::display_enum(f, self.name(), self.value())
33682    }
33683}
33684
33685impl std::convert::From<i32> for ExternalSyncParallelLevel {
33686    fn from(value: i32) -> Self {
33687        match value {
33688            0 => Self::Unspecified,
33689            1 => Self::Min,
33690            2 => Self::Optimal,
33691            3 => Self::Max,
33692            _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
33693                wkt::internal::UnknownEnumValue::Integer(value),
33694            )),
33695        }
33696    }
33697}
33698
33699impl std::convert::From<&str> for ExternalSyncParallelLevel {
33700    fn from(value: &str) -> Self {
33701        use std::string::ToString;
33702        match value {
33703            "EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
33704            "MIN" => Self::Min,
33705            "OPTIMAL" => Self::Optimal,
33706            "MAX" => Self::Max,
33707            _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
33708                wkt::internal::UnknownEnumValue::String(value.to_string()),
33709            )),
33710        }
33711    }
33712}
33713
33714impl serde::ser::Serialize for ExternalSyncParallelLevel {
33715    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33716    where
33717        S: serde::Serializer,
33718    {
33719        match self {
33720            Self::Unspecified => serializer.serialize_i32(0),
33721            Self::Min => serializer.serialize_i32(1),
33722            Self::Optimal => serializer.serialize_i32(2),
33723            Self::Max => serializer.serialize_i32(3),
33724            Self::UnknownValue(u) => u.0.serialize(serializer),
33725        }
33726    }
33727}
33728
33729impl<'de> serde::de::Deserialize<'de> for ExternalSyncParallelLevel {
33730    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33731    where
33732        D: serde::Deserializer<'de>,
33733    {
33734        deserializer.deserialize_any(
33735            wkt::internal::EnumVisitor::<ExternalSyncParallelLevel>::new(
33736                ".google.cloud.sql.v1.ExternalSyncParallelLevel",
33737            ),
33738        )
33739    }
33740}
33741
33742/// Enum for [SqlInstanceType].
33743///
33744/// # Working with unknown values
33745///
33746/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33747/// additional enum variants at any time. Adding new variants is not considered
33748/// a breaking change. Applications should write their code in anticipation of:
33749///
33750/// - New values appearing in future releases of the client library, **and**
33751/// - New values received dynamically, without application changes.
33752///
33753/// Please consult the [Working with enums] section in the user guide for some
33754/// guidelines.
33755///
33756/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33757#[derive(Clone, Debug, PartialEq)]
33758#[non_exhaustive]
33759pub enum SqlInstanceType {
33760    /// This is an unknown Cloud SQL instance type.
33761    Unspecified,
33762    /// A regular Cloud SQL instance that is not replicating from a primary
33763    /// instance.
33764    CloudSqlInstance,
33765    /// An instance running on the customer's premises that is not managed by
33766    /// Cloud SQL.
33767    OnPremisesInstance,
33768    /// A Cloud SQL instance acting as a read-replica.
33769    ReadReplicaInstance,
33770    /// A Cloud SQL read pool.
33771    ReadPoolInstance,
33772    /// If set, the enum was initialized with an unknown value.
33773    ///
33774    /// Applications can examine the value using [SqlInstanceType::value] or
33775    /// [SqlInstanceType::name].
33776    UnknownValue(sql_instance_type::UnknownValue),
33777}
33778
33779#[doc(hidden)]
33780pub mod sql_instance_type {
33781    #[allow(unused_imports)]
33782    use super::*;
33783    #[derive(Clone, Debug, PartialEq)]
33784    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33785}
33786
33787impl SqlInstanceType {
33788    /// Gets the enum value.
33789    ///
33790    /// Returns `None` if the enum contains an unknown value deserialized from
33791    /// the string representation of enums.
33792    pub fn value(&self) -> std::option::Option<i32> {
33793        match self {
33794            Self::Unspecified => std::option::Option::Some(0),
33795            Self::CloudSqlInstance => std::option::Option::Some(1),
33796            Self::OnPremisesInstance => std::option::Option::Some(2),
33797            Self::ReadReplicaInstance => std::option::Option::Some(3),
33798            Self::ReadPoolInstance => std::option::Option::Some(5),
33799            Self::UnknownValue(u) => u.0.value(),
33800        }
33801    }
33802
33803    /// Gets the enum value as a string.
33804    ///
33805    /// Returns `None` if the enum contains an unknown value deserialized from
33806    /// the integer representation of enums.
33807    pub fn name(&self) -> std::option::Option<&str> {
33808        match self {
33809            Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_TYPE_UNSPECIFIED"),
33810            Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
33811            Self::OnPremisesInstance => std::option::Option::Some("ON_PREMISES_INSTANCE"),
33812            Self::ReadReplicaInstance => std::option::Option::Some("READ_REPLICA_INSTANCE"),
33813            Self::ReadPoolInstance => std::option::Option::Some("READ_POOL_INSTANCE"),
33814            Self::UnknownValue(u) => u.0.name(),
33815        }
33816    }
33817}
33818
33819impl std::default::Default for SqlInstanceType {
33820    fn default() -> Self {
33821        use std::convert::From;
33822        Self::from(0)
33823    }
33824}
33825
33826impl std::fmt::Display for SqlInstanceType {
33827    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33828        wkt::internal::display_enum(f, self.name(), self.value())
33829    }
33830}
33831
33832impl std::convert::From<i32> for SqlInstanceType {
33833    fn from(value: i32) -> Self {
33834        match value {
33835            0 => Self::Unspecified,
33836            1 => Self::CloudSqlInstance,
33837            2 => Self::OnPremisesInstance,
33838            3 => Self::ReadReplicaInstance,
33839            5 => Self::ReadPoolInstance,
33840            _ => Self::UnknownValue(sql_instance_type::UnknownValue(
33841                wkt::internal::UnknownEnumValue::Integer(value),
33842            )),
33843        }
33844    }
33845}
33846
33847impl std::convert::From<&str> for SqlInstanceType {
33848    fn from(value: &str) -> Self {
33849        use std::string::ToString;
33850        match value {
33851            "SQL_INSTANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
33852            "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
33853            "ON_PREMISES_INSTANCE" => Self::OnPremisesInstance,
33854            "READ_REPLICA_INSTANCE" => Self::ReadReplicaInstance,
33855            "READ_POOL_INSTANCE" => Self::ReadPoolInstance,
33856            _ => Self::UnknownValue(sql_instance_type::UnknownValue(
33857                wkt::internal::UnknownEnumValue::String(value.to_string()),
33858            )),
33859        }
33860    }
33861}
33862
33863impl serde::ser::Serialize for SqlInstanceType {
33864    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33865    where
33866        S: serde::Serializer,
33867    {
33868        match self {
33869            Self::Unspecified => serializer.serialize_i32(0),
33870            Self::CloudSqlInstance => serializer.serialize_i32(1),
33871            Self::OnPremisesInstance => serializer.serialize_i32(2),
33872            Self::ReadReplicaInstance => serializer.serialize_i32(3),
33873            Self::ReadPoolInstance => serializer.serialize_i32(5),
33874            Self::UnknownValue(u) => u.0.serialize(serializer),
33875        }
33876    }
33877}
33878
33879impl<'de> serde::de::Deserialize<'de> for SqlInstanceType {
33880    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33881    where
33882        D: serde::Deserializer<'de>,
33883    {
33884        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceType>::new(
33885            ".google.cloud.sql.v1.SqlInstanceType",
33886        ))
33887    }
33888}
33889
33890/// The suspension reason of the database instance if the state is SUSPENDED.
33891///
33892/// # Working with unknown values
33893///
33894/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33895/// additional enum variants at any time. Adding new variants is not considered
33896/// a breaking change. Applications should write their code in anticipation of:
33897///
33898/// - New values appearing in future releases of the client library, **and**
33899/// - New values received dynamically, without application changes.
33900///
33901/// Please consult the [Working with enums] section in the user guide for some
33902/// guidelines.
33903///
33904/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33905#[derive(Clone, Debug, PartialEq)]
33906#[non_exhaustive]
33907pub enum SqlSuspensionReason {
33908    /// This is an unknown suspension reason.
33909    Unspecified,
33910    /// The instance is suspended due to billing issues (for example:, account
33911    /// issue)
33912    BillingIssue,
33913    /// The instance is suspended due to illegal content (for example:, child
33914    /// pornography, copyrighted material, etc.).
33915    LegalIssue,
33916    /// The instance is causing operational issues (for example:, causing the
33917    /// database to crash).
33918    OperationalIssue,
33919    /// The KMS key used by the instance is either revoked or denied access to
33920    KmsKeyIssue,
33921    /// The project is suspended due to abuse detected by Ares.
33922    ProjectAbuse,
33923    /// If set, the enum was initialized with an unknown value.
33924    ///
33925    /// Applications can examine the value using [SqlSuspensionReason::value] or
33926    /// [SqlSuspensionReason::name].
33927    UnknownValue(sql_suspension_reason::UnknownValue),
33928}
33929
33930#[doc(hidden)]
33931pub mod sql_suspension_reason {
33932    #[allow(unused_imports)]
33933    use super::*;
33934    #[derive(Clone, Debug, PartialEq)]
33935    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33936}
33937
33938impl SqlSuspensionReason {
33939    /// Gets the enum value.
33940    ///
33941    /// Returns `None` if the enum contains an unknown value deserialized from
33942    /// the string representation of enums.
33943    pub fn value(&self) -> std::option::Option<i32> {
33944        match self {
33945            Self::Unspecified => std::option::Option::Some(0),
33946            Self::BillingIssue => std::option::Option::Some(2),
33947            Self::LegalIssue => std::option::Option::Some(3),
33948            Self::OperationalIssue => std::option::Option::Some(4),
33949            Self::KmsKeyIssue => std::option::Option::Some(5),
33950            Self::ProjectAbuse => std::option::Option::Some(8),
33951            Self::UnknownValue(u) => u.0.value(),
33952        }
33953    }
33954
33955    /// Gets the enum value as a string.
33956    ///
33957    /// Returns `None` if the enum contains an unknown value deserialized from
33958    /// the integer representation of enums.
33959    pub fn name(&self) -> std::option::Option<&str> {
33960        match self {
33961            Self::Unspecified => std::option::Option::Some("SQL_SUSPENSION_REASON_UNSPECIFIED"),
33962            Self::BillingIssue => std::option::Option::Some("BILLING_ISSUE"),
33963            Self::LegalIssue => std::option::Option::Some("LEGAL_ISSUE"),
33964            Self::OperationalIssue => std::option::Option::Some("OPERATIONAL_ISSUE"),
33965            Self::KmsKeyIssue => std::option::Option::Some("KMS_KEY_ISSUE"),
33966            Self::ProjectAbuse => std::option::Option::Some("PROJECT_ABUSE"),
33967            Self::UnknownValue(u) => u.0.name(),
33968        }
33969    }
33970}
33971
33972impl std::default::Default for SqlSuspensionReason {
33973    fn default() -> Self {
33974        use std::convert::From;
33975        Self::from(0)
33976    }
33977}
33978
33979impl std::fmt::Display for SqlSuspensionReason {
33980    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33981        wkt::internal::display_enum(f, self.name(), self.value())
33982    }
33983}
33984
33985impl std::convert::From<i32> for SqlSuspensionReason {
33986    fn from(value: i32) -> Self {
33987        match value {
33988            0 => Self::Unspecified,
33989            2 => Self::BillingIssue,
33990            3 => Self::LegalIssue,
33991            4 => Self::OperationalIssue,
33992            5 => Self::KmsKeyIssue,
33993            8 => Self::ProjectAbuse,
33994            _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
33995                wkt::internal::UnknownEnumValue::Integer(value),
33996            )),
33997        }
33998    }
33999}
34000
34001impl std::convert::From<&str> for SqlSuspensionReason {
34002    fn from(value: &str) -> Self {
34003        use std::string::ToString;
34004        match value {
34005            "SQL_SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
34006            "BILLING_ISSUE" => Self::BillingIssue,
34007            "LEGAL_ISSUE" => Self::LegalIssue,
34008            "OPERATIONAL_ISSUE" => Self::OperationalIssue,
34009            "KMS_KEY_ISSUE" => Self::KmsKeyIssue,
34010            "PROJECT_ABUSE" => Self::ProjectAbuse,
34011            _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
34012                wkt::internal::UnknownEnumValue::String(value.to_string()),
34013            )),
34014        }
34015    }
34016}
34017
34018impl serde::ser::Serialize for SqlSuspensionReason {
34019    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34020    where
34021        S: serde::Serializer,
34022    {
34023        match self {
34024            Self::Unspecified => serializer.serialize_i32(0),
34025            Self::BillingIssue => serializer.serialize_i32(2),
34026            Self::LegalIssue => serializer.serialize_i32(3),
34027            Self::OperationalIssue => serializer.serialize_i32(4),
34028            Self::KmsKeyIssue => serializer.serialize_i32(5),
34029            Self::ProjectAbuse => serializer.serialize_i32(8),
34030            Self::UnknownValue(u) => u.0.serialize(serializer),
34031        }
34032    }
34033}
34034
34035impl<'de> serde::de::Deserialize<'de> for SqlSuspensionReason {
34036    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34037    where
34038        D: serde::Deserializer<'de>,
34039    {
34040        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlSuspensionReason>::new(
34041            ".google.cloud.sql.v1.SqlSuspensionReason",
34042        ))
34043    }
34044}
34045
34046/// Enum for [SqlFileType].
34047///
34048/// # Working with unknown values
34049///
34050/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34051/// additional enum variants at any time. Adding new variants is not considered
34052/// a breaking change. Applications should write their code in anticipation of:
34053///
34054/// - New values appearing in future releases of the client library, **and**
34055/// - New values received dynamically, without application changes.
34056///
34057/// Please consult the [Working with enums] section in the user guide for some
34058/// guidelines.
34059///
34060/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34061#[derive(Clone, Debug, PartialEq)]
34062#[non_exhaustive]
34063pub enum SqlFileType {
34064    /// Unknown file type.
34065    Unspecified,
34066    /// File containing SQL statements.
34067    Sql,
34068    /// File in CSV format.
34069    Csv,
34070    #[allow(missing_docs)]
34071    Bak,
34072    /// TDE certificate.
34073    Tde,
34074    /// If set, the enum was initialized with an unknown value.
34075    ///
34076    /// Applications can examine the value using [SqlFileType::value] or
34077    /// [SqlFileType::name].
34078    UnknownValue(sql_file_type::UnknownValue),
34079}
34080
34081#[doc(hidden)]
34082pub mod sql_file_type {
34083    #[allow(unused_imports)]
34084    use super::*;
34085    #[derive(Clone, Debug, PartialEq)]
34086    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34087}
34088
34089impl SqlFileType {
34090    /// Gets the enum value.
34091    ///
34092    /// Returns `None` if the enum contains an unknown value deserialized from
34093    /// the string representation of enums.
34094    pub fn value(&self) -> std::option::Option<i32> {
34095        match self {
34096            Self::Unspecified => std::option::Option::Some(0),
34097            Self::Sql => std::option::Option::Some(1),
34098            Self::Csv => std::option::Option::Some(2),
34099            Self::Bak => std::option::Option::Some(4),
34100            Self::Tde => std::option::Option::Some(8),
34101            Self::UnknownValue(u) => u.0.value(),
34102        }
34103    }
34104
34105    /// Gets the enum value as a string.
34106    ///
34107    /// Returns `None` if the enum contains an unknown value deserialized from
34108    /// the integer representation of enums.
34109    pub fn name(&self) -> std::option::Option<&str> {
34110        match self {
34111            Self::Unspecified => std::option::Option::Some("SQL_FILE_TYPE_UNSPECIFIED"),
34112            Self::Sql => std::option::Option::Some("SQL"),
34113            Self::Csv => std::option::Option::Some("CSV"),
34114            Self::Bak => std::option::Option::Some("BAK"),
34115            Self::Tde => std::option::Option::Some("TDE"),
34116            Self::UnknownValue(u) => u.0.name(),
34117        }
34118    }
34119}
34120
34121impl std::default::Default for SqlFileType {
34122    fn default() -> Self {
34123        use std::convert::From;
34124        Self::from(0)
34125    }
34126}
34127
34128impl std::fmt::Display for SqlFileType {
34129    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34130        wkt::internal::display_enum(f, self.name(), self.value())
34131    }
34132}
34133
34134impl std::convert::From<i32> for SqlFileType {
34135    fn from(value: i32) -> Self {
34136        match value {
34137            0 => Self::Unspecified,
34138            1 => Self::Sql,
34139            2 => Self::Csv,
34140            4 => Self::Bak,
34141            8 => Self::Tde,
34142            _ => Self::UnknownValue(sql_file_type::UnknownValue(
34143                wkt::internal::UnknownEnumValue::Integer(value),
34144            )),
34145        }
34146    }
34147}
34148
34149impl std::convert::From<&str> for SqlFileType {
34150    fn from(value: &str) -> Self {
34151        use std::string::ToString;
34152        match value {
34153            "SQL_FILE_TYPE_UNSPECIFIED" => Self::Unspecified,
34154            "SQL" => Self::Sql,
34155            "CSV" => Self::Csv,
34156            "BAK" => Self::Bak,
34157            "TDE" => Self::Tde,
34158            _ => Self::UnknownValue(sql_file_type::UnknownValue(
34159                wkt::internal::UnknownEnumValue::String(value.to_string()),
34160            )),
34161        }
34162    }
34163}
34164
34165impl serde::ser::Serialize for SqlFileType {
34166    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34167    where
34168        S: serde::Serializer,
34169    {
34170        match self {
34171            Self::Unspecified => serializer.serialize_i32(0),
34172            Self::Sql => serializer.serialize_i32(1),
34173            Self::Csv => serializer.serialize_i32(2),
34174            Self::Bak => serializer.serialize_i32(4),
34175            Self::Tde => serializer.serialize_i32(8),
34176            Self::UnknownValue(u) => u.0.serialize(serializer),
34177        }
34178    }
34179}
34180
34181impl<'de> serde::de::Deserialize<'de> for SqlFileType {
34182    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34183    where
34184        D: serde::Deserializer<'de>,
34185    {
34186        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFileType>::new(
34187            ".google.cloud.sql.v1.SqlFileType",
34188        ))
34189    }
34190}
34191
34192/// Enum for [BakType].
34193///
34194/// # Working with unknown values
34195///
34196/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34197/// additional enum variants at any time. Adding new variants is not considered
34198/// a breaking change. Applications should write their code in anticipation of:
34199///
34200/// - New values appearing in future releases of the client library, **and**
34201/// - New values received dynamically, without application changes.
34202///
34203/// Please consult the [Working with enums] section in the user guide for some
34204/// guidelines.
34205///
34206/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34207#[derive(Clone, Debug, PartialEq)]
34208#[non_exhaustive]
34209pub enum BakType {
34210    /// Default type.
34211    Unspecified,
34212    /// Full backup.
34213    Full,
34214    /// Differential backup.
34215    Diff,
34216    /// Transaction Log backup
34217    Tlog,
34218    /// If set, the enum was initialized with an unknown value.
34219    ///
34220    /// Applications can examine the value using [BakType::value] or
34221    /// [BakType::name].
34222    UnknownValue(bak_type::UnknownValue),
34223}
34224
34225#[doc(hidden)]
34226pub mod bak_type {
34227    #[allow(unused_imports)]
34228    use super::*;
34229    #[derive(Clone, Debug, PartialEq)]
34230    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34231}
34232
34233impl BakType {
34234    /// Gets the enum value.
34235    ///
34236    /// Returns `None` if the enum contains an unknown value deserialized from
34237    /// the string representation of enums.
34238    pub fn value(&self) -> std::option::Option<i32> {
34239        match self {
34240            Self::Unspecified => std::option::Option::Some(0),
34241            Self::Full => std::option::Option::Some(1),
34242            Self::Diff => std::option::Option::Some(2),
34243            Self::Tlog => std::option::Option::Some(3),
34244            Self::UnknownValue(u) => u.0.value(),
34245        }
34246    }
34247
34248    /// Gets the enum value as a string.
34249    ///
34250    /// Returns `None` if the enum contains an unknown value deserialized from
34251    /// the integer representation of enums.
34252    pub fn name(&self) -> std::option::Option<&str> {
34253        match self {
34254            Self::Unspecified => std::option::Option::Some("BAK_TYPE_UNSPECIFIED"),
34255            Self::Full => std::option::Option::Some("FULL"),
34256            Self::Diff => std::option::Option::Some("DIFF"),
34257            Self::Tlog => std::option::Option::Some("TLOG"),
34258            Self::UnknownValue(u) => u.0.name(),
34259        }
34260    }
34261}
34262
34263impl std::default::Default for BakType {
34264    fn default() -> Self {
34265        use std::convert::From;
34266        Self::from(0)
34267    }
34268}
34269
34270impl std::fmt::Display for BakType {
34271    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34272        wkt::internal::display_enum(f, self.name(), self.value())
34273    }
34274}
34275
34276impl std::convert::From<i32> for BakType {
34277    fn from(value: i32) -> Self {
34278        match value {
34279            0 => Self::Unspecified,
34280            1 => Self::Full,
34281            2 => Self::Diff,
34282            3 => Self::Tlog,
34283            _ => Self::UnknownValue(bak_type::UnknownValue(
34284                wkt::internal::UnknownEnumValue::Integer(value),
34285            )),
34286        }
34287    }
34288}
34289
34290impl std::convert::From<&str> for BakType {
34291    fn from(value: &str) -> Self {
34292        use std::string::ToString;
34293        match value {
34294            "BAK_TYPE_UNSPECIFIED" => Self::Unspecified,
34295            "FULL" => Self::Full,
34296            "DIFF" => Self::Diff,
34297            "TLOG" => Self::Tlog,
34298            _ => Self::UnknownValue(bak_type::UnknownValue(
34299                wkt::internal::UnknownEnumValue::String(value.to_string()),
34300            )),
34301        }
34302    }
34303}
34304
34305impl serde::ser::Serialize for BakType {
34306    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34307    where
34308        S: serde::Serializer,
34309    {
34310        match self {
34311            Self::Unspecified => serializer.serialize_i32(0),
34312            Self::Full => serializer.serialize_i32(1),
34313            Self::Diff => serializer.serialize_i32(2),
34314            Self::Tlog => serializer.serialize_i32(3),
34315            Self::UnknownValue(u) => u.0.serialize(serializer),
34316        }
34317    }
34318}
34319
34320impl<'de> serde::de::Deserialize<'de> for BakType {
34321    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34322    where
34323        D: serde::Deserializer<'de>,
34324    {
34325        deserializer.deserialize_any(wkt::internal::EnumVisitor::<BakType>::new(
34326            ".google.cloud.sql.v1.BakType",
34327        ))
34328    }
34329}
34330
34331/// The type of maintenance to be performed on the instance.
34332///
34333/// # Working with unknown values
34334///
34335/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34336/// additional enum variants at any time. Adding new variants is not considered
34337/// a breaking change. Applications should write their code in anticipation of:
34338///
34339/// - New values appearing in future releases of the client library, **and**
34340/// - New values received dynamically, without application changes.
34341///
34342/// Please consult the [Working with enums] section in the user guide for some
34343/// guidelines.
34344///
34345/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34346#[derive(Clone, Debug, PartialEq)]
34347#[non_exhaustive]
34348pub enum SqlMaintenanceType {
34349    /// Maintenance type is unspecified.
34350    Unspecified,
34351    /// Indicates that a standalone instance is undergoing maintenance. The
34352    /// instance can be either a primary instance or a replica.
34353    InstanceMaintenance,
34354    /// Indicates that the primary instance and all of its replicas, including
34355    /// cascading replicas, are undergoing maintenance. Maintenance is performed on
34356    /// groups of replicas first, followed by the primary instance.
34357    ReplicaIncludedMaintenance,
34358    /// Indicates that the standalone instance is undergoing maintenance, initiated
34359    /// by self-service. The instance can be either a primary instance or a
34360    /// replica.
34361    InstanceSelfServiceMaintenance,
34362    /// Indicates that the primary instance and all of its replicas are undergoing
34363    /// maintenance, initiated by self-service. Maintenance is performed on groups
34364    /// of replicas first, followed by the primary instance.
34365    ReplicaIncludedSelfServiceMaintenance,
34366    /// If set, the enum was initialized with an unknown value.
34367    ///
34368    /// Applications can examine the value using [SqlMaintenanceType::value] or
34369    /// [SqlMaintenanceType::name].
34370    UnknownValue(sql_maintenance_type::UnknownValue),
34371}
34372
34373#[doc(hidden)]
34374pub mod sql_maintenance_type {
34375    #[allow(unused_imports)]
34376    use super::*;
34377    #[derive(Clone, Debug, PartialEq)]
34378    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34379}
34380
34381impl SqlMaintenanceType {
34382    /// Gets the enum value.
34383    ///
34384    /// Returns `None` if the enum contains an unknown value deserialized from
34385    /// the string representation of enums.
34386    pub fn value(&self) -> std::option::Option<i32> {
34387        match self {
34388            Self::Unspecified => std::option::Option::Some(0),
34389            Self::InstanceMaintenance => std::option::Option::Some(1),
34390            Self::ReplicaIncludedMaintenance => std::option::Option::Some(2),
34391            Self::InstanceSelfServiceMaintenance => std::option::Option::Some(3),
34392            Self::ReplicaIncludedSelfServiceMaintenance => std::option::Option::Some(4),
34393            Self::UnknownValue(u) => u.0.value(),
34394        }
34395    }
34396
34397    /// Gets the enum value as a string.
34398    ///
34399    /// Returns `None` if the enum contains an unknown value deserialized from
34400    /// the integer representation of enums.
34401    pub fn name(&self) -> std::option::Option<&str> {
34402        match self {
34403            Self::Unspecified => std::option::Option::Some("SQL_MAINTENANCE_TYPE_UNSPECIFIED"),
34404            Self::InstanceMaintenance => std::option::Option::Some("INSTANCE_MAINTENANCE"),
34405            Self::ReplicaIncludedMaintenance => {
34406                std::option::Option::Some("REPLICA_INCLUDED_MAINTENANCE")
34407            }
34408            Self::InstanceSelfServiceMaintenance => {
34409                std::option::Option::Some("INSTANCE_SELF_SERVICE_MAINTENANCE")
34410            }
34411            Self::ReplicaIncludedSelfServiceMaintenance => {
34412                std::option::Option::Some("REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE")
34413            }
34414            Self::UnknownValue(u) => u.0.name(),
34415        }
34416    }
34417}
34418
34419impl std::default::Default for SqlMaintenanceType {
34420    fn default() -> Self {
34421        use std::convert::From;
34422        Self::from(0)
34423    }
34424}
34425
34426impl std::fmt::Display for SqlMaintenanceType {
34427    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34428        wkt::internal::display_enum(f, self.name(), self.value())
34429    }
34430}
34431
34432impl std::convert::From<i32> for SqlMaintenanceType {
34433    fn from(value: i32) -> Self {
34434        match value {
34435            0 => Self::Unspecified,
34436            1 => Self::InstanceMaintenance,
34437            2 => Self::ReplicaIncludedMaintenance,
34438            3 => Self::InstanceSelfServiceMaintenance,
34439            4 => Self::ReplicaIncludedSelfServiceMaintenance,
34440            _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
34441                wkt::internal::UnknownEnumValue::Integer(value),
34442            )),
34443        }
34444    }
34445}
34446
34447impl std::convert::From<&str> for SqlMaintenanceType {
34448    fn from(value: &str) -> Self {
34449        use std::string::ToString;
34450        match value {
34451            "SQL_MAINTENANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
34452            "INSTANCE_MAINTENANCE" => Self::InstanceMaintenance,
34453            "REPLICA_INCLUDED_MAINTENANCE" => Self::ReplicaIncludedMaintenance,
34454            "INSTANCE_SELF_SERVICE_MAINTENANCE" => Self::InstanceSelfServiceMaintenance,
34455            "REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE" => {
34456                Self::ReplicaIncludedSelfServiceMaintenance
34457            }
34458            _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
34459                wkt::internal::UnknownEnumValue::String(value.to_string()),
34460            )),
34461        }
34462    }
34463}
34464
34465impl serde::ser::Serialize for SqlMaintenanceType {
34466    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34467    where
34468        S: serde::Serializer,
34469    {
34470        match self {
34471            Self::Unspecified => serializer.serialize_i32(0),
34472            Self::InstanceMaintenance => serializer.serialize_i32(1),
34473            Self::ReplicaIncludedMaintenance => serializer.serialize_i32(2),
34474            Self::InstanceSelfServiceMaintenance => serializer.serialize_i32(3),
34475            Self::ReplicaIncludedSelfServiceMaintenance => serializer.serialize_i32(4),
34476            Self::UnknownValue(u) => u.0.serialize(serializer),
34477        }
34478    }
34479}
34480
34481impl<'de> serde::de::Deserialize<'de> for SqlMaintenanceType {
34482    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34483    where
34484        D: serde::Deserializer<'de>,
34485    {
34486        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlMaintenanceType>::new(
34487            ".google.cloud.sql.v1.SqlMaintenanceType",
34488        ))
34489    }
34490}
34491
34492/// Enum for [SqlBackendType].
34493///
34494/// # Working with unknown values
34495///
34496/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34497/// additional enum variants at any time. Adding new variants is not considered
34498/// a breaking change. Applications should write their code in anticipation of:
34499///
34500/// - New values appearing in future releases of the client library, **and**
34501/// - New values received dynamically, without application changes.
34502///
34503/// Please consult the [Working with enums] section in the user guide for some
34504/// guidelines.
34505///
34506/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34507#[derive(Clone, Debug, PartialEq)]
34508#[non_exhaustive]
34509pub enum SqlBackendType {
34510    /// This is an unknown backend type for instance.
34511    Unspecified,
34512    /// V1 speckle instance.
34513    #[deprecated]
34514    FirstGen,
34515    /// V2 speckle instance.
34516    SecondGen,
34517    /// On premises instance.
34518    External,
34519    /// If set, the enum was initialized with an unknown value.
34520    ///
34521    /// Applications can examine the value using [SqlBackendType::value] or
34522    /// [SqlBackendType::name].
34523    UnknownValue(sql_backend_type::UnknownValue),
34524}
34525
34526#[doc(hidden)]
34527pub mod sql_backend_type {
34528    #[allow(unused_imports)]
34529    use super::*;
34530    #[derive(Clone, Debug, PartialEq)]
34531    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34532}
34533
34534impl SqlBackendType {
34535    /// Gets the enum value.
34536    ///
34537    /// Returns `None` if the enum contains an unknown value deserialized from
34538    /// the string representation of enums.
34539    pub fn value(&self) -> std::option::Option<i32> {
34540        match self {
34541            Self::Unspecified => std::option::Option::Some(0),
34542            Self::FirstGen => std::option::Option::Some(1),
34543            Self::SecondGen => std::option::Option::Some(2),
34544            Self::External => std::option::Option::Some(3),
34545            Self::UnknownValue(u) => u.0.value(),
34546        }
34547    }
34548
34549    /// Gets the enum value as a string.
34550    ///
34551    /// Returns `None` if the enum contains an unknown value deserialized from
34552    /// the integer representation of enums.
34553    pub fn name(&self) -> std::option::Option<&str> {
34554        match self {
34555            Self::Unspecified => std::option::Option::Some("SQL_BACKEND_TYPE_UNSPECIFIED"),
34556            Self::FirstGen => std::option::Option::Some("FIRST_GEN"),
34557            Self::SecondGen => std::option::Option::Some("SECOND_GEN"),
34558            Self::External => std::option::Option::Some("EXTERNAL"),
34559            Self::UnknownValue(u) => u.0.name(),
34560        }
34561    }
34562}
34563
34564impl std::default::Default for SqlBackendType {
34565    fn default() -> Self {
34566        use std::convert::From;
34567        Self::from(0)
34568    }
34569}
34570
34571impl std::fmt::Display for SqlBackendType {
34572    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34573        wkt::internal::display_enum(f, self.name(), self.value())
34574    }
34575}
34576
34577impl std::convert::From<i32> for SqlBackendType {
34578    fn from(value: i32) -> Self {
34579        match value {
34580            0 => Self::Unspecified,
34581            1 => Self::FirstGen,
34582            2 => Self::SecondGen,
34583            3 => Self::External,
34584            _ => Self::UnknownValue(sql_backend_type::UnknownValue(
34585                wkt::internal::UnknownEnumValue::Integer(value),
34586            )),
34587        }
34588    }
34589}
34590
34591impl std::convert::From<&str> for SqlBackendType {
34592    fn from(value: &str) -> Self {
34593        use std::string::ToString;
34594        match value {
34595            "SQL_BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
34596            "FIRST_GEN" => Self::FirstGen,
34597            "SECOND_GEN" => Self::SecondGen,
34598            "EXTERNAL" => Self::External,
34599            _ => Self::UnknownValue(sql_backend_type::UnknownValue(
34600                wkt::internal::UnknownEnumValue::String(value.to_string()),
34601            )),
34602        }
34603    }
34604}
34605
34606impl serde::ser::Serialize for SqlBackendType {
34607    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34608    where
34609        S: serde::Serializer,
34610    {
34611        match self {
34612            Self::Unspecified => serializer.serialize_i32(0),
34613            Self::FirstGen => serializer.serialize_i32(1),
34614            Self::SecondGen => serializer.serialize_i32(2),
34615            Self::External => serializer.serialize_i32(3),
34616            Self::UnknownValue(u) => u.0.serialize(serializer),
34617        }
34618    }
34619}
34620
34621impl<'de> serde::de::Deserialize<'de> for SqlBackendType {
34622    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34623    where
34624        D: serde::Deserializer<'de>,
34625    {
34626        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackendType>::new(
34627            ".google.cloud.sql.v1.SqlBackendType",
34628        ))
34629    }
34630}
34631
34632/// Enum for [SqlIpAddressType].
34633///
34634/// # Working with unknown values
34635///
34636/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34637/// additional enum variants at any time. Adding new variants is not considered
34638/// a breaking change. Applications should write their code in anticipation of:
34639///
34640/// - New values appearing in future releases of the client library, **and**
34641/// - New values received dynamically, without application changes.
34642///
34643/// Please consult the [Working with enums] section in the user guide for some
34644/// guidelines.
34645///
34646/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34647#[derive(Clone, Debug, PartialEq)]
34648#[non_exhaustive]
34649pub enum SqlIpAddressType {
34650    /// This is an unknown IP address type.
34651    Unspecified,
34652    /// IP address the customer is supposed to connect to. Usually this is the
34653    /// load balancer's IP address
34654    Primary,
34655    /// Source IP address of the connection a read replica establishes to its
34656    /// external primary instance. This IP address can be allowlisted by the
34657    /// customer in case it has a firewall that filters incoming connection to its
34658    /// on premises primary instance.
34659    Outgoing,
34660    /// Private IP used when using private IPs and network peering.
34661    Private,
34662    /// V1 IP of a migrated instance. We want the user to
34663    /// decommission this IP as soon as the migration is complete.
34664    /// Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
34665    Migrated1StGen,
34666    /// If set, the enum was initialized with an unknown value.
34667    ///
34668    /// Applications can examine the value using [SqlIpAddressType::value] or
34669    /// [SqlIpAddressType::name].
34670    UnknownValue(sql_ip_address_type::UnknownValue),
34671}
34672
34673#[doc(hidden)]
34674pub mod sql_ip_address_type {
34675    #[allow(unused_imports)]
34676    use super::*;
34677    #[derive(Clone, Debug, PartialEq)]
34678    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34679}
34680
34681impl SqlIpAddressType {
34682    /// Gets the enum value.
34683    ///
34684    /// Returns `None` if the enum contains an unknown value deserialized from
34685    /// the string representation of enums.
34686    pub fn value(&self) -> std::option::Option<i32> {
34687        match self {
34688            Self::Unspecified => std::option::Option::Some(0),
34689            Self::Primary => std::option::Option::Some(1),
34690            Self::Outgoing => std::option::Option::Some(2),
34691            Self::Private => std::option::Option::Some(3),
34692            Self::Migrated1StGen => std::option::Option::Some(4),
34693            Self::UnknownValue(u) => u.0.value(),
34694        }
34695    }
34696
34697    /// Gets the enum value as a string.
34698    ///
34699    /// Returns `None` if the enum contains an unknown value deserialized from
34700    /// the integer representation of enums.
34701    pub fn name(&self) -> std::option::Option<&str> {
34702        match self {
34703            Self::Unspecified => std::option::Option::Some("SQL_IP_ADDRESS_TYPE_UNSPECIFIED"),
34704            Self::Primary => std::option::Option::Some("PRIMARY"),
34705            Self::Outgoing => std::option::Option::Some("OUTGOING"),
34706            Self::Private => std::option::Option::Some("PRIVATE"),
34707            Self::Migrated1StGen => std::option::Option::Some("MIGRATED_1ST_GEN"),
34708            Self::UnknownValue(u) => u.0.name(),
34709        }
34710    }
34711}
34712
34713impl std::default::Default for SqlIpAddressType {
34714    fn default() -> Self {
34715        use std::convert::From;
34716        Self::from(0)
34717    }
34718}
34719
34720impl std::fmt::Display for SqlIpAddressType {
34721    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34722        wkt::internal::display_enum(f, self.name(), self.value())
34723    }
34724}
34725
34726impl std::convert::From<i32> for SqlIpAddressType {
34727    fn from(value: i32) -> Self {
34728        match value {
34729            0 => Self::Unspecified,
34730            1 => Self::Primary,
34731            2 => Self::Outgoing,
34732            3 => Self::Private,
34733            4 => Self::Migrated1StGen,
34734            _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
34735                wkt::internal::UnknownEnumValue::Integer(value),
34736            )),
34737        }
34738    }
34739}
34740
34741impl std::convert::From<&str> for SqlIpAddressType {
34742    fn from(value: &str) -> Self {
34743        use std::string::ToString;
34744        match value {
34745            "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" => Self::Unspecified,
34746            "PRIMARY" => Self::Primary,
34747            "OUTGOING" => Self::Outgoing,
34748            "PRIVATE" => Self::Private,
34749            "MIGRATED_1ST_GEN" => Self::Migrated1StGen,
34750            _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
34751                wkt::internal::UnknownEnumValue::String(value.to_string()),
34752            )),
34753        }
34754    }
34755}
34756
34757impl serde::ser::Serialize for SqlIpAddressType {
34758    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34759    where
34760        S: serde::Serializer,
34761    {
34762        match self {
34763            Self::Unspecified => serializer.serialize_i32(0),
34764            Self::Primary => serializer.serialize_i32(1),
34765            Self::Outgoing => serializer.serialize_i32(2),
34766            Self::Private => serializer.serialize_i32(3),
34767            Self::Migrated1StGen => serializer.serialize_i32(4),
34768            Self::UnknownValue(u) => u.0.serialize(serializer),
34769        }
34770    }
34771}
34772
34773impl<'de> serde::de::Deserialize<'de> for SqlIpAddressType {
34774    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34775    where
34776        D: serde::Deserializer<'de>,
34777    {
34778        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlIpAddressType>::new(
34779            ".google.cloud.sql.v1.SqlIpAddressType",
34780        ))
34781    }
34782}
34783
34784/// The database engine type and version.
34785///
34786/// # Working with unknown values
34787///
34788/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34789/// additional enum variants at any time. Adding new variants is not considered
34790/// a breaking change. Applications should write their code in anticipation of:
34791///
34792/// - New values appearing in future releases of the client library, **and**
34793/// - New values received dynamically, without application changes.
34794///
34795/// Please consult the [Working with enums] section in the user guide for some
34796/// guidelines.
34797///
34798/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34799#[derive(Clone, Debug, PartialEq)]
34800#[non_exhaustive]
34801pub enum SqlDatabaseVersion {
34802    /// This is an unknown database version.
34803    Unspecified,
34804    /// The database version is MySQL 5.1.
34805    #[deprecated]
34806    Mysql51,
34807    /// The database version is MySQL 5.5.
34808    #[deprecated]
34809    Mysql55,
34810    /// The database version is MySQL 5.6.
34811    Mysql56,
34812    /// The database version is MySQL 5.7.
34813    Mysql57,
34814    /// The database version is MySQL 8.
34815    Mysql80,
34816    /// The database major version is MySQL 8.0 and the minor version is 18.
34817    Mysql8018,
34818    /// The database major version is MySQL 8.0 and the minor version is 26.
34819    Mysql8026,
34820    /// The database major version is MySQL 8.0 and the minor version is 27.
34821    Mysql8027,
34822    /// The database major version is MySQL 8.0 and the minor version is 28.
34823    Mysql8028,
34824    /// The database major version is MySQL 8.0 and the minor version is 29.
34825    #[deprecated]
34826    Mysql8029,
34827    /// The database major version is MySQL 8.0 and the minor version is 30.
34828    Mysql8030,
34829    /// The database major version is MySQL 8.0 and the minor version is 31.
34830    Mysql8031,
34831    /// The database major version is MySQL 8.0 and the minor version is 32.
34832    Mysql8032,
34833    /// The database major version is MySQL 8.0 and the minor version is 33.
34834    Mysql8033,
34835    /// The database major version is MySQL 8.0 and the minor version is 34.
34836    Mysql8034,
34837    /// The database major version is MySQL 8.0 and the minor version is 35.
34838    Mysql8035,
34839    /// The database major version is MySQL 8.0 and the minor version is 36.
34840    Mysql8036,
34841    /// The database major version is MySQL 8.0 and the minor version is 37.
34842    Mysql8037,
34843    /// The database major version is MySQL 8.0 and the minor version is 39.
34844    Mysql8039,
34845    /// The database major version is MySQL 8.0 and the minor version is 40.
34846    Mysql8040,
34847    /// The database major version is MySQL 8.0 and the minor version is 41.
34848    Mysql8041,
34849    /// The database major version is MySQL 8.0 and the minor version is 42.
34850    Mysql8042,
34851    /// The database major version is MySQL 8.0 and the minor version is 43.
34852    Mysql8043,
34853    /// The database major version is MySQL 8.0 and the minor version is 44.
34854    Mysql8044,
34855    /// The database major version is MySQL 8.0 and the minor version is 45.
34856    Mysql8045,
34857    /// The database major version is MySQL 8.0 and the minor version is 46.
34858    Mysql8046,
34859    /// The database version is MySQL 8.4.
34860    Mysql84,
34861    /// The database version is MySQL 9.7.
34862    Mysql97,
34863    /// The database version is SQL Server 2017 Standard.
34864    Sqlserver2017Standard,
34865    /// The database version is SQL Server 2017 Enterprise.
34866    Sqlserver2017Enterprise,
34867    /// The database version is SQL Server 2017 Express.
34868    Sqlserver2017Express,
34869    /// The database version is SQL Server 2017 Web.
34870    Sqlserver2017Web,
34871    /// The database version is PostgreSQL 9.6.
34872    Postgres96,
34873    /// The database version is PostgreSQL 10.
34874    Postgres10,
34875    /// The database version is PostgreSQL 11.
34876    Postgres11,
34877    /// The database version is PostgreSQL 12.
34878    Postgres12,
34879    /// The database version is PostgreSQL 13.
34880    Postgres13,
34881    /// The database version is PostgreSQL 14.
34882    Postgres14,
34883    /// The database version is PostgreSQL 15.
34884    Postgres15,
34885    /// The database version is PostgreSQL 16.
34886    Postgres16,
34887    /// The database version is PostgreSQL 17.
34888    Postgres17,
34889    /// The database version is PostgreSQL 18.
34890    Postgres18,
34891    /// The database version is PostgreSQL 19.
34892    Postgres19,
34893    /// The database version is SQL Server 2019 Standard.
34894    Sqlserver2019Standard,
34895    /// The database version is SQL Server 2019 Enterprise.
34896    Sqlserver2019Enterprise,
34897    /// The database version is SQL Server 2019 Express.
34898    Sqlserver2019Express,
34899    /// The database version is SQL Server 2019 Web.
34900    Sqlserver2019Web,
34901    /// The database version is SQL Server 2022 Standard.
34902    Sqlserver2022Standard,
34903    /// The database version is SQL Server 2022 Enterprise.
34904    Sqlserver2022Enterprise,
34905    /// The database version is SQL Server 2022 Express.
34906    Sqlserver2022Express,
34907    /// The database version is SQL Server 2022 Web.
34908    Sqlserver2022Web,
34909    /// The database version is SQL Server 2025 Standard.
34910    Sqlserver2025Standard,
34911    /// The database version is SQL Server 2025 Enterprise.
34912    Sqlserver2025Enterprise,
34913    /// The database version is SQL Server 2025 Express.
34914    Sqlserver2025Express,
34915    /// If set, the enum was initialized with an unknown value.
34916    ///
34917    /// Applications can examine the value using [SqlDatabaseVersion::value] or
34918    /// [SqlDatabaseVersion::name].
34919    UnknownValue(sql_database_version::UnknownValue),
34920}
34921
34922#[doc(hidden)]
34923pub mod sql_database_version {
34924    #[allow(unused_imports)]
34925    use super::*;
34926    #[derive(Clone, Debug, PartialEq)]
34927    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34928}
34929
34930impl SqlDatabaseVersion {
34931    /// Gets the enum value.
34932    ///
34933    /// Returns `None` if the enum contains an unknown value deserialized from
34934    /// the string representation of enums.
34935    pub fn value(&self) -> std::option::Option<i32> {
34936        match self {
34937            Self::Unspecified => std::option::Option::Some(0),
34938            Self::Mysql51 => std::option::Option::Some(2),
34939            Self::Mysql55 => std::option::Option::Some(3),
34940            Self::Mysql56 => std::option::Option::Some(5),
34941            Self::Mysql57 => std::option::Option::Some(6),
34942            Self::Mysql80 => std::option::Option::Some(20),
34943            Self::Mysql8018 => std::option::Option::Some(41),
34944            Self::Mysql8026 => std::option::Option::Some(85),
34945            Self::Mysql8027 => std::option::Option::Some(111),
34946            Self::Mysql8028 => std::option::Option::Some(132),
34947            Self::Mysql8029 => std::option::Option::Some(148),
34948            Self::Mysql8030 => std::option::Option::Some(174),
34949            Self::Mysql8031 => std::option::Option::Some(197),
34950            Self::Mysql8032 => std::option::Option::Some(213),
34951            Self::Mysql8033 => std::option::Option::Some(238),
34952            Self::Mysql8034 => std::option::Option::Some(239),
34953            Self::Mysql8035 => std::option::Option::Some(240),
34954            Self::Mysql8036 => std::option::Option::Some(241),
34955            Self::Mysql8037 => std::option::Option::Some(355),
34956            Self::Mysql8039 => std::option::Option::Some(357),
34957            Self::Mysql8040 => std::option::Option::Some(358),
34958            Self::Mysql8041 => std::option::Option::Some(488),
34959            Self::Mysql8042 => std::option::Option::Some(489),
34960            Self::Mysql8043 => std::option::Option::Some(553),
34961            Self::Mysql8044 => std::option::Option::Some(554),
34962            Self::Mysql8045 => std::option::Option::Some(555),
34963            Self::Mysql8046 => std::option::Option::Some(556),
34964            Self::Mysql84 => std::option::Option::Some(398),
34965            Self::Mysql97 => std::option::Option::Some(654),
34966            Self::Sqlserver2017Standard => std::option::Option::Some(11),
34967            Self::Sqlserver2017Enterprise => std::option::Option::Some(14),
34968            Self::Sqlserver2017Express => std::option::Option::Some(15),
34969            Self::Sqlserver2017Web => std::option::Option::Some(16),
34970            Self::Postgres96 => std::option::Option::Some(9),
34971            Self::Postgres10 => std::option::Option::Some(18),
34972            Self::Postgres11 => std::option::Option::Some(10),
34973            Self::Postgres12 => std::option::Option::Some(19),
34974            Self::Postgres13 => std::option::Option::Some(23),
34975            Self::Postgres14 => std::option::Option::Some(110),
34976            Self::Postgres15 => std::option::Option::Some(172),
34977            Self::Postgres16 => std::option::Option::Some(272),
34978            Self::Postgres17 => std::option::Option::Some(408),
34979            Self::Postgres18 => std::option::Option::Some(557),
34980            Self::Postgres19 => std::option::Option::Some(684),
34981            Self::Sqlserver2019Standard => std::option::Option::Some(26),
34982            Self::Sqlserver2019Enterprise => std::option::Option::Some(27),
34983            Self::Sqlserver2019Express => std::option::Option::Some(28),
34984            Self::Sqlserver2019Web => std::option::Option::Some(29),
34985            Self::Sqlserver2022Standard => std::option::Option::Some(199),
34986            Self::Sqlserver2022Enterprise => std::option::Option::Some(200),
34987            Self::Sqlserver2022Express => std::option::Option::Some(201),
34988            Self::Sqlserver2022Web => std::option::Option::Some(202),
34989            Self::Sqlserver2025Standard => std::option::Option::Some(549),
34990            Self::Sqlserver2025Enterprise => std::option::Option::Some(550),
34991            Self::Sqlserver2025Express => std::option::Option::Some(551),
34992            Self::UnknownValue(u) => u.0.value(),
34993        }
34994    }
34995
34996    /// Gets the enum value as a string.
34997    ///
34998    /// Returns `None` if the enum contains an unknown value deserialized from
34999    /// the integer representation of enums.
35000    pub fn name(&self) -> std::option::Option<&str> {
35001        match self {
35002            Self::Unspecified => std::option::Option::Some("SQL_DATABASE_VERSION_UNSPECIFIED"),
35003            Self::Mysql51 => std::option::Option::Some("MYSQL_5_1"),
35004            Self::Mysql55 => std::option::Option::Some("MYSQL_5_5"),
35005            Self::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
35006            Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
35007            Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
35008            Self::Mysql8018 => std::option::Option::Some("MYSQL_8_0_18"),
35009            Self::Mysql8026 => std::option::Option::Some("MYSQL_8_0_26"),
35010            Self::Mysql8027 => std::option::Option::Some("MYSQL_8_0_27"),
35011            Self::Mysql8028 => std::option::Option::Some("MYSQL_8_0_28"),
35012            Self::Mysql8029 => std::option::Option::Some("MYSQL_8_0_29"),
35013            Self::Mysql8030 => std::option::Option::Some("MYSQL_8_0_30"),
35014            Self::Mysql8031 => std::option::Option::Some("MYSQL_8_0_31"),
35015            Self::Mysql8032 => std::option::Option::Some("MYSQL_8_0_32"),
35016            Self::Mysql8033 => std::option::Option::Some("MYSQL_8_0_33"),
35017            Self::Mysql8034 => std::option::Option::Some("MYSQL_8_0_34"),
35018            Self::Mysql8035 => std::option::Option::Some("MYSQL_8_0_35"),
35019            Self::Mysql8036 => std::option::Option::Some("MYSQL_8_0_36"),
35020            Self::Mysql8037 => std::option::Option::Some("MYSQL_8_0_37"),
35021            Self::Mysql8039 => std::option::Option::Some("MYSQL_8_0_39"),
35022            Self::Mysql8040 => std::option::Option::Some("MYSQL_8_0_40"),
35023            Self::Mysql8041 => std::option::Option::Some("MYSQL_8_0_41"),
35024            Self::Mysql8042 => std::option::Option::Some("MYSQL_8_0_42"),
35025            Self::Mysql8043 => std::option::Option::Some("MYSQL_8_0_43"),
35026            Self::Mysql8044 => std::option::Option::Some("MYSQL_8_0_44"),
35027            Self::Mysql8045 => std::option::Option::Some("MYSQL_8_0_45"),
35028            Self::Mysql8046 => std::option::Option::Some("MYSQL_8_0_46"),
35029            Self::Mysql84 => std::option::Option::Some("MYSQL_8_4"),
35030            Self::Mysql97 => std::option::Option::Some("MYSQL_9_7"),
35031            Self::Sqlserver2017Standard => std::option::Option::Some("SQLSERVER_2017_STANDARD"),
35032            Self::Sqlserver2017Enterprise => std::option::Option::Some("SQLSERVER_2017_ENTERPRISE"),
35033            Self::Sqlserver2017Express => std::option::Option::Some("SQLSERVER_2017_EXPRESS"),
35034            Self::Sqlserver2017Web => std::option::Option::Some("SQLSERVER_2017_WEB"),
35035            Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
35036            Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
35037            Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
35038            Self::Postgres12 => std::option::Option::Some("POSTGRES_12"),
35039            Self::Postgres13 => std::option::Option::Some("POSTGRES_13"),
35040            Self::Postgres14 => std::option::Option::Some("POSTGRES_14"),
35041            Self::Postgres15 => std::option::Option::Some("POSTGRES_15"),
35042            Self::Postgres16 => std::option::Option::Some("POSTGRES_16"),
35043            Self::Postgres17 => std::option::Option::Some("POSTGRES_17"),
35044            Self::Postgres18 => std::option::Option::Some("POSTGRES_18"),
35045            Self::Postgres19 => std::option::Option::Some("POSTGRES_19"),
35046            Self::Sqlserver2019Standard => std::option::Option::Some("SQLSERVER_2019_STANDARD"),
35047            Self::Sqlserver2019Enterprise => std::option::Option::Some("SQLSERVER_2019_ENTERPRISE"),
35048            Self::Sqlserver2019Express => std::option::Option::Some("SQLSERVER_2019_EXPRESS"),
35049            Self::Sqlserver2019Web => std::option::Option::Some("SQLSERVER_2019_WEB"),
35050            Self::Sqlserver2022Standard => std::option::Option::Some("SQLSERVER_2022_STANDARD"),
35051            Self::Sqlserver2022Enterprise => std::option::Option::Some("SQLSERVER_2022_ENTERPRISE"),
35052            Self::Sqlserver2022Express => std::option::Option::Some("SQLSERVER_2022_EXPRESS"),
35053            Self::Sqlserver2022Web => std::option::Option::Some("SQLSERVER_2022_WEB"),
35054            Self::Sqlserver2025Standard => std::option::Option::Some("SQLSERVER_2025_STANDARD"),
35055            Self::Sqlserver2025Enterprise => std::option::Option::Some("SQLSERVER_2025_ENTERPRISE"),
35056            Self::Sqlserver2025Express => std::option::Option::Some("SQLSERVER_2025_EXPRESS"),
35057            Self::UnknownValue(u) => u.0.name(),
35058        }
35059    }
35060}
35061
35062impl std::default::Default for SqlDatabaseVersion {
35063    fn default() -> Self {
35064        use std::convert::From;
35065        Self::from(0)
35066    }
35067}
35068
35069impl std::fmt::Display for SqlDatabaseVersion {
35070    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35071        wkt::internal::display_enum(f, self.name(), self.value())
35072    }
35073}
35074
35075impl std::convert::From<i32> for SqlDatabaseVersion {
35076    fn from(value: i32) -> Self {
35077        match value {
35078            0 => Self::Unspecified,
35079            2 => Self::Mysql51,
35080            3 => Self::Mysql55,
35081            5 => Self::Mysql56,
35082            6 => Self::Mysql57,
35083            9 => Self::Postgres96,
35084            10 => Self::Postgres11,
35085            11 => Self::Sqlserver2017Standard,
35086            14 => Self::Sqlserver2017Enterprise,
35087            15 => Self::Sqlserver2017Express,
35088            16 => Self::Sqlserver2017Web,
35089            18 => Self::Postgres10,
35090            19 => Self::Postgres12,
35091            20 => Self::Mysql80,
35092            23 => Self::Postgres13,
35093            26 => Self::Sqlserver2019Standard,
35094            27 => Self::Sqlserver2019Enterprise,
35095            28 => Self::Sqlserver2019Express,
35096            29 => Self::Sqlserver2019Web,
35097            41 => Self::Mysql8018,
35098            85 => Self::Mysql8026,
35099            110 => Self::Postgres14,
35100            111 => Self::Mysql8027,
35101            132 => Self::Mysql8028,
35102            148 => Self::Mysql8029,
35103            172 => Self::Postgres15,
35104            174 => Self::Mysql8030,
35105            197 => Self::Mysql8031,
35106            199 => Self::Sqlserver2022Standard,
35107            200 => Self::Sqlserver2022Enterprise,
35108            201 => Self::Sqlserver2022Express,
35109            202 => Self::Sqlserver2022Web,
35110            213 => Self::Mysql8032,
35111            238 => Self::Mysql8033,
35112            239 => Self::Mysql8034,
35113            240 => Self::Mysql8035,
35114            241 => Self::Mysql8036,
35115            272 => Self::Postgres16,
35116            355 => Self::Mysql8037,
35117            357 => Self::Mysql8039,
35118            358 => Self::Mysql8040,
35119            398 => Self::Mysql84,
35120            408 => Self::Postgres17,
35121            488 => Self::Mysql8041,
35122            489 => Self::Mysql8042,
35123            549 => Self::Sqlserver2025Standard,
35124            550 => Self::Sqlserver2025Enterprise,
35125            551 => Self::Sqlserver2025Express,
35126            553 => Self::Mysql8043,
35127            554 => Self::Mysql8044,
35128            555 => Self::Mysql8045,
35129            556 => Self::Mysql8046,
35130            557 => Self::Postgres18,
35131            654 => Self::Mysql97,
35132            684 => Self::Postgres19,
35133            _ => Self::UnknownValue(sql_database_version::UnknownValue(
35134                wkt::internal::UnknownEnumValue::Integer(value),
35135            )),
35136        }
35137    }
35138}
35139
35140impl std::convert::From<&str> for SqlDatabaseVersion {
35141    fn from(value: &str) -> Self {
35142        use std::string::ToString;
35143        match value {
35144            "SQL_DATABASE_VERSION_UNSPECIFIED" => Self::Unspecified,
35145            "MYSQL_5_1" => Self::Mysql51,
35146            "MYSQL_5_5" => Self::Mysql55,
35147            "MYSQL_5_6" => Self::Mysql56,
35148            "MYSQL_5_7" => Self::Mysql57,
35149            "MYSQL_8_0" => Self::Mysql80,
35150            "MYSQL_8_0_18" => Self::Mysql8018,
35151            "MYSQL_8_0_26" => Self::Mysql8026,
35152            "MYSQL_8_0_27" => Self::Mysql8027,
35153            "MYSQL_8_0_28" => Self::Mysql8028,
35154            "MYSQL_8_0_29" => Self::Mysql8029,
35155            "MYSQL_8_0_30" => Self::Mysql8030,
35156            "MYSQL_8_0_31" => Self::Mysql8031,
35157            "MYSQL_8_0_32" => Self::Mysql8032,
35158            "MYSQL_8_0_33" => Self::Mysql8033,
35159            "MYSQL_8_0_34" => Self::Mysql8034,
35160            "MYSQL_8_0_35" => Self::Mysql8035,
35161            "MYSQL_8_0_36" => Self::Mysql8036,
35162            "MYSQL_8_0_37" => Self::Mysql8037,
35163            "MYSQL_8_0_39" => Self::Mysql8039,
35164            "MYSQL_8_0_40" => Self::Mysql8040,
35165            "MYSQL_8_0_41" => Self::Mysql8041,
35166            "MYSQL_8_0_42" => Self::Mysql8042,
35167            "MYSQL_8_0_43" => Self::Mysql8043,
35168            "MYSQL_8_0_44" => Self::Mysql8044,
35169            "MYSQL_8_0_45" => Self::Mysql8045,
35170            "MYSQL_8_0_46" => Self::Mysql8046,
35171            "MYSQL_8_4" => Self::Mysql84,
35172            "MYSQL_9_7" => Self::Mysql97,
35173            "SQLSERVER_2017_STANDARD" => Self::Sqlserver2017Standard,
35174            "SQLSERVER_2017_ENTERPRISE" => Self::Sqlserver2017Enterprise,
35175            "SQLSERVER_2017_EXPRESS" => Self::Sqlserver2017Express,
35176            "SQLSERVER_2017_WEB" => Self::Sqlserver2017Web,
35177            "POSTGRES_9_6" => Self::Postgres96,
35178            "POSTGRES_10" => Self::Postgres10,
35179            "POSTGRES_11" => Self::Postgres11,
35180            "POSTGRES_12" => Self::Postgres12,
35181            "POSTGRES_13" => Self::Postgres13,
35182            "POSTGRES_14" => Self::Postgres14,
35183            "POSTGRES_15" => Self::Postgres15,
35184            "POSTGRES_16" => Self::Postgres16,
35185            "POSTGRES_17" => Self::Postgres17,
35186            "POSTGRES_18" => Self::Postgres18,
35187            "POSTGRES_19" => Self::Postgres19,
35188            "SQLSERVER_2019_STANDARD" => Self::Sqlserver2019Standard,
35189            "SQLSERVER_2019_ENTERPRISE" => Self::Sqlserver2019Enterprise,
35190            "SQLSERVER_2019_EXPRESS" => Self::Sqlserver2019Express,
35191            "SQLSERVER_2019_WEB" => Self::Sqlserver2019Web,
35192            "SQLSERVER_2022_STANDARD" => Self::Sqlserver2022Standard,
35193            "SQLSERVER_2022_ENTERPRISE" => Self::Sqlserver2022Enterprise,
35194            "SQLSERVER_2022_EXPRESS" => Self::Sqlserver2022Express,
35195            "SQLSERVER_2022_WEB" => Self::Sqlserver2022Web,
35196            "SQLSERVER_2025_STANDARD" => Self::Sqlserver2025Standard,
35197            "SQLSERVER_2025_ENTERPRISE" => Self::Sqlserver2025Enterprise,
35198            "SQLSERVER_2025_EXPRESS" => Self::Sqlserver2025Express,
35199            _ => Self::UnknownValue(sql_database_version::UnknownValue(
35200                wkt::internal::UnknownEnumValue::String(value.to_string()),
35201            )),
35202        }
35203    }
35204}
35205
35206impl serde::ser::Serialize for SqlDatabaseVersion {
35207    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35208    where
35209        S: serde::Serializer,
35210    {
35211        match self {
35212            Self::Unspecified => serializer.serialize_i32(0),
35213            Self::Mysql51 => serializer.serialize_i32(2),
35214            Self::Mysql55 => serializer.serialize_i32(3),
35215            Self::Mysql56 => serializer.serialize_i32(5),
35216            Self::Mysql57 => serializer.serialize_i32(6),
35217            Self::Mysql80 => serializer.serialize_i32(20),
35218            Self::Mysql8018 => serializer.serialize_i32(41),
35219            Self::Mysql8026 => serializer.serialize_i32(85),
35220            Self::Mysql8027 => serializer.serialize_i32(111),
35221            Self::Mysql8028 => serializer.serialize_i32(132),
35222            Self::Mysql8029 => serializer.serialize_i32(148),
35223            Self::Mysql8030 => serializer.serialize_i32(174),
35224            Self::Mysql8031 => serializer.serialize_i32(197),
35225            Self::Mysql8032 => serializer.serialize_i32(213),
35226            Self::Mysql8033 => serializer.serialize_i32(238),
35227            Self::Mysql8034 => serializer.serialize_i32(239),
35228            Self::Mysql8035 => serializer.serialize_i32(240),
35229            Self::Mysql8036 => serializer.serialize_i32(241),
35230            Self::Mysql8037 => serializer.serialize_i32(355),
35231            Self::Mysql8039 => serializer.serialize_i32(357),
35232            Self::Mysql8040 => serializer.serialize_i32(358),
35233            Self::Mysql8041 => serializer.serialize_i32(488),
35234            Self::Mysql8042 => serializer.serialize_i32(489),
35235            Self::Mysql8043 => serializer.serialize_i32(553),
35236            Self::Mysql8044 => serializer.serialize_i32(554),
35237            Self::Mysql8045 => serializer.serialize_i32(555),
35238            Self::Mysql8046 => serializer.serialize_i32(556),
35239            Self::Mysql84 => serializer.serialize_i32(398),
35240            Self::Mysql97 => serializer.serialize_i32(654),
35241            Self::Sqlserver2017Standard => serializer.serialize_i32(11),
35242            Self::Sqlserver2017Enterprise => serializer.serialize_i32(14),
35243            Self::Sqlserver2017Express => serializer.serialize_i32(15),
35244            Self::Sqlserver2017Web => serializer.serialize_i32(16),
35245            Self::Postgres96 => serializer.serialize_i32(9),
35246            Self::Postgres10 => serializer.serialize_i32(18),
35247            Self::Postgres11 => serializer.serialize_i32(10),
35248            Self::Postgres12 => serializer.serialize_i32(19),
35249            Self::Postgres13 => serializer.serialize_i32(23),
35250            Self::Postgres14 => serializer.serialize_i32(110),
35251            Self::Postgres15 => serializer.serialize_i32(172),
35252            Self::Postgres16 => serializer.serialize_i32(272),
35253            Self::Postgres17 => serializer.serialize_i32(408),
35254            Self::Postgres18 => serializer.serialize_i32(557),
35255            Self::Postgres19 => serializer.serialize_i32(684),
35256            Self::Sqlserver2019Standard => serializer.serialize_i32(26),
35257            Self::Sqlserver2019Enterprise => serializer.serialize_i32(27),
35258            Self::Sqlserver2019Express => serializer.serialize_i32(28),
35259            Self::Sqlserver2019Web => serializer.serialize_i32(29),
35260            Self::Sqlserver2022Standard => serializer.serialize_i32(199),
35261            Self::Sqlserver2022Enterprise => serializer.serialize_i32(200),
35262            Self::Sqlserver2022Express => serializer.serialize_i32(201),
35263            Self::Sqlserver2022Web => serializer.serialize_i32(202),
35264            Self::Sqlserver2025Standard => serializer.serialize_i32(549),
35265            Self::Sqlserver2025Enterprise => serializer.serialize_i32(550),
35266            Self::Sqlserver2025Express => serializer.serialize_i32(551),
35267            Self::UnknownValue(u) => u.0.serialize(serializer),
35268        }
35269    }
35270}
35271
35272impl<'de> serde::de::Deserialize<'de> for SqlDatabaseVersion {
35273    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35274    where
35275        D: serde::Deserializer<'de>,
35276    {
35277        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDatabaseVersion>::new(
35278            ".google.cloud.sql.v1.SqlDatabaseVersion",
35279        ))
35280    }
35281}
35282
35283/// The pricing plan for this instance.
35284///
35285/// # Working with unknown values
35286///
35287/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35288/// additional enum variants at any time. Adding new variants is not considered
35289/// a breaking change. Applications should write their code in anticipation of:
35290///
35291/// - New values appearing in future releases of the client library, **and**
35292/// - New values received dynamically, without application changes.
35293///
35294/// Please consult the [Working with enums] section in the user guide for some
35295/// guidelines.
35296///
35297/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35298#[derive(Clone, Debug, PartialEq)]
35299#[non_exhaustive]
35300pub enum SqlPricingPlan {
35301    /// This is an unknown pricing plan for this instance.
35302    Unspecified,
35303    /// The instance is billed at a monthly flat rate.
35304    Package,
35305    /// The instance is billed per usage.
35306    PerUse,
35307    /// If set, the enum was initialized with an unknown value.
35308    ///
35309    /// Applications can examine the value using [SqlPricingPlan::value] or
35310    /// [SqlPricingPlan::name].
35311    UnknownValue(sql_pricing_plan::UnknownValue),
35312}
35313
35314#[doc(hidden)]
35315pub mod sql_pricing_plan {
35316    #[allow(unused_imports)]
35317    use super::*;
35318    #[derive(Clone, Debug, PartialEq)]
35319    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35320}
35321
35322impl SqlPricingPlan {
35323    /// Gets the enum value.
35324    ///
35325    /// Returns `None` if the enum contains an unknown value deserialized from
35326    /// the string representation of enums.
35327    pub fn value(&self) -> std::option::Option<i32> {
35328        match self {
35329            Self::Unspecified => std::option::Option::Some(0),
35330            Self::Package => std::option::Option::Some(1),
35331            Self::PerUse => std::option::Option::Some(2),
35332            Self::UnknownValue(u) => u.0.value(),
35333        }
35334    }
35335
35336    /// Gets the enum value as a string.
35337    ///
35338    /// Returns `None` if the enum contains an unknown value deserialized from
35339    /// the integer representation of enums.
35340    pub fn name(&self) -> std::option::Option<&str> {
35341        match self {
35342            Self::Unspecified => std::option::Option::Some("SQL_PRICING_PLAN_UNSPECIFIED"),
35343            Self::Package => std::option::Option::Some("PACKAGE"),
35344            Self::PerUse => std::option::Option::Some("PER_USE"),
35345            Self::UnknownValue(u) => u.0.name(),
35346        }
35347    }
35348}
35349
35350impl std::default::Default for SqlPricingPlan {
35351    fn default() -> Self {
35352        use std::convert::From;
35353        Self::from(0)
35354    }
35355}
35356
35357impl std::fmt::Display for SqlPricingPlan {
35358    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35359        wkt::internal::display_enum(f, self.name(), self.value())
35360    }
35361}
35362
35363impl std::convert::From<i32> for SqlPricingPlan {
35364    fn from(value: i32) -> Self {
35365        match value {
35366            0 => Self::Unspecified,
35367            1 => Self::Package,
35368            2 => Self::PerUse,
35369            _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
35370                wkt::internal::UnknownEnumValue::Integer(value),
35371            )),
35372        }
35373    }
35374}
35375
35376impl std::convert::From<&str> for SqlPricingPlan {
35377    fn from(value: &str) -> Self {
35378        use std::string::ToString;
35379        match value {
35380            "SQL_PRICING_PLAN_UNSPECIFIED" => Self::Unspecified,
35381            "PACKAGE" => Self::Package,
35382            "PER_USE" => Self::PerUse,
35383            _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
35384                wkt::internal::UnknownEnumValue::String(value.to_string()),
35385            )),
35386        }
35387    }
35388}
35389
35390impl serde::ser::Serialize for SqlPricingPlan {
35391    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35392    where
35393        S: serde::Serializer,
35394    {
35395        match self {
35396            Self::Unspecified => serializer.serialize_i32(0),
35397            Self::Package => serializer.serialize_i32(1),
35398            Self::PerUse => serializer.serialize_i32(2),
35399            Self::UnknownValue(u) => u.0.serialize(serializer),
35400        }
35401    }
35402}
35403
35404impl<'de> serde::de::Deserialize<'de> for SqlPricingPlan {
35405    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35406    where
35407        D: serde::Deserializer<'de>,
35408    {
35409        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlPricingPlan>::new(
35410            ".google.cloud.sql.v1.SqlPricingPlan",
35411        ))
35412    }
35413}
35414
35415/// Enum for [SqlReplicationType].
35416///
35417/// # Working with unknown values
35418///
35419/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35420/// additional enum variants at any time. Adding new variants is not considered
35421/// a breaking change. Applications should write their code in anticipation of:
35422///
35423/// - New values appearing in future releases of the client library, **and**
35424/// - New values received dynamically, without application changes.
35425///
35426/// Please consult the [Working with enums] section in the user guide for some
35427/// guidelines.
35428///
35429/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35430#[derive(Clone, Debug, PartialEq)]
35431#[non_exhaustive]
35432pub enum SqlReplicationType {
35433    /// This is an unknown replication type for a Cloud SQL instance.
35434    Unspecified,
35435    /// The synchronous replication mode for First Generation instances. It is the
35436    /// default value.
35437    Synchronous,
35438    /// The asynchronous replication mode for First Generation instances. It
35439    /// provides a slight performance gain, but if an outage occurs while this
35440    /// option is set to asynchronous, you can lose up to a few seconds of updates
35441    /// to your data.
35442    Asynchronous,
35443    /// If set, the enum was initialized with an unknown value.
35444    ///
35445    /// Applications can examine the value using [SqlReplicationType::value] or
35446    /// [SqlReplicationType::name].
35447    UnknownValue(sql_replication_type::UnknownValue),
35448}
35449
35450#[doc(hidden)]
35451pub mod sql_replication_type {
35452    #[allow(unused_imports)]
35453    use super::*;
35454    #[derive(Clone, Debug, PartialEq)]
35455    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35456}
35457
35458impl SqlReplicationType {
35459    /// Gets the enum value.
35460    ///
35461    /// Returns `None` if the enum contains an unknown value deserialized from
35462    /// the string representation of enums.
35463    pub fn value(&self) -> std::option::Option<i32> {
35464        match self {
35465            Self::Unspecified => std::option::Option::Some(0),
35466            Self::Synchronous => std::option::Option::Some(1),
35467            Self::Asynchronous => std::option::Option::Some(2),
35468            Self::UnknownValue(u) => u.0.value(),
35469        }
35470    }
35471
35472    /// Gets the enum value as a string.
35473    ///
35474    /// Returns `None` if the enum contains an unknown value deserialized from
35475    /// the integer representation of enums.
35476    pub fn name(&self) -> std::option::Option<&str> {
35477        match self {
35478            Self::Unspecified => std::option::Option::Some("SQL_REPLICATION_TYPE_UNSPECIFIED"),
35479            Self::Synchronous => std::option::Option::Some("SYNCHRONOUS"),
35480            Self::Asynchronous => std::option::Option::Some("ASYNCHRONOUS"),
35481            Self::UnknownValue(u) => u.0.name(),
35482        }
35483    }
35484}
35485
35486impl std::default::Default for SqlReplicationType {
35487    fn default() -> Self {
35488        use std::convert::From;
35489        Self::from(0)
35490    }
35491}
35492
35493impl std::fmt::Display for SqlReplicationType {
35494    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35495        wkt::internal::display_enum(f, self.name(), self.value())
35496    }
35497}
35498
35499impl std::convert::From<i32> for SqlReplicationType {
35500    fn from(value: i32) -> Self {
35501        match value {
35502            0 => Self::Unspecified,
35503            1 => Self::Synchronous,
35504            2 => Self::Asynchronous,
35505            _ => Self::UnknownValue(sql_replication_type::UnknownValue(
35506                wkt::internal::UnknownEnumValue::Integer(value),
35507            )),
35508        }
35509    }
35510}
35511
35512impl std::convert::From<&str> for SqlReplicationType {
35513    fn from(value: &str) -> Self {
35514        use std::string::ToString;
35515        match value {
35516            "SQL_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
35517            "SYNCHRONOUS" => Self::Synchronous,
35518            "ASYNCHRONOUS" => Self::Asynchronous,
35519            _ => Self::UnknownValue(sql_replication_type::UnknownValue(
35520                wkt::internal::UnknownEnumValue::String(value.to_string()),
35521            )),
35522        }
35523    }
35524}
35525
35526impl serde::ser::Serialize for SqlReplicationType {
35527    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35528    where
35529        S: serde::Serializer,
35530    {
35531        match self {
35532            Self::Unspecified => serializer.serialize_i32(0),
35533            Self::Synchronous => serializer.serialize_i32(1),
35534            Self::Asynchronous => serializer.serialize_i32(2),
35535            Self::UnknownValue(u) => u.0.serialize(serializer),
35536        }
35537    }
35538}
35539
35540impl<'de> serde::de::Deserialize<'de> for SqlReplicationType {
35541    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35542    where
35543        D: serde::Deserializer<'de>,
35544    {
35545        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlReplicationType>::new(
35546            ".google.cloud.sql.v1.SqlReplicationType",
35547        ))
35548    }
35549}
35550
35551/// The type of disk that is used for a v2 instance to use.
35552///
35553/// # Working with unknown values
35554///
35555/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35556/// additional enum variants at any time. Adding new variants is not considered
35557/// a breaking change. Applications should write their code in anticipation of:
35558///
35559/// - New values appearing in future releases of the client library, **and**
35560/// - New values received dynamically, without application changes.
35561///
35562/// Please consult the [Working with enums] section in the user guide for some
35563/// guidelines.
35564///
35565/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35566#[derive(Clone, Debug, PartialEq)]
35567#[non_exhaustive]
35568pub enum SqlDataDiskType {
35569    /// This is an unknown data disk type.
35570    Unspecified,
35571    /// An SSD data disk.
35572    PdSsd,
35573    /// An HDD data disk.
35574    PdHdd,
35575    /// This field is deprecated and will be removed from a future version of the
35576    /// API.
35577    #[deprecated]
35578    ObsoleteLocalSsd,
35579    /// A Hyperdisk Balanced data disk.
35580    HyperdiskBalanced,
35581    /// If set, the enum was initialized with an unknown value.
35582    ///
35583    /// Applications can examine the value using [SqlDataDiskType::value] or
35584    /// [SqlDataDiskType::name].
35585    UnknownValue(sql_data_disk_type::UnknownValue),
35586}
35587
35588#[doc(hidden)]
35589pub mod sql_data_disk_type {
35590    #[allow(unused_imports)]
35591    use super::*;
35592    #[derive(Clone, Debug, PartialEq)]
35593    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35594}
35595
35596impl SqlDataDiskType {
35597    /// Gets the enum value.
35598    ///
35599    /// Returns `None` if the enum contains an unknown value deserialized from
35600    /// the string representation of enums.
35601    pub fn value(&self) -> std::option::Option<i32> {
35602        match self {
35603            Self::Unspecified => std::option::Option::Some(0),
35604            Self::PdSsd => std::option::Option::Some(1),
35605            Self::PdHdd => std::option::Option::Some(2),
35606            Self::ObsoleteLocalSsd => std::option::Option::Some(3),
35607            Self::HyperdiskBalanced => std::option::Option::Some(4),
35608            Self::UnknownValue(u) => u.0.value(),
35609        }
35610    }
35611
35612    /// Gets the enum value as a string.
35613    ///
35614    /// Returns `None` if the enum contains an unknown value deserialized from
35615    /// the integer representation of enums.
35616    pub fn name(&self) -> std::option::Option<&str> {
35617        match self {
35618            Self::Unspecified => std::option::Option::Some("SQL_DATA_DISK_TYPE_UNSPECIFIED"),
35619            Self::PdSsd => std::option::Option::Some("PD_SSD"),
35620            Self::PdHdd => std::option::Option::Some("PD_HDD"),
35621            Self::ObsoleteLocalSsd => std::option::Option::Some("OBSOLETE_LOCAL_SSD"),
35622            Self::HyperdiskBalanced => std::option::Option::Some("HYPERDISK_BALANCED"),
35623            Self::UnknownValue(u) => u.0.name(),
35624        }
35625    }
35626}
35627
35628impl std::default::Default for SqlDataDiskType {
35629    fn default() -> Self {
35630        use std::convert::From;
35631        Self::from(0)
35632    }
35633}
35634
35635impl std::fmt::Display for SqlDataDiskType {
35636    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35637        wkt::internal::display_enum(f, self.name(), self.value())
35638    }
35639}
35640
35641impl std::convert::From<i32> for SqlDataDiskType {
35642    fn from(value: i32) -> Self {
35643        match value {
35644            0 => Self::Unspecified,
35645            1 => Self::PdSsd,
35646            2 => Self::PdHdd,
35647            3 => Self::ObsoleteLocalSsd,
35648            4 => Self::HyperdiskBalanced,
35649            _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
35650                wkt::internal::UnknownEnumValue::Integer(value),
35651            )),
35652        }
35653    }
35654}
35655
35656impl std::convert::From<&str> for SqlDataDiskType {
35657    fn from(value: &str) -> Self {
35658        use std::string::ToString;
35659        match value {
35660            "SQL_DATA_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
35661            "PD_SSD" => Self::PdSsd,
35662            "PD_HDD" => Self::PdHdd,
35663            "OBSOLETE_LOCAL_SSD" => Self::ObsoleteLocalSsd,
35664            "HYPERDISK_BALANCED" => Self::HyperdiskBalanced,
35665            _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
35666                wkt::internal::UnknownEnumValue::String(value.to_string()),
35667            )),
35668        }
35669    }
35670}
35671
35672impl serde::ser::Serialize for SqlDataDiskType {
35673    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35674    where
35675        S: serde::Serializer,
35676    {
35677        match self {
35678            Self::Unspecified => serializer.serialize_i32(0),
35679            Self::PdSsd => serializer.serialize_i32(1),
35680            Self::PdHdd => serializer.serialize_i32(2),
35681            Self::ObsoleteLocalSsd => serializer.serialize_i32(3),
35682            Self::HyperdiskBalanced => serializer.serialize_i32(4),
35683            Self::UnknownValue(u) => u.0.serialize(serializer),
35684        }
35685    }
35686}
35687
35688impl<'de> serde::de::Deserialize<'de> for SqlDataDiskType {
35689    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35690    where
35691        D: serde::Deserializer<'de>,
35692    {
35693        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDataDiskType>::new(
35694            ".google.cloud.sql.v1.SqlDataDiskType",
35695        ))
35696    }
35697}
35698
35699/// The availability type of the given Cloud SQL instance.
35700///
35701/// # Working with unknown values
35702///
35703/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35704/// additional enum variants at any time. Adding new variants is not considered
35705/// a breaking change. Applications should write their code in anticipation of:
35706///
35707/// - New values appearing in future releases of the client library, **and**
35708/// - New values received dynamically, without application changes.
35709///
35710/// Please consult the [Working with enums] section in the user guide for some
35711/// guidelines.
35712///
35713/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35714#[derive(Clone, Debug, PartialEq)]
35715#[non_exhaustive]
35716pub enum SqlAvailabilityType {
35717    /// This is an unknown Availability type.
35718    Unspecified,
35719    /// Zonal available instance.
35720    Zonal,
35721    /// Regional available instance.
35722    Regional,
35723    /// If set, the enum was initialized with an unknown value.
35724    ///
35725    /// Applications can examine the value using [SqlAvailabilityType::value] or
35726    /// [SqlAvailabilityType::name].
35727    UnknownValue(sql_availability_type::UnknownValue),
35728}
35729
35730#[doc(hidden)]
35731pub mod sql_availability_type {
35732    #[allow(unused_imports)]
35733    use super::*;
35734    #[derive(Clone, Debug, PartialEq)]
35735    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35736}
35737
35738impl SqlAvailabilityType {
35739    /// Gets the enum value.
35740    ///
35741    /// Returns `None` if the enum contains an unknown value deserialized from
35742    /// the string representation of enums.
35743    pub fn value(&self) -> std::option::Option<i32> {
35744        match self {
35745            Self::Unspecified => std::option::Option::Some(0),
35746            Self::Zonal => std::option::Option::Some(1),
35747            Self::Regional => std::option::Option::Some(2),
35748            Self::UnknownValue(u) => u.0.value(),
35749        }
35750    }
35751
35752    /// Gets the enum value as a string.
35753    ///
35754    /// Returns `None` if the enum contains an unknown value deserialized from
35755    /// the integer representation of enums.
35756    pub fn name(&self) -> std::option::Option<&str> {
35757        match self {
35758            Self::Unspecified => std::option::Option::Some("SQL_AVAILABILITY_TYPE_UNSPECIFIED"),
35759            Self::Zonal => std::option::Option::Some("ZONAL"),
35760            Self::Regional => std::option::Option::Some("REGIONAL"),
35761            Self::UnknownValue(u) => u.0.name(),
35762        }
35763    }
35764}
35765
35766impl std::default::Default for SqlAvailabilityType {
35767    fn default() -> Self {
35768        use std::convert::From;
35769        Self::from(0)
35770    }
35771}
35772
35773impl std::fmt::Display for SqlAvailabilityType {
35774    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35775        wkt::internal::display_enum(f, self.name(), self.value())
35776    }
35777}
35778
35779impl std::convert::From<i32> for SqlAvailabilityType {
35780    fn from(value: i32) -> Self {
35781        match value {
35782            0 => Self::Unspecified,
35783            1 => Self::Zonal,
35784            2 => Self::Regional,
35785            _ => Self::UnknownValue(sql_availability_type::UnknownValue(
35786                wkt::internal::UnknownEnumValue::Integer(value),
35787            )),
35788        }
35789    }
35790}
35791
35792impl std::convert::From<&str> for SqlAvailabilityType {
35793    fn from(value: &str) -> Self {
35794        use std::string::ToString;
35795        match value {
35796            "SQL_AVAILABILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
35797            "ZONAL" => Self::Zonal,
35798            "REGIONAL" => Self::Regional,
35799            _ => Self::UnknownValue(sql_availability_type::UnknownValue(
35800                wkt::internal::UnknownEnumValue::String(value.to_string()),
35801            )),
35802        }
35803    }
35804}
35805
35806impl serde::ser::Serialize for SqlAvailabilityType {
35807    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35808    where
35809        S: serde::Serializer,
35810    {
35811        match self {
35812            Self::Unspecified => serializer.serialize_i32(0),
35813            Self::Zonal => serializer.serialize_i32(1),
35814            Self::Regional => serializer.serialize_i32(2),
35815            Self::UnknownValue(u) => u.0.serialize(serializer),
35816        }
35817    }
35818}
35819
35820impl<'de> serde::de::Deserialize<'de> for SqlAvailabilityType {
35821    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35822    where
35823        D: serde::Deserializer<'de>,
35824    {
35825        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlAvailabilityType>::new(
35826            ".google.cloud.sql.v1.SqlAvailabilityType",
35827        ))
35828    }
35829}
35830
35831/// Enum for [SqlUpdateTrack].
35832///
35833/// # Working with unknown values
35834///
35835/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35836/// additional enum variants at any time. Adding new variants is not considered
35837/// a breaking change. Applications should write their code in anticipation of:
35838///
35839/// - New values appearing in future releases of the client library, **and**
35840/// - New values received dynamically, without application changes.
35841///
35842/// Please consult the [Working with enums] section in the user guide for some
35843/// guidelines.
35844///
35845/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35846#[derive(Clone, Debug, PartialEq)]
35847#[non_exhaustive]
35848pub enum SqlUpdateTrack {
35849    /// This is an unknown maintenance timing preference.
35850    Unspecified,
35851    /// For an instance with a scheduled maintenance window, this maintenance
35852    /// timing indicates that the maintenance update is scheduled 7 to 14 days
35853    /// after the notification is sent out. Also referred to as `Week 1` (Console)
35854    /// and `preview` (gcloud CLI).
35855    Canary,
35856    /// For an instance with a scheduled maintenance window, this maintenance
35857    /// timing indicates that the maintenance update is scheduled 15 to 21 days
35858    /// after the notification is sent out. Also referred to as `Week 2` (Console)
35859    /// and `production` (gcloud CLI).
35860    Stable,
35861    /// For instance with a scheduled maintenance window, this maintenance
35862    /// timing indicates that the maintenance update is scheduled 35 to 42 days
35863    /// after the notification is sent out.
35864    Week5,
35865    /// If set, the enum was initialized with an unknown value.
35866    ///
35867    /// Applications can examine the value using [SqlUpdateTrack::value] or
35868    /// [SqlUpdateTrack::name].
35869    UnknownValue(sql_update_track::UnknownValue),
35870}
35871
35872#[doc(hidden)]
35873pub mod sql_update_track {
35874    #[allow(unused_imports)]
35875    use super::*;
35876    #[derive(Clone, Debug, PartialEq)]
35877    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35878}
35879
35880impl SqlUpdateTrack {
35881    /// Gets the enum value.
35882    ///
35883    /// Returns `None` if the enum contains an unknown value deserialized from
35884    /// the string representation of enums.
35885    pub fn value(&self) -> std::option::Option<i32> {
35886        match self {
35887            Self::Unspecified => std::option::Option::Some(0),
35888            Self::Canary => std::option::Option::Some(1),
35889            Self::Stable => std::option::Option::Some(2),
35890            Self::Week5 => std::option::Option::Some(3),
35891            Self::UnknownValue(u) => u.0.value(),
35892        }
35893    }
35894
35895    /// Gets the enum value as a string.
35896    ///
35897    /// Returns `None` if the enum contains an unknown value deserialized from
35898    /// the integer representation of enums.
35899    pub fn name(&self) -> std::option::Option<&str> {
35900        match self {
35901            Self::Unspecified => std::option::Option::Some("SQL_UPDATE_TRACK_UNSPECIFIED"),
35902            Self::Canary => std::option::Option::Some("canary"),
35903            Self::Stable => std::option::Option::Some("stable"),
35904            Self::Week5 => std::option::Option::Some("week5"),
35905            Self::UnknownValue(u) => u.0.name(),
35906        }
35907    }
35908}
35909
35910impl std::default::Default for SqlUpdateTrack {
35911    fn default() -> Self {
35912        use std::convert::From;
35913        Self::from(0)
35914    }
35915}
35916
35917impl std::fmt::Display for SqlUpdateTrack {
35918    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35919        wkt::internal::display_enum(f, self.name(), self.value())
35920    }
35921}
35922
35923impl std::convert::From<i32> for SqlUpdateTrack {
35924    fn from(value: i32) -> Self {
35925        match value {
35926            0 => Self::Unspecified,
35927            1 => Self::Canary,
35928            2 => Self::Stable,
35929            3 => Self::Week5,
35930            _ => Self::UnknownValue(sql_update_track::UnknownValue(
35931                wkt::internal::UnknownEnumValue::Integer(value),
35932            )),
35933        }
35934    }
35935}
35936
35937impl std::convert::From<&str> for SqlUpdateTrack {
35938    fn from(value: &str) -> Self {
35939        use std::string::ToString;
35940        match value {
35941            "SQL_UPDATE_TRACK_UNSPECIFIED" => Self::Unspecified,
35942            "canary" => Self::Canary,
35943            "stable" => Self::Stable,
35944            "week5" => Self::Week5,
35945            _ => Self::UnknownValue(sql_update_track::UnknownValue(
35946                wkt::internal::UnknownEnumValue::String(value.to_string()),
35947            )),
35948        }
35949    }
35950}
35951
35952impl serde::ser::Serialize for SqlUpdateTrack {
35953    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35954    where
35955        S: serde::Serializer,
35956    {
35957        match self {
35958            Self::Unspecified => serializer.serialize_i32(0),
35959            Self::Canary => serializer.serialize_i32(1),
35960            Self::Stable => serializer.serialize_i32(2),
35961            Self::Week5 => serializer.serialize_i32(3),
35962            Self::UnknownValue(u) => u.0.serialize(serializer),
35963        }
35964    }
35965}
35966
35967impl<'de> serde::de::Deserialize<'de> for SqlUpdateTrack {
35968    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35969    where
35970        D: serde::Deserializer<'de>,
35971    {
35972        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUpdateTrack>::new(
35973            ".google.cloud.sql.v1.SqlUpdateTrack",
35974        ))
35975    }
35976}