google_cloud_sql_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate reqwest;
26extern crate serde;
27extern crate serde_json;
28extern crate serde_with;
29extern crate std;
30extern crate tracing;
31extern crate wkt;
32
33mod debug;
34mod deserialize;
35mod serialize;
36
37/// Backup runs delete request.
38#[derive(Clone, Default, PartialEq)]
39#[non_exhaustive]
40pub struct SqlBackupRunsDeleteRequest {
41    /// The ID of the backup run to delete. To find a backup run ID, use the
42    /// [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/backupRuns/list)
43    /// method.
44    pub id: i64,
45
46    /// Cloud SQL instance ID. This does not include the project ID.
47    pub instance: std::string::String,
48
49    /// Project ID of the project that contains the instance.
50    pub project: std::string::String,
51
52    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
53}
54
55impl SqlBackupRunsDeleteRequest {
56    pub fn new() -> Self {
57        std::default::Default::default()
58    }
59
60    /// Sets the value of [id][crate::model::SqlBackupRunsDeleteRequest::id].
61    ///
62    /// # Example
63    /// ```ignore,no_run
64    /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
65    /// let x = SqlBackupRunsDeleteRequest::new().set_id(42);
66    /// ```
67    pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
68        self.id = v.into();
69        self
70    }
71
72    /// Sets the value of [instance][crate::model::SqlBackupRunsDeleteRequest::instance].
73    ///
74    /// # Example
75    /// ```ignore,no_run
76    /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
77    /// let x = SqlBackupRunsDeleteRequest::new().set_instance("example");
78    /// ```
79    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
80        self.instance = v.into();
81        self
82    }
83
84    /// Sets the value of [project][crate::model::SqlBackupRunsDeleteRequest::project].
85    ///
86    /// # Example
87    /// ```ignore,no_run
88    /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
89    /// let x = SqlBackupRunsDeleteRequest::new().set_project("example");
90    /// ```
91    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
92        self.project = v.into();
93        self
94    }
95}
96
97impl wkt::message::Message for SqlBackupRunsDeleteRequest {
98    fn typename() -> &'static str {
99        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsDeleteRequest"
100    }
101}
102
103/// Backup runs get request.
104#[derive(Clone, Default, PartialEq)]
105#[non_exhaustive]
106pub struct SqlBackupRunsGetRequest {
107    /// The ID of this backup run.
108    pub id: i64,
109
110    /// Cloud SQL instance ID. This does not include the project ID.
111    pub instance: std::string::String,
112
113    /// Project ID of the project that contains the instance.
114    pub project: std::string::String,
115
116    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
117}
118
119impl SqlBackupRunsGetRequest {
120    pub fn new() -> Self {
121        std::default::Default::default()
122    }
123
124    /// Sets the value of [id][crate::model::SqlBackupRunsGetRequest::id].
125    ///
126    /// # Example
127    /// ```ignore,no_run
128    /// # use google_cloud_sql_v1::model::SqlBackupRunsGetRequest;
129    /// let x = SqlBackupRunsGetRequest::new().set_id(42);
130    /// ```
131    pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
132        self.id = v.into();
133        self
134    }
135
136    /// Sets the value of [instance][crate::model::SqlBackupRunsGetRequest::instance].
137    ///
138    /// # Example
139    /// ```ignore,no_run
140    /// # use google_cloud_sql_v1::model::SqlBackupRunsGetRequest;
141    /// let x = SqlBackupRunsGetRequest::new().set_instance("example");
142    /// ```
143    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
144        self.instance = v.into();
145        self
146    }
147
148    /// Sets the value of [project][crate::model::SqlBackupRunsGetRequest::project].
149    ///
150    /// # Example
151    /// ```ignore,no_run
152    /// # use google_cloud_sql_v1::model::SqlBackupRunsGetRequest;
153    /// let x = SqlBackupRunsGetRequest::new().set_project("example");
154    /// ```
155    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
156        self.project = v.into();
157        self
158    }
159}
160
161impl wkt::message::Message for SqlBackupRunsGetRequest {
162    fn typename() -> &'static str {
163        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsGetRequest"
164    }
165}
166
167/// Backup runs insert request.
168#[derive(Clone, Default, PartialEq)]
169#[non_exhaustive]
170pub struct SqlBackupRunsInsertRequest {
171    /// Cloud SQL instance ID. This does not include the project ID.
172    pub instance: std::string::String,
173
174    /// Project ID of the project that contains the instance.
175    pub project: std::string::String,
176
177    pub body: std::option::Option<crate::model::BackupRun>,
178
179    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
180}
181
182impl SqlBackupRunsInsertRequest {
183    pub fn new() -> Self {
184        std::default::Default::default()
185    }
186
187    /// Sets the value of [instance][crate::model::SqlBackupRunsInsertRequest::instance].
188    ///
189    /// # Example
190    /// ```ignore,no_run
191    /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
192    /// let x = SqlBackupRunsInsertRequest::new().set_instance("example");
193    /// ```
194    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
195        self.instance = v.into();
196        self
197    }
198
199    /// Sets the value of [project][crate::model::SqlBackupRunsInsertRequest::project].
200    ///
201    /// # Example
202    /// ```ignore,no_run
203    /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
204    /// let x = SqlBackupRunsInsertRequest::new().set_project("example");
205    /// ```
206    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
207        self.project = v.into();
208        self
209    }
210
211    /// Sets the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
212    ///
213    /// # Example
214    /// ```ignore,no_run
215    /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
216    /// use google_cloud_sql_v1::model::BackupRun;
217    /// let x = SqlBackupRunsInsertRequest::new().set_body(BackupRun::default()/* use setters */);
218    /// ```
219    pub fn set_body<T>(mut self, v: T) -> Self
220    where
221        T: std::convert::Into<crate::model::BackupRun>,
222    {
223        self.body = std::option::Option::Some(v.into());
224        self
225    }
226
227    /// Sets or clears the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
228    ///
229    /// # Example
230    /// ```ignore,no_run
231    /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
232    /// use google_cloud_sql_v1::model::BackupRun;
233    /// let x = SqlBackupRunsInsertRequest::new().set_or_clear_body(Some(BackupRun::default()/* use setters */));
234    /// let x = SqlBackupRunsInsertRequest::new().set_or_clear_body(None::<BackupRun>);
235    /// ```
236    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
237    where
238        T: std::convert::Into<crate::model::BackupRun>,
239    {
240        self.body = v.map(|x| x.into());
241        self
242    }
243}
244
245impl wkt::message::Message for SqlBackupRunsInsertRequest {
246    fn typename() -> &'static str {
247        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsInsertRequest"
248    }
249}
250
251/// Backup runs list request.
252#[derive(Clone, Default, PartialEq)]
253#[non_exhaustive]
254pub struct SqlBackupRunsListRequest {
255    /// Cloud SQL instance ID, or "-" for all instances. This does not include
256    /// the project ID.
257    pub instance: std::string::String,
258
259    /// Maximum number of backup runs per response.
260    pub max_results: i32,
261
262    /// A previously-returned page token representing part of the larger set of
263    /// results to view.
264    pub page_token: std::string::String,
265
266    /// Project ID of the project that contains the instance.
267    pub project: std::string::String,
268
269    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
270}
271
272impl SqlBackupRunsListRequest {
273    pub fn new() -> Self {
274        std::default::Default::default()
275    }
276
277    /// Sets the value of [instance][crate::model::SqlBackupRunsListRequest::instance].
278    ///
279    /// # Example
280    /// ```ignore,no_run
281    /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
282    /// let x = SqlBackupRunsListRequest::new().set_instance("example");
283    /// ```
284    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
285        self.instance = v.into();
286        self
287    }
288
289    /// Sets the value of [max_results][crate::model::SqlBackupRunsListRequest::max_results].
290    ///
291    /// # Example
292    /// ```ignore,no_run
293    /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
294    /// let x = SqlBackupRunsListRequest::new().set_max_results(42);
295    /// ```
296    pub fn set_max_results<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
297        self.max_results = v.into();
298        self
299    }
300
301    /// Sets the value of [page_token][crate::model::SqlBackupRunsListRequest::page_token].
302    ///
303    /// # Example
304    /// ```ignore,no_run
305    /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
306    /// let x = SqlBackupRunsListRequest::new().set_page_token("example");
307    /// ```
308    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
309        self.page_token = v.into();
310        self
311    }
312
313    /// Sets the value of [project][crate::model::SqlBackupRunsListRequest::project].
314    ///
315    /// # Example
316    /// ```ignore,no_run
317    /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
318    /// let x = SqlBackupRunsListRequest::new().set_project("example");
319    /// ```
320    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
321        self.project = v.into();
322        self
323    }
324}
325
326impl wkt::message::Message for SqlBackupRunsListRequest {
327    fn typename() -> &'static str {
328        "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsListRequest"
329    }
330}
331
332/// A BackupRun resource.
333#[derive(Clone, Default, PartialEq)]
334#[non_exhaustive]
335pub struct BackupRun {
336    /// This is always `sql#backupRun`.
337    pub kind: std::string::String,
338
339    /// The status of this run.
340    pub status: crate::model::SqlBackupRunStatus,
341
342    /// The time the run was enqueued in UTC timezone in
343    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
344    /// `2012-11-15T16:19:00.094Z`.
345    pub enqueued_time: std::option::Option<wkt::Timestamp>,
346
347    /// The identifier for this backup run. Unique only for a specific Cloud SQL
348    /// instance.
349    pub id: i64,
350
351    /// The time the backup operation actually started in UTC timezone in
352    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
353    /// `2012-11-15T16:19:00.094Z`.
354    pub start_time: std::option::Option<wkt::Timestamp>,
355
356    /// The time the backup operation completed 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 end_time: std::option::Option<wkt::Timestamp>,
360
361    /// Information about why the backup operation failed. This is only present if
362    /// the run has the FAILED status.
363    pub error: std::option::Option<crate::model::OperationError>,
364
365    /// The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
366    /// This field defaults to "ON_DEMAND" and is ignored, when specified for
367    /// insert requests.
368    pub r#type: crate::model::SqlBackupRunType,
369
370    /// The description of this run, only applicable to on-demand backups.
371    pub description: std::string::String,
372
373    /// The start time of the backup window during which this the backup was
374    /// attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
375    /// example `2012-11-15T16:19:00.094Z`.
376    pub window_start_time: std::option::Option<wkt::Timestamp>,
377
378    /// Name of the database instance.
379    pub instance: std::string::String,
380
381    /// The URI of this resource.
382    pub self_link: std::string::String,
383
384    /// Location of the backups.
385    pub location: std::string::String,
386
387    /// Encryption configuration specific to a backup.
388    pub disk_encryption_configuration:
389        std::option::Option<crate::model::DiskEncryptionConfiguration>,
390
391    /// Encryption status specific to a backup.
392    pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
393
394    /// Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
395    pub backup_kind: crate::model::SqlBackupKind,
396
397    /// Backup time zone to prevent restores to an instance with
398    /// a different time zone. Now relevant only for SQL Server.
399    pub time_zone: std::string::String,
400
401    /// Output only. The maximum chargeable bytes for the backup.
402    pub max_chargeable_bytes: std::option::Option<i64>,
403
404    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
405}
406
407impl BackupRun {
408    pub fn new() -> Self {
409        std::default::Default::default()
410    }
411
412    /// Sets the value of [kind][crate::model::BackupRun::kind].
413    ///
414    /// # Example
415    /// ```ignore,no_run
416    /// # use google_cloud_sql_v1::model::BackupRun;
417    /// let x = BackupRun::new().set_kind("example");
418    /// ```
419    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
420        self.kind = v.into();
421        self
422    }
423
424    /// Sets the value of [status][crate::model::BackupRun::status].
425    ///
426    /// # Example
427    /// ```ignore,no_run
428    /// # use google_cloud_sql_v1::model::BackupRun;
429    /// use google_cloud_sql_v1::model::SqlBackupRunStatus;
430    /// let x0 = BackupRun::new().set_status(SqlBackupRunStatus::Enqueued);
431    /// let x1 = BackupRun::new().set_status(SqlBackupRunStatus::Overdue);
432    /// let x2 = BackupRun::new().set_status(SqlBackupRunStatus::Running);
433    /// ```
434    pub fn set_status<T: std::convert::Into<crate::model::SqlBackupRunStatus>>(
435        mut self,
436        v: T,
437    ) -> Self {
438        self.status = v.into();
439        self
440    }
441
442    /// Sets the value of [enqueued_time][crate::model::BackupRun::enqueued_time].
443    ///
444    /// # Example
445    /// ```ignore,no_run
446    /// # use google_cloud_sql_v1::model::BackupRun;
447    /// use wkt::Timestamp;
448    /// let x = BackupRun::new().set_enqueued_time(Timestamp::default()/* use setters */);
449    /// ```
450    pub fn set_enqueued_time<T>(mut self, v: T) -> Self
451    where
452        T: std::convert::Into<wkt::Timestamp>,
453    {
454        self.enqueued_time = std::option::Option::Some(v.into());
455        self
456    }
457
458    /// Sets or clears the value of [enqueued_time][crate::model::BackupRun::enqueued_time].
459    ///
460    /// # Example
461    /// ```ignore,no_run
462    /// # use google_cloud_sql_v1::model::BackupRun;
463    /// use wkt::Timestamp;
464    /// let x = BackupRun::new().set_or_clear_enqueued_time(Some(Timestamp::default()/* use setters */));
465    /// let x = BackupRun::new().set_or_clear_enqueued_time(None::<Timestamp>);
466    /// ```
467    pub fn set_or_clear_enqueued_time<T>(mut self, v: std::option::Option<T>) -> Self
468    where
469        T: std::convert::Into<wkt::Timestamp>,
470    {
471        self.enqueued_time = v.map(|x| x.into());
472        self
473    }
474
475    /// Sets the value of [id][crate::model::BackupRun::id].
476    ///
477    /// # Example
478    /// ```ignore,no_run
479    /// # use google_cloud_sql_v1::model::BackupRun;
480    /// let x = BackupRun::new().set_id(42);
481    /// ```
482    pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
483        self.id = v.into();
484        self
485    }
486
487    /// Sets the value of [start_time][crate::model::BackupRun::start_time].
488    ///
489    /// # Example
490    /// ```ignore,no_run
491    /// # use google_cloud_sql_v1::model::BackupRun;
492    /// use wkt::Timestamp;
493    /// let x = BackupRun::new().set_start_time(Timestamp::default()/* use setters */);
494    /// ```
495    pub fn set_start_time<T>(mut self, v: T) -> Self
496    where
497        T: std::convert::Into<wkt::Timestamp>,
498    {
499        self.start_time = std::option::Option::Some(v.into());
500        self
501    }
502
503    /// Sets or clears the value of [start_time][crate::model::BackupRun::start_time].
504    ///
505    /// # Example
506    /// ```ignore,no_run
507    /// # use google_cloud_sql_v1::model::BackupRun;
508    /// use wkt::Timestamp;
509    /// let x = BackupRun::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
510    /// let x = BackupRun::new().set_or_clear_start_time(None::<Timestamp>);
511    /// ```
512    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
513    where
514        T: std::convert::Into<wkt::Timestamp>,
515    {
516        self.start_time = v.map(|x| x.into());
517        self
518    }
519
520    /// Sets the value of [end_time][crate::model::BackupRun::end_time].
521    ///
522    /// # Example
523    /// ```ignore,no_run
524    /// # use google_cloud_sql_v1::model::BackupRun;
525    /// use wkt::Timestamp;
526    /// let x = BackupRun::new().set_end_time(Timestamp::default()/* use setters */);
527    /// ```
528    pub fn set_end_time<T>(mut self, v: T) -> Self
529    where
530        T: std::convert::Into<wkt::Timestamp>,
531    {
532        self.end_time = std::option::Option::Some(v.into());
533        self
534    }
535
536    /// Sets or clears the value of [end_time][crate::model::BackupRun::end_time].
537    ///
538    /// # Example
539    /// ```ignore,no_run
540    /// # use google_cloud_sql_v1::model::BackupRun;
541    /// use wkt::Timestamp;
542    /// let x = BackupRun::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
543    /// let x = BackupRun::new().set_or_clear_end_time(None::<Timestamp>);
544    /// ```
545    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
546    where
547        T: std::convert::Into<wkt::Timestamp>,
548    {
549        self.end_time = v.map(|x| x.into());
550        self
551    }
552
553    /// Sets the value of [error][crate::model::BackupRun::error].
554    ///
555    /// # Example
556    /// ```ignore,no_run
557    /// # use google_cloud_sql_v1::model::BackupRun;
558    /// use google_cloud_sql_v1::model::OperationError;
559    /// let x = BackupRun::new().set_error(OperationError::default()/* use setters */);
560    /// ```
561    pub fn set_error<T>(mut self, v: T) -> Self
562    where
563        T: std::convert::Into<crate::model::OperationError>,
564    {
565        self.error = std::option::Option::Some(v.into());
566        self
567    }
568
569    /// Sets or clears the value of [error][crate::model::BackupRun::error].
570    ///
571    /// # Example
572    /// ```ignore,no_run
573    /// # use google_cloud_sql_v1::model::BackupRun;
574    /// use google_cloud_sql_v1::model::OperationError;
575    /// let x = BackupRun::new().set_or_clear_error(Some(OperationError::default()/* use setters */));
576    /// let x = BackupRun::new().set_or_clear_error(None::<OperationError>);
577    /// ```
578    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
579    where
580        T: std::convert::Into<crate::model::OperationError>,
581    {
582        self.error = v.map(|x| x.into());
583        self
584    }
585
586    /// Sets the value of [r#type][crate::model::BackupRun::type].
587    ///
588    /// # Example
589    /// ```ignore,no_run
590    /// # use google_cloud_sql_v1::model::BackupRun;
591    /// use google_cloud_sql_v1::model::SqlBackupRunType;
592    /// let x0 = BackupRun::new().set_type(SqlBackupRunType::Automated);
593    /// let x1 = BackupRun::new().set_type(SqlBackupRunType::OnDemand);
594    /// ```
595    pub fn set_type<T: std::convert::Into<crate::model::SqlBackupRunType>>(mut self, v: T) -> Self {
596        self.r#type = v.into();
597        self
598    }
599
600    /// Sets the value of [description][crate::model::BackupRun::description].
601    ///
602    /// # Example
603    /// ```ignore,no_run
604    /// # use google_cloud_sql_v1::model::BackupRun;
605    /// let x = BackupRun::new().set_description("example");
606    /// ```
607    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
608        self.description = v.into();
609        self
610    }
611
612    /// Sets the value of [window_start_time][crate::model::BackupRun::window_start_time].
613    ///
614    /// # Example
615    /// ```ignore,no_run
616    /// # use google_cloud_sql_v1::model::BackupRun;
617    /// use wkt::Timestamp;
618    /// let x = BackupRun::new().set_window_start_time(Timestamp::default()/* use setters */);
619    /// ```
620    pub fn set_window_start_time<T>(mut self, v: T) -> Self
621    where
622        T: std::convert::Into<wkt::Timestamp>,
623    {
624        self.window_start_time = std::option::Option::Some(v.into());
625        self
626    }
627
628    /// Sets or clears the value of [window_start_time][crate::model::BackupRun::window_start_time].
629    ///
630    /// # Example
631    /// ```ignore,no_run
632    /// # use google_cloud_sql_v1::model::BackupRun;
633    /// use wkt::Timestamp;
634    /// let x = BackupRun::new().set_or_clear_window_start_time(Some(Timestamp::default()/* use setters */));
635    /// let x = BackupRun::new().set_or_clear_window_start_time(None::<Timestamp>);
636    /// ```
637    pub fn set_or_clear_window_start_time<T>(mut self, v: std::option::Option<T>) -> Self
638    where
639        T: std::convert::Into<wkt::Timestamp>,
640    {
641        self.window_start_time = v.map(|x| x.into());
642        self
643    }
644
645    /// Sets the value of [instance][crate::model::BackupRun::instance].
646    ///
647    /// # Example
648    /// ```ignore,no_run
649    /// # use google_cloud_sql_v1::model::BackupRun;
650    /// let x = BackupRun::new().set_instance("example");
651    /// ```
652    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
653        self.instance = v.into();
654        self
655    }
656
657    /// Sets the value of [self_link][crate::model::BackupRun::self_link].
658    ///
659    /// # Example
660    /// ```ignore,no_run
661    /// # use google_cloud_sql_v1::model::BackupRun;
662    /// let x = BackupRun::new().set_self_link("example");
663    /// ```
664    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
665        self.self_link = v.into();
666        self
667    }
668
669    /// Sets the value of [location][crate::model::BackupRun::location].
670    ///
671    /// # Example
672    /// ```ignore,no_run
673    /// # use google_cloud_sql_v1::model::BackupRun;
674    /// let x = BackupRun::new().set_location("example");
675    /// ```
676    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
677        self.location = v.into();
678        self
679    }
680
681    /// Sets the value of [disk_encryption_configuration][crate::model::BackupRun::disk_encryption_configuration].
682    ///
683    /// # Example
684    /// ```ignore,no_run
685    /// # use google_cloud_sql_v1::model::BackupRun;
686    /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
687    /// let x = BackupRun::new().set_disk_encryption_configuration(DiskEncryptionConfiguration::default()/* use setters */);
688    /// ```
689    pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
690    where
691        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
692    {
693        self.disk_encryption_configuration = std::option::Option::Some(v.into());
694        self
695    }
696
697    /// Sets or clears the value of [disk_encryption_configuration][crate::model::BackupRun::disk_encryption_configuration].
698    ///
699    /// # Example
700    /// ```ignore,no_run
701    /// # use google_cloud_sql_v1::model::BackupRun;
702    /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
703    /// let x = BackupRun::new().set_or_clear_disk_encryption_configuration(Some(DiskEncryptionConfiguration::default()/* use setters */));
704    /// let x = BackupRun::new().set_or_clear_disk_encryption_configuration(None::<DiskEncryptionConfiguration>);
705    /// ```
706    pub fn set_or_clear_disk_encryption_configuration<T>(
707        mut self,
708        v: std::option::Option<T>,
709    ) -> Self
710    where
711        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
712    {
713        self.disk_encryption_configuration = v.map(|x| x.into());
714        self
715    }
716
717    /// Sets the value of [disk_encryption_status][crate::model::BackupRun::disk_encryption_status].
718    ///
719    /// # Example
720    /// ```ignore,no_run
721    /// # use google_cloud_sql_v1::model::BackupRun;
722    /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
723    /// let x = BackupRun::new().set_disk_encryption_status(DiskEncryptionStatus::default()/* use setters */);
724    /// ```
725    pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
726    where
727        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
728    {
729        self.disk_encryption_status = std::option::Option::Some(v.into());
730        self
731    }
732
733    /// Sets or clears the value of [disk_encryption_status][crate::model::BackupRun::disk_encryption_status].
734    ///
735    /// # Example
736    /// ```ignore,no_run
737    /// # use google_cloud_sql_v1::model::BackupRun;
738    /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
739    /// let x = BackupRun::new().set_or_clear_disk_encryption_status(Some(DiskEncryptionStatus::default()/* use setters */));
740    /// let x = BackupRun::new().set_or_clear_disk_encryption_status(None::<DiskEncryptionStatus>);
741    /// ```
742    pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
743    where
744        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
745    {
746        self.disk_encryption_status = v.map(|x| x.into());
747        self
748    }
749
750    /// Sets the value of [backup_kind][crate::model::BackupRun::backup_kind].
751    ///
752    /// # Example
753    /// ```ignore,no_run
754    /// # use google_cloud_sql_v1::model::BackupRun;
755    /// use google_cloud_sql_v1::model::SqlBackupKind;
756    /// let x0 = BackupRun::new().set_backup_kind(SqlBackupKind::Snapshot);
757    /// let x1 = BackupRun::new().set_backup_kind(SqlBackupKind::Physical);
758    /// ```
759    pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
760        mut self,
761        v: T,
762    ) -> Self {
763        self.backup_kind = v.into();
764        self
765    }
766
767    /// Sets the value of [time_zone][crate::model::BackupRun::time_zone].
768    ///
769    /// # Example
770    /// ```ignore,no_run
771    /// # use google_cloud_sql_v1::model::BackupRun;
772    /// let x = BackupRun::new().set_time_zone("example");
773    /// ```
774    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
775        self.time_zone = v.into();
776        self
777    }
778
779    /// Sets the value of [max_chargeable_bytes][crate::model::BackupRun::max_chargeable_bytes].
780    ///
781    /// # Example
782    /// ```ignore,no_run
783    /// # use google_cloud_sql_v1::model::BackupRun;
784    /// let x = BackupRun::new().set_max_chargeable_bytes(42);
785    /// ```
786    pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
787    where
788        T: std::convert::Into<i64>,
789    {
790        self.max_chargeable_bytes = std::option::Option::Some(v.into());
791        self
792    }
793
794    /// Sets or clears the value of [max_chargeable_bytes][crate::model::BackupRun::max_chargeable_bytes].
795    ///
796    /// # Example
797    /// ```ignore,no_run
798    /// # use google_cloud_sql_v1::model::BackupRun;
799    /// let x = BackupRun::new().set_or_clear_max_chargeable_bytes(Some(42));
800    /// let x = BackupRun::new().set_or_clear_max_chargeable_bytes(None::<i32>);
801    /// ```
802    pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
803    where
804        T: std::convert::Into<i64>,
805    {
806        self.max_chargeable_bytes = v.map(|x| x.into());
807        self
808    }
809}
810
811impl wkt::message::Message for BackupRun {
812    fn typename() -> &'static str {
813        "type.googleapis.com/google.cloud.sql.v1.BackupRun"
814    }
815}
816
817/// Backup run list results.
818#[derive(Clone, Default, PartialEq)]
819#[non_exhaustive]
820pub struct BackupRunsListResponse {
821    /// This is always `sql#backupRunsList`.
822    pub kind: std::string::String,
823
824    /// A list of backup runs in reverse chronological order of the enqueued time.
825    pub items: std::vec::Vec<crate::model::BackupRun>,
826
827    /// The continuation token, used to page through large result sets. Provide
828    /// this value in a subsequent request to return the next page of results.
829    pub next_page_token: std::string::String,
830
831    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
832}
833
834impl BackupRunsListResponse {
835    pub fn new() -> Self {
836        std::default::Default::default()
837    }
838
839    /// Sets the value of [kind][crate::model::BackupRunsListResponse::kind].
840    ///
841    /// # Example
842    /// ```ignore,no_run
843    /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
844    /// let x = BackupRunsListResponse::new().set_kind("example");
845    /// ```
846    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
847        self.kind = v.into();
848        self
849    }
850
851    /// Sets the value of [items][crate::model::BackupRunsListResponse::items].
852    ///
853    /// # Example
854    /// ```ignore,no_run
855    /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
856    /// use google_cloud_sql_v1::model::BackupRun;
857    /// let x = BackupRunsListResponse::new()
858    ///     .set_items([
859    ///         BackupRun::default()/* use setters */,
860    ///         BackupRun::default()/* use (different) setters */,
861    ///     ]);
862    /// ```
863    pub fn set_items<T, V>(mut self, v: T) -> Self
864    where
865        T: std::iter::IntoIterator<Item = V>,
866        V: std::convert::Into<crate::model::BackupRun>,
867    {
868        use std::iter::Iterator;
869        self.items = v.into_iter().map(|i| i.into()).collect();
870        self
871    }
872
873    /// Sets the value of [next_page_token][crate::model::BackupRunsListResponse::next_page_token].
874    ///
875    /// # Example
876    /// ```ignore,no_run
877    /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
878    /// let x = BackupRunsListResponse::new().set_next_page_token("example");
879    /// ```
880    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
881        self.next_page_token = v.into();
882        self
883    }
884}
885
886impl wkt::message::Message for BackupRunsListResponse {
887    fn typename() -> &'static str {
888        "type.googleapis.com/google.cloud.sql.v1.BackupRunsListResponse"
889    }
890}
891
892#[doc(hidden)]
893impl gax::paginator::internal::PageableResponse for BackupRunsListResponse {
894    type PageItem = crate::model::BackupRun;
895
896    fn items(self) -> std::vec::Vec<Self::PageItem> {
897        self.items
898    }
899
900    fn next_page_token(&self) -> std::string::String {
901        use std::clone::Clone;
902        self.next_page_token.clone()
903    }
904}
905
906/// Connect settings retrieval request.
907#[derive(Clone, Default, PartialEq)]
908#[non_exhaustive]
909pub struct GetConnectSettingsRequest {
910    /// Cloud SQL instance ID. This does not include the project ID.
911    pub instance: std::string::String,
912
913    /// Project ID of the project that contains the instance.
914    pub project: std::string::String,
915
916    /// Optional. Optional snapshot read timestamp to trade freshness for
917    /// performance.
918    pub read_time: std::option::Option<wkt::Timestamp>,
919
920    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
921}
922
923impl GetConnectSettingsRequest {
924    pub fn new() -> Self {
925        std::default::Default::default()
926    }
927
928    /// Sets the value of [instance][crate::model::GetConnectSettingsRequest::instance].
929    ///
930    /// # Example
931    /// ```ignore,no_run
932    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
933    /// let x = GetConnectSettingsRequest::new().set_instance("example");
934    /// ```
935    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
936        self.instance = v.into();
937        self
938    }
939
940    /// Sets the value of [project][crate::model::GetConnectSettingsRequest::project].
941    ///
942    /// # Example
943    /// ```ignore,no_run
944    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
945    /// let x = GetConnectSettingsRequest::new().set_project("example");
946    /// ```
947    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
948        self.project = v.into();
949        self
950    }
951
952    /// Sets the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
953    ///
954    /// # Example
955    /// ```ignore,no_run
956    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
957    /// use wkt::Timestamp;
958    /// let x = GetConnectSettingsRequest::new().set_read_time(Timestamp::default()/* use setters */);
959    /// ```
960    pub fn set_read_time<T>(mut self, v: T) -> Self
961    where
962        T: std::convert::Into<wkt::Timestamp>,
963    {
964        self.read_time = std::option::Option::Some(v.into());
965        self
966    }
967
968    /// Sets or clears the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
969    ///
970    /// # Example
971    /// ```ignore,no_run
972    /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
973    /// use wkt::Timestamp;
974    /// let x = GetConnectSettingsRequest::new().set_or_clear_read_time(Some(Timestamp::default()/* use setters */));
975    /// let x = GetConnectSettingsRequest::new().set_or_clear_read_time(None::<Timestamp>);
976    /// ```
977    pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
978    where
979        T: std::convert::Into<wkt::Timestamp>,
980    {
981        self.read_time = v.map(|x| x.into());
982        self
983    }
984}
985
986impl wkt::message::Message for GetConnectSettingsRequest {
987    fn typename() -> &'static str {
988        "type.googleapis.com/google.cloud.sql.v1.GetConnectSettingsRequest"
989    }
990}
991
992/// Connect settings retrieval response.
993#[derive(Clone, Default, PartialEq)]
994#[non_exhaustive]
995pub struct ConnectSettings {
996    /// This is always `sql#connectSettings`.
997    pub kind: std::string::String,
998
999    /// SSL configuration.
1000    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
1001
1002    /// The assigned IP addresses for the instance.
1003    pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
1004
1005    /// The cloud region for the instance. For example, `us-central1`,
1006    /// `europe-west1`. The region cannot be changed after instance creation.
1007    pub region: std::string::String,
1008
1009    /// The database engine type and version. The `databaseVersion`
1010    /// field cannot be changed after instance creation.
1011    /// MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
1012    /// or `MYSQL_5_6`.
1013    /// PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
1014    /// `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
1015    /// SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
1016    /// `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
1017    /// `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
1018    /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
1019    /// `SQLSERVER_2019_WEB`.
1020    pub database_version: crate::model::SqlDatabaseVersion,
1021
1022    /// `SECOND_GEN`: Cloud SQL database instance.
1023    /// `EXTERNAL`: A database server that is not managed by Google.
1024    /// This property is read-only; use the `tier` property in the `settings`
1025    /// object to determine the database type.
1026    pub backend_type: crate::model::SqlBackendType,
1027
1028    /// Whether PSC connectivity is enabled for this instance.
1029    pub psc_enabled: bool,
1030
1031    /// The dns name of the instance.
1032    pub dns_name: std::string::String,
1033
1034    /// Specify what type of CA is used for the server certificate.
1035    pub server_ca_mode: crate::model::connect_settings::CaMode,
1036
1037    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1038}
1039
1040impl ConnectSettings {
1041    pub fn new() -> Self {
1042        std::default::Default::default()
1043    }
1044
1045    /// Sets the value of [kind][crate::model::ConnectSettings::kind].
1046    ///
1047    /// # Example
1048    /// ```ignore,no_run
1049    /// # use google_cloud_sql_v1::model::ConnectSettings;
1050    /// let x = ConnectSettings::new().set_kind("example");
1051    /// ```
1052    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1053        self.kind = v.into();
1054        self
1055    }
1056
1057    /// Sets the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
1058    ///
1059    /// # Example
1060    /// ```ignore,no_run
1061    /// # use google_cloud_sql_v1::model::ConnectSettings;
1062    /// use google_cloud_sql_v1::model::SslCert;
1063    /// let x = ConnectSettings::new().set_server_ca_cert(SslCert::default()/* use setters */);
1064    /// ```
1065    pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
1066    where
1067        T: std::convert::Into<crate::model::SslCert>,
1068    {
1069        self.server_ca_cert = std::option::Option::Some(v.into());
1070        self
1071    }
1072
1073    /// Sets or clears the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
1074    ///
1075    /// # Example
1076    /// ```ignore,no_run
1077    /// # use google_cloud_sql_v1::model::ConnectSettings;
1078    /// use google_cloud_sql_v1::model::SslCert;
1079    /// let x = ConnectSettings::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
1080    /// let x = ConnectSettings::new().set_or_clear_server_ca_cert(None::<SslCert>);
1081    /// ```
1082    pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
1083    where
1084        T: std::convert::Into<crate::model::SslCert>,
1085    {
1086        self.server_ca_cert = v.map(|x| x.into());
1087        self
1088    }
1089
1090    /// Sets the value of [ip_addresses][crate::model::ConnectSettings::ip_addresses].
1091    ///
1092    /// # Example
1093    /// ```ignore,no_run
1094    /// # use google_cloud_sql_v1::model::ConnectSettings;
1095    /// use google_cloud_sql_v1::model::IpMapping;
1096    /// let x = ConnectSettings::new()
1097    ///     .set_ip_addresses([
1098    ///         IpMapping::default()/* use setters */,
1099    ///         IpMapping::default()/* use (different) setters */,
1100    ///     ]);
1101    /// ```
1102    pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
1103    where
1104        T: std::iter::IntoIterator<Item = V>,
1105        V: std::convert::Into<crate::model::IpMapping>,
1106    {
1107        use std::iter::Iterator;
1108        self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
1109        self
1110    }
1111
1112    /// Sets the value of [region][crate::model::ConnectSettings::region].
1113    ///
1114    /// # Example
1115    /// ```ignore,no_run
1116    /// # use google_cloud_sql_v1::model::ConnectSettings;
1117    /// let x = ConnectSettings::new().set_region("example");
1118    /// ```
1119    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1120        self.region = v.into();
1121        self
1122    }
1123
1124    /// Sets the value of [database_version][crate::model::ConnectSettings::database_version].
1125    ///
1126    /// # Example
1127    /// ```ignore,no_run
1128    /// # use google_cloud_sql_v1::model::ConnectSettings;
1129    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
1130    /// let x0 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql56);
1131    /// let x1 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql57);
1132    /// let x2 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Sqlserver2017Standard);
1133    /// ```
1134    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
1135        mut self,
1136        v: T,
1137    ) -> Self {
1138        self.database_version = v.into();
1139        self
1140    }
1141
1142    /// Sets the value of [backend_type][crate::model::ConnectSettings::backend_type].
1143    ///
1144    /// # Example
1145    /// ```ignore,no_run
1146    /// # use google_cloud_sql_v1::model::ConnectSettings;
1147    /// use google_cloud_sql_v1::model::SqlBackendType;
1148    /// let x0 = ConnectSettings::new().set_backend_type(SqlBackendType::SecondGen);
1149    /// let x1 = ConnectSettings::new().set_backend_type(SqlBackendType::External);
1150    /// ```
1151    pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
1152        mut self,
1153        v: T,
1154    ) -> Self {
1155        self.backend_type = v.into();
1156        self
1157    }
1158
1159    /// Sets the value of [psc_enabled][crate::model::ConnectSettings::psc_enabled].
1160    ///
1161    /// # Example
1162    /// ```ignore,no_run
1163    /// # use google_cloud_sql_v1::model::ConnectSettings;
1164    /// let x = ConnectSettings::new().set_psc_enabled(true);
1165    /// ```
1166    pub fn set_psc_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1167        self.psc_enabled = v.into();
1168        self
1169    }
1170
1171    /// Sets the value of [dns_name][crate::model::ConnectSettings::dns_name].
1172    ///
1173    /// # Example
1174    /// ```ignore,no_run
1175    /// # use google_cloud_sql_v1::model::ConnectSettings;
1176    /// let x = ConnectSettings::new().set_dns_name("example");
1177    /// ```
1178    pub fn set_dns_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1179        self.dns_name = v.into();
1180        self
1181    }
1182
1183    /// Sets the value of [server_ca_mode][crate::model::ConnectSettings::server_ca_mode].
1184    ///
1185    /// # Example
1186    /// ```ignore,no_run
1187    /// # use google_cloud_sql_v1::model::ConnectSettings;
1188    /// use google_cloud_sql_v1::model::connect_settings::CaMode;
1189    /// let x0 = ConnectSettings::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
1190    /// let x1 = ConnectSettings::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
1191    /// ```
1192    pub fn set_server_ca_mode<T: std::convert::Into<crate::model::connect_settings::CaMode>>(
1193        mut self,
1194        v: T,
1195    ) -> Self {
1196        self.server_ca_mode = v.into();
1197        self
1198    }
1199}
1200
1201impl wkt::message::Message for ConnectSettings {
1202    fn typename() -> &'static str {
1203        "type.googleapis.com/google.cloud.sql.v1.ConnectSettings"
1204    }
1205}
1206
1207/// Defines additional types related to [ConnectSettings].
1208pub mod connect_settings {
1209    #[allow(unused_imports)]
1210    use super::*;
1211
1212    /// Various Certificate Authority (CA) modes for certificate signing.
1213    ///
1214    /// # Working with unknown values
1215    ///
1216    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1217    /// additional enum variants at any time. Adding new variants is not considered
1218    /// a breaking change. Applications should write their code in anticipation of:
1219    ///
1220    /// - New values appearing in future releases of the client library, **and**
1221    /// - New values received dynamically, without application changes.
1222    ///
1223    /// Please consult the [Working with enums] section in the user guide for some
1224    /// guidelines.
1225    ///
1226    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1227    #[derive(Clone, Debug, PartialEq)]
1228    #[non_exhaustive]
1229    pub enum CaMode {
1230        /// CA mode is unknown.
1231        Unspecified,
1232        /// Google-managed self-signed internal CA.
1233        GoogleManagedInternalCa,
1234        /// Google-managed regional CA part of root CA hierarchy hosted on Google
1235        /// Cloud's Certificate Authority Service (CAS).
1236        GoogleManagedCasCa,
1237        /// If set, the enum was initialized with an unknown value.
1238        ///
1239        /// Applications can examine the value using [CaMode::value] or
1240        /// [CaMode::name].
1241        UnknownValue(ca_mode::UnknownValue),
1242    }
1243
1244    #[doc(hidden)]
1245    pub mod ca_mode {
1246        #[allow(unused_imports)]
1247        use super::*;
1248        #[derive(Clone, Debug, PartialEq)]
1249        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1250    }
1251
1252    impl CaMode {
1253        /// Gets the enum value.
1254        ///
1255        /// Returns `None` if the enum contains an unknown value deserialized from
1256        /// the string representation of enums.
1257        pub fn value(&self) -> std::option::Option<i32> {
1258            match self {
1259                Self::Unspecified => std::option::Option::Some(0),
1260                Self::GoogleManagedInternalCa => std::option::Option::Some(1),
1261                Self::GoogleManagedCasCa => std::option::Option::Some(2),
1262                Self::UnknownValue(u) => u.0.value(),
1263            }
1264        }
1265
1266        /// Gets the enum value as a string.
1267        ///
1268        /// Returns `None` if the enum contains an unknown value deserialized from
1269        /// the integer representation of enums.
1270        pub fn name(&self) -> std::option::Option<&str> {
1271            match self {
1272                Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
1273                Self::GoogleManagedInternalCa => {
1274                    std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
1275                }
1276                Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
1277                Self::UnknownValue(u) => u.0.name(),
1278            }
1279        }
1280    }
1281
1282    impl std::default::Default for CaMode {
1283        fn default() -> Self {
1284            use std::convert::From;
1285            Self::from(0)
1286        }
1287    }
1288
1289    impl std::fmt::Display for CaMode {
1290        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1291            wkt::internal::display_enum(f, self.name(), self.value())
1292        }
1293    }
1294
1295    impl std::convert::From<i32> for CaMode {
1296        fn from(value: i32) -> Self {
1297            match value {
1298                0 => Self::Unspecified,
1299                1 => Self::GoogleManagedInternalCa,
1300                2 => Self::GoogleManagedCasCa,
1301                _ => Self::UnknownValue(ca_mode::UnknownValue(
1302                    wkt::internal::UnknownEnumValue::Integer(value),
1303                )),
1304            }
1305        }
1306    }
1307
1308    impl std::convert::From<&str> for CaMode {
1309        fn from(value: &str) -> Self {
1310            use std::string::ToString;
1311            match value {
1312                "CA_MODE_UNSPECIFIED" => Self::Unspecified,
1313                "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
1314                "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
1315                _ => Self::UnknownValue(ca_mode::UnknownValue(
1316                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1317                )),
1318            }
1319        }
1320    }
1321
1322    impl serde::ser::Serialize for CaMode {
1323        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1324        where
1325            S: serde::Serializer,
1326        {
1327            match self {
1328                Self::Unspecified => serializer.serialize_i32(0),
1329                Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
1330                Self::GoogleManagedCasCa => serializer.serialize_i32(2),
1331                Self::UnknownValue(u) => u.0.serialize(serializer),
1332            }
1333        }
1334    }
1335
1336    impl<'de> serde::de::Deserialize<'de> for CaMode {
1337        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1338        where
1339            D: serde::Deserializer<'de>,
1340        {
1341            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
1342                ".google.cloud.sql.v1.ConnectSettings.CaMode",
1343            ))
1344        }
1345    }
1346}
1347
1348/// Ephemeral certificate creation request.
1349#[derive(Clone, Default, PartialEq)]
1350#[non_exhaustive]
1351pub struct GenerateEphemeralCertRequest {
1352    /// Cloud SQL instance ID. This does not include the project ID.
1353    pub instance: std::string::String,
1354
1355    /// Project ID of the project that contains the instance.
1356    pub project: std::string::String,
1357
1358    /// PEM encoded public key to include in the signed certificate.
1359    pub public_key: std::string::String,
1360
1361    /// Optional. Access token to include in the signed certificate.
1362    pub access_token: std::string::String,
1363
1364    /// Optional. Optional snapshot read timestamp to trade freshness for
1365    /// performance.
1366    pub read_time: std::option::Option<wkt::Timestamp>,
1367
1368    /// Optional. If set, it will contain the cert valid duration.
1369    pub valid_duration: std::option::Option<wkt::Duration>,
1370
1371    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1372}
1373
1374impl GenerateEphemeralCertRequest {
1375    pub fn new() -> Self {
1376        std::default::Default::default()
1377    }
1378
1379    /// Sets the value of [instance][crate::model::GenerateEphemeralCertRequest::instance].
1380    ///
1381    /// # Example
1382    /// ```ignore,no_run
1383    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
1384    /// let x = GenerateEphemeralCertRequest::new().set_instance("example");
1385    /// ```
1386    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1387        self.instance = v.into();
1388        self
1389    }
1390
1391    /// Sets the value of [project][crate::model::GenerateEphemeralCertRequest::project].
1392    ///
1393    /// # Example
1394    /// ```ignore,no_run
1395    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
1396    /// let x = GenerateEphemeralCertRequest::new().set_project("example");
1397    /// ```
1398    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1399        self.project = v.into();
1400        self
1401    }
1402
1403    /// Sets the value of [public_key][crate::model::GenerateEphemeralCertRequest::public_key].
1404    ///
1405    /// # Example
1406    /// ```ignore,no_run
1407    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
1408    /// let x = GenerateEphemeralCertRequest::new().set_public_key("example");
1409    /// ```
1410    pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1411        self.public_key = v.into();
1412        self
1413    }
1414
1415    /// Sets the value of [access_token][crate::model::GenerateEphemeralCertRequest::access_token].
1416    ///
1417    /// # Example
1418    /// ```ignore,no_run
1419    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
1420    /// let x = GenerateEphemeralCertRequest::new().set_access_token("example");
1421    /// ```
1422    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1423        self.access_token = v.into();
1424        self
1425    }
1426
1427    /// Sets the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
1428    ///
1429    /// # Example
1430    /// ```ignore,no_run
1431    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
1432    /// use wkt::Timestamp;
1433    /// let x = GenerateEphemeralCertRequest::new().set_read_time(Timestamp::default()/* use setters */);
1434    /// ```
1435    pub fn set_read_time<T>(mut self, v: T) -> Self
1436    where
1437        T: std::convert::Into<wkt::Timestamp>,
1438    {
1439        self.read_time = std::option::Option::Some(v.into());
1440        self
1441    }
1442
1443    /// Sets or clears the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
1444    ///
1445    /// # Example
1446    /// ```ignore,no_run
1447    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
1448    /// use wkt::Timestamp;
1449    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_read_time(Some(Timestamp::default()/* use setters */));
1450    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_read_time(None::<Timestamp>);
1451    /// ```
1452    pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
1453    where
1454        T: std::convert::Into<wkt::Timestamp>,
1455    {
1456        self.read_time = v.map(|x| x.into());
1457        self
1458    }
1459
1460    /// Sets the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
1461    ///
1462    /// # Example
1463    /// ```ignore,no_run
1464    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
1465    /// use wkt::Duration;
1466    /// let x = GenerateEphemeralCertRequest::new().set_valid_duration(Duration::default()/* use setters */);
1467    /// ```
1468    pub fn set_valid_duration<T>(mut self, v: T) -> Self
1469    where
1470        T: std::convert::Into<wkt::Duration>,
1471    {
1472        self.valid_duration = std::option::Option::Some(v.into());
1473        self
1474    }
1475
1476    /// Sets or clears the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
1477    ///
1478    /// # Example
1479    /// ```ignore,no_run
1480    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
1481    /// use wkt::Duration;
1482    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_valid_duration(Some(Duration::default()/* use setters */));
1483    /// let x = GenerateEphemeralCertRequest::new().set_or_clear_valid_duration(None::<Duration>);
1484    /// ```
1485    pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
1486    where
1487        T: std::convert::Into<wkt::Duration>,
1488    {
1489        self.valid_duration = v.map(|x| x.into());
1490        self
1491    }
1492}
1493
1494impl wkt::message::Message for GenerateEphemeralCertRequest {
1495    fn typename() -> &'static str {
1496        "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertRequest"
1497    }
1498}
1499
1500/// Ephemeral certificate creation request.
1501#[derive(Clone, Default, PartialEq)]
1502#[non_exhaustive]
1503pub struct GenerateEphemeralCertResponse {
1504    /// Generated cert
1505    pub ephemeral_cert: std::option::Option<crate::model::SslCert>,
1506
1507    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1508}
1509
1510impl GenerateEphemeralCertResponse {
1511    pub fn new() -> Self {
1512        std::default::Default::default()
1513    }
1514
1515    /// Sets the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
1516    ///
1517    /// # Example
1518    /// ```ignore,no_run
1519    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertResponse;
1520    /// use google_cloud_sql_v1::model::SslCert;
1521    /// let x = GenerateEphemeralCertResponse::new().set_ephemeral_cert(SslCert::default()/* use setters */);
1522    /// ```
1523    pub fn set_ephemeral_cert<T>(mut self, v: T) -> Self
1524    where
1525        T: std::convert::Into<crate::model::SslCert>,
1526    {
1527        self.ephemeral_cert = std::option::Option::Some(v.into());
1528        self
1529    }
1530
1531    /// Sets or clears the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
1532    ///
1533    /// # Example
1534    /// ```ignore,no_run
1535    /// # use google_cloud_sql_v1::model::GenerateEphemeralCertResponse;
1536    /// use google_cloud_sql_v1::model::SslCert;
1537    /// let x = GenerateEphemeralCertResponse::new().set_or_clear_ephemeral_cert(Some(SslCert::default()/* use setters */));
1538    /// let x = GenerateEphemeralCertResponse::new().set_or_clear_ephemeral_cert(None::<SslCert>);
1539    /// ```
1540    pub fn set_or_clear_ephemeral_cert<T>(mut self, v: std::option::Option<T>) -> Self
1541    where
1542        T: std::convert::Into<crate::model::SslCert>,
1543    {
1544        self.ephemeral_cert = v.map(|x| x.into());
1545        self
1546    }
1547}
1548
1549impl wkt::message::Message for GenerateEphemeralCertResponse {
1550    fn typename() -> &'static str {
1551        "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertResponse"
1552    }
1553}
1554
1555/// Database delete request.
1556#[derive(Clone, Default, PartialEq)]
1557#[non_exhaustive]
1558pub struct SqlDatabasesDeleteRequest {
1559    /// Name of the database to be deleted in the instance.
1560    pub database: std::string::String,
1561
1562    /// Database instance ID. This does not include the project ID.
1563    pub instance: std::string::String,
1564
1565    /// Project ID of the project that contains the instance.
1566    pub project: std::string::String,
1567
1568    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1569}
1570
1571impl SqlDatabasesDeleteRequest {
1572    pub fn new() -> Self {
1573        std::default::Default::default()
1574    }
1575
1576    /// Sets the value of [database][crate::model::SqlDatabasesDeleteRequest::database].
1577    ///
1578    /// # Example
1579    /// ```ignore,no_run
1580    /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
1581    /// let x = SqlDatabasesDeleteRequest::new().set_database("example");
1582    /// ```
1583    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1584        self.database = v.into();
1585        self
1586    }
1587
1588    /// Sets the value of [instance][crate::model::SqlDatabasesDeleteRequest::instance].
1589    ///
1590    /// # Example
1591    /// ```ignore,no_run
1592    /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
1593    /// let x = SqlDatabasesDeleteRequest::new().set_instance("example");
1594    /// ```
1595    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1596        self.instance = v.into();
1597        self
1598    }
1599
1600    /// Sets the value of [project][crate::model::SqlDatabasesDeleteRequest::project].
1601    ///
1602    /// # Example
1603    /// ```ignore,no_run
1604    /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
1605    /// let x = SqlDatabasesDeleteRequest::new().set_project("example");
1606    /// ```
1607    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1608        self.project = v.into();
1609        self
1610    }
1611}
1612
1613impl wkt::message::Message for SqlDatabasesDeleteRequest {
1614    fn typename() -> &'static str {
1615        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesDeleteRequest"
1616    }
1617}
1618
1619/// Database get request.
1620#[derive(Clone, Default, PartialEq)]
1621#[non_exhaustive]
1622pub struct SqlDatabasesGetRequest {
1623    /// Name of the database in the instance.
1624    pub database: std::string::String,
1625
1626    /// Database instance ID. This does not include the project ID.
1627    pub instance: std::string::String,
1628
1629    /// Project ID of the project that contains the instance.
1630    pub project: std::string::String,
1631
1632    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1633}
1634
1635impl SqlDatabasesGetRequest {
1636    pub fn new() -> Self {
1637        std::default::Default::default()
1638    }
1639
1640    /// Sets the value of [database][crate::model::SqlDatabasesGetRequest::database].
1641    ///
1642    /// # Example
1643    /// ```ignore,no_run
1644    /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
1645    /// let x = SqlDatabasesGetRequest::new().set_database("example");
1646    /// ```
1647    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1648        self.database = v.into();
1649        self
1650    }
1651
1652    /// Sets the value of [instance][crate::model::SqlDatabasesGetRequest::instance].
1653    ///
1654    /// # Example
1655    /// ```ignore,no_run
1656    /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
1657    /// let x = SqlDatabasesGetRequest::new().set_instance("example");
1658    /// ```
1659    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1660        self.instance = v.into();
1661        self
1662    }
1663
1664    /// Sets the value of [project][crate::model::SqlDatabasesGetRequest::project].
1665    ///
1666    /// # Example
1667    /// ```ignore,no_run
1668    /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
1669    /// let x = SqlDatabasesGetRequest::new().set_project("example");
1670    /// ```
1671    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1672        self.project = v.into();
1673        self
1674    }
1675}
1676
1677impl wkt::message::Message for SqlDatabasesGetRequest {
1678    fn typename() -> &'static str {
1679        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesGetRequest"
1680    }
1681}
1682
1683/// Database insert request.
1684#[derive(Clone, Default, PartialEq)]
1685#[non_exhaustive]
1686pub struct SqlDatabasesInsertRequest {
1687    /// Database instance ID. This does not include the project ID.
1688    pub instance: std::string::String,
1689
1690    /// Project ID of the project that contains the instance.
1691    pub project: std::string::String,
1692
1693    pub body: std::option::Option<crate::model::Database>,
1694
1695    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1696}
1697
1698impl SqlDatabasesInsertRequest {
1699    pub fn new() -> Self {
1700        std::default::Default::default()
1701    }
1702
1703    /// Sets the value of [instance][crate::model::SqlDatabasesInsertRequest::instance].
1704    ///
1705    /// # Example
1706    /// ```ignore,no_run
1707    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
1708    /// let x = SqlDatabasesInsertRequest::new().set_instance("example");
1709    /// ```
1710    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1711        self.instance = v.into();
1712        self
1713    }
1714
1715    /// Sets the value of [project][crate::model::SqlDatabasesInsertRequest::project].
1716    ///
1717    /// # Example
1718    /// ```ignore,no_run
1719    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
1720    /// let x = SqlDatabasesInsertRequest::new().set_project("example");
1721    /// ```
1722    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1723        self.project = v.into();
1724        self
1725    }
1726
1727    /// Sets the value of [body][crate::model::SqlDatabasesInsertRequest::body].
1728    ///
1729    /// # Example
1730    /// ```ignore,no_run
1731    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
1732    /// use google_cloud_sql_v1::model::Database;
1733    /// let x = SqlDatabasesInsertRequest::new().set_body(Database::default()/* use setters */);
1734    /// ```
1735    pub fn set_body<T>(mut self, v: T) -> Self
1736    where
1737        T: std::convert::Into<crate::model::Database>,
1738    {
1739        self.body = std::option::Option::Some(v.into());
1740        self
1741    }
1742
1743    /// Sets or clears the value of [body][crate::model::SqlDatabasesInsertRequest::body].
1744    ///
1745    /// # Example
1746    /// ```ignore,no_run
1747    /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
1748    /// use google_cloud_sql_v1::model::Database;
1749    /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
1750    /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(None::<Database>);
1751    /// ```
1752    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1753    where
1754        T: std::convert::Into<crate::model::Database>,
1755    {
1756        self.body = v.map(|x| x.into());
1757        self
1758    }
1759}
1760
1761impl wkt::message::Message for SqlDatabasesInsertRequest {
1762    fn typename() -> &'static str {
1763        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesInsertRequest"
1764    }
1765}
1766
1767/// Database list request.
1768#[derive(Clone, Default, PartialEq)]
1769#[non_exhaustive]
1770pub struct SqlDatabasesListRequest {
1771    /// Cloud SQL instance ID. This does not include the project ID.
1772    pub instance: std::string::String,
1773
1774    /// Project ID of the project that contains the instance.
1775    pub project: std::string::String,
1776
1777    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1778}
1779
1780impl SqlDatabasesListRequest {
1781    pub fn new() -> Self {
1782        std::default::Default::default()
1783    }
1784
1785    /// Sets the value of [instance][crate::model::SqlDatabasesListRequest::instance].
1786    ///
1787    /// # Example
1788    /// ```ignore,no_run
1789    /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
1790    /// let x = SqlDatabasesListRequest::new().set_instance("example");
1791    /// ```
1792    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1793        self.instance = v.into();
1794        self
1795    }
1796
1797    /// Sets the value of [project][crate::model::SqlDatabasesListRequest::project].
1798    ///
1799    /// # Example
1800    /// ```ignore,no_run
1801    /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
1802    /// let x = SqlDatabasesListRequest::new().set_project("example");
1803    /// ```
1804    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1805        self.project = v.into();
1806        self
1807    }
1808}
1809
1810impl wkt::message::Message for SqlDatabasesListRequest {
1811    fn typename() -> &'static str {
1812        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesListRequest"
1813    }
1814}
1815
1816/// Database update request.
1817#[derive(Clone, Default, PartialEq)]
1818#[non_exhaustive]
1819pub struct SqlDatabasesUpdateRequest {
1820    /// Name of the database to be updated in the instance.
1821    pub database: std::string::String,
1822
1823    /// Database instance ID. This does not include the project ID.
1824    pub instance: std::string::String,
1825
1826    /// Project ID of the project that contains the instance.
1827    pub project: std::string::String,
1828
1829    pub body: std::option::Option<crate::model::Database>,
1830
1831    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1832}
1833
1834impl SqlDatabasesUpdateRequest {
1835    pub fn new() -> Self {
1836        std::default::Default::default()
1837    }
1838
1839    /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
1840    ///
1841    /// # Example
1842    /// ```ignore,no_run
1843    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
1844    /// let x = SqlDatabasesUpdateRequest::new().set_database("example");
1845    /// ```
1846    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1847        self.database = v.into();
1848        self
1849    }
1850
1851    /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
1852    ///
1853    /// # Example
1854    /// ```ignore,no_run
1855    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
1856    /// let x = SqlDatabasesUpdateRequest::new().set_instance("example");
1857    /// ```
1858    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1859        self.instance = v.into();
1860        self
1861    }
1862
1863    /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
1864    ///
1865    /// # Example
1866    /// ```ignore,no_run
1867    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
1868    /// let x = SqlDatabasesUpdateRequest::new().set_project("example");
1869    /// ```
1870    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1871        self.project = v.into();
1872        self
1873    }
1874
1875    /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
1876    ///
1877    /// # Example
1878    /// ```ignore,no_run
1879    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
1880    /// use google_cloud_sql_v1::model::Database;
1881    /// let x = SqlDatabasesUpdateRequest::new().set_body(Database::default()/* use setters */);
1882    /// ```
1883    pub fn set_body<T>(mut self, v: T) -> Self
1884    where
1885        T: std::convert::Into<crate::model::Database>,
1886    {
1887        self.body = std::option::Option::Some(v.into());
1888        self
1889    }
1890
1891    /// Sets or clears the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
1892    ///
1893    /// # Example
1894    /// ```ignore,no_run
1895    /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
1896    /// use google_cloud_sql_v1::model::Database;
1897    /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
1898    /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(None::<Database>);
1899    /// ```
1900    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1901    where
1902        T: std::convert::Into<crate::model::Database>,
1903    {
1904        self.body = v.map(|x| x.into());
1905        self
1906    }
1907}
1908
1909impl wkt::message::Message for SqlDatabasesUpdateRequest {
1910    fn typename() -> &'static str {
1911        "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesUpdateRequest"
1912    }
1913}
1914
1915/// Database list response.
1916#[derive(Clone, Default, PartialEq)]
1917#[non_exhaustive]
1918pub struct DatabasesListResponse {
1919    /// This is always `sql#databasesList`.
1920    pub kind: std::string::String,
1921
1922    /// List of database resources in the instance.
1923    pub items: std::vec::Vec<crate::model::Database>,
1924
1925    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1926}
1927
1928impl DatabasesListResponse {
1929    pub fn new() -> Self {
1930        std::default::Default::default()
1931    }
1932
1933    /// Sets the value of [kind][crate::model::DatabasesListResponse::kind].
1934    ///
1935    /// # Example
1936    /// ```ignore,no_run
1937    /// # use google_cloud_sql_v1::model::DatabasesListResponse;
1938    /// let x = DatabasesListResponse::new().set_kind("example");
1939    /// ```
1940    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1941        self.kind = v.into();
1942        self
1943    }
1944
1945    /// Sets the value of [items][crate::model::DatabasesListResponse::items].
1946    ///
1947    /// # Example
1948    /// ```ignore,no_run
1949    /// # use google_cloud_sql_v1::model::DatabasesListResponse;
1950    /// use google_cloud_sql_v1::model::Database;
1951    /// let x = DatabasesListResponse::new()
1952    ///     .set_items([
1953    ///         Database::default()/* use setters */,
1954    ///         Database::default()/* use (different) setters */,
1955    ///     ]);
1956    /// ```
1957    pub fn set_items<T, V>(mut self, v: T) -> Self
1958    where
1959        T: std::iter::IntoIterator<Item = V>,
1960        V: std::convert::Into<crate::model::Database>,
1961    {
1962        use std::iter::Iterator;
1963        self.items = v.into_iter().map(|i| i.into()).collect();
1964        self
1965    }
1966}
1967
1968impl wkt::message::Message for DatabasesListResponse {
1969    fn typename() -> &'static str {
1970        "type.googleapis.com/google.cloud.sql.v1.DatabasesListResponse"
1971    }
1972}
1973
1974/// Flags list request.
1975#[derive(Clone, Default, PartialEq)]
1976#[non_exhaustive]
1977pub struct SqlFlagsListRequest {
1978    /// Database type and version you want to retrieve flags for. By default, this
1979    /// method returns flags for all database types and versions.
1980    pub database_version: std::string::String,
1981
1982    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1983}
1984
1985impl SqlFlagsListRequest {
1986    pub fn new() -> Self {
1987        std::default::Default::default()
1988    }
1989
1990    /// Sets the value of [database_version][crate::model::SqlFlagsListRequest::database_version].
1991    ///
1992    /// # Example
1993    /// ```ignore,no_run
1994    /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
1995    /// let x = SqlFlagsListRequest::new().set_database_version("example");
1996    /// ```
1997    pub fn set_database_version<T: std::convert::Into<std::string::String>>(
1998        mut self,
1999        v: T,
2000    ) -> Self {
2001        self.database_version = v.into();
2002        self
2003    }
2004}
2005
2006impl wkt::message::Message for SqlFlagsListRequest {
2007    fn typename() -> &'static str {
2008        "type.googleapis.com/google.cloud.sql.v1.SqlFlagsListRequest"
2009    }
2010}
2011
2012/// Flags list response.
2013#[derive(Clone, Default, PartialEq)]
2014#[non_exhaustive]
2015pub struct FlagsListResponse {
2016    /// This is always `sql#flagsList`.
2017    pub kind: std::string::String,
2018
2019    /// List of flags.
2020    pub items: std::vec::Vec<crate::model::Flag>,
2021
2022    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2023}
2024
2025impl FlagsListResponse {
2026    pub fn new() -> Self {
2027        std::default::Default::default()
2028    }
2029
2030    /// Sets the value of [kind][crate::model::FlagsListResponse::kind].
2031    ///
2032    /// # Example
2033    /// ```ignore,no_run
2034    /// # use google_cloud_sql_v1::model::FlagsListResponse;
2035    /// let x = FlagsListResponse::new().set_kind("example");
2036    /// ```
2037    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2038        self.kind = v.into();
2039        self
2040    }
2041
2042    /// Sets the value of [items][crate::model::FlagsListResponse::items].
2043    ///
2044    /// # Example
2045    /// ```ignore,no_run
2046    /// # use google_cloud_sql_v1::model::FlagsListResponse;
2047    /// use google_cloud_sql_v1::model::Flag;
2048    /// let x = FlagsListResponse::new()
2049    ///     .set_items([
2050    ///         Flag::default()/* use setters */,
2051    ///         Flag::default()/* use (different) setters */,
2052    ///     ]);
2053    /// ```
2054    pub fn set_items<T, V>(mut self, v: T) -> Self
2055    where
2056        T: std::iter::IntoIterator<Item = V>,
2057        V: std::convert::Into<crate::model::Flag>,
2058    {
2059        use std::iter::Iterator;
2060        self.items = v.into_iter().map(|i| i.into()).collect();
2061        self
2062    }
2063}
2064
2065impl wkt::message::Message for FlagsListResponse {
2066    fn typename() -> &'static str {
2067        "type.googleapis.com/google.cloud.sql.v1.FlagsListResponse"
2068    }
2069}
2070
2071/// A flag resource.
2072#[derive(Clone, Default, PartialEq)]
2073#[non_exhaustive]
2074pub struct Flag {
2075    /// This is the name of the flag. Flag names always use underscores, not
2076    /// hyphens, for example: `max_allowed_packet`
2077    pub name: std::string::String,
2078
2079    /// The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
2080    /// `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
2081    /// value, such as `skip_grant_tables`.
2082    pub r#type: crate::model::SqlFlagType,
2083
2084    /// The database version this flag applies to. Can be
2085    /// MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
2086    /// or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
2087    /// `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
2088    /// `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
2089    /// `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
2090    /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
2091    /// `SQLSERVER_2019_WEB`.
2092    /// See [the complete
2093    /// list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
2094    pub applies_to: std::vec::Vec<crate::model::SqlDatabaseVersion>,
2095
2096    /// For `STRING` flags, a list of strings that the value can be set to.
2097    pub allowed_string_values: std::vec::Vec<std::string::String>,
2098
2099    /// For `INTEGER` flags, the minimum allowed value.
2100    pub min_value: std::option::Option<wkt::Int64Value>,
2101
2102    /// For `INTEGER` flags, the maximum allowed value.
2103    pub max_value: std::option::Option<wkt::Int64Value>,
2104
2105    /// Indicates whether changing this flag will trigger a database restart. Only
2106    /// applicable to Second Generation instances.
2107    pub requires_restart: std::option::Option<wkt::BoolValue>,
2108
2109    /// This is always `sql#flag`.
2110    pub kind: std::string::String,
2111
2112    /// Whether or not the flag is considered in beta.
2113    pub in_beta: std::option::Option<wkt::BoolValue>,
2114
2115    /// Use this field if only certain integers are accepted. Can be combined
2116    /// with min_value and max_value to add additional values.
2117    pub allowed_int_values: std::vec::Vec<i64>,
2118
2119    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2120}
2121
2122impl Flag {
2123    pub fn new() -> Self {
2124        std::default::Default::default()
2125    }
2126
2127    /// Sets the value of [name][crate::model::Flag::name].
2128    ///
2129    /// # Example
2130    /// ```ignore,no_run
2131    /// # use google_cloud_sql_v1::model::Flag;
2132    /// let x = Flag::new().set_name("example");
2133    /// ```
2134    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2135        self.name = v.into();
2136        self
2137    }
2138
2139    /// Sets the value of [r#type][crate::model::Flag::type].
2140    ///
2141    /// # Example
2142    /// ```ignore,no_run
2143    /// # use google_cloud_sql_v1::model::Flag;
2144    /// use google_cloud_sql_v1::model::SqlFlagType;
2145    /// let x0 = Flag::new().set_type(SqlFlagType::Boolean);
2146    /// let x1 = Flag::new().set_type(SqlFlagType::String);
2147    /// let x2 = Flag::new().set_type(SqlFlagType::Integer);
2148    /// ```
2149    pub fn set_type<T: std::convert::Into<crate::model::SqlFlagType>>(mut self, v: T) -> Self {
2150        self.r#type = v.into();
2151        self
2152    }
2153
2154    /// Sets the value of [applies_to][crate::model::Flag::applies_to].
2155    ///
2156    /// # Example
2157    /// ```ignore,no_run
2158    /// # use google_cloud_sql_v1::model::Flag;
2159    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
2160    /// let x = Flag::new().set_applies_to([
2161    ///     SqlDatabaseVersion::Mysql56,
2162    ///     SqlDatabaseVersion::Mysql57,
2163    ///     SqlDatabaseVersion::Sqlserver2017Standard,
2164    /// ]);
2165    /// ```
2166    pub fn set_applies_to<T, V>(mut self, v: T) -> Self
2167    where
2168        T: std::iter::IntoIterator<Item = V>,
2169        V: std::convert::Into<crate::model::SqlDatabaseVersion>,
2170    {
2171        use std::iter::Iterator;
2172        self.applies_to = v.into_iter().map(|i| i.into()).collect();
2173        self
2174    }
2175
2176    /// Sets the value of [allowed_string_values][crate::model::Flag::allowed_string_values].
2177    ///
2178    /// # Example
2179    /// ```ignore,no_run
2180    /// # use google_cloud_sql_v1::model::Flag;
2181    /// let x = Flag::new().set_allowed_string_values(["a", "b", "c"]);
2182    /// ```
2183    pub fn set_allowed_string_values<T, V>(mut self, v: T) -> Self
2184    where
2185        T: std::iter::IntoIterator<Item = V>,
2186        V: std::convert::Into<std::string::String>,
2187    {
2188        use std::iter::Iterator;
2189        self.allowed_string_values = v.into_iter().map(|i| i.into()).collect();
2190        self
2191    }
2192
2193    /// Sets the value of [min_value][crate::model::Flag::min_value].
2194    ///
2195    /// # Example
2196    /// ```ignore,no_run
2197    /// # use google_cloud_sql_v1::model::Flag;
2198    /// use wkt::Int64Value;
2199    /// let x = Flag::new().set_min_value(Int64Value::default()/* use setters */);
2200    /// ```
2201    pub fn set_min_value<T>(mut self, v: T) -> Self
2202    where
2203        T: std::convert::Into<wkt::Int64Value>,
2204    {
2205        self.min_value = std::option::Option::Some(v.into());
2206        self
2207    }
2208
2209    /// Sets or clears the value of [min_value][crate::model::Flag::min_value].
2210    ///
2211    /// # Example
2212    /// ```ignore,no_run
2213    /// # use google_cloud_sql_v1::model::Flag;
2214    /// use wkt::Int64Value;
2215    /// let x = Flag::new().set_or_clear_min_value(Some(Int64Value::default()/* use setters */));
2216    /// let x = Flag::new().set_or_clear_min_value(None::<Int64Value>);
2217    /// ```
2218    pub fn set_or_clear_min_value<T>(mut self, v: std::option::Option<T>) -> Self
2219    where
2220        T: std::convert::Into<wkt::Int64Value>,
2221    {
2222        self.min_value = v.map(|x| x.into());
2223        self
2224    }
2225
2226    /// Sets the value of [max_value][crate::model::Flag::max_value].
2227    ///
2228    /// # Example
2229    /// ```ignore,no_run
2230    /// # use google_cloud_sql_v1::model::Flag;
2231    /// use wkt::Int64Value;
2232    /// let x = Flag::new().set_max_value(Int64Value::default()/* use setters */);
2233    /// ```
2234    pub fn set_max_value<T>(mut self, v: T) -> Self
2235    where
2236        T: std::convert::Into<wkt::Int64Value>,
2237    {
2238        self.max_value = std::option::Option::Some(v.into());
2239        self
2240    }
2241
2242    /// Sets or clears the value of [max_value][crate::model::Flag::max_value].
2243    ///
2244    /// # Example
2245    /// ```ignore,no_run
2246    /// # use google_cloud_sql_v1::model::Flag;
2247    /// use wkt::Int64Value;
2248    /// let x = Flag::new().set_or_clear_max_value(Some(Int64Value::default()/* use setters */));
2249    /// let x = Flag::new().set_or_clear_max_value(None::<Int64Value>);
2250    /// ```
2251    pub fn set_or_clear_max_value<T>(mut self, v: std::option::Option<T>) -> Self
2252    where
2253        T: std::convert::Into<wkt::Int64Value>,
2254    {
2255        self.max_value = v.map(|x| x.into());
2256        self
2257    }
2258
2259    /// Sets the value of [requires_restart][crate::model::Flag::requires_restart].
2260    ///
2261    /// # Example
2262    /// ```ignore,no_run
2263    /// # use google_cloud_sql_v1::model::Flag;
2264    /// use wkt::BoolValue;
2265    /// let x = Flag::new().set_requires_restart(BoolValue::default()/* use setters */);
2266    /// ```
2267    pub fn set_requires_restart<T>(mut self, v: T) -> Self
2268    where
2269        T: std::convert::Into<wkt::BoolValue>,
2270    {
2271        self.requires_restart = std::option::Option::Some(v.into());
2272        self
2273    }
2274
2275    /// Sets or clears the value of [requires_restart][crate::model::Flag::requires_restart].
2276    ///
2277    /// # Example
2278    /// ```ignore,no_run
2279    /// # use google_cloud_sql_v1::model::Flag;
2280    /// use wkt::BoolValue;
2281    /// let x = Flag::new().set_or_clear_requires_restart(Some(BoolValue::default()/* use setters */));
2282    /// let x = Flag::new().set_or_clear_requires_restart(None::<BoolValue>);
2283    /// ```
2284    pub fn set_or_clear_requires_restart<T>(mut self, v: std::option::Option<T>) -> Self
2285    where
2286        T: std::convert::Into<wkt::BoolValue>,
2287    {
2288        self.requires_restart = v.map(|x| x.into());
2289        self
2290    }
2291
2292    /// Sets the value of [kind][crate::model::Flag::kind].
2293    ///
2294    /// # Example
2295    /// ```ignore,no_run
2296    /// # use google_cloud_sql_v1::model::Flag;
2297    /// let x = Flag::new().set_kind("example");
2298    /// ```
2299    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2300        self.kind = v.into();
2301        self
2302    }
2303
2304    /// Sets the value of [in_beta][crate::model::Flag::in_beta].
2305    ///
2306    /// # Example
2307    /// ```ignore,no_run
2308    /// # use google_cloud_sql_v1::model::Flag;
2309    /// use wkt::BoolValue;
2310    /// let x = Flag::new().set_in_beta(BoolValue::default()/* use setters */);
2311    /// ```
2312    pub fn set_in_beta<T>(mut self, v: T) -> Self
2313    where
2314        T: std::convert::Into<wkt::BoolValue>,
2315    {
2316        self.in_beta = std::option::Option::Some(v.into());
2317        self
2318    }
2319
2320    /// Sets or clears the value of [in_beta][crate::model::Flag::in_beta].
2321    ///
2322    /// # Example
2323    /// ```ignore,no_run
2324    /// # use google_cloud_sql_v1::model::Flag;
2325    /// use wkt::BoolValue;
2326    /// let x = Flag::new().set_or_clear_in_beta(Some(BoolValue::default()/* use setters */));
2327    /// let x = Flag::new().set_or_clear_in_beta(None::<BoolValue>);
2328    /// ```
2329    pub fn set_or_clear_in_beta<T>(mut self, v: std::option::Option<T>) -> Self
2330    where
2331        T: std::convert::Into<wkt::BoolValue>,
2332    {
2333        self.in_beta = v.map(|x| x.into());
2334        self
2335    }
2336
2337    /// Sets the value of [allowed_int_values][crate::model::Flag::allowed_int_values].
2338    ///
2339    /// # Example
2340    /// ```ignore,no_run
2341    /// # use google_cloud_sql_v1::model::Flag;
2342    /// let x = Flag::new().set_allowed_int_values([1, 2, 3]);
2343    /// ```
2344    pub fn set_allowed_int_values<T, V>(mut self, v: T) -> Self
2345    where
2346        T: std::iter::IntoIterator<Item = V>,
2347        V: std::convert::Into<i64>,
2348    {
2349        use std::iter::Iterator;
2350        self.allowed_int_values = v.into_iter().map(|i| i.into()).collect();
2351        self
2352    }
2353}
2354
2355impl wkt::message::Message for Flag {
2356    fn typename() -> &'static str {
2357        "type.googleapis.com/google.cloud.sql.v1.Flag"
2358    }
2359}
2360
2361/// Instance add server CA request.
2362#[derive(Clone, Default, PartialEq)]
2363#[non_exhaustive]
2364pub struct SqlInstancesAddServerCaRequest {
2365    /// Cloud SQL instance ID. This does not include the project ID.
2366    pub instance: std::string::String,
2367
2368    /// Project ID of the project that contains the instance.
2369    pub project: std::string::String,
2370
2371    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2372}
2373
2374impl SqlInstancesAddServerCaRequest {
2375    pub fn new() -> Self {
2376        std::default::Default::default()
2377    }
2378
2379    /// Sets the value of [instance][crate::model::SqlInstancesAddServerCaRequest::instance].
2380    ///
2381    /// # Example
2382    /// ```ignore,no_run
2383    /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
2384    /// let x = SqlInstancesAddServerCaRequest::new().set_instance("example");
2385    /// ```
2386    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2387        self.instance = v.into();
2388        self
2389    }
2390
2391    /// Sets the value of [project][crate::model::SqlInstancesAddServerCaRequest::project].
2392    ///
2393    /// # Example
2394    /// ```ignore,no_run
2395    /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
2396    /// let x = SqlInstancesAddServerCaRequest::new().set_project("example");
2397    /// ```
2398    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2399        self.project = v.into();
2400        self
2401    }
2402}
2403
2404impl wkt::message::Message for SqlInstancesAddServerCaRequest {
2405    fn typename() -> &'static str {
2406        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCaRequest"
2407    }
2408}
2409
2410/// Instance clone request.
2411#[derive(Clone, Default, PartialEq)]
2412#[non_exhaustive]
2413pub struct SqlInstancesCloneRequest {
2414    /// The ID of the Cloud SQL instance to be cloned (source). This does not
2415    /// include the project ID.
2416    pub instance: std::string::String,
2417
2418    /// Project ID of the source as well as the clone Cloud SQL instance.
2419    pub project: std::string::String,
2420
2421    pub body: std::option::Option<crate::model::InstancesCloneRequest>,
2422
2423    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2424}
2425
2426impl SqlInstancesCloneRequest {
2427    pub fn new() -> Self {
2428        std::default::Default::default()
2429    }
2430
2431    /// Sets the value of [instance][crate::model::SqlInstancesCloneRequest::instance].
2432    ///
2433    /// # Example
2434    /// ```ignore,no_run
2435    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
2436    /// let x = SqlInstancesCloneRequest::new().set_instance("example");
2437    /// ```
2438    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2439        self.instance = v.into();
2440        self
2441    }
2442
2443    /// Sets the value of [project][crate::model::SqlInstancesCloneRequest::project].
2444    ///
2445    /// # Example
2446    /// ```ignore,no_run
2447    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
2448    /// let x = SqlInstancesCloneRequest::new().set_project("example");
2449    /// ```
2450    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2451        self.project = v.into();
2452        self
2453    }
2454
2455    /// Sets the value of [body][crate::model::SqlInstancesCloneRequest::body].
2456    ///
2457    /// # Example
2458    /// ```ignore,no_run
2459    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
2460    /// use google_cloud_sql_v1::model::InstancesCloneRequest;
2461    /// let x = SqlInstancesCloneRequest::new().set_body(InstancesCloneRequest::default()/* use setters */);
2462    /// ```
2463    pub fn set_body<T>(mut self, v: T) -> Self
2464    where
2465        T: std::convert::Into<crate::model::InstancesCloneRequest>,
2466    {
2467        self.body = std::option::Option::Some(v.into());
2468        self
2469    }
2470
2471    /// Sets or clears the value of [body][crate::model::SqlInstancesCloneRequest::body].
2472    ///
2473    /// # Example
2474    /// ```ignore,no_run
2475    /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
2476    /// use google_cloud_sql_v1::model::InstancesCloneRequest;
2477    /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(Some(InstancesCloneRequest::default()/* use setters */));
2478    /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(None::<InstancesCloneRequest>);
2479    /// ```
2480    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2481    where
2482        T: std::convert::Into<crate::model::InstancesCloneRequest>,
2483    {
2484        self.body = v.map(|x| x.into());
2485        self
2486    }
2487}
2488
2489impl wkt::message::Message for SqlInstancesCloneRequest {
2490    fn typename() -> &'static str {
2491        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCloneRequest"
2492    }
2493}
2494
2495/// Instance delete request.
2496#[derive(Clone, Default, PartialEq)]
2497#[non_exhaustive]
2498pub struct SqlInstancesDeleteRequest {
2499    /// Cloud SQL instance ID. This does not include the project ID.
2500    pub instance: std::string::String,
2501
2502    /// Project ID of the project that contains the instance to be deleted.
2503    pub project: std::string::String,
2504
2505    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2506}
2507
2508impl SqlInstancesDeleteRequest {
2509    pub fn new() -> Self {
2510        std::default::Default::default()
2511    }
2512
2513    /// Sets the value of [instance][crate::model::SqlInstancesDeleteRequest::instance].
2514    ///
2515    /// # Example
2516    /// ```ignore,no_run
2517    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
2518    /// let x = SqlInstancesDeleteRequest::new().set_instance("example");
2519    /// ```
2520    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2521        self.instance = v.into();
2522        self
2523    }
2524
2525    /// Sets the value of [project][crate::model::SqlInstancesDeleteRequest::project].
2526    ///
2527    /// # Example
2528    /// ```ignore,no_run
2529    /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
2530    /// let x = SqlInstancesDeleteRequest::new().set_project("example");
2531    /// ```
2532    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2533        self.project = v.into();
2534        self
2535    }
2536}
2537
2538impl wkt::message::Message for SqlInstancesDeleteRequest {
2539    fn typename() -> &'static str {
2540        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDeleteRequest"
2541    }
2542}
2543
2544/// Instance demote master request.
2545#[derive(Clone, Default, PartialEq)]
2546#[non_exhaustive]
2547pub struct SqlInstancesDemoteMasterRequest {
2548    /// Cloud SQL instance name.
2549    pub instance: std::string::String,
2550
2551    /// ID of the project that contains the instance.
2552    pub project: std::string::String,
2553
2554    pub body: std::option::Option<crate::model::InstancesDemoteMasterRequest>,
2555
2556    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2557}
2558
2559impl SqlInstancesDemoteMasterRequest {
2560    pub fn new() -> Self {
2561        std::default::Default::default()
2562    }
2563
2564    /// Sets the value of [instance][crate::model::SqlInstancesDemoteMasterRequest::instance].
2565    ///
2566    /// # Example
2567    /// ```ignore,no_run
2568    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
2569    /// let x = SqlInstancesDemoteMasterRequest::new().set_instance("example");
2570    /// ```
2571    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2572        self.instance = v.into();
2573        self
2574    }
2575
2576    /// Sets the value of [project][crate::model::SqlInstancesDemoteMasterRequest::project].
2577    ///
2578    /// # Example
2579    /// ```ignore,no_run
2580    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
2581    /// let x = SqlInstancesDemoteMasterRequest::new().set_project("example");
2582    /// ```
2583    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2584        self.project = v.into();
2585        self
2586    }
2587
2588    /// Sets the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
2589    ///
2590    /// # Example
2591    /// ```ignore,no_run
2592    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
2593    /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
2594    /// let x = SqlInstancesDemoteMasterRequest::new().set_body(InstancesDemoteMasterRequest::default()/* use setters */);
2595    /// ```
2596    pub fn set_body<T>(mut self, v: T) -> Self
2597    where
2598        T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
2599    {
2600        self.body = std::option::Option::Some(v.into());
2601        self
2602    }
2603
2604    /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
2605    ///
2606    /// # Example
2607    /// ```ignore,no_run
2608    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
2609    /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
2610    /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(Some(InstancesDemoteMasterRequest::default()/* use setters */));
2611    /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(None::<InstancesDemoteMasterRequest>);
2612    /// ```
2613    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2614    where
2615        T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
2616    {
2617        self.body = v.map(|x| x.into());
2618        self
2619    }
2620}
2621
2622impl wkt::message::Message for SqlInstancesDemoteMasterRequest {
2623    fn typename() -> &'static str {
2624        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteMasterRequest"
2625    }
2626}
2627
2628/// Instance demote request.
2629#[derive(Clone, Default, PartialEq)]
2630#[non_exhaustive]
2631pub struct SqlInstancesDemoteRequest {
2632    /// Required. Cloud SQL instance name.
2633    pub instance: std::string::String,
2634
2635    /// Required. ID of the project that contains the instance.
2636    pub project: std::string::String,
2637
2638    /// Required. The request body.
2639    pub body: std::option::Option<crate::model::InstancesDemoteRequest>,
2640
2641    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2642}
2643
2644impl SqlInstancesDemoteRequest {
2645    pub fn new() -> Self {
2646        std::default::Default::default()
2647    }
2648
2649    /// Sets the value of [instance][crate::model::SqlInstancesDemoteRequest::instance].
2650    ///
2651    /// # Example
2652    /// ```ignore,no_run
2653    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
2654    /// let x = SqlInstancesDemoteRequest::new().set_instance("example");
2655    /// ```
2656    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2657        self.instance = v.into();
2658        self
2659    }
2660
2661    /// Sets the value of [project][crate::model::SqlInstancesDemoteRequest::project].
2662    ///
2663    /// # Example
2664    /// ```ignore,no_run
2665    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
2666    /// let x = SqlInstancesDemoteRequest::new().set_project("example");
2667    /// ```
2668    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2669        self.project = v.into();
2670        self
2671    }
2672
2673    /// Sets the value of [body][crate::model::SqlInstancesDemoteRequest::body].
2674    ///
2675    /// # Example
2676    /// ```ignore,no_run
2677    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
2678    /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
2679    /// let x = SqlInstancesDemoteRequest::new().set_body(InstancesDemoteRequest::default()/* use setters */);
2680    /// ```
2681    pub fn set_body<T>(mut self, v: T) -> Self
2682    where
2683        T: std::convert::Into<crate::model::InstancesDemoteRequest>,
2684    {
2685        self.body = std::option::Option::Some(v.into());
2686        self
2687    }
2688
2689    /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteRequest::body].
2690    ///
2691    /// # Example
2692    /// ```ignore,no_run
2693    /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
2694    /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
2695    /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(Some(InstancesDemoteRequest::default()/* use setters */));
2696    /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(None::<InstancesDemoteRequest>);
2697    /// ```
2698    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2699    where
2700        T: std::convert::Into<crate::model::InstancesDemoteRequest>,
2701    {
2702        self.body = v.map(|x| x.into());
2703        self
2704    }
2705}
2706
2707impl wkt::message::Message for SqlInstancesDemoteRequest {
2708    fn typename() -> &'static str {
2709        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteRequest"
2710    }
2711}
2712
2713/// Instance export request.
2714#[derive(Clone, Default, PartialEq)]
2715#[non_exhaustive]
2716pub struct SqlInstancesExportRequest {
2717    /// Cloud SQL instance ID. This does not include the project ID.
2718    pub instance: std::string::String,
2719
2720    /// Project ID of the project that contains the instance to be exported.
2721    pub project: std::string::String,
2722
2723    pub body: std::option::Option<crate::model::InstancesExportRequest>,
2724
2725    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2726}
2727
2728impl SqlInstancesExportRequest {
2729    pub fn new() -> Self {
2730        std::default::Default::default()
2731    }
2732
2733    /// Sets the value of [instance][crate::model::SqlInstancesExportRequest::instance].
2734    ///
2735    /// # Example
2736    /// ```ignore,no_run
2737    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
2738    /// let x = SqlInstancesExportRequest::new().set_instance("example");
2739    /// ```
2740    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2741        self.instance = v.into();
2742        self
2743    }
2744
2745    /// Sets the value of [project][crate::model::SqlInstancesExportRequest::project].
2746    ///
2747    /// # Example
2748    /// ```ignore,no_run
2749    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
2750    /// let x = SqlInstancesExportRequest::new().set_project("example");
2751    /// ```
2752    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2753        self.project = v.into();
2754        self
2755    }
2756
2757    /// Sets the value of [body][crate::model::SqlInstancesExportRequest::body].
2758    ///
2759    /// # Example
2760    /// ```ignore,no_run
2761    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
2762    /// use google_cloud_sql_v1::model::InstancesExportRequest;
2763    /// let x = SqlInstancesExportRequest::new().set_body(InstancesExportRequest::default()/* use setters */);
2764    /// ```
2765    pub fn set_body<T>(mut self, v: T) -> Self
2766    where
2767        T: std::convert::Into<crate::model::InstancesExportRequest>,
2768    {
2769        self.body = std::option::Option::Some(v.into());
2770        self
2771    }
2772
2773    /// Sets or clears the value of [body][crate::model::SqlInstancesExportRequest::body].
2774    ///
2775    /// # Example
2776    /// ```ignore,no_run
2777    /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
2778    /// use google_cloud_sql_v1::model::InstancesExportRequest;
2779    /// let x = SqlInstancesExportRequest::new().set_or_clear_body(Some(InstancesExportRequest::default()/* use setters */));
2780    /// let x = SqlInstancesExportRequest::new().set_or_clear_body(None::<InstancesExportRequest>);
2781    /// ```
2782    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2783    where
2784        T: std::convert::Into<crate::model::InstancesExportRequest>,
2785    {
2786        self.body = v.map(|x| x.into());
2787        self
2788    }
2789}
2790
2791impl wkt::message::Message for SqlInstancesExportRequest {
2792    fn typename() -> &'static str {
2793        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExportRequest"
2794    }
2795}
2796
2797/// Instance failover request.
2798#[derive(Clone, Default, PartialEq)]
2799#[non_exhaustive]
2800pub struct SqlInstancesFailoverRequest {
2801    /// Cloud SQL instance ID. This does not include the project ID.
2802    pub instance: std::string::String,
2803
2804    /// ID of the project that contains the read replica.
2805    pub project: std::string::String,
2806
2807    pub body: std::option::Option<crate::model::InstancesFailoverRequest>,
2808
2809    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2810}
2811
2812impl SqlInstancesFailoverRequest {
2813    pub fn new() -> Self {
2814        std::default::Default::default()
2815    }
2816
2817    /// Sets the value of [instance][crate::model::SqlInstancesFailoverRequest::instance].
2818    ///
2819    /// # Example
2820    /// ```ignore,no_run
2821    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
2822    /// let x = SqlInstancesFailoverRequest::new().set_instance("example");
2823    /// ```
2824    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2825        self.instance = v.into();
2826        self
2827    }
2828
2829    /// Sets the value of [project][crate::model::SqlInstancesFailoverRequest::project].
2830    ///
2831    /// # Example
2832    /// ```ignore,no_run
2833    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
2834    /// let x = SqlInstancesFailoverRequest::new().set_project("example");
2835    /// ```
2836    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2837        self.project = v.into();
2838        self
2839    }
2840
2841    /// Sets the value of [body][crate::model::SqlInstancesFailoverRequest::body].
2842    ///
2843    /// # Example
2844    /// ```ignore,no_run
2845    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
2846    /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
2847    /// let x = SqlInstancesFailoverRequest::new().set_body(InstancesFailoverRequest::default()/* use setters */);
2848    /// ```
2849    pub fn set_body<T>(mut self, v: T) -> Self
2850    where
2851        T: std::convert::Into<crate::model::InstancesFailoverRequest>,
2852    {
2853        self.body = std::option::Option::Some(v.into());
2854        self
2855    }
2856
2857    /// Sets or clears the value of [body][crate::model::SqlInstancesFailoverRequest::body].
2858    ///
2859    /// # Example
2860    /// ```ignore,no_run
2861    /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
2862    /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
2863    /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(Some(InstancesFailoverRequest::default()/* use setters */));
2864    /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(None::<InstancesFailoverRequest>);
2865    /// ```
2866    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2867    where
2868        T: std::convert::Into<crate::model::InstancesFailoverRequest>,
2869    {
2870        self.body = v.map(|x| x.into());
2871        self
2872    }
2873}
2874
2875impl wkt::message::Message for SqlInstancesFailoverRequest {
2876    fn typename() -> &'static str {
2877        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesFailoverRequest"
2878    }
2879}
2880
2881/// Instance get request.
2882#[derive(Clone, Default, PartialEq)]
2883#[non_exhaustive]
2884pub struct SqlInstancesGetRequest {
2885    /// Database instance ID. This does not include the project ID.
2886    pub instance: std::string::String,
2887
2888    /// Project ID of the project that contains the instance.
2889    pub project: std::string::String,
2890
2891    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2892}
2893
2894impl SqlInstancesGetRequest {
2895    pub fn new() -> Self {
2896        std::default::Default::default()
2897    }
2898
2899    /// Sets the value of [instance][crate::model::SqlInstancesGetRequest::instance].
2900    ///
2901    /// # Example
2902    /// ```ignore,no_run
2903    /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
2904    /// let x = SqlInstancesGetRequest::new().set_instance("example");
2905    /// ```
2906    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2907        self.instance = v.into();
2908        self
2909    }
2910
2911    /// Sets the value of [project][crate::model::SqlInstancesGetRequest::project].
2912    ///
2913    /// # Example
2914    /// ```ignore,no_run
2915    /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
2916    /// let x = SqlInstancesGetRequest::new().set_project("example");
2917    /// ```
2918    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2919        self.project = v.into();
2920        self
2921    }
2922}
2923
2924impl wkt::message::Message for SqlInstancesGetRequest {
2925    fn typename() -> &'static str {
2926        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetRequest"
2927    }
2928}
2929
2930/// Instance import request.
2931#[derive(Clone, Default, PartialEq)]
2932#[non_exhaustive]
2933pub struct SqlInstancesImportRequest {
2934    /// Cloud SQL instance ID. This does not include the project ID.
2935    pub instance: std::string::String,
2936
2937    /// Project ID of the project that contains the instance.
2938    pub project: std::string::String,
2939
2940    pub body: std::option::Option<crate::model::InstancesImportRequest>,
2941
2942    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2943}
2944
2945impl SqlInstancesImportRequest {
2946    pub fn new() -> Self {
2947        std::default::Default::default()
2948    }
2949
2950    /// Sets the value of [instance][crate::model::SqlInstancesImportRequest::instance].
2951    ///
2952    /// # Example
2953    /// ```ignore,no_run
2954    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
2955    /// let x = SqlInstancesImportRequest::new().set_instance("example");
2956    /// ```
2957    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2958        self.instance = v.into();
2959        self
2960    }
2961
2962    /// Sets the value of [project][crate::model::SqlInstancesImportRequest::project].
2963    ///
2964    /// # Example
2965    /// ```ignore,no_run
2966    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
2967    /// let x = SqlInstancesImportRequest::new().set_project("example");
2968    /// ```
2969    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2970        self.project = v.into();
2971        self
2972    }
2973
2974    /// Sets the value of [body][crate::model::SqlInstancesImportRequest::body].
2975    ///
2976    /// # Example
2977    /// ```ignore,no_run
2978    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
2979    /// use google_cloud_sql_v1::model::InstancesImportRequest;
2980    /// let x = SqlInstancesImportRequest::new().set_body(InstancesImportRequest::default()/* use setters */);
2981    /// ```
2982    pub fn set_body<T>(mut self, v: T) -> Self
2983    where
2984        T: std::convert::Into<crate::model::InstancesImportRequest>,
2985    {
2986        self.body = std::option::Option::Some(v.into());
2987        self
2988    }
2989
2990    /// Sets or clears the value of [body][crate::model::SqlInstancesImportRequest::body].
2991    ///
2992    /// # Example
2993    /// ```ignore,no_run
2994    /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
2995    /// use google_cloud_sql_v1::model::InstancesImportRequest;
2996    /// let x = SqlInstancesImportRequest::new().set_or_clear_body(Some(InstancesImportRequest::default()/* use setters */));
2997    /// let x = SqlInstancesImportRequest::new().set_or_clear_body(None::<InstancesImportRequest>);
2998    /// ```
2999    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3000    where
3001        T: std::convert::Into<crate::model::InstancesImportRequest>,
3002    {
3003        self.body = v.map(|x| x.into());
3004        self
3005    }
3006}
3007
3008impl wkt::message::Message for SqlInstancesImportRequest {
3009    fn typename() -> &'static str {
3010        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesImportRequest"
3011    }
3012}
3013
3014/// Instance insert request.
3015#[derive(Clone, Default, PartialEq)]
3016#[non_exhaustive]
3017pub struct SqlInstancesInsertRequest {
3018    /// Project ID of the project to which the newly created Cloud SQL instances
3019    /// should belong.
3020    pub project: std::string::String,
3021
3022    pub body: std::option::Option<crate::model::DatabaseInstance>,
3023
3024    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3025}
3026
3027impl SqlInstancesInsertRequest {
3028    pub fn new() -> Self {
3029        std::default::Default::default()
3030    }
3031
3032    /// Sets the value of [project][crate::model::SqlInstancesInsertRequest::project].
3033    ///
3034    /// # Example
3035    /// ```ignore,no_run
3036    /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
3037    /// let x = SqlInstancesInsertRequest::new().set_project("example");
3038    /// ```
3039    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3040        self.project = v.into();
3041        self
3042    }
3043
3044    /// Sets the value of [body][crate::model::SqlInstancesInsertRequest::body].
3045    ///
3046    /// # Example
3047    /// ```ignore,no_run
3048    /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
3049    /// use google_cloud_sql_v1::model::DatabaseInstance;
3050    /// let x = SqlInstancesInsertRequest::new().set_body(DatabaseInstance::default()/* use setters */);
3051    /// ```
3052    pub fn set_body<T>(mut self, v: T) -> Self
3053    where
3054        T: std::convert::Into<crate::model::DatabaseInstance>,
3055    {
3056        self.body = std::option::Option::Some(v.into());
3057        self
3058    }
3059
3060    /// Sets or clears the value of [body][crate::model::SqlInstancesInsertRequest::body].
3061    ///
3062    /// # Example
3063    /// ```ignore,no_run
3064    /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
3065    /// use google_cloud_sql_v1::model::DatabaseInstance;
3066    /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
3067    /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(None::<DatabaseInstance>);
3068    /// ```
3069    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3070    where
3071        T: std::convert::Into<crate::model::DatabaseInstance>,
3072    {
3073        self.body = v.map(|x| x.into());
3074        self
3075    }
3076}
3077
3078impl wkt::message::Message for SqlInstancesInsertRequest {
3079    fn typename() -> &'static str {
3080        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesInsertRequest"
3081    }
3082}
3083
3084/// Instance list request.
3085#[derive(Clone, Default, PartialEq)]
3086#[non_exhaustive]
3087pub struct SqlInstancesListRequest {
3088    /// A filter expression that filters resources listed in the response.
3089    /// The expression is in the form of field:value. For example,
3090    /// 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
3091    /// their JSON representation, such as 'settings.userLabels.auto_start:true'.
3092    ///
3093    /// Multiple filter queries are space-separated. For example.
3094    /// 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
3095    /// expression is an AND expression. However, you can include AND and OR
3096    /// expressions explicitly.
3097    pub filter: std::string::String,
3098
3099    /// The maximum number of instances to return. The service may return fewer
3100    /// than this value.
3101    /// If unspecified, at most 500 instances are returned.
3102    /// The maximum value is 1000; values above 1000 are coerced to 1000.
3103    pub max_results: u32,
3104
3105    /// A previously-returned page token representing part of the larger set of
3106    /// results to view.
3107    pub page_token: std::string::String,
3108
3109    /// Project ID of the project for which to list Cloud SQL instances.
3110    pub project: std::string::String,
3111
3112    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3113}
3114
3115impl SqlInstancesListRequest {
3116    pub fn new() -> Self {
3117        std::default::Default::default()
3118    }
3119
3120    /// Sets the value of [filter][crate::model::SqlInstancesListRequest::filter].
3121    ///
3122    /// # Example
3123    /// ```ignore,no_run
3124    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
3125    /// let x = SqlInstancesListRequest::new().set_filter("example");
3126    /// ```
3127    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3128        self.filter = v.into();
3129        self
3130    }
3131
3132    /// Sets the value of [max_results][crate::model::SqlInstancesListRequest::max_results].
3133    ///
3134    /// # Example
3135    /// ```ignore,no_run
3136    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
3137    /// let x = SqlInstancesListRequest::new().set_max_results(42_u32);
3138    /// ```
3139    pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
3140        self.max_results = v.into();
3141        self
3142    }
3143
3144    /// Sets the value of [page_token][crate::model::SqlInstancesListRequest::page_token].
3145    ///
3146    /// # Example
3147    /// ```ignore,no_run
3148    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
3149    /// let x = SqlInstancesListRequest::new().set_page_token("example");
3150    /// ```
3151    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3152        self.page_token = v.into();
3153        self
3154    }
3155
3156    /// Sets the value of [project][crate::model::SqlInstancesListRequest::project].
3157    ///
3158    /// # Example
3159    /// ```ignore,no_run
3160    /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
3161    /// let x = SqlInstancesListRequest::new().set_project("example");
3162    /// ```
3163    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3164        self.project = v.into();
3165        self
3166    }
3167}
3168
3169impl wkt::message::Message for SqlInstancesListRequest {
3170    fn typename() -> &'static str {
3171        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListRequest"
3172    }
3173}
3174
3175/// Instance list server CAs request.
3176#[derive(Clone, Default, PartialEq)]
3177#[non_exhaustive]
3178pub struct SqlInstancesListServerCasRequest {
3179    /// Cloud SQL instance ID. This does not include the project ID.
3180    pub instance: std::string::String,
3181
3182    /// Project ID of the project that contains the instance.
3183    pub project: std::string::String,
3184
3185    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3186}
3187
3188impl SqlInstancesListServerCasRequest {
3189    pub fn new() -> Self {
3190        std::default::Default::default()
3191    }
3192
3193    /// Sets the value of [instance][crate::model::SqlInstancesListServerCasRequest::instance].
3194    ///
3195    /// # Example
3196    /// ```ignore,no_run
3197    /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
3198    /// let x = SqlInstancesListServerCasRequest::new().set_instance("example");
3199    /// ```
3200    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3201        self.instance = v.into();
3202        self
3203    }
3204
3205    /// Sets the value of [project][crate::model::SqlInstancesListServerCasRequest::project].
3206    ///
3207    /// # Example
3208    /// ```ignore,no_run
3209    /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
3210    /// let x = SqlInstancesListServerCasRequest::new().set_project("example");
3211    /// ```
3212    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3213        self.project = v.into();
3214        self
3215    }
3216}
3217
3218impl wkt::message::Message for SqlInstancesListServerCasRequest {
3219    fn typename() -> &'static str {
3220        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCasRequest"
3221    }
3222}
3223
3224/// Instance patch request.
3225#[derive(Clone, Default, PartialEq)]
3226#[non_exhaustive]
3227pub struct SqlInstancesPatchRequest {
3228    /// Cloud SQL instance ID. This does not include the project ID.
3229    pub instance: std::string::String,
3230
3231    /// Project ID of the project that contains the instance.
3232    pub project: std::string::String,
3233
3234    pub body: std::option::Option<crate::model::DatabaseInstance>,
3235
3236    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3237}
3238
3239impl SqlInstancesPatchRequest {
3240    pub fn new() -> Self {
3241        std::default::Default::default()
3242    }
3243
3244    /// Sets the value of [instance][crate::model::SqlInstancesPatchRequest::instance].
3245    ///
3246    /// # Example
3247    /// ```ignore,no_run
3248    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
3249    /// let x = SqlInstancesPatchRequest::new().set_instance("example");
3250    /// ```
3251    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3252        self.instance = v.into();
3253        self
3254    }
3255
3256    /// Sets the value of [project][crate::model::SqlInstancesPatchRequest::project].
3257    ///
3258    /// # Example
3259    /// ```ignore,no_run
3260    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
3261    /// let x = SqlInstancesPatchRequest::new().set_project("example");
3262    /// ```
3263    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3264        self.project = v.into();
3265        self
3266    }
3267
3268    /// Sets the value of [body][crate::model::SqlInstancesPatchRequest::body].
3269    ///
3270    /// # Example
3271    /// ```ignore,no_run
3272    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
3273    /// use google_cloud_sql_v1::model::DatabaseInstance;
3274    /// let x = SqlInstancesPatchRequest::new().set_body(DatabaseInstance::default()/* use setters */);
3275    /// ```
3276    pub fn set_body<T>(mut self, v: T) -> Self
3277    where
3278        T: std::convert::Into<crate::model::DatabaseInstance>,
3279    {
3280        self.body = std::option::Option::Some(v.into());
3281        self
3282    }
3283
3284    /// Sets or clears the value of [body][crate::model::SqlInstancesPatchRequest::body].
3285    ///
3286    /// # Example
3287    /// ```ignore,no_run
3288    /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
3289    /// use google_cloud_sql_v1::model::DatabaseInstance;
3290    /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
3291    /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(None::<DatabaseInstance>);
3292    /// ```
3293    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3294    where
3295        T: std::convert::Into<crate::model::DatabaseInstance>,
3296    {
3297        self.body = v.map(|x| x.into());
3298        self
3299    }
3300}
3301
3302impl wkt::message::Message for SqlInstancesPatchRequest {
3303    fn typename() -> &'static str {
3304        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPatchRequest"
3305    }
3306}
3307
3308/// Instance promote replica request.
3309#[derive(Clone, Default, PartialEq)]
3310#[non_exhaustive]
3311pub struct SqlInstancesPromoteReplicaRequest {
3312    /// Cloud SQL read replica instance name.
3313    pub instance: std::string::String,
3314
3315    /// ID of the project that contains the read replica.
3316    pub project: std::string::String,
3317
3318    /// Set to true to invoke a replica failover to the designated DR
3319    /// replica. As part of replica failover, the promote operation attempts
3320    /// to add the original primary instance as a replica of the promoted
3321    /// DR replica when the original primary instance comes back online.
3322    /// If set to false or not specified, then the original primary
3323    /// instance becomes an independent Cloud SQL primary instance.
3324    /// Only applicable to MySQL.
3325    pub failover: bool,
3326
3327    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3328}
3329
3330impl SqlInstancesPromoteReplicaRequest {
3331    pub fn new() -> Self {
3332        std::default::Default::default()
3333    }
3334
3335    /// Sets the value of [instance][crate::model::SqlInstancesPromoteReplicaRequest::instance].
3336    ///
3337    /// # Example
3338    /// ```ignore,no_run
3339    /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
3340    /// let x = SqlInstancesPromoteReplicaRequest::new().set_instance("example");
3341    /// ```
3342    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3343        self.instance = v.into();
3344        self
3345    }
3346
3347    /// Sets the value of [project][crate::model::SqlInstancesPromoteReplicaRequest::project].
3348    ///
3349    /// # Example
3350    /// ```ignore,no_run
3351    /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
3352    /// let x = SqlInstancesPromoteReplicaRequest::new().set_project("example");
3353    /// ```
3354    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3355        self.project = v.into();
3356        self
3357    }
3358
3359    /// Sets the value of [failover][crate::model::SqlInstancesPromoteReplicaRequest::failover].
3360    ///
3361    /// # Example
3362    /// ```ignore,no_run
3363    /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
3364    /// let x = SqlInstancesPromoteReplicaRequest::new().set_failover(true);
3365    /// ```
3366    pub fn set_failover<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3367        self.failover = v.into();
3368        self
3369    }
3370}
3371
3372impl wkt::message::Message for SqlInstancesPromoteReplicaRequest {
3373    fn typename() -> &'static str {
3374        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest"
3375    }
3376}
3377
3378/// Instance switchover request.
3379#[derive(Clone, Default, PartialEq)]
3380#[non_exhaustive]
3381pub struct SqlInstancesSwitchoverRequest {
3382    /// Cloud SQL read replica instance name.
3383    pub instance: std::string::String,
3384
3385    /// ID of the project that contains the replica.
3386    pub project: std::string::String,
3387
3388    /// Optional. (MySQL only) Cloud SQL instance operations timeout, which is a
3389    /// sum of all database operations. Default value is 10 minutes and can be
3390    /// modified to a maximum value of 24 hours.
3391    pub db_timeout: std::option::Option<wkt::Duration>,
3392
3393    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3394}
3395
3396impl SqlInstancesSwitchoverRequest {
3397    pub fn new() -> Self {
3398        std::default::Default::default()
3399    }
3400
3401    /// Sets the value of [instance][crate::model::SqlInstancesSwitchoverRequest::instance].
3402    ///
3403    /// # Example
3404    /// ```ignore,no_run
3405    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
3406    /// let x = SqlInstancesSwitchoverRequest::new().set_instance("example");
3407    /// ```
3408    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3409        self.instance = v.into();
3410        self
3411    }
3412
3413    /// Sets the value of [project][crate::model::SqlInstancesSwitchoverRequest::project].
3414    ///
3415    /// # Example
3416    /// ```ignore,no_run
3417    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
3418    /// let x = SqlInstancesSwitchoverRequest::new().set_project("example");
3419    /// ```
3420    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3421        self.project = v.into();
3422        self
3423    }
3424
3425    /// Sets the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
3426    ///
3427    /// # Example
3428    /// ```ignore,no_run
3429    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
3430    /// use wkt::Duration;
3431    /// let x = SqlInstancesSwitchoverRequest::new().set_db_timeout(Duration::default()/* use setters */);
3432    /// ```
3433    pub fn set_db_timeout<T>(mut self, v: T) -> Self
3434    where
3435        T: std::convert::Into<wkt::Duration>,
3436    {
3437        self.db_timeout = std::option::Option::Some(v.into());
3438        self
3439    }
3440
3441    /// Sets or clears the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
3442    ///
3443    /// # Example
3444    /// ```ignore,no_run
3445    /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
3446    /// use wkt::Duration;
3447    /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(Some(Duration::default()/* use setters */));
3448    /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(None::<Duration>);
3449    /// ```
3450    pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
3451    where
3452        T: std::convert::Into<wkt::Duration>,
3453    {
3454        self.db_timeout = v.map(|x| x.into());
3455        self
3456    }
3457}
3458
3459impl wkt::message::Message for SqlInstancesSwitchoverRequest {
3460    fn typename() -> &'static str {
3461        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesSwitchoverRequest"
3462    }
3463}
3464
3465/// Instance reset SSL config request.
3466#[derive(Clone, Default, PartialEq)]
3467#[non_exhaustive]
3468pub struct SqlInstancesResetSslConfigRequest {
3469    /// Cloud SQL instance ID. This does not include the project ID.
3470    pub instance: std::string::String,
3471
3472    /// Project ID of the project that contains the instance.
3473    pub project: std::string::String,
3474
3475    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3476}
3477
3478impl SqlInstancesResetSslConfigRequest {
3479    pub fn new() -> Self {
3480        std::default::Default::default()
3481    }
3482
3483    /// Sets the value of [instance][crate::model::SqlInstancesResetSslConfigRequest::instance].
3484    ///
3485    /// # Example
3486    /// ```ignore,no_run
3487    /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
3488    /// let x = SqlInstancesResetSslConfigRequest::new().set_instance("example");
3489    /// ```
3490    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3491        self.instance = v.into();
3492        self
3493    }
3494
3495    /// Sets the value of [project][crate::model::SqlInstancesResetSslConfigRequest::project].
3496    ///
3497    /// # Example
3498    /// ```ignore,no_run
3499    /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
3500    /// let x = SqlInstancesResetSslConfigRequest::new().set_project("example");
3501    /// ```
3502    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3503        self.project = v.into();
3504        self
3505    }
3506}
3507
3508impl wkt::message::Message for SqlInstancesResetSslConfigRequest {
3509    fn typename() -> &'static str {
3510        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetSslConfigRequest"
3511    }
3512}
3513
3514/// Instance restart request.
3515#[derive(Clone, Default, PartialEq)]
3516#[non_exhaustive]
3517pub struct SqlInstancesRestartRequest {
3518    /// Cloud SQL instance ID. This does not include the project ID.
3519    pub instance: std::string::String,
3520
3521    /// Project ID of the project that contains the instance to be restarted.
3522    pub project: std::string::String,
3523
3524    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3525}
3526
3527impl SqlInstancesRestartRequest {
3528    pub fn new() -> Self {
3529        std::default::Default::default()
3530    }
3531
3532    /// Sets the value of [instance][crate::model::SqlInstancesRestartRequest::instance].
3533    ///
3534    /// # Example
3535    /// ```ignore,no_run
3536    /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
3537    /// let x = SqlInstancesRestartRequest::new().set_instance("example");
3538    /// ```
3539    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3540        self.instance = v.into();
3541        self
3542    }
3543
3544    /// Sets the value of [project][crate::model::SqlInstancesRestartRequest::project].
3545    ///
3546    /// # Example
3547    /// ```ignore,no_run
3548    /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
3549    /// let x = SqlInstancesRestartRequest::new().set_project("example");
3550    /// ```
3551    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3552        self.project = v.into();
3553        self
3554    }
3555}
3556
3557impl wkt::message::Message for SqlInstancesRestartRequest {
3558    fn typename() -> &'static str {
3559        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestartRequest"
3560    }
3561}
3562
3563/// Instance restore backup request.
3564#[derive(Clone, Default, PartialEq)]
3565#[non_exhaustive]
3566pub struct SqlInstancesRestoreBackupRequest {
3567    /// Cloud SQL instance ID. This does not include the project ID.
3568    pub instance: std::string::String,
3569
3570    /// Project ID of the project that contains the instance.
3571    pub project: std::string::String,
3572
3573    pub body: std::option::Option<crate::model::InstancesRestoreBackupRequest>,
3574
3575    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3576}
3577
3578impl SqlInstancesRestoreBackupRequest {
3579    pub fn new() -> Self {
3580        std::default::Default::default()
3581    }
3582
3583    /// Sets the value of [instance][crate::model::SqlInstancesRestoreBackupRequest::instance].
3584    ///
3585    /// # Example
3586    /// ```ignore,no_run
3587    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
3588    /// let x = SqlInstancesRestoreBackupRequest::new().set_instance("example");
3589    /// ```
3590    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3591        self.instance = v.into();
3592        self
3593    }
3594
3595    /// Sets the value of [project][crate::model::SqlInstancesRestoreBackupRequest::project].
3596    ///
3597    /// # Example
3598    /// ```ignore,no_run
3599    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
3600    /// let x = SqlInstancesRestoreBackupRequest::new().set_project("example");
3601    /// ```
3602    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3603        self.project = v.into();
3604        self
3605    }
3606
3607    /// Sets the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
3608    ///
3609    /// # Example
3610    /// ```ignore,no_run
3611    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
3612    /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
3613    /// let x = SqlInstancesRestoreBackupRequest::new().set_body(InstancesRestoreBackupRequest::default()/* use setters */);
3614    /// ```
3615    pub fn set_body<T>(mut self, v: T) -> Self
3616    where
3617        T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
3618    {
3619        self.body = std::option::Option::Some(v.into());
3620        self
3621    }
3622
3623    /// Sets or clears the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
3624    ///
3625    /// # Example
3626    /// ```ignore,no_run
3627    /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
3628    /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
3629    /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(Some(InstancesRestoreBackupRequest::default()/* use setters */));
3630    /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(None::<InstancesRestoreBackupRequest>);
3631    /// ```
3632    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3633    where
3634        T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
3635    {
3636        self.body = v.map(|x| x.into());
3637        self
3638    }
3639}
3640
3641impl wkt::message::Message for SqlInstancesRestoreBackupRequest {
3642    fn typename() -> &'static str {
3643        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestoreBackupRequest"
3644    }
3645}
3646
3647/// Instance rotate server CA request.
3648#[derive(Clone, Default, PartialEq)]
3649#[non_exhaustive]
3650pub struct SqlInstancesRotateServerCaRequest {
3651    /// Cloud SQL instance ID. This does not include the project ID.
3652    pub instance: std::string::String,
3653
3654    /// Project ID of the project that contains the instance.
3655    pub project: std::string::String,
3656
3657    pub body: std::option::Option<crate::model::InstancesRotateServerCaRequest>,
3658
3659    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3660}
3661
3662impl SqlInstancesRotateServerCaRequest {
3663    pub fn new() -> Self {
3664        std::default::Default::default()
3665    }
3666
3667    /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCaRequest::instance].
3668    ///
3669    /// # Example
3670    /// ```ignore,no_run
3671    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
3672    /// let x = SqlInstancesRotateServerCaRequest::new().set_instance("example");
3673    /// ```
3674    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3675        self.instance = v.into();
3676        self
3677    }
3678
3679    /// Sets the value of [project][crate::model::SqlInstancesRotateServerCaRequest::project].
3680    ///
3681    /// # Example
3682    /// ```ignore,no_run
3683    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
3684    /// let x = SqlInstancesRotateServerCaRequest::new().set_project("example");
3685    /// ```
3686    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3687        self.project = v.into();
3688        self
3689    }
3690
3691    /// Sets the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
3692    ///
3693    /// # Example
3694    /// ```ignore,no_run
3695    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
3696    /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
3697    /// let x = SqlInstancesRotateServerCaRequest::new().set_body(InstancesRotateServerCaRequest::default()/* use setters */);
3698    /// ```
3699    pub fn set_body<T>(mut self, v: T) -> Self
3700    where
3701        T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
3702    {
3703        self.body = std::option::Option::Some(v.into());
3704        self
3705    }
3706
3707    /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
3708    ///
3709    /// # Example
3710    /// ```ignore,no_run
3711    /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
3712    /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
3713    /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(Some(InstancesRotateServerCaRequest::default()/* use setters */));
3714    /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(None::<InstancesRotateServerCaRequest>);
3715    /// ```
3716    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3717    where
3718        T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
3719    {
3720        self.body = v.map(|x| x.into());
3721        self
3722    }
3723}
3724
3725impl wkt::message::Message for SqlInstancesRotateServerCaRequest {
3726    fn typename() -> &'static str {
3727        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCaRequest"
3728    }
3729}
3730
3731/// Instance start replica request.
3732#[derive(Clone, Default, PartialEq)]
3733#[non_exhaustive]
3734pub struct SqlInstancesStartReplicaRequest {
3735    /// Cloud SQL read replica instance name.
3736    pub instance: std::string::String,
3737
3738    /// ID of the project that contains the read replica.
3739    pub project: std::string::String,
3740
3741    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3742}
3743
3744impl SqlInstancesStartReplicaRequest {
3745    pub fn new() -> Self {
3746        std::default::Default::default()
3747    }
3748
3749    /// Sets the value of [instance][crate::model::SqlInstancesStartReplicaRequest::instance].
3750    ///
3751    /// # Example
3752    /// ```ignore,no_run
3753    /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
3754    /// let x = SqlInstancesStartReplicaRequest::new().set_instance("example");
3755    /// ```
3756    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3757        self.instance = v.into();
3758        self
3759    }
3760
3761    /// Sets the value of [project][crate::model::SqlInstancesStartReplicaRequest::project].
3762    ///
3763    /// # Example
3764    /// ```ignore,no_run
3765    /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
3766    /// let x = SqlInstancesStartReplicaRequest::new().set_project("example");
3767    /// ```
3768    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3769        self.project = v.into();
3770        self
3771    }
3772}
3773
3774impl wkt::message::Message for SqlInstancesStartReplicaRequest {
3775    fn typename() -> &'static str {
3776        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartReplicaRequest"
3777    }
3778}
3779
3780/// Instance stop replica request.
3781#[derive(Clone, Default, PartialEq)]
3782#[non_exhaustive]
3783pub struct SqlInstancesStopReplicaRequest {
3784    /// Cloud SQL read replica instance name.
3785    pub instance: std::string::String,
3786
3787    /// ID of the project that contains the read replica.
3788    pub project: std::string::String,
3789
3790    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3791}
3792
3793impl SqlInstancesStopReplicaRequest {
3794    pub fn new() -> Self {
3795        std::default::Default::default()
3796    }
3797
3798    /// Sets the value of [instance][crate::model::SqlInstancesStopReplicaRequest::instance].
3799    ///
3800    /// # Example
3801    /// ```ignore,no_run
3802    /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
3803    /// let x = SqlInstancesStopReplicaRequest::new().set_instance("example");
3804    /// ```
3805    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3806        self.instance = v.into();
3807        self
3808    }
3809
3810    /// Sets the value of [project][crate::model::SqlInstancesStopReplicaRequest::project].
3811    ///
3812    /// # Example
3813    /// ```ignore,no_run
3814    /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
3815    /// let x = SqlInstancesStopReplicaRequest::new().set_project("example");
3816    /// ```
3817    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3818        self.project = v.into();
3819        self
3820    }
3821}
3822
3823impl wkt::message::Message for SqlInstancesStopReplicaRequest {
3824    fn typename() -> &'static str {
3825        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStopReplicaRequest"
3826    }
3827}
3828
3829/// Instance truncate log request.
3830#[derive(Clone, Default, PartialEq)]
3831#[non_exhaustive]
3832pub struct SqlInstancesTruncateLogRequest {
3833    /// Cloud SQL instance ID. This does not include the project ID.
3834    pub instance: std::string::String,
3835
3836    /// Project ID of the Cloud SQL project.
3837    pub project: std::string::String,
3838
3839    pub body: std::option::Option<crate::model::InstancesTruncateLogRequest>,
3840
3841    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3842}
3843
3844impl SqlInstancesTruncateLogRequest {
3845    pub fn new() -> Self {
3846        std::default::Default::default()
3847    }
3848
3849    /// Sets the value of [instance][crate::model::SqlInstancesTruncateLogRequest::instance].
3850    ///
3851    /// # Example
3852    /// ```ignore,no_run
3853    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
3854    /// let x = SqlInstancesTruncateLogRequest::new().set_instance("example");
3855    /// ```
3856    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3857        self.instance = v.into();
3858        self
3859    }
3860
3861    /// Sets the value of [project][crate::model::SqlInstancesTruncateLogRequest::project].
3862    ///
3863    /// # Example
3864    /// ```ignore,no_run
3865    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
3866    /// let x = SqlInstancesTruncateLogRequest::new().set_project("example");
3867    /// ```
3868    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3869        self.project = v.into();
3870        self
3871    }
3872
3873    /// Sets the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
3874    ///
3875    /// # Example
3876    /// ```ignore,no_run
3877    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
3878    /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
3879    /// let x = SqlInstancesTruncateLogRequest::new().set_body(InstancesTruncateLogRequest::default()/* use setters */);
3880    /// ```
3881    pub fn set_body<T>(mut self, v: T) -> Self
3882    where
3883        T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
3884    {
3885        self.body = std::option::Option::Some(v.into());
3886        self
3887    }
3888
3889    /// Sets or clears the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
3890    ///
3891    /// # Example
3892    /// ```ignore,no_run
3893    /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
3894    /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
3895    /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(Some(InstancesTruncateLogRequest::default()/* use setters */));
3896    /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(None::<InstancesTruncateLogRequest>);
3897    /// ```
3898    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3899    where
3900        T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
3901    {
3902        self.body = v.map(|x| x.into());
3903        self
3904    }
3905}
3906
3907impl wkt::message::Message for SqlInstancesTruncateLogRequest {
3908    fn typename() -> &'static str {
3909        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesTruncateLogRequest"
3910    }
3911}
3912
3913/// Instance perform disk shrink request.
3914#[derive(Clone, Default, PartialEq)]
3915#[non_exhaustive]
3916pub struct SqlInstancesPerformDiskShrinkRequest {
3917    /// Cloud SQL instance ID. This does not include the project ID.
3918    pub instance: std::string::String,
3919
3920    /// Project ID of the project that contains the instance.
3921    pub project: std::string::String,
3922
3923    /// Perform disk shrink context.
3924    pub body: std::option::Option<crate::model::PerformDiskShrinkContext>,
3925
3926    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3927}
3928
3929impl SqlInstancesPerformDiskShrinkRequest {
3930    pub fn new() -> Self {
3931        std::default::Default::default()
3932    }
3933
3934    /// Sets the value of [instance][crate::model::SqlInstancesPerformDiskShrinkRequest::instance].
3935    ///
3936    /// # Example
3937    /// ```ignore,no_run
3938    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
3939    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_instance("example");
3940    /// ```
3941    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3942        self.instance = v.into();
3943        self
3944    }
3945
3946    /// Sets the value of [project][crate::model::SqlInstancesPerformDiskShrinkRequest::project].
3947    ///
3948    /// # Example
3949    /// ```ignore,no_run
3950    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
3951    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_project("example");
3952    /// ```
3953    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3954        self.project = v.into();
3955        self
3956    }
3957
3958    /// Sets the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
3959    ///
3960    /// # Example
3961    /// ```ignore,no_run
3962    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
3963    /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
3964    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_body(PerformDiskShrinkContext::default()/* use setters */);
3965    /// ```
3966    pub fn set_body<T>(mut self, v: T) -> Self
3967    where
3968        T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
3969    {
3970        self.body = std::option::Option::Some(v.into());
3971        self
3972    }
3973
3974    /// Sets or clears the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
3975    ///
3976    /// # Example
3977    /// ```ignore,no_run
3978    /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
3979    /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
3980    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(Some(PerformDiskShrinkContext::default()/* use setters */));
3981    /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(None::<PerformDiskShrinkContext>);
3982    /// ```
3983    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3984    where
3985        T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
3986    {
3987        self.body = v.map(|x| x.into());
3988        self
3989    }
3990}
3991
3992impl wkt::message::Message for SqlInstancesPerformDiskShrinkRequest {
3993    fn typename() -> &'static str {
3994        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest"
3995    }
3996}
3997
3998/// Instance update request.
3999#[derive(Clone, Default, PartialEq)]
4000#[non_exhaustive]
4001pub struct SqlInstancesUpdateRequest {
4002    /// Cloud SQL instance ID. This does not include the project ID.
4003    pub instance: std::string::String,
4004
4005    /// Project ID of the project that contains the instance.
4006    pub project: std::string::String,
4007
4008    pub body: std::option::Option<crate::model::DatabaseInstance>,
4009
4010    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4011}
4012
4013impl SqlInstancesUpdateRequest {
4014    pub fn new() -> Self {
4015        std::default::Default::default()
4016    }
4017
4018    /// Sets the value of [instance][crate::model::SqlInstancesUpdateRequest::instance].
4019    ///
4020    /// # Example
4021    /// ```ignore,no_run
4022    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
4023    /// let x = SqlInstancesUpdateRequest::new().set_instance("example");
4024    /// ```
4025    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4026        self.instance = v.into();
4027        self
4028    }
4029
4030    /// Sets the value of [project][crate::model::SqlInstancesUpdateRequest::project].
4031    ///
4032    /// # Example
4033    /// ```ignore,no_run
4034    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
4035    /// let x = SqlInstancesUpdateRequest::new().set_project("example");
4036    /// ```
4037    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4038        self.project = v.into();
4039        self
4040    }
4041
4042    /// Sets the value of [body][crate::model::SqlInstancesUpdateRequest::body].
4043    ///
4044    /// # Example
4045    /// ```ignore,no_run
4046    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
4047    /// use google_cloud_sql_v1::model::DatabaseInstance;
4048    /// let x = SqlInstancesUpdateRequest::new().set_body(DatabaseInstance::default()/* use setters */);
4049    /// ```
4050    pub fn set_body<T>(mut self, v: T) -> Self
4051    where
4052        T: std::convert::Into<crate::model::DatabaseInstance>,
4053    {
4054        self.body = std::option::Option::Some(v.into());
4055        self
4056    }
4057
4058    /// Sets or clears the value of [body][crate::model::SqlInstancesUpdateRequest::body].
4059    ///
4060    /// # Example
4061    /// ```ignore,no_run
4062    /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
4063    /// use google_cloud_sql_v1::model::DatabaseInstance;
4064    /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
4065    /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(None::<DatabaseInstance>);
4066    /// ```
4067    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4068    where
4069        T: std::convert::Into<crate::model::DatabaseInstance>,
4070    {
4071        self.body = v.map(|x| x.into());
4072        self
4073    }
4074}
4075
4076impl wkt::message::Message for SqlInstancesUpdateRequest {
4077    fn typename() -> &'static str {
4078        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesUpdateRequest"
4079    }
4080}
4081
4082/// Instance reschedule maintenance request.
4083#[derive(Clone, Default, PartialEq)]
4084#[non_exhaustive]
4085pub struct SqlInstancesRescheduleMaintenanceRequest {
4086    /// Cloud SQL instance ID. This does not include the project ID.
4087    pub instance: std::string::String,
4088
4089    /// ID of the project that contains the instance.
4090    pub project: std::string::String,
4091
4092    pub body: std::option::Option<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
4093
4094    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4095}
4096
4097impl SqlInstancesRescheduleMaintenanceRequest {
4098    pub fn new() -> Self {
4099        std::default::Default::default()
4100    }
4101
4102    /// Sets the value of [instance][crate::model::SqlInstancesRescheduleMaintenanceRequest::instance].
4103    ///
4104    /// # Example
4105    /// ```ignore,no_run
4106    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
4107    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_instance("example");
4108    /// ```
4109    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4110        self.instance = v.into();
4111        self
4112    }
4113
4114    /// Sets the value of [project][crate::model::SqlInstancesRescheduleMaintenanceRequest::project].
4115    ///
4116    /// # Example
4117    /// ```ignore,no_run
4118    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
4119    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_project("example");
4120    /// ```
4121    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4122        self.project = v.into();
4123        self
4124    }
4125
4126    /// Sets the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
4127    ///
4128    /// # Example
4129    /// ```ignore,no_run
4130    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
4131    /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
4132    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_body(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */);
4133    /// ```
4134    pub fn set_body<T>(mut self, v: T) -> Self
4135    where
4136        T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
4137    {
4138        self.body = std::option::Option::Some(v.into());
4139        self
4140    }
4141
4142    /// Sets or clears the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
4143    ///
4144    /// # Example
4145    /// ```ignore,no_run
4146    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
4147    /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
4148    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(Some(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */));
4149    /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(None::<SqlInstancesRescheduleMaintenanceRequestBody>);
4150    /// ```
4151    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4152    where
4153        T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
4154    {
4155        self.body = v.map(|x| x.into());
4156        self
4157    }
4158}
4159
4160impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequest {
4161    fn typename() -> &'static str {
4162        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest"
4163    }
4164}
4165
4166/// Instance reencrypt request.
4167#[derive(Clone, Default, PartialEq)]
4168#[non_exhaustive]
4169pub struct SqlInstancesReencryptRequest {
4170    /// Cloud SQL instance ID. This does not include the project ID.
4171    pub instance: std::string::String,
4172
4173    /// ID of the project that contains the instance.
4174    pub project: std::string::String,
4175
4176    /// Reencrypt body that users request
4177    pub body: std::option::Option<crate::model::InstancesReencryptRequest>,
4178
4179    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4180}
4181
4182impl SqlInstancesReencryptRequest {
4183    pub fn new() -> Self {
4184        std::default::Default::default()
4185    }
4186
4187    /// Sets the value of [instance][crate::model::SqlInstancesReencryptRequest::instance].
4188    ///
4189    /// # Example
4190    /// ```ignore,no_run
4191    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
4192    /// let x = SqlInstancesReencryptRequest::new().set_instance("example");
4193    /// ```
4194    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4195        self.instance = v.into();
4196        self
4197    }
4198
4199    /// Sets the value of [project][crate::model::SqlInstancesReencryptRequest::project].
4200    ///
4201    /// # Example
4202    /// ```ignore,no_run
4203    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
4204    /// let x = SqlInstancesReencryptRequest::new().set_project("example");
4205    /// ```
4206    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4207        self.project = v.into();
4208        self
4209    }
4210
4211    /// Sets the value of [body][crate::model::SqlInstancesReencryptRequest::body].
4212    ///
4213    /// # Example
4214    /// ```ignore,no_run
4215    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
4216    /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
4217    /// let x = SqlInstancesReencryptRequest::new().set_body(InstancesReencryptRequest::default()/* use setters */);
4218    /// ```
4219    pub fn set_body<T>(mut self, v: T) -> Self
4220    where
4221        T: std::convert::Into<crate::model::InstancesReencryptRequest>,
4222    {
4223        self.body = std::option::Option::Some(v.into());
4224        self
4225    }
4226
4227    /// Sets or clears the value of [body][crate::model::SqlInstancesReencryptRequest::body].
4228    ///
4229    /// # Example
4230    /// ```ignore,no_run
4231    /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
4232    /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
4233    /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(Some(InstancesReencryptRequest::default()/* use setters */));
4234    /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(None::<InstancesReencryptRequest>);
4235    /// ```
4236    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4237    where
4238        T: std::convert::Into<crate::model::InstancesReencryptRequest>,
4239    {
4240        self.body = v.map(|x| x.into());
4241        self
4242    }
4243}
4244
4245impl wkt::message::Message for SqlInstancesReencryptRequest {
4246    fn typename() -> &'static str {
4247        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReencryptRequest"
4248    }
4249}
4250
4251/// Database Instance reencrypt request.
4252#[derive(Clone, Default, PartialEq)]
4253#[non_exhaustive]
4254pub struct InstancesReencryptRequest {
4255    /// Configuration specific to backup re-encryption
4256    pub backup_reencryption_config: std::option::Option<crate::model::BackupReencryptionConfig>,
4257
4258    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4259}
4260
4261impl InstancesReencryptRequest {
4262    pub fn new() -> Self {
4263        std::default::Default::default()
4264    }
4265
4266    /// Sets the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
4267    ///
4268    /// # Example
4269    /// ```ignore,no_run
4270    /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
4271    /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
4272    /// let x = InstancesReencryptRequest::new().set_backup_reencryption_config(BackupReencryptionConfig::default()/* use setters */);
4273    /// ```
4274    pub fn set_backup_reencryption_config<T>(mut self, v: T) -> Self
4275    where
4276        T: std::convert::Into<crate::model::BackupReencryptionConfig>,
4277    {
4278        self.backup_reencryption_config = std::option::Option::Some(v.into());
4279        self
4280    }
4281
4282    /// Sets or clears the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
4283    ///
4284    /// # Example
4285    /// ```ignore,no_run
4286    /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
4287    /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
4288    /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(Some(BackupReencryptionConfig::default()/* use setters */));
4289    /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(None::<BackupReencryptionConfig>);
4290    /// ```
4291    pub fn set_or_clear_backup_reencryption_config<T>(mut self, v: std::option::Option<T>) -> Self
4292    where
4293        T: std::convert::Into<crate::model::BackupReencryptionConfig>,
4294    {
4295        self.backup_reencryption_config = v.map(|x| x.into());
4296        self
4297    }
4298}
4299
4300impl wkt::message::Message for InstancesReencryptRequest {
4301    fn typename() -> &'static str {
4302        "type.googleapis.com/google.cloud.sql.v1.InstancesReencryptRequest"
4303    }
4304}
4305
4306/// Backup Reencryption Config
4307#[derive(Clone, Default, PartialEq)]
4308#[non_exhaustive]
4309pub struct BackupReencryptionConfig {
4310    /// Backup re-encryption limit
4311    pub backup_limit: std::option::Option<i32>,
4312
4313    /// Type of backups users want to re-encrypt.
4314    pub backup_type: std::option::Option<crate::model::backup_reencryption_config::BackupType>,
4315
4316    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4317}
4318
4319impl BackupReencryptionConfig {
4320    pub fn new() -> Self {
4321        std::default::Default::default()
4322    }
4323
4324    /// Sets the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
4325    ///
4326    /// # Example
4327    /// ```ignore,no_run
4328    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
4329    /// let x = BackupReencryptionConfig::new().set_backup_limit(42);
4330    /// ```
4331    pub fn set_backup_limit<T>(mut self, v: T) -> Self
4332    where
4333        T: std::convert::Into<i32>,
4334    {
4335        self.backup_limit = std::option::Option::Some(v.into());
4336        self
4337    }
4338
4339    /// Sets or clears the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
4340    ///
4341    /// # Example
4342    /// ```ignore,no_run
4343    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
4344    /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(Some(42));
4345    /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(None::<i32>);
4346    /// ```
4347    pub fn set_or_clear_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
4348    where
4349        T: std::convert::Into<i32>,
4350    {
4351        self.backup_limit = v.map(|x| x.into());
4352        self
4353    }
4354
4355    /// Sets the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
4356    ///
4357    /// # Example
4358    /// ```ignore,no_run
4359    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
4360    /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
4361    /// let x0 = BackupReencryptionConfig::new().set_backup_type(BackupType::Automated);
4362    /// let x1 = BackupReencryptionConfig::new().set_backup_type(BackupType::OnDemand);
4363    /// ```
4364    pub fn set_backup_type<T>(mut self, v: T) -> Self
4365    where
4366        T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
4367    {
4368        self.backup_type = std::option::Option::Some(v.into());
4369        self
4370    }
4371
4372    /// Sets or clears the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
4373    ///
4374    /// # Example
4375    /// ```ignore,no_run
4376    /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
4377    /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
4378    /// let x0 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::Automated));
4379    /// let x1 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::OnDemand));
4380    /// let x_none = BackupReencryptionConfig::new().set_or_clear_backup_type(None::<BackupType>);
4381    /// ```
4382    pub fn set_or_clear_backup_type<T>(mut self, v: std::option::Option<T>) -> Self
4383    where
4384        T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
4385    {
4386        self.backup_type = v.map(|x| x.into());
4387        self
4388    }
4389}
4390
4391impl wkt::message::Message for BackupReencryptionConfig {
4392    fn typename() -> &'static str {
4393        "type.googleapis.com/google.cloud.sql.v1.BackupReencryptionConfig"
4394    }
4395}
4396
4397/// Defines additional types related to [BackupReencryptionConfig].
4398pub mod backup_reencryption_config {
4399    #[allow(unused_imports)]
4400    use super::*;
4401
4402    /// Backup type for re-encryption
4403    ///
4404    /// # Working with unknown values
4405    ///
4406    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4407    /// additional enum variants at any time. Adding new variants is not considered
4408    /// a breaking change. Applications should write their code in anticipation of:
4409    ///
4410    /// - New values appearing in future releases of the client library, **and**
4411    /// - New values received dynamically, without application changes.
4412    ///
4413    /// Please consult the [Working with enums] section in the user guide for some
4414    /// guidelines.
4415    ///
4416    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4417    #[derive(Clone, Debug, PartialEq)]
4418    #[non_exhaustive]
4419    pub enum BackupType {
4420        /// Unknown backup type, will be defaulted to AUTOMATIC backup type
4421        Unspecified,
4422        /// Reencrypt automatic backups
4423        Automated,
4424        /// Reencrypt on-demand backups
4425        OnDemand,
4426        /// If set, the enum was initialized with an unknown value.
4427        ///
4428        /// Applications can examine the value using [BackupType::value] or
4429        /// [BackupType::name].
4430        UnknownValue(backup_type::UnknownValue),
4431    }
4432
4433    #[doc(hidden)]
4434    pub mod backup_type {
4435        #[allow(unused_imports)]
4436        use super::*;
4437        #[derive(Clone, Debug, PartialEq)]
4438        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4439    }
4440
4441    impl BackupType {
4442        /// Gets the enum value.
4443        ///
4444        /// Returns `None` if the enum contains an unknown value deserialized from
4445        /// the string representation of enums.
4446        pub fn value(&self) -> std::option::Option<i32> {
4447            match self {
4448                Self::Unspecified => std::option::Option::Some(0),
4449                Self::Automated => std::option::Option::Some(1),
4450                Self::OnDemand => std::option::Option::Some(2),
4451                Self::UnknownValue(u) => u.0.value(),
4452            }
4453        }
4454
4455        /// Gets the enum value as a string.
4456        ///
4457        /// Returns `None` if the enum contains an unknown value deserialized from
4458        /// the integer representation of enums.
4459        pub fn name(&self) -> std::option::Option<&str> {
4460            match self {
4461                Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
4462                Self::Automated => std::option::Option::Some("AUTOMATED"),
4463                Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
4464                Self::UnknownValue(u) => u.0.name(),
4465            }
4466        }
4467    }
4468
4469    impl std::default::Default for BackupType {
4470        fn default() -> Self {
4471            use std::convert::From;
4472            Self::from(0)
4473        }
4474    }
4475
4476    impl std::fmt::Display for BackupType {
4477        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4478            wkt::internal::display_enum(f, self.name(), self.value())
4479        }
4480    }
4481
4482    impl std::convert::From<i32> for BackupType {
4483        fn from(value: i32) -> Self {
4484            match value {
4485                0 => Self::Unspecified,
4486                1 => Self::Automated,
4487                2 => Self::OnDemand,
4488                _ => Self::UnknownValue(backup_type::UnknownValue(
4489                    wkt::internal::UnknownEnumValue::Integer(value),
4490                )),
4491            }
4492        }
4493    }
4494
4495    impl std::convert::From<&str> for BackupType {
4496        fn from(value: &str) -> Self {
4497            use std::string::ToString;
4498            match value {
4499                "BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
4500                "AUTOMATED" => Self::Automated,
4501                "ON_DEMAND" => Self::OnDemand,
4502                _ => Self::UnknownValue(backup_type::UnknownValue(
4503                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4504                )),
4505            }
4506        }
4507    }
4508
4509    impl serde::ser::Serialize for BackupType {
4510        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4511        where
4512            S: serde::Serializer,
4513        {
4514            match self {
4515                Self::Unspecified => serializer.serialize_i32(0),
4516                Self::Automated => serializer.serialize_i32(1),
4517                Self::OnDemand => serializer.serialize_i32(2),
4518                Self::UnknownValue(u) => u.0.serialize(serializer),
4519            }
4520        }
4521    }
4522
4523    impl<'de> serde::de::Deserialize<'de> for BackupType {
4524        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4525        where
4526            D: serde::Deserializer<'de>,
4527        {
4528            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
4529                ".google.cloud.sql.v1.BackupReencryptionConfig.BackupType",
4530            ))
4531        }
4532    }
4533}
4534
4535/// Instance get disk shrink config request.
4536#[derive(Clone, Default, PartialEq)]
4537#[non_exhaustive]
4538pub struct SqlInstancesGetDiskShrinkConfigRequest {
4539    /// Cloud SQL instance ID. This does not include the project ID.
4540    pub instance: std::string::String,
4541
4542    /// Project ID of the project that contains the instance.
4543    pub project: std::string::String,
4544
4545    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4546}
4547
4548impl SqlInstancesGetDiskShrinkConfigRequest {
4549    pub fn new() -> Self {
4550        std::default::Default::default()
4551    }
4552
4553    /// Sets the value of [instance][crate::model::SqlInstancesGetDiskShrinkConfigRequest::instance].
4554    ///
4555    /// # Example
4556    /// ```ignore,no_run
4557    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
4558    /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_instance("example");
4559    /// ```
4560    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4561        self.instance = v.into();
4562        self
4563    }
4564
4565    /// Sets the value of [project][crate::model::SqlInstancesGetDiskShrinkConfigRequest::project].
4566    ///
4567    /// # Example
4568    /// ```ignore,no_run
4569    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
4570    /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_project("example");
4571    /// ```
4572    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4573        self.project = v.into();
4574        self
4575    }
4576}
4577
4578impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigRequest {
4579    fn typename() -> &'static str {
4580        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest"
4581    }
4582}
4583
4584/// Instance verify external sync settings request.
4585#[derive(Clone, Default, PartialEq)]
4586#[non_exhaustive]
4587pub struct SqlInstancesVerifyExternalSyncSettingsRequest {
4588    /// Cloud SQL instance ID. This does not include the project ID.
4589    pub instance: std::string::String,
4590
4591    /// Project ID of the project that contains the instance.
4592    pub project: std::string::String,
4593
4594    /// Flag to enable verifying connection only
4595    pub verify_connection_only: bool,
4596
4597    /// External sync mode
4598    pub sync_mode:
4599        crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
4600
4601    /// Optional. Flag to verify settings required by replication setup only
4602    pub verify_replication_only: bool,
4603
4604    /// Optional. MigrationType configures the migration to use physical files or
4605    /// logical dump files. If not set, then the logical dump file configuration is
4606    /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
4607    pub migration_type:
4608        crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
4609
4610    /// Optional. Parallel level for initial data sync. Only applicable for
4611    /// PostgreSQL.
4612    pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
4613
4614    pub sync_config: std::option::Option<
4615        crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
4616    >,
4617
4618    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4619}
4620
4621impl SqlInstancesVerifyExternalSyncSettingsRequest {
4622    pub fn new() -> Self {
4623        std::default::Default::default()
4624    }
4625
4626    /// Sets the value of [instance][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::instance].
4627    ///
4628    /// # Example
4629    /// ```ignore,no_run
4630    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
4631    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_instance("example");
4632    /// ```
4633    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4634        self.instance = v.into();
4635        self
4636    }
4637
4638    /// Sets the value of [project][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::project].
4639    ///
4640    /// # Example
4641    /// ```ignore,no_run
4642    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
4643    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_project("example");
4644    /// ```
4645    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4646        self.project = v.into();
4647        self
4648    }
4649
4650    /// Sets the value of [verify_connection_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_connection_only].
4651    ///
4652    /// # Example
4653    /// ```ignore,no_run
4654    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
4655    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_connection_only(true);
4656    /// ```
4657    pub fn set_verify_connection_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4658        self.verify_connection_only = v.into();
4659        self
4660    }
4661
4662    /// Sets the value of [sync_mode][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_mode].
4663    ///
4664    /// # Example
4665    /// ```ignore,no_run
4666    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
4667    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
4668    /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Online);
4669    /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Offline);
4670    /// ```
4671    pub fn set_sync_mode<
4672        T: std::convert::Into<
4673                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
4674            >,
4675    >(
4676        mut self,
4677        v: T,
4678    ) -> Self {
4679        self.sync_mode = v.into();
4680        self
4681    }
4682
4683    /// Sets the value of [verify_replication_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_replication_only].
4684    ///
4685    /// # Example
4686    /// ```ignore,no_run
4687    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
4688    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_replication_only(true);
4689    /// ```
4690    pub fn set_verify_replication_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4691        self.verify_replication_only = v.into();
4692        self
4693    }
4694
4695    /// Sets the value of [migration_type][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::migration_type].
4696    ///
4697    /// # Example
4698    /// ```ignore,no_run
4699    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
4700    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
4701    /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Logical);
4702    /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Physical);
4703    /// ```
4704    pub fn set_migration_type<
4705        T: std::convert::Into<
4706                crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
4707            >,
4708    >(
4709        mut self,
4710        v: T,
4711    ) -> Self {
4712        self.migration_type = v.into();
4713        self
4714    }
4715
4716    /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_parallel_level].
4717    ///
4718    /// # Example
4719    /// ```ignore,no_run
4720    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
4721    /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
4722    /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
4723    /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
4724    /// let x2 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
4725    /// ```
4726    pub fn set_sync_parallel_level<
4727        T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
4728    >(
4729        mut self,
4730        v: T,
4731    ) -> Self {
4732        self.sync_parallel_level = v.into();
4733        self
4734    }
4735
4736    /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config].
4737    ///
4738    /// Note that all the setters affecting `sync_config` are mutually
4739    /// exclusive.
4740    ///
4741    /// # Example
4742    /// ```ignore,no_run
4743    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
4744    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
4745    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_config(Some(
4746    ///     google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
4747    /// ```
4748    pub fn set_sync_config<
4749        T: std::convert::Into<
4750                std::option::Option<
4751                    crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
4752                >,
4753            >,
4754    >(
4755        mut self,
4756        v: T,
4757    ) -> Self {
4758        self.sync_config = v.into();
4759        self
4760    }
4761
4762    /// The value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
4763    /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
4764    /// holds a different branch.
4765    pub fn mysql_sync_config(
4766        &self,
4767    ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
4768        #[allow(unreachable_patterns)]
4769        self.sync_config.as_ref().and_then(|v| match v {
4770            crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
4771            _ => std::option::Option::None,
4772        })
4773    }
4774
4775    /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
4776    /// to hold a `MysqlSyncConfig`.
4777    ///
4778    /// Note that all the setters affecting `sync_config` are
4779    /// mutually exclusive.
4780    ///
4781    /// # Example
4782    /// ```ignore,no_run
4783    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
4784    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
4785    /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
4786    /// assert!(x.mysql_sync_config().is_some());
4787    /// ```
4788    pub fn set_mysql_sync_config<
4789        T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
4790    >(
4791        mut self,
4792        v: T,
4793    ) -> Self {
4794        self.sync_config = std::option::Option::Some(
4795            crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(
4796                v.into()
4797            )
4798        );
4799        self
4800    }
4801}
4802
4803impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsRequest {
4804    fn typename() -> &'static str {
4805        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest"
4806    }
4807}
4808
4809/// Defines additional types related to [SqlInstancesVerifyExternalSyncSettingsRequest].
4810pub mod sql_instances_verify_external_sync_settings_request {
4811    #[allow(unused_imports)]
4812    use super::*;
4813
4814    ///
4815    /// # Working with unknown values
4816    ///
4817    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4818    /// additional enum variants at any time. Adding new variants is not considered
4819    /// a breaking change. Applications should write their code in anticipation of:
4820    ///
4821    /// - New values appearing in future releases of the client library, **and**
4822    /// - New values received dynamically, without application changes.
4823    ///
4824    /// Please consult the [Working with enums] section in the user guide for some
4825    /// guidelines.
4826    ///
4827    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4828    #[derive(Clone, Debug, PartialEq)]
4829    #[non_exhaustive]
4830    pub enum ExternalSyncMode {
4831        /// Unknown external sync mode, will be defaulted to ONLINE mode
4832        Unspecified,
4833        /// Online external sync will set up replication after initial data external
4834        /// sync
4835        Online,
4836        /// Offline external sync only dumps and loads a one-time snapshot of
4837        /// the primary instance's data
4838        Offline,
4839        /// If set, the enum was initialized with an unknown value.
4840        ///
4841        /// Applications can examine the value using [ExternalSyncMode::value] or
4842        /// [ExternalSyncMode::name].
4843        UnknownValue(external_sync_mode::UnknownValue),
4844    }
4845
4846    #[doc(hidden)]
4847    pub mod external_sync_mode {
4848        #[allow(unused_imports)]
4849        use super::*;
4850        #[derive(Clone, Debug, PartialEq)]
4851        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4852    }
4853
4854    impl ExternalSyncMode {
4855        /// Gets the enum value.
4856        ///
4857        /// Returns `None` if the enum contains an unknown value deserialized from
4858        /// the string representation of enums.
4859        pub fn value(&self) -> std::option::Option<i32> {
4860            match self {
4861                Self::Unspecified => std::option::Option::Some(0),
4862                Self::Online => std::option::Option::Some(1),
4863                Self::Offline => std::option::Option::Some(2),
4864                Self::UnknownValue(u) => u.0.value(),
4865            }
4866        }
4867
4868        /// Gets the enum value as a string.
4869        ///
4870        /// Returns `None` if the enum contains an unknown value deserialized from
4871        /// the integer representation of enums.
4872        pub fn name(&self) -> std::option::Option<&str> {
4873            match self {
4874                Self::Unspecified => std::option::Option::Some("EXTERNAL_SYNC_MODE_UNSPECIFIED"),
4875                Self::Online => std::option::Option::Some("ONLINE"),
4876                Self::Offline => std::option::Option::Some("OFFLINE"),
4877                Self::UnknownValue(u) => u.0.name(),
4878            }
4879        }
4880    }
4881
4882    impl std::default::Default for ExternalSyncMode {
4883        fn default() -> Self {
4884            use std::convert::From;
4885            Self::from(0)
4886        }
4887    }
4888
4889    impl std::fmt::Display for ExternalSyncMode {
4890        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4891            wkt::internal::display_enum(f, self.name(), self.value())
4892        }
4893    }
4894
4895    impl std::convert::From<i32> for ExternalSyncMode {
4896        fn from(value: i32) -> Self {
4897            match value {
4898                0 => Self::Unspecified,
4899                1 => Self::Online,
4900                2 => Self::Offline,
4901                _ => Self::UnknownValue(external_sync_mode::UnknownValue(
4902                    wkt::internal::UnknownEnumValue::Integer(value),
4903                )),
4904            }
4905        }
4906    }
4907
4908    impl std::convert::From<&str> for ExternalSyncMode {
4909        fn from(value: &str) -> Self {
4910            use std::string::ToString;
4911            match value {
4912                "EXTERNAL_SYNC_MODE_UNSPECIFIED" => Self::Unspecified,
4913                "ONLINE" => Self::Online,
4914                "OFFLINE" => Self::Offline,
4915                _ => Self::UnknownValue(external_sync_mode::UnknownValue(
4916                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4917                )),
4918            }
4919        }
4920    }
4921
4922    impl serde::ser::Serialize for ExternalSyncMode {
4923        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4924        where
4925            S: serde::Serializer,
4926        {
4927            match self {
4928                Self::Unspecified => serializer.serialize_i32(0),
4929                Self::Online => serializer.serialize_i32(1),
4930                Self::Offline => serializer.serialize_i32(2),
4931                Self::UnknownValue(u) => u.0.serialize(serializer),
4932            }
4933        }
4934    }
4935
4936    impl<'de> serde::de::Deserialize<'de> for ExternalSyncMode {
4937        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4938        where
4939            D: serde::Deserializer<'de>,
4940        {
4941            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExternalSyncMode>::new(
4942                ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode"))
4943        }
4944    }
4945
4946    /// MigrationType determines whether the migration is a physical file-based
4947    /// migration or a logical dump file-based migration.
4948    ///
4949    /// # Working with unknown values
4950    ///
4951    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4952    /// additional enum variants at any time. Adding new variants is not considered
4953    /// a breaking change. Applications should write their code in anticipation of:
4954    ///
4955    /// - New values appearing in future releases of the client library, **and**
4956    /// - New values received dynamically, without application changes.
4957    ///
4958    /// Please consult the [Working with enums] section in the user guide for some
4959    /// guidelines.
4960    ///
4961    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4962    #[derive(Clone, Debug, PartialEq)]
4963    #[non_exhaustive]
4964    pub enum MigrationType {
4965        /// Default value is a logical dump file-based migration
4966        Unspecified,
4967        /// Logical dump file-based migration
4968        Logical,
4969        /// Physical file-based migration
4970        Physical,
4971        /// If set, the enum was initialized with an unknown value.
4972        ///
4973        /// Applications can examine the value using [MigrationType::value] or
4974        /// [MigrationType::name].
4975        UnknownValue(migration_type::UnknownValue),
4976    }
4977
4978    #[doc(hidden)]
4979    pub mod migration_type {
4980        #[allow(unused_imports)]
4981        use super::*;
4982        #[derive(Clone, Debug, PartialEq)]
4983        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4984    }
4985
4986    impl MigrationType {
4987        /// Gets the enum value.
4988        ///
4989        /// Returns `None` if the enum contains an unknown value deserialized from
4990        /// the string representation of enums.
4991        pub fn value(&self) -> std::option::Option<i32> {
4992            match self {
4993                Self::Unspecified => std::option::Option::Some(0),
4994                Self::Logical => std::option::Option::Some(1),
4995                Self::Physical => std::option::Option::Some(2),
4996                Self::UnknownValue(u) => u.0.value(),
4997            }
4998        }
4999
5000        /// Gets the enum value as a string.
5001        ///
5002        /// Returns `None` if the enum contains an unknown value deserialized from
5003        /// the integer representation of enums.
5004        pub fn name(&self) -> std::option::Option<&str> {
5005            match self {
5006                Self::Unspecified => std::option::Option::Some("MIGRATION_TYPE_UNSPECIFIED"),
5007                Self::Logical => std::option::Option::Some("LOGICAL"),
5008                Self::Physical => std::option::Option::Some("PHYSICAL"),
5009                Self::UnknownValue(u) => u.0.name(),
5010            }
5011        }
5012    }
5013
5014    impl std::default::Default for MigrationType {
5015        fn default() -> Self {
5016            use std::convert::From;
5017            Self::from(0)
5018        }
5019    }
5020
5021    impl std::fmt::Display for MigrationType {
5022        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5023            wkt::internal::display_enum(f, self.name(), self.value())
5024        }
5025    }
5026
5027    impl std::convert::From<i32> for MigrationType {
5028        fn from(value: i32) -> Self {
5029            match value {
5030                0 => Self::Unspecified,
5031                1 => Self::Logical,
5032                2 => Self::Physical,
5033                _ => Self::UnknownValue(migration_type::UnknownValue(
5034                    wkt::internal::UnknownEnumValue::Integer(value),
5035                )),
5036            }
5037        }
5038    }
5039
5040    impl std::convert::From<&str> for MigrationType {
5041        fn from(value: &str) -> Self {
5042            use std::string::ToString;
5043            match value {
5044                "MIGRATION_TYPE_UNSPECIFIED" => Self::Unspecified,
5045                "LOGICAL" => Self::Logical,
5046                "PHYSICAL" => Self::Physical,
5047                _ => Self::UnknownValue(migration_type::UnknownValue(
5048                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5049                )),
5050            }
5051        }
5052    }
5053
5054    impl serde::ser::Serialize for MigrationType {
5055        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5056        where
5057            S: serde::Serializer,
5058        {
5059            match self {
5060                Self::Unspecified => serializer.serialize_i32(0),
5061                Self::Logical => serializer.serialize_i32(1),
5062                Self::Physical => serializer.serialize_i32(2),
5063                Self::UnknownValue(u) => u.0.serialize(serializer),
5064            }
5065        }
5066    }
5067
5068    impl<'de> serde::de::Deserialize<'de> for MigrationType {
5069        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5070        where
5071            D: serde::Deserializer<'de>,
5072        {
5073            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationType>::new(
5074                ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType",
5075            ))
5076        }
5077    }
5078
5079    #[derive(Clone, Debug, PartialEq)]
5080    #[non_exhaustive]
5081    pub enum SyncConfig {
5082        /// Optional. MySQL-specific settings for start external sync.
5083        MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
5084    }
5085}
5086
5087/// Instance start external sync request.
5088#[derive(Clone, Default, PartialEq)]
5089#[non_exhaustive]
5090pub struct SqlInstancesStartExternalSyncRequest {
5091    /// Cloud SQL instance ID. This does not include the project ID.
5092    pub instance: std::string::String,
5093
5094    /// ID of the project that contains the instance.
5095    pub project: std::string::String,
5096
5097    /// External sync mode.
5098    pub sync_mode:
5099        crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
5100
5101    /// Whether to skip the verification step (VESS).
5102    pub skip_verification: bool,
5103
5104    /// Optional. Parallel level for initial data sync. Currently only applicable
5105    /// for MySQL.
5106    pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
5107
5108    /// Optional. MigrationType configures the migration to use physical files or
5109    /// logical dump files. If not set, then the logical dump file configuration is
5110    /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
5111    pub migration_type:
5112        crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
5113
5114    pub sync_config:
5115        std::option::Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>,
5116
5117    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5118}
5119
5120impl SqlInstancesStartExternalSyncRequest {
5121    pub fn new() -> Self {
5122        std::default::Default::default()
5123    }
5124
5125    /// Sets the value of [instance][crate::model::SqlInstancesStartExternalSyncRequest::instance].
5126    ///
5127    /// # Example
5128    /// ```ignore,no_run
5129    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
5130    /// let x = SqlInstancesStartExternalSyncRequest::new().set_instance("example");
5131    /// ```
5132    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5133        self.instance = v.into();
5134        self
5135    }
5136
5137    /// Sets the value of [project][crate::model::SqlInstancesStartExternalSyncRequest::project].
5138    ///
5139    /// # Example
5140    /// ```ignore,no_run
5141    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
5142    /// let x = SqlInstancesStartExternalSyncRequest::new().set_project("example");
5143    /// ```
5144    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5145        self.project = v.into();
5146        self
5147    }
5148
5149    /// Sets the value of [sync_mode][crate::model::SqlInstancesStartExternalSyncRequest::sync_mode].
5150    ///
5151    /// # Example
5152    /// ```ignore,no_run
5153    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
5154    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
5155    /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Online);
5156    /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Offline);
5157    /// ```
5158    pub fn set_sync_mode<
5159        T: std::convert::Into<
5160                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
5161            >,
5162    >(
5163        mut self,
5164        v: T,
5165    ) -> Self {
5166        self.sync_mode = v.into();
5167        self
5168    }
5169
5170    /// Sets the value of [skip_verification][crate::model::SqlInstancesStartExternalSyncRequest::skip_verification].
5171    ///
5172    /// # Example
5173    /// ```ignore,no_run
5174    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
5175    /// let x = SqlInstancesStartExternalSyncRequest::new().set_skip_verification(true);
5176    /// ```
5177    pub fn set_skip_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5178        self.skip_verification = v.into();
5179        self
5180    }
5181
5182    /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesStartExternalSyncRequest::sync_parallel_level].
5183    ///
5184    /// # Example
5185    /// ```ignore,no_run
5186    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
5187    /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
5188    /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
5189    /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
5190    /// let x2 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
5191    /// ```
5192    pub fn set_sync_parallel_level<
5193        T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
5194    >(
5195        mut self,
5196        v: T,
5197    ) -> Self {
5198        self.sync_parallel_level = v.into();
5199        self
5200    }
5201
5202    /// Sets the value of [migration_type][crate::model::SqlInstancesStartExternalSyncRequest::migration_type].
5203    ///
5204    /// # Example
5205    /// ```ignore,no_run
5206    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
5207    /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
5208    /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Logical);
5209    /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Physical);
5210    /// ```
5211    pub fn set_migration_type<
5212        T: std::convert::Into<
5213                crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
5214            >,
5215    >(
5216        mut self,
5217        v: T,
5218    ) -> Self {
5219        self.migration_type = v.into();
5220        self
5221    }
5222
5223    /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config].
5224    ///
5225    /// Note that all the setters affecting `sync_config` are mutually
5226    /// exclusive.
5227    ///
5228    /// # Example
5229    /// ```ignore,no_run
5230    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
5231    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
5232    /// let x = SqlInstancesStartExternalSyncRequest::new().set_sync_config(Some(
5233    ///     google_cloud_sql_v1::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
5234    /// ```
5235    pub fn set_sync_config<
5236        T: std::convert::Into<
5237                std::option::Option<
5238                    crate::model::sql_instances_start_external_sync_request::SyncConfig,
5239                >,
5240            >,
5241    >(
5242        mut self,
5243        v: T,
5244    ) -> Self {
5245        self.sync_config = v.into();
5246        self
5247    }
5248
5249    /// The value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
5250    /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
5251    /// holds a different branch.
5252    pub fn mysql_sync_config(
5253        &self,
5254    ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
5255        #[allow(unreachable_patterns)]
5256        self.sync_config.as_ref().and_then(|v| match v {
5257            crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
5258            _ => std::option::Option::None,
5259        })
5260    }
5261
5262    /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
5263    /// to hold a `MysqlSyncConfig`.
5264    ///
5265    /// Note that all the setters affecting `sync_config` are
5266    /// mutually exclusive.
5267    ///
5268    /// # Example
5269    /// ```ignore,no_run
5270    /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
5271    /// use google_cloud_sql_v1::model::MySqlSyncConfig;
5272    /// let x = SqlInstancesStartExternalSyncRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
5273    /// assert!(x.mysql_sync_config().is_some());
5274    /// ```
5275    pub fn set_mysql_sync_config<
5276        T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
5277    >(
5278        mut self,
5279        v: T,
5280    ) -> Self {
5281        self.sync_config = std::option::Option::Some(
5282            crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(
5283                v.into(),
5284            ),
5285        );
5286        self
5287    }
5288}
5289
5290impl wkt::message::Message for SqlInstancesStartExternalSyncRequest {
5291    fn typename() -> &'static str {
5292        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest"
5293    }
5294}
5295
5296/// Defines additional types related to [SqlInstancesStartExternalSyncRequest].
5297pub mod sql_instances_start_external_sync_request {
5298    #[allow(unused_imports)]
5299    use super::*;
5300
5301    #[derive(Clone, Debug, PartialEq)]
5302    #[non_exhaustive]
5303    pub enum SyncConfig {
5304        /// MySQL-specific settings for start external sync.
5305        MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
5306    }
5307}
5308
5309/// Instance reset replica size request.
5310#[derive(Clone, Default, PartialEq)]
5311#[non_exhaustive]
5312pub struct SqlInstancesResetReplicaSizeRequest {
5313    /// Cloud SQL read replica instance name.
5314    pub instance: std::string::String,
5315
5316    /// ID of the project that contains the read replica.
5317    pub project: std::string::String,
5318
5319    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5320}
5321
5322impl SqlInstancesResetReplicaSizeRequest {
5323    pub fn new() -> Self {
5324        std::default::Default::default()
5325    }
5326
5327    /// Sets the value of [instance][crate::model::SqlInstancesResetReplicaSizeRequest::instance].
5328    ///
5329    /// # Example
5330    /// ```ignore,no_run
5331    /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
5332    /// let x = SqlInstancesResetReplicaSizeRequest::new().set_instance("example");
5333    /// ```
5334    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5335        self.instance = v.into();
5336        self
5337    }
5338
5339    /// Sets the value of [project][crate::model::SqlInstancesResetReplicaSizeRequest::project].
5340    ///
5341    /// # Example
5342    /// ```ignore,no_run
5343    /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
5344    /// let x = SqlInstancesResetReplicaSizeRequest::new().set_project("example");
5345    /// ```
5346    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5347        self.project = v.into();
5348        self
5349    }
5350}
5351
5352impl wkt::message::Message for SqlInstancesResetReplicaSizeRequest {
5353    fn typename() -> &'static str {
5354        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest"
5355    }
5356}
5357
5358/// Instance create ephemeral certificate request.
5359#[derive(Clone, Default, PartialEq)]
5360#[non_exhaustive]
5361pub struct SqlInstancesCreateEphemeralCertRequest {
5362    /// Cloud SQL instance ID. This does not include the project ID.
5363    pub instance: std::string::String,
5364
5365    /// Project ID of the Cloud SQL project.
5366    pub project: std::string::String,
5367
5368    pub body: std::option::Option<crate::model::SslCertsCreateEphemeralRequest>,
5369
5370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5371}
5372
5373impl SqlInstancesCreateEphemeralCertRequest {
5374    pub fn new() -> Self {
5375        std::default::Default::default()
5376    }
5377
5378    /// Sets the value of [instance][crate::model::SqlInstancesCreateEphemeralCertRequest::instance].
5379    ///
5380    /// # Example
5381    /// ```ignore,no_run
5382    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
5383    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_instance("example");
5384    /// ```
5385    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5386        self.instance = v.into();
5387        self
5388    }
5389
5390    /// Sets the value of [project][crate::model::SqlInstancesCreateEphemeralCertRequest::project].
5391    ///
5392    /// # Example
5393    /// ```ignore,no_run
5394    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
5395    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_project("example");
5396    /// ```
5397    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5398        self.project = v.into();
5399        self
5400    }
5401
5402    /// Sets the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
5403    ///
5404    /// # Example
5405    /// ```ignore,no_run
5406    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
5407    /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
5408    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_body(SslCertsCreateEphemeralRequest::default()/* use setters */);
5409    /// ```
5410    pub fn set_body<T>(mut self, v: T) -> Self
5411    where
5412        T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
5413    {
5414        self.body = std::option::Option::Some(v.into());
5415        self
5416    }
5417
5418    /// Sets or clears the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
5419    ///
5420    /// # Example
5421    /// ```ignore,no_run
5422    /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
5423    /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
5424    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(Some(SslCertsCreateEphemeralRequest::default()/* use setters */));
5425    /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(None::<SslCertsCreateEphemeralRequest>);
5426    /// ```
5427    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5428    where
5429        T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
5430    {
5431        self.body = v.map(|x| x.into());
5432        self
5433    }
5434}
5435
5436impl wkt::message::Message for SqlInstancesCreateEphemeralCertRequest {
5437    fn typename() -> &'static str {
5438        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest"
5439    }
5440}
5441
5442/// Database instance clone request.
5443#[derive(Clone, Default, PartialEq)]
5444#[non_exhaustive]
5445pub struct InstancesCloneRequest {
5446    /// Contains details about the clone operation.
5447    pub clone_context: std::option::Option<crate::model::CloneContext>,
5448
5449    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5450}
5451
5452impl InstancesCloneRequest {
5453    pub fn new() -> Self {
5454        std::default::Default::default()
5455    }
5456
5457    /// Sets the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
5458    ///
5459    /// # Example
5460    /// ```ignore,no_run
5461    /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
5462    /// use google_cloud_sql_v1::model::CloneContext;
5463    /// let x = InstancesCloneRequest::new().set_clone_context(CloneContext::default()/* use setters */);
5464    /// ```
5465    pub fn set_clone_context<T>(mut self, v: T) -> Self
5466    where
5467        T: std::convert::Into<crate::model::CloneContext>,
5468    {
5469        self.clone_context = std::option::Option::Some(v.into());
5470        self
5471    }
5472
5473    /// Sets or clears the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
5474    ///
5475    /// # Example
5476    /// ```ignore,no_run
5477    /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
5478    /// use google_cloud_sql_v1::model::CloneContext;
5479    /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(Some(CloneContext::default()/* use setters */));
5480    /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(None::<CloneContext>);
5481    /// ```
5482    pub fn set_or_clear_clone_context<T>(mut self, v: std::option::Option<T>) -> Self
5483    where
5484        T: std::convert::Into<crate::model::CloneContext>,
5485    {
5486        self.clone_context = v.map(|x| x.into());
5487        self
5488    }
5489}
5490
5491impl wkt::message::Message for InstancesCloneRequest {
5492    fn typename() -> &'static str {
5493        "type.googleapis.com/google.cloud.sql.v1.InstancesCloneRequest"
5494    }
5495}
5496
5497/// Database demote primary instance request.
5498#[derive(Clone, Default, PartialEq)]
5499#[non_exhaustive]
5500pub struct InstancesDemoteMasterRequest {
5501    /// Contains details about the demoteMaster operation.
5502    pub demote_master_context: std::option::Option<crate::model::DemoteMasterContext>,
5503
5504    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5505}
5506
5507impl InstancesDemoteMasterRequest {
5508    pub fn new() -> Self {
5509        std::default::Default::default()
5510    }
5511
5512    /// Sets the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
5513    ///
5514    /// # Example
5515    /// ```ignore,no_run
5516    /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
5517    /// use google_cloud_sql_v1::model::DemoteMasterContext;
5518    /// let x = InstancesDemoteMasterRequest::new().set_demote_master_context(DemoteMasterContext::default()/* use setters */);
5519    /// ```
5520    pub fn set_demote_master_context<T>(mut self, v: T) -> Self
5521    where
5522        T: std::convert::Into<crate::model::DemoteMasterContext>,
5523    {
5524        self.demote_master_context = std::option::Option::Some(v.into());
5525        self
5526    }
5527
5528    /// Sets or clears the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
5529    ///
5530    /// # Example
5531    /// ```ignore,no_run
5532    /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
5533    /// use google_cloud_sql_v1::model::DemoteMasterContext;
5534    /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(Some(DemoteMasterContext::default()/* use setters */));
5535    /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(None::<DemoteMasterContext>);
5536    /// ```
5537    pub fn set_or_clear_demote_master_context<T>(mut self, v: std::option::Option<T>) -> Self
5538    where
5539        T: std::convert::Into<crate::model::DemoteMasterContext>,
5540    {
5541        self.demote_master_context = v.map(|x| x.into());
5542        self
5543    }
5544}
5545
5546impl wkt::message::Message for InstancesDemoteMasterRequest {
5547    fn typename() -> &'static str {
5548        "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteMasterRequest"
5549    }
5550}
5551
5552/// This request is used to demote an existing standalone instance to be a
5553/// Cloud SQL read replica for an external database server.
5554#[derive(Clone, Default, PartialEq)]
5555#[non_exhaustive]
5556pub struct InstancesDemoteRequest {
5557    /// Required. Contains details about the demote operation.
5558    pub demote_context: std::option::Option<crate::model::DemoteContext>,
5559
5560    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5561}
5562
5563impl InstancesDemoteRequest {
5564    pub fn new() -> Self {
5565        std::default::Default::default()
5566    }
5567
5568    /// Sets the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
5569    ///
5570    /// # Example
5571    /// ```ignore,no_run
5572    /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
5573    /// use google_cloud_sql_v1::model::DemoteContext;
5574    /// let x = InstancesDemoteRequest::new().set_demote_context(DemoteContext::default()/* use setters */);
5575    /// ```
5576    pub fn set_demote_context<T>(mut self, v: T) -> Self
5577    where
5578        T: std::convert::Into<crate::model::DemoteContext>,
5579    {
5580        self.demote_context = std::option::Option::Some(v.into());
5581        self
5582    }
5583
5584    /// Sets or clears the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
5585    ///
5586    /// # Example
5587    /// ```ignore,no_run
5588    /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
5589    /// use google_cloud_sql_v1::model::DemoteContext;
5590    /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(Some(DemoteContext::default()/* use setters */));
5591    /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(None::<DemoteContext>);
5592    /// ```
5593    pub fn set_or_clear_demote_context<T>(mut self, v: std::option::Option<T>) -> Self
5594    where
5595        T: std::convert::Into<crate::model::DemoteContext>,
5596    {
5597        self.demote_context = v.map(|x| x.into());
5598        self
5599    }
5600}
5601
5602impl wkt::message::Message for InstancesDemoteRequest {
5603    fn typename() -> &'static str {
5604        "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteRequest"
5605    }
5606}
5607
5608/// Database instance export request.
5609#[derive(Clone, Default, PartialEq)]
5610#[non_exhaustive]
5611pub struct InstancesExportRequest {
5612    /// Contains details about the export operation.
5613    pub export_context: std::option::Option<crate::model::ExportContext>,
5614
5615    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5616}
5617
5618impl InstancesExportRequest {
5619    pub fn new() -> Self {
5620        std::default::Default::default()
5621    }
5622
5623    /// Sets the value of [export_context][crate::model::InstancesExportRequest::export_context].
5624    ///
5625    /// # Example
5626    /// ```ignore,no_run
5627    /// # use google_cloud_sql_v1::model::InstancesExportRequest;
5628    /// use google_cloud_sql_v1::model::ExportContext;
5629    /// let x = InstancesExportRequest::new().set_export_context(ExportContext::default()/* use setters */);
5630    /// ```
5631    pub fn set_export_context<T>(mut self, v: T) -> Self
5632    where
5633        T: std::convert::Into<crate::model::ExportContext>,
5634    {
5635        self.export_context = std::option::Option::Some(v.into());
5636        self
5637    }
5638
5639    /// Sets or clears the value of [export_context][crate::model::InstancesExportRequest::export_context].
5640    ///
5641    /// # Example
5642    /// ```ignore,no_run
5643    /// # use google_cloud_sql_v1::model::InstancesExportRequest;
5644    /// use google_cloud_sql_v1::model::ExportContext;
5645    /// let x = InstancesExportRequest::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
5646    /// let x = InstancesExportRequest::new().set_or_clear_export_context(None::<ExportContext>);
5647    /// ```
5648    pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
5649    where
5650        T: std::convert::Into<crate::model::ExportContext>,
5651    {
5652        self.export_context = v.map(|x| x.into());
5653        self
5654    }
5655}
5656
5657impl wkt::message::Message for InstancesExportRequest {
5658    fn typename() -> &'static str {
5659        "type.googleapis.com/google.cloud.sql.v1.InstancesExportRequest"
5660    }
5661}
5662
5663/// Instance failover request.
5664#[derive(Clone, Default, PartialEq)]
5665#[non_exhaustive]
5666pub struct InstancesFailoverRequest {
5667    /// Failover Context.
5668    pub failover_context: std::option::Option<crate::model::FailoverContext>,
5669
5670    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5671}
5672
5673impl InstancesFailoverRequest {
5674    pub fn new() -> Self {
5675        std::default::Default::default()
5676    }
5677
5678    /// Sets the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
5679    ///
5680    /// # Example
5681    /// ```ignore,no_run
5682    /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
5683    /// use google_cloud_sql_v1::model::FailoverContext;
5684    /// let x = InstancesFailoverRequest::new().set_failover_context(FailoverContext::default()/* use setters */);
5685    /// ```
5686    pub fn set_failover_context<T>(mut self, v: T) -> Self
5687    where
5688        T: std::convert::Into<crate::model::FailoverContext>,
5689    {
5690        self.failover_context = std::option::Option::Some(v.into());
5691        self
5692    }
5693
5694    /// Sets or clears the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
5695    ///
5696    /// # Example
5697    /// ```ignore,no_run
5698    /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
5699    /// use google_cloud_sql_v1::model::FailoverContext;
5700    /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(Some(FailoverContext::default()/* use setters */));
5701    /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(None::<FailoverContext>);
5702    /// ```
5703    pub fn set_or_clear_failover_context<T>(mut self, v: std::option::Option<T>) -> Self
5704    where
5705        T: std::convert::Into<crate::model::FailoverContext>,
5706    {
5707        self.failover_context = v.map(|x| x.into());
5708        self
5709    }
5710}
5711
5712impl wkt::message::Message for InstancesFailoverRequest {
5713    fn typename() -> &'static str {
5714        "type.googleapis.com/google.cloud.sql.v1.InstancesFailoverRequest"
5715    }
5716}
5717
5718/// SslCerts create ephemeral certificate request.
5719#[derive(Clone, Default, PartialEq)]
5720#[non_exhaustive]
5721pub struct SslCertsCreateEphemeralRequest {
5722    /// PEM encoded public key to include in the signed certificate.
5723    pub public_key: std::string::String,
5724
5725    /// Access token to include in the signed certificate.
5726    pub access_token: std::string::String,
5727
5728    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5729}
5730
5731impl SslCertsCreateEphemeralRequest {
5732    pub fn new() -> Self {
5733        std::default::Default::default()
5734    }
5735
5736    /// Sets the value of [public_key][crate::model::SslCertsCreateEphemeralRequest::public_key].
5737    ///
5738    /// # Example
5739    /// ```ignore,no_run
5740    /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
5741    /// let x = SslCertsCreateEphemeralRequest::new().set_public_key("example");
5742    /// ```
5743    pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5744        self.public_key = v.into();
5745        self
5746    }
5747
5748    /// Sets the value of [access_token][crate::model::SslCertsCreateEphemeralRequest::access_token].
5749    ///
5750    /// # Example
5751    /// ```ignore,no_run
5752    /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
5753    /// let x = SslCertsCreateEphemeralRequest::new().set_access_token("example");
5754    /// ```
5755    pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5756        self.access_token = v.into();
5757        self
5758    }
5759}
5760
5761impl wkt::message::Message for SslCertsCreateEphemeralRequest {
5762    fn typename() -> &'static str {
5763        "type.googleapis.com/google.cloud.sql.v1.SslCertsCreateEphemeralRequest"
5764    }
5765}
5766
5767/// Database instance import request.
5768#[derive(Clone, Default, PartialEq)]
5769#[non_exhaustive]
5770pub struct InstancesImportRequest {
5771    /// Contains details about the import operation.
5772    pub import_context: std::option::Option<crate::model::ImportContext>,
5773
5774    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5775}
5776
5777impl InstancesImportRequest {
5778    pub fn new() -> Self {
5779        std::default::Default::default()
5780    }
5781
5782    /// Sets the value of [import_context][crate::model::InstancesImportRequest::import_context].
5783    ///
5784    /// # Example
5785    /// ```ignore,no_run
5786    /// # use google_cloud_sql_v1::model::InstancesImportRequest;
5787    /// use google_cloud_sql_v1::model::ImportContext;
5788    /// let x = InstancesImportRequest::new().set_import_context(ImportContext::default()/* use setters */);
5789    /// ```
5790    pub fn set_import_context<T>(mut self, v: T) -> Self
5791    where
5792        T: std::convert::Into<crate::model::ImportContext>,
5793    {
5794        self.import_context = std::option::Option::Some(v.into());
5795        self
5796    }
5797
5798    /// Sets or clears the value of [import_context][crate::model::InstancesImportRequest::import_context].
5799    ///
5800    /// # Example
5801    /// ```ignore,no_run
5802    /// # use google_cloud_sql_v1::model::InstancesImportRequest;
5803    /// use google_cloud_sql_v1::model::ImportContext;
5804    /// let x = InstancesImportRequest::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
5805    /// let x = InstancesImportRequest::new().set_or_clear_import_context(None::<ImportContext>);
5806    /// ```
5807    pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
5808    where
5809        T: std::convert::Into<crate::model::ImportContext>,
5810    {
5811        self.import_context = v.map(|x| x.into());
5812        self
5813    }
5814}
5815
5816impl wkt::message::Message for InstancesImportRequest {
5817    fn typename() -> &'static str {
5818        "type.googleapis.com/google.cloud.sql.v1.InstancesImportRequest"
5819    }
5820}
5821
5822/// Database instances list response.
5823#[derive(Clone, Default, PartialEq)]
5824#[non_exhaustive]
5825pub struct InstancesListResponse {
5826    /// This is always `sql#instancesList`.
5827    pub kind: std::string::String,
5828
5829    /// List of warnings that occurred while handling the request.
5830    pub warnings: std::vec::Vec<crate::model::ApiWarning>,
5831
5832    /// List of database instance resources.
5833    pub items: std::vec::Vec<crate::model::DatabaseInstance>,
5834
5835    /// The continuation token, used to page through large result sets. Provide
5836    /// this value in a subsequent request to return the next page of results.
5837    pub next_page_token: std::string::String,
5838
5839    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5840}
5841
5842impl InstancesListResponse {
5843    pub fn new() -> Self {
5844        std::default::Default::default()
5845    }
5846
5847    /// Sets the value of [kind][crate::model::InstancesListResponse::kind].
5848    ///
5849    /// # Example
5850    /// ```ignore,no_run
5851    /// # use google_cloud_sql_v1::model::InstancesListResponse;
5852    /// let x = InstancesListResponse::new().set_kind("example");
5853    /// ```
5854    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5855        self.kind = v.into();
5856        self
5857    }
5858
5859    /// Sets the value of [warnings][crate::model::InstancesListResponse::warnings].
5860    ///
5861    /// # Example
5862    /// ```ignore,no_run
5863    /// # use google_cloud_sql_v1::model::InstancesListResponse;
5864    /// use google_cloud_sql_v1::model::ApiWarning;
5865    /// let x = InstancesListResponse::new()
5866    ///     .set_warnings([
5867    ///         ApiWarning::default()/* use setters */,
5868    ///         ApiWarning::default()/* use (different) setters */,
5869    ///     ]);
5870    /// ```
5871    pub fn set_warnings<T, V>(mut self, v: T) -> Self
5872    where
5873        T: std::iter::IntoIterator<Item = V>,
5874        V: std::convert::Into<crate::model::ApiWarning>,
5875    {
5876        use std::iter::Iterator;
5877        self.warnings = v.into_iter().map(|i| i.into()).collect();
5878        self
5879    }
5880
5881    /// Sets the value of [items][crate::model::InstancesListResponse::items].
5882    ///
5883    /// # Example
5884    /// ```ignore,no_run
5885    /// # use google_cloud_sql_v1::model::InstancesListResponse;
5886    /// use google_cloud_sql_v1::model::DatabaseInstance;
5887    /// let x = InstancesListResponse::new()
5888    ///     .set_items([
5889    ///         DatabaseInstance::default()/* use setters */,
5890    ///         DatabaseInstance::default()/* use (different) setters */,
5891    ///     ]);
5892    /// ```
5893    pub fn set_items<T, V>(mut self, v: T) -> Self
5894    where
5895        T: std::iter::IntoIterator<Item = V>,
5896        V: std::convert::Into<crate::model::DatabaseInstance>,
5897    {
5898        use std::iter::Iterator;
5899        self.items = v.into_iter().map(|i| i.into()).collect();
5900        self
5901    }
5902
5903    /// Sets the value of [next_page_token][crate::model::InstancesListResponse::next_page_token].
5904    ///
5905    /// # Example
5906    /// ```ignore,no_run
5907    /// # use google_cloud_sql_v1::model::InstancesListResponse;
5908    /// let x = InstancesListResponse::new().set_next_page_token("example");
5909    /// ```
5910    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5911        self.next_page_token = v.into();
5912        self
5913    }
5914}
5915
5916impl wkt::message::Message for InstancesListResponse {
5917    fn typename() -> &'static str {
5918        "type.googleapis.com/google.cloud.sql.v1.InstancesListResponse"
5919    }
5920}
5921
5922#[doc(hidden)]
5923impl gax::paginator::internal::PageableResponse for InstancesListResponse {
5924    type PageItem = crate::model::DatabaseInstance;
5925
5926    fn items(self) -> std::vec::Vec<Self::PageItem> {
5927        self.items
5928    }
5929
5930    fn next_page_token(&self) -> std::string::String {
5931        use std::clone::Clone;
5932        self.next_page_token.clone()
5933    }
5934}
5935
5936/// Instances ListServerCas response.
5937#[derive(Clone, Default, PartialEq)]
5938#[non_exhaustive]
5939pub struct InstancesListServerCasResponse {
5940    /// List of server CA certificates for the instance.
5941    pub certs: std::vec::Vec<crate::model::SslCert>,
5942
5943    pub active_version: std::string::String,
5944
5945    /// This is always `sql#instancesListServerCas`.
5946    pub kind: std::string::String,
5947
5948    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5949}
5950
5951impl InstancesListServerCasResponse {
5952    pub fn new() -> Self {
5953        std::default::Default::default()
5954    }
5955
5956    /// Sets the value of [certs][crate::model::InstancesListServerCasResponse::certs].
5957    ///
5958    /// # Example
5959    /// ```ignore,no_run
5960    /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
5961    /// use google_cloud_sql_v1::model::SslCert;
5962    /// let x = InstancesListServerCasResponse::new()
5963    ///     .set_certs([
5964    ///         SslCert::default()/* use setters */,
5965    ///         SslCert::default()/* use (different) setters */,
5966    ///     ]);
5967    /// ```
5968    pub fn set_certs<T, V>(mut self, v: T) -> Self
5969    where
5970        T: std::iter::IntoIterator<Item = V>,
5971        V: std::convert::Into<crate::model::SslCert>,
5972    {
5973        use std::iter::Iterator;
5974        self.certs = v.into_iter().map(|i| i.into()).collect();
5975        self
5976    }
5977
5978    /// Sets the value of [active_version][crate::model::InstancesListServerCasResponse::active_version].
5979    ///
5980    /// # Example
5981    /// ```ignore,no_run
5982    /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
5983    /// let x = InstancesListServerCasResponse::new().set_active_version("example");
5984    /// ```
5985    pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5986        self.active_version = v.into();
5987        self
5988    }
5989
5990    /// Sets the value of [kind][crate::model::InstancesListServerCasResponse::kind].
5991    ///
5992    /// # Example
5993    /// ```ignore,no_run
5994    /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
5995    /// let x = InstancesListServerCasResponse::new().set_kind("example");
5996    /// ```
5997    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5998        self.kind = v.into();
5999        self
6000    }
6001}
6002
6003impl wkt::message::Message for InstancesListServerCasResponse {
6004    fn typename() -> &'static str {
6005        "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCasResponse"
6006    }
6007}
6008
6009/// Database instance restore backup request.
6010#[derive(Clone, Default, PartialEq)]
6011#[non_exhaustive]
6012pub struct InstancesRestoreBackupRequest {
6013    /// Parameters required to perform the restore backup operation.
6014    pub restore_backup_context: std::option::Option<crate::model::RestoreBackupContext>,
6015
6016    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6017}
6018
6019impl InstancesRestoreBackupRequest {
6020    pub fn new() -> Self {
6021        std::default::Default::default()
6022    }
6023
6024    /// Sets the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
6025    ///
6026    /// # Example
6027    /// ```ignore,no_run
6028    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6029    /// use google_cloud_sql_v1::model::RestoreBackupContext;
6030    /// let x = InstancesRestoreBackupRequest::new().set_restore_backup_context(RestoreBackupContext::default()/* use setters */);
6031    /// ```
6032    pub fn set_restore_backup_context<T>(mut self, v: T) -> Self
6033    where
6034        T: std::convert::Into<crate::model::RestoreBackupContext>,
6035    {
6036        self.restore_backup_context = std::option::Option::Some(v.into());
6037        self
6038    }
6039
6040    /// Sets or clears the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
6041    ///
6042    /// # Example
6043    /// ```ignore,no_run
6044    /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6045    /// use google_cloud_sql_v1::model::RestoreBackupContext;
6046    /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(Some(RestoreBackupContext::default()/* use setters */));
6047    /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(None::<RestoreBackupContext>);
6048    /// ```
6049    pub fn set_or_clear_restore_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
6050    where
6051        T: std::convert::Into<crate::model::RestoreBackupContext>,
6052    {
6053        self.restore_backup_context = v.map(|x| x.into());
6054        self
6055    }
6056}
6057
6058impl wkt::message::Message for InstancesRestoreBackupRequest {
6059    fn typename() -> &'static str {
6060        "type.googleapis.com/google.cloud.sql.v1.InstancesRestoreBackupRequest"
6061    }
6062}
6063
6064/// Rotate server CA request.
6065#[derive(Clone, Default, PartialEq)]
6066#[non_exhaustive]
6067pub struct InstancesRotateServerCaRequest {
6068    /// Contains details about the rotate server CA operation.
6069    pub rotate_server_ca_context: std::option::Option<crate::model::RotateServerCaContext>,
6070
6071    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6072}
6073
6074impl InstancesRotateServerCaRequest {
6075    pub fn new() -> Self {
6076        std::default::Default::default()
6077    }
6078
6079    /// Sets the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
6080    ///
6081    /// # Example
6082    /// ```ignore,no_run
6083    /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6084    /// use google_cloud_sql_v1::model::RotateServerCaContext;
6085    /// let x = InstancesRotateServerCaRequest::new().set_rotate_server_ca_context(RotateServerCaContext::default()/* use setters */);
6086    /// ```
6087    pub fn set_rotate_server_ca_context<T>(mut self, v: T) -> Self
6088    where
6089        T: std::convert::Into<crate::model::RotateServerCaContext>,
6090    {
6091        self.rotate_server_ca_context = std::option::Option::Some(v.into());
6092        self
6093    }
6094
6095    /// Sets or clears the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
6096    ///
6097    /// # Example
6098    /// ```ignore,no_run
6099    /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6100    /// use google_cloud_sql_v1::model::RotateServerCaContext;
6101    /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(Some(RotateServerCaContext::default()/* use setters */));
6102    /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(None::<RotateServerCaContext>);
6103    /// ```
6104    pub fn set_or_clear_rotate_server_ca_context<T>(mut self, v: std::option::Option<T>) -> Self
6105    where
6106        T: std::convert::Into<crate::model::RotateServerCaContext>,
6107    {
6108        self.rotate_server_ca_context = v.map(|x| x.into());
6109        self
6110    }
6111}
6112
6113impl wkt::message::Message for InstancesRotateServerCaRequest {
6114    fn typename() -> &'static str {
6115        "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCaRequest"
6116    }
6117}
6118
6119/// Instance truncate log request.
6120#[derive(Clone, Default, PartialEq)]
6121#[non_exhaustive]
6122pub struct InstancesTruncateLogRequest {
6123    /// Contains details about the truncate log operation.
6124    pub truncate_log_context: std::option::Option<crate::model::TruncateLogContext>,
6125
6126    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6127}
6128
6129impl InstancesTruncateLogRequest {
6130    pub fn new() -> Self {
6131        std::default::Default::default()
6132    }
6133
6134    /// Sets the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
6135    ///
6136    /// # Example
6137    /// ```ignore,no_run
6138    /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
6139    /// use google_cloud_sql_v1::model::TruncateLogContext;
6140    /// let x = InstancesTruncateLogRequest::new().set_truncate_log_context(TruncateLogContext::default()/* use setters */);
6141    /// ```
6142    pub fn set_truncate_log_context<T>(mut self, v: T) -> Self
6143    where
6144        T: std::convert::Into<crate::model::TruncateLogContext>,
6145    {
6146        self.truncate_log_context = std::option::Option::Some(v.into());
6147        self
6148    }
6149
6150    /// Sets or clears the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
6151    ///
6152    /// # Example
6153    /// ```ignore,no_run
6154    /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
6155    /// use google_cloud_sql_v1::model::TruncateLogContext;
6156    /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(Some(TruncateLogContext::default()/* use setters */));
6157    /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(None::<TruncateLogContext>);
6158    /// ```
6159    pub fn set_or_clear_truncate_log_context<T>(mut self, v: std::option::Option<T>) -> Self
6160    where
6161        T: std::convert::Into<crate::model::TruncateLogContext>,
6162    {
6163        self.truncate_log_context = v.map(|x| x.into());
6164        self
6165    }
6166}
6167
6168impl wkt::message::Message for InstancesTruncateLogRequest {
6169    fn typename() -> &'static str {
6170        "type.googleapis.com/google.cloud.sql.v1.InstancesTruncateLogRequest"
6171    }
6172}
6173
6174/// Request to acquire a lease for SSRS.
6175#[derive(Clone, Default, PartialEq)]
6176#[non_exhaustive]
6177pub struct InstancesAcquireSsrsLeaseRequest {
6178    /// Contains details about the acquire SSRS lease operation.
6179    pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
6180
6181    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6182}
6183
6184impl InstancesAcquireSsrsLeaseRequest {
6185    pub fn new() -> Self {
6186        std::default::Default::default()
6187    }
6188
6189    /// Sets the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
6190    ///
6191    /// # Example
6192    /// ```ignore,no_run
6193    /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
6194    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
6195    /// let x = InstancesAcquireSsrsLeaseRequest::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
6196    /// ```
6197    pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
6198    where
6199        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
6200    {
6201        self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
6202        self
6203    }
6204
6205    /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
6206    ///
6207    /// # Example
6208    /// ```ignore,no_run
6209    /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
6210    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
6211    /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
6212    /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
6213    /// ```
6214    pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
6215    where
6216        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
6217    {
6218        self.acquire_ssrs_lease_context = v.map(|x| x.into());
6219        self
6220    }
6221}
6222
6223impl wkt::message::Message for InstancesAcquireSsrsLeaseRequest {
6224    fn typename() -> &'static str {
6225        "type.googleapis.com/google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest"
6226    }
6227}
6228
6229/// Instance verify external sync settings response.
6230#[derive(Clone, Default, PartialEq)]
6231#[non_exhaustive]
6232pub struct SqlInstancesVerifyExternalSyncSettingsResponse {
6233    /// This is always `sql#migrationSettingErrorList`.
6234    pub kind: std::string::String,
6235
6236    /// List of migration violations.
6237    pub errors: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
6238
6239    /// List of migration warnings.
6240    pub warnings: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
6241
6242    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6243}
6244
6245impl SqlInstancesVerifyExternalSyncSettingsResponse {
6246    pub fn new() -> Self {
6247        std::default::Default::default()
6248    }
6249
6250    /// Sets the value of [kind][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::kind].
6251    ///
6252    /// # Example
6253    /// ```ignore,no_run
6254    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
6255    /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new().set_kind("example");
6256    /// ```
6257    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6258        self.kind = v.into();
6259        self
6260    }
6261
6262    /// Sets the value of [errors][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::errors].
6263    ///
6264    /// # Example
6265    /// ```ignore,no_run
6266    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
6267    /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
6268    /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
6269    ///     .set_errors([
6270    ///         SqlExternalSyncSettingError::default()/* use setters */,
6271    ///         SqlExternalSyncSettingError::default()/* use (different) setters */,
6272    ///     ]);
6273    /// ```
6274    pub fn set_errors<T, V>(mut self, v: T) -> Self
6275    where
6276        T: std::iter::IntoIterator<Item = V>,
6277        V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
6278    {
6279        use std::iter::Iterator;
6280        self.errors = v.into_iter().map(|i| i.into()).collect();
6281        self
6282    }
6283
6284    /// Sets the value of [warnings][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::warnings].
6285    ///
6286    /// # Example
6287    /// ```ignore,no_run
6288    /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
6289    /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
6290    /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
6291    ///     .set_warnings([
6292    ///         SqlExternalSyncSettingError::default()/* use setters */,
6293    ///         SqlExternalSyncSettingError::default()/* use (different) setters */,
6294    ///     ]);
6295    /// ```
6296    pub fn set_warnings<T, V>(mut self, v: T) -> Self
6297    where
6298        T: std::iter::IntoIterator<Item = V>,
6299        V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
6300    {
6301        use std::iter::Iterator;
6302        self.warnings = v.into_iter().map(|i| i.into()).collect();
6303        self
6304    }
6305}
6306
6307impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsResponse {
6308    fn typename() -> &'static str {
6309        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse"
6310    }
6311}
6312
6313/// Instance get disk shrink config response.
6314#[derive(Clone, Default, PartialEq)]
6315#[non_exhaustive]
6316pub struct SqlInstancesGetDiskShrinkConfigResponse {
6317    /// This is always `sql#getDiskShrinkConfig`.
6318    pub kind: std::string::String,
6319
6320    /// The minimum size to which a disk can be shrunk in GigaBytes.
6321    pub minimal_target_size_gb: i64,
6322
6323    /// Additional message to customers.
6324    pub message: std::string::String,
6325
6326    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6327}
6328
6329impl SqlInstancesGetDiskShrinkConfigResponse {
6330    pub fn new() -> Self {
6331        std::default::Default::default()
6332    }
6333
6334    /// Sets the value of [kind][crate::model::SqlInstancesGetDiskShrinkConfigResponse::kind].
6335    ///
6336    /// # Example
6337    /// ```ignore,no_run
6338    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
6339    /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_kind("example");
6340    /// ```
6341    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6342        self.kind = v.into();
6343        self
6344    }
6345
6346    /// Sets the value of [minimal_target_size_gb][crate::model::SqlInstancesGetDiskShrinkConfigResponse::minimal_target_size_gb].
6347    ///
6348    /// # Example
6349    /// ```ignore,no_run
6350    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
6351    /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_minimal_target_size_gb(42);
6352    /// ```
6353    pub fn set_minimal_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6354        self.minimal_target_size_gb = v.into();
6355        self
6356    }
6357
6358    /// Sets the value of [message][crate::model::SqlInstancesGetDiskShrinkConfigResponse::message].
6359    ///
6360    /// # Example
6361    /// ```ignore,no_run
6362    /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
6363    /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_message("example");
6364    /// ```
6365    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6366        self.message = v.into();
6367        self
6368    }
6369}
6370
6371impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigResponse {
6372    fn typename() -> &'static str {
6373        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse"
6374    }
6375}
6376
6377/// Instance get latest recovery time request.
6378#[derive(Clone, Default, PartialEq)]
6379#[non_exhaustive]
6380pub struct SqlInstancesGetLatestRecoveryTimeRequest {
6381    /// Cloud SQL instance ID. This does not include the project ID.
6382    pub instance: std::string::String,
6383
6384    /// Project ID of the project that contains the instance.
6385    pub project: std::string::String,
6386
6387    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6388}
6389
6390impl SqlInstancesGetLatestRecoveryTimeRequest {
6391    pub fn new() -> Self {
6392        std::default::Default::default()
6393    }
6394
6395    /// Sets the value of [instance][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::instance].
6396    ///
6397    /// # Example
6398    /// ```ignore,no_run
6399    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
6400    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_instance("example");
6401    /// ```
6402    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6403        self.instance = v.into();
6404        self
6405    }
6406
6407    /// Sets the value of [project][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::project].
6408    ///
6409    /// # Example
6410    /// ```ignore,no_run
6411    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
6412    /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_project("example");
6413    /// ```
6414    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6415        self.project = v.into();
6416        self
6417    }
6418}
6419
6420impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeRequest {
6421    fn typename() -> &'static str {
6422        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest"
6423    }
6424}
6425
6426/// Instance get latest recovery time response.
6427#[derive(Clone, Default, PartialEq)]
6428#[non_exhaustive]
6429pub struct SqlInstancesGetLatestRecoveryTimeResponse {
6430    /// This is always `sql#getLatestRecoveryTime`.
6431    pub kind: std::string::String,
6432
6433    /// Timestamp, identifies the latest recovery time of the source instance.
6434    pub latest_recovery_time: std::option::Option<wkt::Timestamp>,
6435
6436    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6437}
6438
6439impl SqlInstancesGetLatestRecoveryTimeResponse {
6440    pub fn new() -> Self {
6441        std::default::Default::default()
6442    }
6443
6444    /// Sets the value of [kind][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::kind].
6445    ///
6446    /// # Example
6447    /// ```ignore,no_run
6448    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
6449    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_kind("example");
6450    /// ```
6451    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6452        self.kind = v.into();
6453        self
6454    }
6455
6456    /// Sets the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
6457    ///
6458    /// # Example
6459    /// ```ignore,no_run
6460    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
6461    /// use wkt::Timestamp;
6462    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_latest_recovery_time(Timestamp::default()/* use setters */);
6463    /// ```
6464    pub fn set_latest_recovery_time<T>(mut self, v: T) -> Self
6465    where
6466        T: std::convert::Into<wkt::Timestamp>,
6467    {
6468        self.latest_recovery_time = std::option::Option::Some(v.into());
6469        self
6470    }
6471
6472    /// Sets or clears the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
6473    ///
6474    /// # Example
6475    /// ```ignore,no_run
6476    /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
6477    /// use wkt::Timestamp;
6478    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(Some(Timestamp::default()/* use setters */));
6479    /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(None::<Timestamp>);
6480    /// ```
6481    pub fn set_or_clear_latest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
6482    where
6483        T: std::convert::Into<wkt::Timestamp>,
6484    {
6485        self.latest_recovery_time = v.map(|x| x.into());
6486        self
6487    }
6488}
6489
6490impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeResponse {
6491    fn typename() -> &'static str {
6492        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse"
6493    }
6494}
6495
6496/// Database instance clone context.
6497#[derive(Clone, Default, PartialEq)]
6498#[non_exhaustive]
6499pub struct CloneContext {
6500    /// This is always `sql#cloneContext`.
6501    pub kind: std::string::String,
6502
6503    /// Reserved for future use.
6504    pub pitr_timestamp_ms: i64,
6505
6506    /// Name of the Cloud SQL instance to be created as a clone.
6507    pub destination_instance_name: std::string::String,
6508
6509    /// Binary log coordinates, if specified, identify the position up to which the
6510    /// source instance is cloned. If not specified, the source instance is
6511    /// cloned up to the most recent binary log coordinates.
6512    pub bin_log_coordinates: std::option::Option<crate::model::BinLogCoordinates>,
6513
6514    /// Timestamp, if specified, identifies the time to which the source instance
6515    /// is cloned.
6516    pub point_in_time: std::option::Option<wkt::Timestamp>,
6517
6518    /// The name of the allocated ip range for the private ip Cloud SQL instance.
6519    /// For example: "google-managed-services-default". If set, the cloned instance
6520    /// ip will be created in the allocated range. The range name must comply with
6521    /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
6522    /// must be 1-63 characters long and match the regular expression
6523    /// [a-z]([-a-z0-9]*[a-z0-9])?.
6524    /// Reserved for future use.
6525    pub allocated_ip_range: std::string::String,
6526
6527    /// (SQL Server only) Clone only the specified databases from the source
6528    /// instance. Clone all databases if empty.
6529    pub database_names: std::vec::Vec<std::string::String>,
6530
6531    /// Optional. Copy clone and point-in-time recovery clone of an instance to the
6532    /// specified zone. If no zone is specified, clone to the same primary zone as
6533    /// the source instance. This field applies to all DB types.
6534    pub preferred_zone: std::option::Option<std::string::String>,
6535
6536    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6537}
6538
6539impl CloneContext {
6540    pub fn new() -> Self {
6541        std::default::Default::default()
6542    }
6543
6544    /// Sets the value of [kind][crate::model::CloneContext::kind].
6545    ///
6546    /// # Example
6547    /// ```ignore,no_run
6548    /// # use google_cloud_sql_v1::model::CloneContext;
6549    /// let x = CloneContext::new().set_kind("example");
6550    /// ```
6551    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6552        self.kind = v.into();
6553        self
6554    }
6555
6556    /// Sets the value of [pitr_timestamp_ms][crate::model::CloneContext::pitr_timestamp_ms].
6557    ///
6558    /// # Example
6559    /// ```ignore,no_run
6560    /// # use google_cloud_sql_v1::model::CloneContext;
6561    /// let x = CloneContext::new().set_pitr_timestamp_ms(42);
6562    /// ```
6563    pub fn set_pitr_timestamp_ms<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6564        self.pitr_timestamp_ms = v.into();
6565        self
6566    }
6567
6568    /// Sets the value of [destination_instance_name][crate::model::CloneContext::destination_instance_name].
6569    ///
6570    /// # Example
6571    /// ```ignore,no_run
6572    /// # use google_cloud_sql_v1::model::CloneContext;
6573    /// let x = CloneContext::new().set_destination_instance_name("example");
6574    /// ```
6575    pub fn set_destination_instance_name<T: std::convert::Into<std::string::String>>(
6576        mut self,
6577        v: T,
6578    ) -> Self {
6579        self.destination_instance_name = v.into();
6580        self
6581    }
6582
6583    /// Sets the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
6584    ///
6585    /// # Example
6586    /// ```ignore,no_run
6587    /// # use google_cloud_sql_v1::model::CloneContext;
6588    /// use google_cloud_sql_v1::model::BinLogCoordinates;
6589    /// let x = CloneContext::new().set_bin_log_coordinates(BinLogCoordinates::default()/* use setters */);
6590    /// ```
6591    pub fn set_bin_log_coordinates<T>(mut self, v: T) -> Self
6592    where
6593        T: std::convert::Into<crate::model::BinLogCoordinates>,
6594    {
6595        self.bin_log_coordinates = std::option::Option::Some(v.into());
6596        self
6597    }
6598
6599    /// Sets or clears the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
6600    ///
6601    /// # Example
6602    /// ```ignore,no_run
6603    /// # use google_cloud_sql_v1::model::CloneContext;
6604    /// use google_cloud_sql_v1::model::BinLogCoordinates;
6605    /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(Some(BinLogCoordinates::default()/* use setters */));
6606    /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(None::<BinLogCoordinates>);
6607    /// ```
6608    pub fn set_or_clear_bin_log_coordinates<T>(mut self, v: std::option::Option<T>) -> Self
6609    where
6610        T: std::convert::Into<crate::model::BinLogCoordinates>,
6611    {
6612        self.bin_log_coordinates = v.map(|x| x.into());
6613        self
6614    }
6615
6616    /// Sets the value of [point_in_time][crate::model::CloneContext::point_in_time].
6617    ///
6618    /// # Example
6619    /// ```ignore,no_run
6620    /// # use google_cloud_sql_v1::model::CloneContext;
6621    /// use wkt::Timestamp;
6622    /// let x = CloneContext::new().set_point_in_time(Timestamp::default()/* use setters */);
6623    /// ```
6624    pub fn set_point_in_time<T>(mut self, v: T) -> Self
6625    where
6626        T: std::convert::Into<wkt::Timestamp>,
6627    {
6628        self.point_in_time = std::option::Option::Some(v.into());
6629        self
6630    }
6631
6632    /// Sets or clears the value of [point_in_time][crate::model::CloneContext::point_in_time].
6633    ///
6634    /// # Example
6635    /// ```ignore,no_run
6636    /// # use google_cloud_sql_v1::model::CloneContext;
6637    /// use wkt::Timestamp;
6638    /// let x = CloneContext::new().set_or_clear_point_in_time(Some(Timestamp::default()/* use setters */));
6639    /// let x = CloneContext::new().set_or_clear_point_in_time(None::<Timestamp>);
6640    /// ```
6641    pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
6642    where
6643        T: std::convert::Into<wkt::Timestamp>,
6644    {
6645        self.point_in_time = v.map(|x| x.into());
6646        self
6647    }
6648
6649    /// Sets the value of [allocated_ip_range][crate::model::CloneContext::allocated_ip_range].
6650    ///
6651    /// # Example
6652    /// ```ignore,no_run
6653    /// # use google_cloud_sql_v1::model::CloneContext;
6654    /// let x = CloneContext::new().set_allocated_ip_range("example");
6655    /// ```
6656    pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
6657        mut self,
6658        v: T,
6659    ) -> Self {
6660        self.allocated_ip_range = v.into();
6661        self
6662    }
6663
6664    /// Sets the value of [database_names][crate::model::CloneContext::database_names].
6665    ///
6666    /// # Example
6667    /// ```ignore,no_run
6668    /// # use google_cloud_sql_v1::model::CloneContext;
6669    /// let x = CloneContext::new().set_database_names(["a", "b", "c"]);
6670    /// ```
6671    pub fn set_database_names<T, V>(mut self, v: T) -> Self
6672    where
6673        T: std::iter::IntoIterator<Item = V>,
6674        V: std::convert::Into<std::string::String>,
6675    {
6676        use std::iter::Iterator;
6677        self.database_names = v.into_iter().map(|i| i.into()).collect();
6678        self
6679    }
6680
6681    /// Sets the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
6682    ///
6683    /// # Example
6684    /// ```ignore,no_run
6685    /// # use google_cloud_sql_v1::model::CloneContext;
6686    /// let x = CloneContext::new().set_preferred_zone("example");
6687    /// ```
6688    pub fn set_preferred_zone<T>(mut self, v: T) -> Self
6689    where
6690        T: std::convert::Into<std::string::String>,
6691    {
6692        self.preferred_zone = std::option::Option::Some(v.into());
6693        self
6694    }
6695
6696    /// Sets or clears the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
6697    ///
6698    /// # Example
6699    /// ```ignore,no_run
6700    /// # use google_cloud_sql_v1::model::CloneContext;
6701    /// let x = CloneContext::new().set_or_clear_preferred_zone(Some("example"));
6702    /// let x = CloneContext::new().set_or_clear_preferred_zone(None::<String>);
6703    /// ```
6704    pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
6705    where
6706        T: std::convert::Into<std::string::String>,
6707    {
6708        self.preferred_zone = v.map(|x| x.into());
6709        self
6710    }
6711}
6712
6713impl wkt::message::Message for CloneContext {
6714    fn typename() -> &'static str {
6715        "type.googleapis.com/google.cloud.sql.v1.CloneContext"
6716    }
6717}
6718
6719/// Binary log coordinates.
6720#[derive(Clone, Default, PartialEq)]
6721#[non_exhaustive]
6722pub struct BinLogCoordinates {
6723    /// Name of the binary log file for a Cloud SQL instance.
6724    pub bin_log_file_name: std::string::String,
6725
6726    /// Position (offset) within the binary log file.
6727    pub bin_log_position: i64,
6728
6729    /// This is always `sql#binLogCoordinates`.
6730    pub kind: std::string::String,
6731
6732    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6733}
6734
6735impl BinLogCoordinates {
6736    pub fn new() -> Self {
6737        std::default::Default::default()
6738    }
6739
6740    /// Sets the value of [bin_log_file_name][crate::model::BinLogCoordinates::bin_log_file_name].
6741    ///
6742    /// # Example
6743    /// ```ignore,no_run
6744    /// # use google_cloud_sql_v1::model::BinLogCoordinates;
6745    /// let x = BinLogCoordinates::new().set_bin_log_file_name("example");
6746    /// ```
6747    pub fn set_bin_log_file_name<T: std::convert::Into<std::string::String>>(
6748        mut self,
6749        v: T,
6750    ) -> Self {
6751        self.bin_log_file_name = v.into();
6752        self
6753    }
6754
6755    /// Sets the value of [bin_log_position][crate::model::BinLogCoordinates::bin_log_position].
6756    ///
6757    /// # Example
6758    /// ```ignore,no_run
6759    /// # use google_cloud_sql_v1::model::BinLogCoordinates;
6760    /// let x = BinLogCoordinates::new().set_bin_log_position(42);
6761    /// ```
6762    pub fn set_bin_log_position<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6763        self.bin_log_position = v.into();
6764        self
6765    }
6766
6767    /// Sets the value of [kind][crate::model::BinLogCoordinates::kind].
6768    ///
6769    /// # Example
6770    /// ```ignore,no_run
6771    /// # use google_cloud_sql_v1::model::BinLogCoordinates;
6772    /// let x = BinLogCoordinates::new().set_kind("example");
6773    /// ```
6774    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6775        self.kind = v.into();
6776        self
6777    }
6778}
6779
6780impl wkt::message::Message for BinLogCoordinates {
6781    fn typename() -> &'static str {
6782        "type.googleapis.com/google.cloud.sql.v1.BinLogCoordinates"
6783    }
6784}
6785
6786/// A Cloud SQL instance resource.
6787#[derive(Clone, Default, PartialEq)]
6788#[non_exhaustive]
6789pub struct DatabaseInstance {
6790    /// This is always `sql#instance`.
6791    pub kind: std::string::String,
6792
6793    /// The current serving state of the Cloud SQL instance.
6794    pub state: crate::model::database_instance::SqlInstanceState,
6795
6796    /// The database engine type and version. The `databaseVersion` field cannot
6797    /// be changed after instance creation.
6798    pub database_version: crate::model::SqlDatabaseVersion,
6799
6800    /// The user settings.
6801    pub settings: std::option::Option<crate::model::Settings>,
6802
6803    /// This field is deprecated and will be removed from a future version of the
6804    /// API. Use the `settings.settingsVersion` field instead.
6805    pub etag: std::string::String,
6806
6807    /// The name and status of the failover replica.
6808    pub failover_replica: std::option::Option<crate::model::database_instance::SqlFailoverReplica>,
6809
6810    /// The name of the instance which will act as primary in the replication
6811    /// setup.
6812    pub master_instance_name: std::string::String,
6813
6814    /// The replicas of the instance.
6815    pub replica_names: std::vec::Vec<std::string::String>,
6816
6817    /// The maximum disk size of the instance in bytes.
6818    #[deprecated]
6819    pub max_disk_size: std::option::Option<wkt::Int64Value>,
6820
6821    /// The current disk usage of the instance in bytes. This property has been
6822    /// deprecated. Use the
6823    /// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
6824    /// Monitoring API instead. Please see [this
6825    /// announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
6826    /// for details.
6827    #[deprecated]
6828    pub current_disk_size: std::option::Option<wkt::Int64Value>,
6829
6830    /// The assigned IP addresses for the instance.
6831    pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
6832
6833    /// SSL configuration.
6834    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
6835
6836    /// The instance type.
6837    pub instance_type: crate::model::SqlInstanceType,
6838
6839    /// The project ID of the project containing the Cloud SQL instance. The Google
6840    /// apps domain is prefixed if applicable.
6841    pub project: std::string::String,
6842
6843    /// The IPv6 address assigned to the instance.
6844    /// (Deprecated) This property was applicable only
6845    /// to First Generation instances.
6846    #[deprecated]
6847    pub ipv6_address: std::string::String,
6848
6849    /// The service account email address assigned to the instance.\This
6850    /// property is read-only.
6851    pub service_account_email_address: std::string::String,
6852
6853    /// Configuration specific to on-premises instances.
6854    pub on_premises_configuration: std::option::Option<crate::model::OnPremisesConfiguration>,
6855
6856    /// Configuration specific to failover replicas and read replicas.
6857    pub replica_configuration: std::option::Option<crate::model::ReplicaConfiguration>,
6858
6859    /// The backend type.
6860    /// `SECOND_GEN`: Cloud SQL database instance.
6861    /// `EXTERNAL`: A database server that is not managed by Google.
6862    ///
6863    /// This property is read-only; use the `tier` property in the `settings`
6864    /// object to determine the database type.
6865    pub backend_type: crate::model::SqlBackendType,
6866
6867    /// The URI of this resource.
6868    pub self_link: std::string::String,
6869
6870    /// If the instance state is SUSPENDED, the reason for the suspension.
6871    pub suspension_reason: std::vec::Vec<crate::model::SqlSuspensionReason>,
6872
6873    /// Connection name of the Cloud SQL instance used in connection strings.
6874    pub connection_name: std::string::String,
6875
6876    /// Name of the Cloud SQL instance. This does not include the project ID.
6877    pub name: std::string::String,
6878
6879    /// The geographical region of the Cloud SQL instance.
6880    ///
6881    /// It can be one of the
6882    /// [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
6883    /// where Cloud SQL operates:
6884    ///
6885    /// For example,  `asia-east1`, `europe-west1`, and  `us-central1`.
6886    /// The default value is `us-central1`.
6887    pub region: std::string::String,
6888
6889    /// The Compute Engine zone that the instance is currently serving from. This
6890    /// value could be different from the zone that was specified when the instance
6891    /// was created if the instance has failed over to its secondary zone. WARNING:
6892    /// Changing this might restart the instance.
6893    pub gce_zone: std::string::String,
6894
6895    /// The Compute Engine zone that the failover instance is currently serving
6896    /// from for a regional instance. This value could be different
6897    /// from the zone that was specified when the instance
6898    /// was created if the instance has failed over to its secondary/failover zone.
6899    pub secondary_gce_zone: std::string::String,
6900
6901    /// Disk encryption configuration specific to an instance.
6902    pub disk_encryption_configuration:
6903        std::option::Option<crate::model::DiskEncryptionConfiguration>,
6904
6905    /// Disk encryption status specific to an instance.
6906    pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
6907
6908    /// Initial root password. Use only on creation. You must set root passwords
6909    /// before you can connect to PostgreSQL instances.
6910    pub root_password: std::string::String,
6911
6912    /// The start time of any upcoming scheduled maintenance for this instance.
6913    pub scheduled_maintenance:
6914        std::option::Option<crate::model::database_instance::SqlScheduledMaintenance>,
6915
6916    /// This status indicates whether the instance satisfies PZS.
6917    ///
6918    /// The status is reserved for future use.
6919    pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
6920
6921    /// Output only. Stores the current database version running on the instance
6922    /// including minor version such as `MYSQL_8_0_18`.
6923    pub database_installed_version: std::string::String,
6924
6925    /// This field represents the report generated by the proactive database
6926    /// wellness job for OutOfDisk issues.
6927    ///
6928    /// * Writers:
6929    /// * the proactive database wellness job for OOD.
6930    /// * Readers:
6931    /// * the proactive database wellness job
6932    pub out_of_disk_report:
6933        std::option::Option<crate::model::database_instance::SqlOutOfDiskReport>,
6934
6935    /// Output only. The time when the instance was created in
6936    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
6937    /// `2012-11-15T16:19:00.094Z`.
6938    pub create_time: std::option::Option<wkt::Timestamp>,
6939
6940    /// Output only. List all maintenance versions applicable on the instance
6941    pub available_maintenance_versions: std::vec::Vec<std::string::String>,
6942
6943    /// The current software version on the instance.
6944    pub maintenance_version: std::string::String,
6945
6946    /// Output only. All database versions that are available for upgrade.
6947    pub upgradable_database_versions: std::vec::Vec<crate::model::AvailableDatabaseVersion>,
6948
6949    pub sql_network_architecture:
6950        std::option::Option<crate::model::database_instance::SqlNetworkArchitecture>,
6951
6952    /// Output only. The link to service attachment of PSC instance.
6953    pub psc_service_attachment_link: std::option::Option<std::string::String>,
6954
6955    /// Output only. The dns name of the instance.
6956    pub dns_name: std::option::Option<std::string::String>,
6957
6958    /// Output only. DEPRECATED: please use write_endpoint instead.
6959    #[deprecated]
6960    pub primary_dns_name: std::option::Option<std::string::String>,
6961
6962    /// Output only. The dns name of the primary instance in a replication group.
6963    pub write_endpoint: std::option::Option<std::string::String>,
6964
6965    /// Optional. A primary instance and disaster recovery (DR) replica pair.
6966    /// A DR replica is a cross-region replica that you designate
6967    /// for failover in the event that the primary instance
6968    /// experiences regional failure. Only applicable to MySQL.
6969    pub replication_cluster: std::option::Option<crate::model::ReplicationCluster>,
6970
6971    /// Gemini instance configuration.
6972    pub gemini_config: std::option::Option<crate::model::GeminiInstanceConfig>,
6973
6974    /// Output only. This status indicates whether the instance satisfies PZI.
6975    ///
6976    /// The status is reserved for future use.
6977    pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
6978
6979    /// Input only. Whether Cloud SQL is enabled to switch storing point-in-time
6980    /// recovery log files from a data disk to Cloud Storage.
6981    pub switch_transaction_logs_to_cloud_storage_enabled: std::option::Option<wkt::BoolValue>,
6982
6983    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6984}
6985
6986impl DatabaseInstance {
6987    pub fn new() -> Self {
6988        std::default::Default::default()
6989    }
6990
6991    /// Sets the value of [kind][crate::model::DatabaseInstance::kind].
6992    ///
6993    /// # Example
6994    /// ```ignore,no_run
6995    /// # use google_cloud_sql_v1::model::DatabaseInstance;
6996    /// let x = DatabaseInstance::new().set_kind("example");
6997    /// ```
6998    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6999        self.kind = v.into();
7000        self
7001    }
7002
7003    /// Sets the value of [state][crate::model::DatabaseInstance::state].
7004    ///
7005    /// # Example
7006    /// ```ignore,no_run
7007    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7008    /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
7009    /// let x0 = DatabaseInstance::new().set_state(SqlInstanceState::Runnable);
7010    /// let x1 = DatabaseInstance::new().set_state(SqlInstanceState::Suspended);
7011    /// let x2 = DatabaseInstance::new().set_state(SqlInstanceState::PendingDelete);
7012    /// ```
7013    pub fn set_state<T: std::convert::Into<crate::model::database_instance::SqlInstanceState>>(
7014        mut self,
7015        v: T,
7016    ) -> Self {
7017        self.state = v.into();
7018        self
7019    }
7020
7021    /// Sets the value of [database_version][crate::model::DatabaseInstance::database_version].
7022    ///
7023    /// # Example
7024    /// ```ignore,no_run
7025    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7026    /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
7027    /// let x0 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql56);
7028    /// let x1 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql57);
7029    /// let x2 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Sqlserver2017Standard);
7030    /// ```
7031    pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
7032        mut self,
7033        v: T,
7034    ) -> Self {
7035        self.database_version = v.into();
7036        self
7037    }
7038
7039    /// Sets the value of [settings][crate::model::DatabaseInstance::settings].
7040    ///
7041    /// # Example
7042    /// ```ignore,no_run
7043    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7044    /// use google_cloud_sql_v1::model::Settings;
7045    /// let x = DatabaseInstance::new().set_settings(Settings::default()/* use setters */);
7046    /// ```
7047    pub fn set_settings<T>(mut self, v: T) -> Self
7048    where
7049        T: std::convert::Into<crate::model::Settings>,
7050    {
7051        self.settings = std::option::Option::Some(v.into());
7052        self
7053    }
7054
7055    /// Sets or clears the value of [settings][crate::model::DatabaseInstance::settings].
7056    ///
7057    /// # Example
7058    /// ```ignore,no_run
7059    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7060    /// use google_cloud_sql_v1::model::Settings;
7061    /// let x = DatabaseInstance::new().set_or_clear_settings(Some(Settings::default()/* use setters */));
7062    /// let x = DatabaseInstance::new().set_or_clear_settings(None::<Settings>);
7063    /// ```
7064    pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
7065    where
7066        T: std::convert::Into<crate::model::Settings>,
7067    {
7068        self.settings = v.map(|x| x.into());
7069        self
7070    }
7071
7072    /// Sets the value of [etag][crate::model::DatabaseInstance::etag].
7073    ///
7074    /// # Example
7075    /// ```ignore,no_run
7076    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7077    /// let x = DatabaseInstance::new().set_etag("example");
7078    /// ```
7079    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7080        self.etag = v.into();
7081        self
7082    }
7083
7084    /// Sets the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
7085    ///
7086    /// # Example
7087    /// ```ignore,no_run
7088    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7089    /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
7090    /// let x = DatabaseInstance::new().set_failover_replica(SqlFailoverReplica::default()/* use setters */);
7091    /// ```
7092    pub fn set_failover_replica<T>(mut self, v: T) -> Self
7093    where
7094        T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
7095    {
7096        self.failover_replica = std::option::Option::Some(v.into());
7097        self
7098    }
7099
7100    /// Sets or clears the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
7101    ///
7102    /// # Example
7103    /// ```ignore,no_run
7104    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7105    /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
7106    /// let x = DatabaseInstance::new().set_or_clear_failover_replica(Some(SqlFailoverReplica::default()/* use setters */));
7107    /// let x = DatabaseInstance::new().set_or_clear_failover_replica(None::<SqlFailoverReplica>);
7108    /// ```
7109    pub fn set_or_clear_failover_replica<T>(mut self, v: std::option::Option<T>) -> Self
7110    where
7111        T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
7112    {
7113        self.failover_replica = v.map(|x| x.into());
7114        self
7115    }
7116
7117    /// Sets the value of [master_instance_name][crate::model::DatabaseInstance::master_instance_name].
7118    ///
7119    /// # Example
7120    /// ```ignore,no_run
7121    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7122    /// let x = DatabaseInstance::new().set_master_instance_name("example");
7123    /// ```
7124    pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
7125        mut self,
7126        v: T,
7127    ) -> Self {
7128        self.master_instance_name = v.into();
7129        self
7130    }
7131
7132    /// Sets the value of [replica_names][crate::model::DatabaseInstance::replica_names].
7133    ///
7134    /// # Example
7135    /// ```ignore,no_run
7136    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7137    /// let x = DatabaseInstance::new().set_replica_names(["a", "b", "c"]);
7138    /// ```
7139    pub fn set_replica_names<T, V>(mut self, v: T) -> Self
7140    where
7141        T: std::iter::IntoIterator<Item = V>,
7142        V: std::convert::Into<std::string::String>,
7143    {
7144        use std::iter::Iterator;
7145        self.replica_names = v.into_iter().map(|i| i.into()).collect();
7146        self
7147    }
7148
7149    /// Sets the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
7150    ///
7151    /// # Example
7152    /// ```ignore,no_run
7153    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7154    /// use wkt::Int64Value;
7155    /// let x = DatabaseInstance::new().set_max_disk_size(Int64Value::default()/* use setters */);
7156    /// ```
7157    #[deprecated]
7158    pub fn set_max_disk_size<T>(mut self, v: T) -> Self
7159    where
7160        T: std::convert::Into<wkt::Int64Value>,
7161    {
7162        self.max_disk_size = std::option::Option::Some(v.into());
7163        self
7164    }
7165
7166    /// Sets or clears the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
7167    ///
7168    /// # Example
7169    /// ```ignore,no_run
7170    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7171    /// use wkt::Int64Value;
7172    /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(Some(Int64Value::default()/* use setters */));
7173    /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(None::<Int64Value>);
7174    /// ```
7175    #[deprecated]
7176    pub fn set_or_clear_max_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
7177    where
7178        T: std::convert::Into<wkt::Int64Value>,
7179    {
7180        self.max_disk_size = v.map(|x| x.into());
7181        self
7182    }
7183
7184    /// Sets the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
7185    ///
7186    /// # Example
7187    /// ```ignore,no_run
7188    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7189    /// use wkt::Int64Value;
7190    /// let x = DatabaseInstance::new().set_current_disk_size(Int64Value::default()/* use setters */);
7191    /// ```
7192    #[deprecated]
7193    pub fn set_current_disk_size<T>(mut self, v: T) -> Self
7194    where
7195        T: std::convert::Into<wkt::Int64Value>,
7196    {
7197        self.current_disk_size = std::option::Option::Some(v.into());
7198        self
7199    }
7200
7201    /// Sets or clears the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
7202    ///
7203    /// # Example
7204    /// ```ignore,no_run
7205    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7206    /// use wkt::Int64Value;
7207    /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(Some(Int64Value::default()/* use setters */));
7208    /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(None::<Int64Value>);
7209    /// ```
7210    #[deprecated]
7211    pub fn set_or_clear_current_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
7212    where
7213        T: std::convert::Into<wkt::Int64Value>,
7214    {
7215        self.current_disk_size = v.map(|x| x.into());
7216        self
7217    }
7218
7219    /// Sets the value of [ip_addresses][crate::model::DatabaseInstance::ip_addresses].
7220    ///
7221    /// # Example
7222    /// ```ignore,no_run
7223    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7224    /// use google_cloud_sql_v1::model::IpMapping;
7225    /// let x = DatabaseInstance::new()
7226    ///     .set_ip_addresses([
7227    ///         IpMapping::default()/* use setters */,
7228    ///         IpMapping::default()/* use (different) setters */,
7229    ///     ]);
7230    /// ```
7231    pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
7232    where
7233        T: std::iter::IntoIterator<Item = V>,
7234        V: std::convert::Into<crate::model::IpMapping>,
7235    {
7236        use std::iter::Iterator;
7237        self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
7238        self
7239    }
7240
7241    /// Sets the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
7242    ///
7243    /// # Example
7244    /// ```ignore,no_run
7245    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7246    /// use google_cloud_sql_v1::model::SslCert;
7247    /// let x = DatabaseInstance::new().set_server_ca_cert(SslCert::default()/* use setters */);
7248    /// ```
7249    pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
7250    where
7251        T: std::convert::Into<crate::model::SslCert>,
7252    {
7253        self.server_ca_cert = std::option::Option::Some(v.into());
7254        self
7255    }
7256
7257    /// Sets or clears the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
7258    ///
7259    /// # Example
7260    /// ```ignore,no_run
7261    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7262    /// use google_cloud_sql_v1::model::SslCert;
7263    /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
7264    /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(None::<SslCert>);
7265    /// ```
7266    pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
7267    where
7268        T: std::convert::Into<crate::model::SslCert>,
7269    {
7270        self.server_ca_cert = v.map(|x| x.into());
7271        self
7272    }
7273
7274    /// Sets the value of [instance_type][crate::model::DatabaseInstance::instance_type].
7275    ///
7276    /// # Example
7277    /// ```ignore,no_run
7278    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7279    /// use google_cloud_sql_v1::model::SqlInstanceType;
7280    /// let x0 = DatabaseInstance::new().set_instance_type(SqlInstanceType::CloudSqlInstance);
7281    /// let x1 = DatabaseInstance::new().set_instance_type(SqlInstanceType::OnPremisesInstance);
7282    /// let x2 = DatabaseInstance::new().set_instance_type(SqlInstanceType::ReadReplicaInstance);
7283    /// ```
7284    pub fn set_instance_type<T: std::convert::Into<crate::model::SqlInstanceType>>(
7285        mut self,
7286        v: T,
7287    ) -> Self {
7288        self.instance_type = v.into();
7289        self
7290    }
7291
7292    /// Sets the value of [project][crate::model::DatabaseInstance::project].
7293    ///
7294    /// # Example
7295    /// ```ignore,no_run
7296    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7297    /// let x = DatabaseInstance::new().set_project("example");
7298    /// ```
7299    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7300        self.project = v.into();
7301        self
7302    }
7303
7304    /// Sets the value of [ipv6_address][crate::model::DatabaseInstance::ipv6_address].
7305    ///
7306    /// # Example
7307    /// ```ignore,no_run
7308    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7309    /// let x = DatabaseInstance::new().set_ipv6_address("example");
7310    /// ```
7311    #[deprecated]
7312    pub fn set_ipv6_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7313        self.ipv6_address = v.into();
7314        self
7315    }
7316
7317    /// Sets the value of [service_account_email_address][crate::model::DatabaseInstance::service_account_email_address].
7318    ///
7319    /// # Example
7320    /// ```ignore,no_run
7321    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7322    /// let x = DatabaseInstance::new().set_service_account_email_address("example");
7323    /// ```
7324    pub fn set_service_account_email_address<T: std::convert::Into<std::string::String>>(
7325        mut self,
7326        v: T,
7327    ) -> Self {
7328        self.service_account_email_address = v.into();
7329        self
7330    }
7331
7332    /// Sets the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
7333    ///
7334    /// # Example
7335    /// ```ignore,no_run
7336    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7337    /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
7338    /// let x = DatabaseInstance::new().set_on_premises_configuration(OnPremisesConfiguration::default()/* use setters */);
7339    /// ```
7340    pub fn set_on_premises_configuration<T>(mut self, v: T) -> Self
7341    where
7342        T: std::convert::Into<crate::model::OnPremisesConfiguration>,
7343    {
7344        self.on_premises_configuration = std::option::Option::Some(v.into());
7345        self
7346    }
7347
7348    /// Sets or clears the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
7349    ///
7350    /// # Example
7351    /// ```ignore,no_run
7352    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7353    /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
7354    /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(Some(OnPremisesConfiguration::default()/* use setters */));
7355    /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(None::<OnPremisesConfiguration>);
7356    /// ```
7357    pub fn set_or_clear_on_premises_configuration<T>(mut self, v: std::option::Option<T>) -> Self
7358    where
7359        T: std::convert::Into<crate::model::OnPremisesConfiguration>,
7360    {
7361        self.on_premises_configuration = v.map(|x| x.into());
7362        self
7363    }
7364
7365    /// Sets the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
7366    ///
7367    /// # Example
7368    /// ```ignore,no_run
7369    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7370    /// use google_cloud_sql_v1::model::ReplicaConfiguration;
7371    /// let x = DatabaseInstance::new().set_replica_configuration(ReplicaConfiguration::default()/* use setters */);
7372    /// ```
7373    pub fn set_replica_configuration<T>(mut self, v: T) -> Self
7374    where
7375        T: std::convert::Into<crate::model::ReplicaConfiguration>,
7376    {
7377        self.replica_configuration = std::option::Option::Some(v.into());
7378        self
7379    }
7380
7381    /// Sets or clears the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
7382    ///
7383    /// # Example
7384    /// ```ignore,no_run
7385    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7386    /// use google_cloud_sql_v1::model::ReplicaConfiguration;
7387    /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(Some(ReplicaConfiguration::default()/* use setters */));
7388    /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(None::<ReplicaConfiguration>);
7389    /// ```
7390    pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
7391    where
7392        T: std::convert::Into<crate::model::ReplicaConfiguration>,
7393    {
7394        self.replica_configuration = v.map(|x| x.into());
7395        self
7396    }
7397
7398    /// Sets the value of [backend_type][crate::model::DatabaseInstance::backend_type].
7399    ///
7400    /// # Example
7401    /// ```ignore,no_run
7402    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7403    /// use google_cloud_sql_v1::model::SqlBackendType;
7404    /// let x0 = DatabaseInstance::new().set_backend_type(SqlBackendType::SecondGen);
7405    /// let x1 = DatabaseInstance::new().set_backend_type(SqlBackendType::External);
7406    /// ```
7407    pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
7408        mut self,
7409        v: T,
7410    ) -> Self {
7411        self.backend_type = v.into();
7412        self
7413    }
7414
7415    /// Sets the value of [self_link][crate::model::DatabaseInstance::self_link].
7416    ///
7417    /// # Example
7418    /// ```ignore,no_run
7419    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7420    /// let x = DatabaseInstance::new().set_self_link("example");
7421    /// ```
7422    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7423        self.self_link = v.into();
7424        self
7425    }
7426
7427    /// Sets the value of [suspension_reason][crate::model::DatabaseInstance::suspension_reason].
7428    ///
7429    /// # Example
7430    /// ```ignore,no_run
7431    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7432    /// use google_cloud_sql_v1::model::SqlSuspensionReason;
7433    /// let x = DatabaseInstance::new().set_suspension_reason([
7434    ///     SqlSuspensionReason::BillingIssue,
7435    ///     SqlSuspensionReason::LegalIssue,
7436    ///     SqlSuspensionReason::OperationalIssue,
7437    /// ]);
7438    /// ```
7439    pub fn set_suspension_reason<T, V>(mut self, v: T) -> Self
7440    where
7441        T: std::iter::IntoIterator<Item = V>,
7442        V: std::convert::Into<crate::model::SqlSuspensionReason>,
7443    {
7444        use std::iter::Iterator;
7445        self.suspension_reason = v.into_iter().map(|i| i.into()).collect();
7446        self
7447    }
7448
7449    /// Sets the value of [connection_name][crate::model::DatabaseInstance::connection_name].
7450    ///
7451    /// # Example
7452    /// ```ignore,no_run
7453    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7454    /// let x = DatabaseInstance::new().set_connection_name("example");
7455    /// ```
7456    pub fn set_connection_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7457        self.connection_name = v.into();
7458        self
7459    }
7460
7461    /// Sets the value of [name][crate::model::DatabaseInstance::name].
7462    ///
7463    /// # Example
7464    /// ```ignore,no_run
7465    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7466    /// let x = DatabaseInstance::new().set_name("example");
7467    /// ```
7468    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7469        self.name = v.into();
7470        self
7471    }
7472
7473    /// Sets the value of [region][crate::model::DatabaseInstance::region].
7474    ///
7475    /// # Example
7476    /// ```ignore,no_run
7477    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7478    /// let x = DatabaseInstance::new().set_region("example");
7479    /// ```
7480    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7481        self.region = v.into();
7482        self
7483    }
7484
7485    /// Sets the value of [gce_zone][crate::model::DatabaseInstance::gce_zone].
7486    ///
7487    /// # Example
7488    /// ```ignore,no_run
7489    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7490    /// let x = DatabaseInstance::new().set_gce_zone("example");
7491    /// ```
7492    pub fn set_gce_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7493        self.gce_zone = v.into();
7494        self
7495    }
7496
7497    /// Sets the value of [secondary_gce_zone][crate::model::DatabaseInstance::secondary_gce_zone].
7498    ///
7499    /// # Example
7500    /// ```ignore,no_run
7501    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7502    /// let x = DatabaseInstance::new().set_secondary_gce_zone("example");
7503    /// ```
7504    pub fn set_secondary_gce_zone<T: std::convert::Into<std::string::String>>(
7505        mut self,
7506        v: T,
7507    ) -> Self {
7508        self.secondary_gce_zone = v.into();
7509        self
7510    }
7511
7512    /// Sets the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
7513    ///
7514    /// # Example
7515    /// ```ignore,no_run
7516    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7517    /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
7518    /// let x = DatabaseInstance::new().set_disk_encryption_configuration(DiskEncryptionConfiguration::default()/* use setters */);
7519    /// ```
7520    pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
7521    where
7522        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
7523    {
7524        self.disk_encryption_configuration = std::option::Option::Some(v.into());
7525        self
7526    }
7527
7528    /// Sets or clears the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
7529    ///
7530    /// # Example
7531    /// ```ignore,no_run
7532    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7533    /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
7534    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(Some(DiskEncryptionConfiguration::default()/* use setters */));
7535    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(None::<DiskEncryptionConfiguration>);
7536    /// ```
7537    pub fn set_or_clear_disk_encryption_configuration<T>(
7538        mut self,
7539        v: std::option::Option<T>,
7540    ) -> Self
7541    where
7542        T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
7543    {
7544        self.disk_encryption_configuration = v.map(|x| x.into());
7545        self
7546    }
7547
7548    /// Sets the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
7549    ///
7550    /// # Example
7551    /// ```ignore,no_run
7552    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7553    /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
7554    /// let x = DatabaseInstance::new().set_disk_encryption_status(DiskEncryptionStatus::default()/* use setters */);
7555    /// ```
7556    pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
7557    where
7558        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
7559    {
7560        self.disk_encryption_status = std::option::Option::Some(v.into());
7561        self
7562    }
7563
7564    /// Sets or clears the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
7565    ///
7566    /// # Example
7567    /// ```ignore,no_run
7568    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7569    /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
7570    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(Some(DiskEncryptionStatus::default()/* use setters */));
7571    /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(None::<DiskEncryptionStatus>);
7572    /// ```
7573    pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
7574    where
7575        T: std::convert::Into<crate::model::DiskEncryptionStatus>,
7576    {
7577        self.disk_encryption_status = v.map(|x| x.into());
7578        self
7579    }
7580
7581    /// Sets the value of [root_password][crate::model::DatabaseInstance::root_password].
7582    ///
7583    /// # Example
7584    /// ```ignore,no_run
7585    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7586    /// let x = DatabaseInstance::new().set_root_password("example");
7587    /// ```
7588    pub fn set_root_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7589        self.root_password = v.into();
7590        self
7591    }
7592
7593    /// Sets the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
7594    ///
7595    /// # Example
7596    /// ```ignore,no_run
7597    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7598    /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
7599    /// let x = DatabaseInstance::new().set_scheduled_maintenance(SqlScheduledMaintenance::default()/* use setters */);
7600    /// ```
7601    pub fn set_scheduled_maintenance<T>(mut self, v: T) -> Self
7602    where
7603        T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
7604    {
7605        self.scheduled_maintenance = std::option::Option::Some(v.into());
7606        self
7607    }
7608
7609    /// Sets or clears the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
7610    ///
7611    /// # Example
7612    /// ```ignore,no_run
7613    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7614    /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
7615    /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(Some(SqlScheduledMaintenance::default()/* use setters */));
7616    /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(None::<SqlScheduledMaintenance>);
7617    /// ```
7618    pub fn set_or_clear_scheduled_maintenance<T>(mut self, v: std::option::Option<T>) -> Self
7619    where
7620        T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
7621    {
7622        self.scheduled_maintenance = v.map(|x| x.into());
7623        self
7624    }
7625
7626    /// Sets the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
7627    ///
7628    /// # Example
7629    /// ```ignore,no_run
7630    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7631    /// use wkt::BoolValue;
7632    /// let x = DatabaseInstance::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
7633    /// ```
7634    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
7635    where
7636        T: std::convert::Into<wkt::BoolValue>,
7637    {
7638        self.satisfies_pzs = std::option::Option::Some(v.into());
7639        self
7640    }
7641
7642    /// Sets or clears the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
7643    ///
7644    /// # Example
7645    /// ```ignore,no_run
7646    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7647    /// use wkt::BoolValue;
7648    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
7649    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
7650    /// ```
7651    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
7652    where
7653        T: std::convert::Into<wkt::BoolValue>,
7654    {
7655        self.satisfies_pzs = v.map(|x| x.into());
7656        self
7657    }
7658
7659    /// Sets the value of [database_installed_version][crate::model::DatabaseInstance::database_installed_version].
7660    ///
7661    /// # Example
7662    /// ```ignore,no_run
7663    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7664    /// let x = DatabaseInstance::new().set_database_installed_version("example");
7665    /// ```
7666    pub fn set_database_installed_version<T: std::convert::Into<std::string::String>>(
7667        mut self,
7668        v: T,
7669    ) -> Self {
7670        self.database_installed_version = v.into();
7671        self
7672    }
7673
7674    /// Sets the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
7675    ///
7676    /// # Example
7677    /// ```ignore,no_run
7678    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7679    /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
7680    /// let x = DatabaseInstance::new().set_out_of_disk_report(SqlOutOfDiskReport::default()/* use setters */);
7681    /// ```
7682    pub fn set_out_of_disk_report<T>(mut self, v: T) -> Self
7683    where
7684        T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
7685    {
7686        self.out_of_disk_report = std::option::Option::Some(v.into());
7687        self
7688    }
7689
7690    /// Sets or clears the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
7691    ///
7692    /// # Example
7693    /// ```ignore,no_run
7694    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7695    /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
7696    /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(Some(SqlOutOfDiskReport::default()/* use setters */));
7697    /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(None::<SqlOutOfDiskReport>);
7698    /// ```
7699    pub fn set_or_clear_out_of_disk_report<T>(mut self, v: std::option::Option<T>) -> Self
7700    where
7701        T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
7702    {
7703        self.out_of_disk_report = v.map(|x| x.into());
7704        self
7705    }
7706
7707    /// Sets the value of [create_time][crate::model::DatabaseInstance::create_time].
7708    ///
7709    /// # Example
7710    /// ```ignore,no_run
7711    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7712    /// use wkt::Timestamp;
7713    /// let x = DatabaseInstance::new().set_create_time(Timestamp::default()/* use setters */);
7714    /// ```
7715    pub fn set_create_time<T>(mut self, v: T) -> Self
7716    where
7717        T: std::convert::Into<wkt::Timestamp>,
7718    {
7719        self.create_time = std::option::Option::Some(v.into());
7720        self
7721    }
7722
7723    /// Sets or clears the value of [create_time][crate::model::DatabaseInstance::create_time].
7724    ///
7725    /// # Example
7726    /// ```ignore,no_run
7727    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7728    /// use wkt::Timestamp;
7729    /// let x = DatabaseInstance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7730    /// let x = DatabaseInstance::new().set_or_clear_create_time(None::<Timestamp>);
7731    /// ```
7732    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7733    where
7734        T: std::convert::Into<wkt::Timestamp>,
7735    {
7736        self.create_time = v.map(|x| x.into());
7737        self
7738    }
7739
7740    /// Sets the value of [available_maintenance_versions][crate::model::DatabaseInstance::available_maintenance_versions].
7741    ///
7742    /// # Example
7743    /// ```ignore,no_run
7744    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7745    /// let x = DatabaseInstance::new().set_available_maintenance_versions(["a", "b", "c"]);
7746    /// ```
7747    pub fn set_available_maintenance_versions<T, V>(mut self, v: T) -> Self
7748    where
7749        T: std::iter::IntoIterator<Item = V>,
7750        V: std::convert::Into<std::string::String>,
7751    {
7752        use std::iter::Iterator;
7753        self.available_maintenance_versions = v.into_iter().map(|i| i.into()).collect();
7754        self
7755    }
7756
7757    /// Sets the value of [maintenance_version][crate::model::DatabaseInstance::maintenance_version].
7758    ///
7759    /// # Example
7760    /// ```ignore,no_run
7761    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7762    /// let x = DatabaseInstance::new().set_maintenance_version("example");
7763    /// ```
7764    pub fn set_maintenance_version<T: std::convert::Into<std::string::String>>(
7765        mut self,
7766        v: T,
7767    ) -> Self {
7768        self.maintenance_version = v.into();
7769        self
7770    }
7771
7772    /// Sets the value of [upgradable_database_versions][crate::model::DatabaseInstance::upgradable_database_versions].
7773    ///
7774    /// # Example
7775    /// ```ignore,no_run
7776    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7777    /// use google_cloud_sql_v1::model::AvailableDatabaseVersion;
7778    /// let x = DatabaseInstance::new()
7779    ///     .set_upgradable_database_versions([
7780    ///         AvailableDatabaseVersion::default()/* use setters */,
7781    ///         AvailableDatabaseVersion::default()/* use (different) setters */,
7782    ///     ]);
7783    /// ```
7784    pub fn set_upgradable_database_versions<T, V>(mut self, v: T) -> Self
7785    where
7786        T: std::iter::IntoIterator<Item = V>,
7787        V: std::convert::Into<crate::model::AvailableDatabaseVersion>,
7788    {
7789        use std::iter::Iterator;
7790        self.upgradable_database_versions = v.into_iter().map(|i| i.into()).collect();
7791        self
7792    }
7793
7794    /// Sets the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
7795    ///
7796    /// # Example
7797    /// ```ignore,no_run
7798    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7799    /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
7800    /// let x0 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::NewNetworkArchitecture);
7801    /// let x1 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::OldNetworkArchitecture);
7802    /// ```
7803    pub fn set_sql_network_architecture<T>(mut self, v: T) -> Self
7804    where
7805        T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
7806    {
7807        self.sql_network_architecture = std::option::Option::Some(v.into());
7808        self
7809    }
7810
7811    /// Sets or clears the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
7812    ///
7813    /// # Example
7814    /// ```ignore,no_run
7815    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7816    /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
7817    /// let x0 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::NewNetworkArchitecture));
7818    /// let x1 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::OldNetworkArchitecture));
7819    /// let x_none = DatabaseInstance::new().set_or_clear_sql_network_architecture(None::<SqlNetworkArchitecture>);
7820    /// ```
7821    pub fn set_or_clear_sql_network_architecture<T>(mut self, v: std::option::Option<T>) -> Self
7822    where
7823        T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
7824    {
7825        self.sql_network_architecture = v.map(|x| x.into());
7826        self
7827    }
7828
7829    /// Sets the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
7830    ///
7831    /// # Example
7832    /// ```ignore,no_run
7833    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7834    /// let x = DatabaseInstance::new().set_psc_service_attachment_link("example");
7835    /// ```
7836    pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
7837    where
7838        T: std::convert::Into<std::string::String>,
7839    {
7840        self.psc_service_attachment_link = std::option::Option::Some(v.into());
7841        self
7842    }
7843
7844    /// Sets or clears the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
7845    ///
7846    /// # Example
7847    /// ```ignore,no_run
7848    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7849    /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(Some("example"));
7850    /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(None::<String>);
7851    /// ```
7852    pub fn set_or_clear_psc_service_attachment_link<T>(mut self, v: std::option::Option<T>) -> Self
7853    where
7854        T: std::convert::Into<std::string::String>,
7855    {
7856        self.psc_service_attachment_link = v.map(|x| x.into());
7857        self
7858    }
7859
7860    /// Sets the value of [dns_name][crate::model::DatabaseInstance::dns_name].
7861    ///
7862    /// # Example
7863    /// ```ignore,no_run
7864    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7865    /// let x = DatabaseInstance::new().set_dns_name("example");
7866    /// ```
7867    pub fn set_dns_name<T>(mut self, v: T) -> Self
7868    where
7869        T: std::convert::Into<std::string::String>,
7870    {
7871        self.dns_name = std::option::Option::Some(v.into());
7872        self
7873    }
7874
7875    /// Sets or clears the value of [dns_name][crate::model::DatabaseInstance::dns_name].
7876    ///
7877    /// # Example
7878    /// ```ignore,no_run
7879    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7880    /// let x = DatabaseInstance::new().set_or_clear_dns_name(Some("example"));
7881    /// let x = DatabaseInstance::new().set_or_clear_dns_name(None::<String>);
7882    /// ```
7883    pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
7884    where
7885        T: std::convert::Into<std::string::String>,
7886    {
7887        self.dns_name = v.map(|x| x.into());
7888        self
7889    }
7890
7891    /// Sets the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
7892    ///
7893    /// # Example
7894    /// ```ignore,no_run
7895    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7896    /// let x = DatabaseInstance::new().set_primary_dns_name("example");
7897    /// ```
7898    #[deprecated]
7899    pub fn set_primary_dns_name<T>(mut self, v: T) -> Self
7900    where
7901        T: std::convert::Into<std::string::String>,
7902    {
7903        self.primary_dns_name = std::option::Option::Some(v.into());
7904        self
7905    }
7906
7907    /// Sets or clears the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
7908    ///
7909    /// # Example
7910    /// ```ignore,no_run
7911    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7912    /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(Some("example"));
7913    /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(None::<String>);
7914    /// ```
7915    #[deprecated]
7916    pub fn set_or_clear_primary_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
7917    where
7918        T: std::convert::Into<std::string::String>,
7919    {
7920        self.primary_dns_name = v.map(|x| x.into());
7921        self
7922    }
7923
7924    /// Sets the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
7925    ///
7926    /// # Example
7927    /// ```ignore,no_run
7928    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7929    /// let x = DatabaseInstance::new().set_write_endpoint("example");
7930    /// ```
7931    pub fn set_write_endpoint<T>(mut self, v: T) -> Self
7932    where
7933        T: std::convert::Into<std::string::String>,
7934    {
7935        self.write_endpoint = std::option::Option::Some(v.into());
7936        self
7937    }
7938
7939    /// Sets or clears the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
7940    ///
7941    /// # Example
7942    /// ```ignore,no_run
7943    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7944    /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(Some("example"));
7945    /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(None::<String>);
7946    /// ```
7947    pub fn set_or_clear_write_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
7948    where
7949        T: std::convert::Into<std::string::String>,
7950    {
7951        self.write_endpoint = v.map(|x| x.into());
7952        self
7953    }
7954
7955    /// Sets the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
7956    ///
7957    /// # Example
7958    /// ```ignore,no_run
7959    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7960    /// use google_cloud_sql_v1::model::ReplicationCluster;
7961    /// let x = DatabaseInstance::new().set_replication_cluster(ReplicationCluster::default()/* use setters */);
7962    /// ```
7963    pub fn set_replication_cluster<T>(mut self, v: T) -> Self
7964    where
7965        T: std::convert::Into<crate::model::ReplicationCluster>,
7966    {
7967        self.replication_cluster = std::option::Option::Some(v.into());
7968        self
7969    }
7970
7971    /// Sets or clears the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
7972    ///
7973    /// # Example
7974    /// ```ignore,no_run
7975    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7976    /// use google_cloud_sql_v1::model::ReplicationCluster;
7977    /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(Some(ReplicationCluster::default()/* use setters */));
7978    /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(None::<ReplicationCluster>);
7979    /// ```
7980    pub fn set_or_clear_replication_cluster<T>(mut self, v: std::option::Option<T>) -> Self
7981    where
7982        T: std::convert::Into<crate::model::ReplicationCluster>,
7983    {
7984        self.replication_cluster = v.map(|x| x.into());
7985        self
7986    }
7987
7988    /// Sets the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
7989    ///
7990    /// # Example
7991    /// ```ignore,no_run
7992    /// # use google_cloud_sql_v1::model::DatabaseInstance;
7993    /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
7994    /// let x = DatabaseInstance::new().set_gemini_config(GeminiInstanceConfig::default()/* use setters */);
7995    /// ```
7996    pub fn set_gemini_config<T>(mut self, v: T) -> Self
7997    where
7998        T: std::convert::Into<crate::model::GeminiInstanceConfig>,
7999    {
8000        self.gemini_config = std::option::Option::Some(v.into());
8001        self
8002    }
8003
8004    /// Sets or clears the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
8005    ///
8006    /// # Example
8007    /// ```ignore,no_run
8008    /// # use google_cloud_sql_v1::model::DatabaseInstance;
8009    /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
8010    /// let x = DatabaseInstance::new().set_or_clear_gemini_config(Some(GeminiInstanceConfig::default()/* use setters */));
8011    /// let x = DatabaseInstance::new().set_or_clear_gemini_config(None::<GeminiInstanceConfig>);
8012    /// ```
8013    pub fn set_or_clear_gemini_config<T>(mut self, v: std::option::Option<T>) -> Self
8014    where
8015        T: std::convert::Into<crate::model::GeminiInstanceConfig>,
8016    {
8017        self.gemini_config = v.map(|x| x.into());
8018        self
8019    }
8020
8021    /// Sets the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
8022    ///
8023    /// # Example
8024    /// ```ignore,no_run
8025    /// # use google_cloud_sql_v1::model::DatabaseInstance;
8026    /// use wkt::BoolValue;
8027    /// let x = DatabaseInstance::new().set_satisfies_pzi(BoolValue::default()/* use setters */);
8028    /// ```
8029    pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
8030    where
8031        T: std::convert::Into<wkt::BoolValue>,
8032    {
8033        self.satisfies_pzi = std::option::Option::Some(v.into());
8034        self
8035    }
8036
8037    /// Sets or clears the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
8038    ///
8039    /// # Example
8040    /// ```ignore,no_run
8041    /// # use google_cloud_sql_v1::model::DatabaseInstance;
8042    /// use wkt::BoolValue;
8043    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(Some(BoolValue::default()/* use setters */));
8044    /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(None::<BoolValue>);
8045    /// ```
8046    pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
8047    where
8048        T: std::convert::Into<wkt::BoolValue>,
8049    {
8050        self.satisfies_pzi = v.map(|x| x.into());
8051        self
8052    }
8053
8054    /// Sets the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
8055    ///
8056    /// # Example
8057    /// ```ignore,no_run
8058    /// # use google_cloud_sql_v1::model::DatabaseInstance;
8059    /// use wkt::BoolValue;
8060    /// let x = DatabaseInstance::new().set_switch_transaction_logs_to_cloud_storage_enabled(BoolValue::default()/* use setters */);
8061    /// ```
8062    pub fn set_switch_transaction_logs_to_cloud_storage_enabled<T>(mut self, v: T) -> Self
8063    where
8064        T: std::convert::Into<wkt::BoolValue>,
8065    {
8066        self.switch_transaction_logs_to_cloud_storage_enabled = std::option::Option::Some(v.into());
8067        self
8068    }
8069
8070    /// Sets or clears the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
8071    ///
8072    /// # Example
8073    /// ```ignore,no_run
8074    /// # use google_cloud_sql_v1::model::DatabaseInstance;
8075    /// use wkt::BoolValue;
8076    /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(Some(BoolValue::default()/* use setters */));
8077    /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(None::<BoolValue>);
8078    /// ```
8079    pub fn set_or_clear_switch_transaction_logs_to_cloud_storage_enabled<T>(
8080        mut self,
8081        v: std::option::Option<T>,
8082    ) -> Self
8083    where
8084        T: std::convert::Into<wkt::BoolValue>,
8085    {
8086        self.switch_transaction_logs_to_cloud_storage_enabled = v.map(|x| x.into());
8087        self
8088    }
8089}
8090
8091impl wkt::message::Message for DatabaseInstance {
8092    fn typename() -> &'static str {
8093        "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance"
8094    }
8095}
8096
8097/// Defines additional types related to [DatabaseInstance].
8098pub mod database_instance {
8099    #[allow(unused_imports)]
8100    use super::*;
8101
8102    #[derive(Clone, Default, PartialEq)]
8103    #[non_exhaustive]
8104    pub struct SqlFailoverReplica {
8105        /// The name of the failover replica. If specified at instance creation, a
8106        /// failover replica is created for the instance. The name
8107        /// doesn't include the project ID.
8108        pub name: std::string::String,
8109
8110        /// The availability status of the failover replica. A false status indicates
8111        /// that the failover replica is out of sync. The primary instance can only
8112        /// failover to the failover replica when the status is true.
8113        pub available: std::option::Option<wkt::BoolValue>,
8114
8115        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8116    }
8117
8118    impl SqlFailoverReplica {
8119        pub fn new() -> Self {
8120            std::default::Default::default()
8121        }
8122
8123        /// Sets the value of [name][crate::model::database_instance::SqlFailoverReplica::name].
8124        ///
8125        /// # Example
8126        /// ```ignore,no_run
8127        /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
8128        /// let x = SqlFailoverReplica::new().set_name("example");
8129        /// ```
8130        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8131            self.name = v.into();
8132            self
8133        }
8134
8135        /// Sets the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
8136        ///
8137        /// # Example
8138        /// ```ignore,no_run
8139        /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
8140        /// use wkt::BoolValue;
8141        /// let x = SqlFailoverReplica::new().set_available(BoolValue::default()/* use setters */);
8142        /// ```
8143        pub fn set_available<T>(mut self, v: T) -> Self
8144        where
8145            T: std::convert::Into<wkt::BoolValue>,
8146        {
8147            self.available = std::option::Option::Some(v.into());
8148            self
8149        }
8150
8151        /// Sets or clears the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
8152        ///
8153        /// # Example
8154        /// ```ignore,no_run
8155        /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
8156        /// use wkt::BoolValue;
8157        /// let x = SqlFailoverReplica::new().set_or_clear_available(Some(BoolValue::default()/* use setters */));
8158        /// let x = SqlFailoverReplica::new().set_or_clear_available(None::<BoolValue>);
8159        /// ```
8160        pub fn set_or_clear_available<T>(mut self, v: std::option::Option<T>) -> Self
8161        where
8162            T: std::convert::Into<wkt::BoolValue>,
8163        {
8164            self.available = v.map(|x| x.into());
8165            self
8166        }
8167    }
8168
8169    impl wkt::message::Message for SqlFailoverReplica {
8170        fn typename() -> &'static str {
8171            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica"
8172        }
8173    }
8174
8175    /// Any scheduled maintenance for this instance.
8176    #[derive(Clone, Default, PartialEq)]
8177    #[non_exhaustive]
8178    pub struct SqlScheduledMaintenance {
8179        /// The start time of any upcoming scheduled maintenance for this instance.
8180        pub start_time: std::option::Option<wkt::Timestamp>,
8181
8182        #[deprecated]
8183        pub can_defer: bool,
8184
8185        /// If the scheduled maintenance can be rescheduled.
8186        pub can_reschedule: bool,
8187
8188        /// Maintenance cannot be rescheduled to start beyond this deadline.
8189        pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
8190
8191        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8192    }
8193
8194    impl SqlScheduledMaintenance {
8195        pub fn new() -> Self {
8196            std::default::Default::default()
8197        }
8198
8199        /// Sets the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
8200        ///
8201        /// # Example
8202        /// ```ignore,no_run
8203        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
8204        /// use wkt::Timestamp;
8205        /// let x = SqlScheduledMaintenance::new().set_start_time(Timestamp::default()/* use setters */);
8206        /// ```
8207        pub fn set_start_time<T>(mut self, v: T) -> Self
8208        where
8209            T: std::convert::Into<wkt::Timestamp>,
8210        {
8211            self.start_time = std::option::Option::Some(v.into());
8212            self
8213        }
8214
8215        /// Sets or clears the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
8216        ///
8217        /// # Example
8218        /// ```ignore,no_run
8219        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
8220        /// use wkt::Timestamp;
8221        /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8222        /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(None::<Timestamp>);
8223        /// ```
8224        pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8225        where
8226            T: std::convert::Into<wkt::Timestamp>,
8227        {
8228            self.start_time = v.map(|x| x.into());
8229            self
8230        }
8231
8232        /// Sets the value of [can_defer][crate::model::database_instance::SqlScheduledMaintenance::can_defer].
8233        ///
8234        /// # Example
8235        /// ```ignore,no_run
8236        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
8237        /// let x = SqlScheduledMaintenance::new().set_can_defer(true);
8238        /// ```
8239        #[deprecated]
8240        pub fn set_can_defer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8241            self.can_defer = v.into();
8242            self
8243        }
8244
8245        /// Sets the value of [can_reschedule][crate::model::database_instance::SqlScheduledMaintenance::can_reschedule].
8246        ///
8247        /// # Example
8248        /// ```ignore,no_run
8249        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
8250        /// let x = SqlScheduledMaintenance::new().set_can_reschedule(true);
8251        /// ```
8252        pub fn set_can_reschedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8253            self.can_reschedule = v.into();
8254            self
8255        }
8256
8257        /// Sets the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
8258        ///
8259        /// # Example
8260        /// ```ignore,no_run
8261        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
8262        /// use wkt::Timestamp;
8263        /// let x = SqlScheduledMaintenance::new().set_schedule_deadline_time(Timestamp::default()/* use setters */);
8264        /// ```
8265        pub fn set_schedule_deadline_time<T>(mut self, v: T) -> Self
8266        where
8267            T: std::convert::Into<wkt::Timestamp>,
8268        {
8269            self.schedule_deadline_time = std::option::Option::Some(v.into());
8270            self
8271        }
8272
8273        /// Sets or clears the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
8274        ///
8275        /// # Example
8276        /// ```ignore,no_run
8277        /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
8278        /// use wkt::Timestamp;
8279        /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(Some(Timestamp::default()/* use setters */));
8280        /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(None::<Timestamp>);
8281        /// ```
8282        pub fn set_or_clear_schedule_deadline_time<T>(mut self, v: std::option::Option<T>) -> Self
8283        where
8284            T: std::convert::Into<wkt::Timestamp>,
8285        {
8286            self.schedule_deadline_time = v.map(|x| x.into());
8287            self
8288        }
8289    }
8290
8291    impl wkt::message::Message for SqlScheduledMaintenance {
8292        fn typename() -> &'static str {
8293            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance"
8294        }
8295    }
8296
8297    /// This message wraps up the information written by out-of-disk detection job.
8298    #[derive(Clone, Default, PartialEq)]
8299    #[non_exhaustive]
8300    pub struct SqlOutOfDiskReport {
8301        /// This field represents the state generated by the proactive database
8302        /// wellness job for OutOfDisk issues.
8303        ///
8304        /// * Writers:
8305        /// * the proactive database wellness job for OOD.
8306        /// * Readers:
8307        /// * the proactive database wellness job
8308        pub sql_out_of_disk_state: std::option::Option<
8309            crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
8310        >,
8311
8312        /// The minimum recommended increase size in GigaBytes
8313        /// This field is consumed by the frontend
8314        ///
8315        /// * Writers:
8316        /// * the proactive database wellness job for OOD.
8317        /// * Readers:
8318        pub sql_min_recommended_increase_size_gb: std::option::Option<i32>,
8319
8320        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8321    }
8322
8323    impl SqlOutOfDiskReport {
8324        pub fn new() -> Self {
8325            std::default::Default::default()
8326        }
8327
8328        /// Sets the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
8329        ///
8330        /// # Example
8331        /// ```ignore,no_run
8332        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
8333        /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
8334        /// let x0 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::Normal);
8335        /// let x1 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::SoftShutdown);
8336        /// ```
8337        pub fn set_sql_out_of_disk_state<T>(mut self, v: T) -> Self
8338        where
8339            T: std::convert::Into<
8340                    crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
8341                >,
8342        {
8343            self.sql_out_of_disk_state = std::option::Option::Some(v.into());
8344            self
8345        }
8346
8347        /// Sets or clears the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
8348        ///
8349        /// # Example
8350        /// ```ignore,no_run
8351        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
8352        /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
8353        /// let x0 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::Normal));
8354        /// let x1 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::SoftShutdown));
8355        /// let x_none = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(None::<SqlOutOfDiskState>);
8356        /// ```
8357        pub fn set_or_clear_sql_out_of_disk_state<T>(mut self, v: std::option::Option<T>) -> Self
8358        where
8359            T: std::convert::Into<
8360                    crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
8361                >,
8362        {
8363            self.sql_out_of_disk_state = v.map(|x| x.into());
8364            self
8365        }
8366
8367        /// Sets the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
8368        ///
8369        /// # Example
8370        /// ```ignore,no_run
8371        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
8372        /// let x = SqlOutOfDiskReport::new().set_sql_min_recommended_increase_size_gb(42);
8373        /// ```
8374        pub fn set_sql_min_recommended_increase_size_gb<T>(mut self, v: T) -> Self
8375        where
8376            T: std::convert::Into<i32>,
8377        {
8378            self.sql_min_recommended_increase_size_gb = std::option::Option::Some(v.into());
8379            self
8380        }
8381
8382        /// Sets or clears the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
8383        ///
8384        /// # Example
8385        /// ```ignore,no_run
8386        /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
8387        /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(Some(42));
8388        /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(None::<i32>);
8389        /// ```
8390        pub fn set_or_clear_sql_min_recommended_increase_size_gb<T>(
8391            mut self,
8392            v: std::option::Option<T>,
8393        ) -> Self
8394        where
8395            T: std::convert::Into<i32>,
8396        {
8397            self.sql_min_recommended_increase_size_gb = v.map(|x| x.into());
8398            self
8399        }
8400    }
8401
8402    impl wkt::message::Message for SqlOutOfDiskReport {
8403        fn typename() -> &'static str {
8404            "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport"
8405        }
8406    }
8407
8408    /// Defines additional types related to [SqlOutOfDiskReport].
8409    pub mod sql_out_of_disk_report {
8410        #[allow(unused_imports)]
8411        use super::*;
8412
8413        /// This enum lists all possible states regarding out-of-disk issues.
8414        ///
8415        /// # Working with unknown values
8416        ///
8417        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8418        /// additional enum variants at any time. Adding new variants is not considered
8419        /// a breaking change. Applications should write their code in anticipation of:
8420        ///
8421        /// - New values appearing in future releases of the client library, **and**
8422        /// - New values received dynamically, without application changes.
8423        ///
8424        /// Please consult the [Working with enums] section in the user guide for some
8425        /// guidelines.
8426        ///
8427        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8428        #[derive(Clone, Debug, PartialEq)]
8429        #[non_exhaustive]
8430        pub enum SqlOutOfDiskState {
8431            /// Unspecified state
8432            Unspecified,
8433            /// The instance has plenty space on data disk
8434            Normal,
8435            /// Data disk is almost used up. It is shutdown to prevent data
8436            /// corruption.
8437            SoftShutdown,
8438            /// If set, the enum was initialized with an unknown value.
8439            ///
8440            /// Applications can examine the value using [SqlOutOfDiskState::value] or
8441            /// [SqlOutOfDiskState::name].
8442            UnknownValue(sql_out_of_disk_state::UnknownValue),
8443        }
8444
8445        #[doc(hidden)]
8446        pub mod sql_out_of_disk_state {
8447            #[allow(unused_imports)]
8448            use super::*;
8449            #[derive(Clone, Debug, PartialEq)]
8450            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8451        }
8452
8453        impl SqlOutOfDiskState {
8454            /// Gets the enum value.
8455            ///
8456            /// Returns `None` if the enum contains an unknown value deserialized from
8457            /// the string representation of enums.
8458            pub fn value(&self) -> std::option::Option<i32> {
8459                match self {
8460                    Self::Unspecified => std::option::Option::Some(0),
8461                    Self::Normal => std::option::Option::Some(1),
8462                    Self::SoftShutdown => std::option::Option::Some(2),
8463                    Self::UnknownValue(u) => u.0.value(),
8464                }
8465            }
8466
8467            /// Gets the enum value as a string.
8468            ///
8469            /// Returns `None` if the enum contains an unknown value deserialized from
8470            /// the integer representation of enums.
8471            pub fn name(&self) -> std::option::Option<&str> {
8472                match self {
8473                    Self::Unspecified => {
8474                        std::option::Option::Some("SQL_OUT_OF_DISK_STATE_UNSPECIFIED")
8475                    }
8476                    Self::Normal => std::option::Option::Some("NORMAL"),
8477                    Self::SoftShutdown => std::option::Option::Some("SOFT_SHUTDOWN"),
8478                    Self::UnknownValue(u) => u.0.name(),
8479                }
8480            }
8481        }
8482
8483        impl std::default::Default for SqlOutOfDiskState {
8484            fn default() -> Self {
8485                use std::convert::From;
8486                Self::from(0)
8487            }
8488        }
8489
8490        impl std::fmt::Display for SqlOutOfDiskState {
8491            fn fmt(
8492                &self,
8493                f: &mut std::fmt::Formatter<'_>,
8494            ) -> std::result::Result<(), std::fmt::Error> {
8495                wkt::internal::display_enum(f, self.name(), self.value())
8496            }
8497        }
8498
8499        impl std::convert::From<i32> for SqlOutOfDiskState {
8500            fn from(value: i32) -> Self {
8501                match value {
8502                    0 => Self::Unspecified,
8503                    1 => Self::Normal,
8504                    2 => Self::SoftShutdown,
8505                    _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
8506                        wkt::internal::UnknownEnumValue::Integer(value),
8507                    )),
8508                }
8509            }
8510        }
8511
8512        impl std::convert::From<&str> for SqlOutOfDiskState {
8513            fn from(value: &str) -> Self {
8514                use std::string::ToString;
8515                match value {
8516                    "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" => Self::Unspecified,
8517                    "NORMAL" => Self::Normal,
8518                    "SOFT_SHUTDOWN" => Self::SoftShutdown,
8519                    _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
8520                        wkt::internal::UnknownEnumValue::String(value.to_string()),
8521                    )),
8522                }
8523            }
8524        }
8525
8526        impl serde::ser::Serialize for SqlOutOfDiskState {
8527            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8528            where
8529                S: serde::Serializer,
8530            {
8531                match self {
8532                    Self::Unspecified => serializer.serialize_i32(0),
8533                    Self::Normal => serializer.serialize_i32(1),
8534                    Self::SoftShutdown => serializer.serialize_i32(2),
8535                    Self::UnknownValue(u) => u.0.serialize(serializer),
8536                }
8537            }
8538        }
8539
8540        impl<'de> serde::de::Deserialize<'de> for SqlOutOfDiskState {
8541            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8542            where
8543                D: serde::Deserializer<'de>,
8544            {
8545                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOutOfDiskState>::new(
8546                    ".google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState",
8547                ))
8548            }
8549        }
8550    }
8551
8552    /// The current serving state of the database instance.
8553    ///
8554    /// # Working with unknown values
8555    ///
8556    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8557    /// additional enum variants at any time. Adding new variants is not considered
8558    /// a breaking change. Applications should write their code in anticipation of:
8559    ///
8560    /// - New values appearing in future releases of the client library, **and**
8561    /// - New values received dynamically, without application changes.
8562    ///
8563    /// Please consult the [Working with enums] section in the user guide for some
8564    /// guidelines.
8565    ///
8566    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8567    #[derive(Clone, Debug, PartialEq)]
8568    #[non_exhaustive]
8569    pub enum SqlInstanceState {
8570        /// The state of the instance is unknown.
8571        Unspecified,
8572        /// The instance is running, or has been stopped by owner.
8573        Runnable,
8574        /// The instance is not available, for example due to problems with billing.
8575        Suspended,
8576        /// The instance is being deleted.
8577        PendingDelete,
8578        /// The instance is being created.
8579        PendingCreate,
8580        /// The instance is down for maintenance.
8581        Maintenance,
8582        /// The creation of the instance failed or a fatal error occurred during
8583        /// maintenance.
8584        Failed,
8585        /// Deprecated
8586        #[deprecated]
8587        OnlineMaintenance,
8588        /// If set, the enum was initialized with an unknown value.
8589        ///
8590        /// Applications can examine the value using [SqlInstanceState::value] or
8591        /// [SqlInstanceState::name].
8592        UnknownValue(sql_instance_state::UnknownValue),
8593    }
8594
8595    #[doc(hidden)]
8596    pub mod sql_instance_state {
8597        #[allow(unused_imports)]
8598        use super::*;
8599        #[derive(Clone, Debug, PartialEq)]
8600        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8601    }
8602
8603    impl SqlInstanceState {
8604        /// Gets the enum value.
8605        ///
8606        /// Returns `None` if the enum contains an unknown value deserialized from
8607        /// the string representation of enums.
8608        pub fn value(&self) -> std::option::Option<i32> {
8609            match self {
8610                Self::Unspecified => std::option::Option::Some(0),
8611                Self::Runnable => std::option::Option::Some(1),
8612                Self::Suspended => std::option::Option::Some(2),
8613                Self::PendingDelete => std::option::Option::Some(3),
8614                Self::PendingCreate => std::option::Option::Some(4),
8615                Self::Maintenance => std::option::Option::Some(5),
8616                Self::Failed => std::option::Option::Some(6),
8617                Self::OnlineMaintenance => std::option::Option::Some(7),
8618                Self::UnknownValue(u) => u.0.value(),
8619            }
8620        }
8621
8622        /// Gets the enum value as a string.
8623        ///
8624        /// Returns `None` if the enum contains an unknown value deserialized from
8625        /// the integer representation of enums.
8626        pub fn name(&self) -> std::option::Option<&str> {
8627            match self {
8628                Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_STATE_UNSPECIFIED"),
8629                Self::Runnable => std::option::Option::Some("RUNNABLE"),
8630                Self::Suspended => std::option::Option::Some("SUSPENDED"),
8631                Self::PendingDelete => std::option::Option::Some("PENDING_DELETE"),
8632                Self::PendingCreate => std::option::Option::Some("PENDING_CREATE"),
8633                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
8634                Self::Failed => std::option::Option::Some("FAILED"),
8635                Self::OnlineMaintenance => std::option::Option::Some("ONLINE_MAINTENANCE"),
8636                Self::UnknownValue(u) => u.0.name(),
8637            }
8638        }
8639    }
8640
8641    impl std::default::Default for SqlInstanceState {
8642        fn default() -> Self {
8643            use std::convert::From;
8644            Self::from(0)
8645        }
8646    }
8647
8648    impl std::fmt::Display for SqlInstanceState {
8649        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8650            wkt::internal::display_enum(f, self.name(), self.value())
8651        }
8652    }
8653
8654    impl std::convert::From<i32> for SqlInstanceState {
8655        fn from(value: i32) -> Self {
8656            match value {
8657                0 => Self::Unspecified,
8658                1 => Self::Runnable,
8659                2 => Self::Suspended,
8660                3 => Self::PendingDelete,
8661                4 => Self::PendingCreate,
8662                5 => Self::Maintenance,
8663                6 => Self::Failed,
8664                7 => Self::OnlineMaintenance,
8665                _ => Self::UnknownValue(sql_instance_state::UnknownValue(
8666                    wkt::internal::UnknownEnumValue::Integer(value),
8667                )),
8668            }
8669        }
8670    }
8671
8672    impl std::convert::From<&str> for SqlInstanceState {
8673        fn from(value: &str) -> Self {
8674            use std::string::ToString;
8675            match value {
8676                "SQL_INSTANCE_STATE_UNSPECIFIED" => Self::Unspecified,
8677                "RUNNABLE" => Self::Runnable,
8678                "SUSPENDED" => Self::Suspended,
8679                "PENDING_DELETE" => Self::PendingDelete,
8680                "PENDING_CREATE" => Self::PendingCreate,
8681                "MAINTENANCE" => Self::Maintenance,
8682                "FAILED" => Self::Failed,
8683                "ONLINE_MAINTENANCE" => Self::OnlineMaintenance,
8684                _ => Self::UnknownValue(sql_instance_state::UnknownValue(
8685                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8686                )),
8687            }
8688        }
8689    }
8690
8691    impl serde::ser::Serialize for SqlInstanceState {
8692        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8693        where
8694            S: serde::Serializer,
8695        {
8696            match self {
8697                Self::Unspecified => serializer.serialize_i32(0),
8698                Self::Runnable => serializer.serialize_i32(1),
8699                Self::Suspended => serializer.serialize_i32(2),
8700                Self::PendingDelete => serializer.serialize_i32(3),
8701                Self::PendingCreate => serializer.serialize_i32(4),
8702                Self::Maintenance => serializer.serialize_i32(5),
8703                Self::Failed => serializer.serialize_i32(6),
8704                Self::OnlineMaintenance => serializer.serialize_i32(7),
8705                Self::UnknownValue(u) => u.0.serialize(serializer),
8706            }
8707        }
8708    }
8709
8710    impl<'de> serde::de::Deserialize<'de> for SqlInstanceState {
8711        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8712        where
8713            D: serde::Deserializer<'de>,
8714        {
8715            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceState>::new(
8716                ".google.cloud.sql.v1.DatabaseInstance.SqlInstanceState",
8717            ))
8718        }
8719    }
8720
8721    /// The SQL network architecture for the instance.
8722    ///
8723    /// # Working with unknown values
8724    ///
8725    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8726    /// additional enum variants at any time. Adding new variants is not considered
8727    /// a breaking change. Applications should write their code in anticipation of:
8728    ///
8729    /// - New values appearing in future releases of the client library, **and**
8730    /// - New values received dynamically, without application changes.
8731    ///
8732    /// Please consult the [Working with enums] section in the user guide for some
8733    /// guidelines.
8734    ///
8735    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8736    #[derive(Clone, Debug, PartialEq)]
8737    #[non_exhaustive]
8738    pub enum SqlNetworkArchitecture {
8739        Unspecified,
8740        /// The instance uses the new network architecture.
8741        NewNetworkArchitecture,
8742        /// The instance uses the old network architecture.
8743        OldNetworkArchitecture,
8744        /// If set, the enum was initialized with an unknown value.
8745        ///
8746        /// Applications can examine the value using [SqlNetworkArchitecture::value] or
8747        /// [SqlNetworkArchitecture::name].
8748        UnknownValue(sql_network_architecture::UnknownValue),
8749    }
8750
8751    #[doc(hidden)]
8752    pub mod sql_network_architecture {
8753        #[allow(unused_imports)]
8754        use super::*;
8755        #[derive(Clone, Debug, PartialEq)]
8756        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8757    }
8758
8759    impl SqlNetworkArchitecture {
8760        /// Gets the enum value.
8761        ///
8762        /// Returns `None` if the enum contains an unknown value deserialized from
8763        /// the string representation of enums.
8764        pub fn value(&self) -> std::option::Option<i32> {
8765            match self {
8766                Self::Unspecified => std::option::Option::Some(0),
8767                Self::NewNetworkArchitecture => std::option::Option::Some(1),
8768                Self::OldNetworkArchitecture => std::option::Option::Some(2),
8769                Self::UnknownValue(u) => u.0.value(),
8770            }
8771        }
8772
8773        /// Gets the enum value as a string.
8774        ///
8775        /// Returns `None` if the enum contains an unknown value deserialized from
8776        /// the integer representation of enums.
8777        pub fn name(&self) -> std::option::Option<&str> {
8778            match self {
8779                Self::Unspecified => {
8780                    std::option::Option::Some("SQL_NETWORK_ARCHITECTURE_UNSPECIFIED")
8781                }
8782                Self::NewNetworkArchitecture => {
8783                    std::option::Option::Some("NEW_NETWORK_ARCHITECTURE")
8784                }
8785                Self::OldNetworkArchitecture => {
8786                    std::option::Option::Some("OLD_NETWORK_ARCHITECTURE")
8787                }
8788                Self::UnknownValue(u) => u.0.name(),
8789            }
8790        }
8791    }
8792
8793    impl std::default::Default for SqlNetworkArchitecture {
8794        fn default() -> Self {
8795            use std::convert::From;
8796            Self::from(0)
8797        }
8798    }
8799
8800    impl std::fmt::Display for SqlNetworkArchitecture {
8801        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8802            wkt::internal::display_enum(f, self.name(), self.value())
8803        }
8804    }
8805
8806    impl std::convert::From<i32> for SqlNetworkArchitecture {
8807        fn from(value: i32) -> Self {
8808            match value {
8809                0 => Self::Unspecified,
8810                1 => Self::NewNetworkArchitecture,
8811                2 => Self::OldNetworkArchitecture,
8812                _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
8813                    wkt::internal::UnknownEnumValue::Integer(value),
8814                )),
8815            }
8816        }
8817    }
8818
8819    impl std::convert::From<&str> for SqlNetworkArchitecture {
8820        fn from(value: &str) -> Self {
8821            use std::string::ToString;
8822            match value {
8823                "SQL_NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
8824                "NEW_NETWORK_ARCHITECTURE" => Self::NewNetworkArchitecture,
8825                "OLD_NETWORK_ARCHITECTURE" => Self::OldNetworkArchitecture,
8826                _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
8827                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8828                )),
8829            }
8830        }
8831    }
8832
8833    impl serde::ser::Serialize for SqlNetworkArchitecture {
8834        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8835        where
8836            S: serde::Serializer,
8837        {
8838            match self {
8839                Self::Unspecified => serializer.serialize_i32(0),
8840                Self::NewNetworkArchitecture => serializer.serialize_i32(1),
8841                Self::OldNetworkArchitecture => serializer.serialize_i32(2),
8842                Self::UnknownValue(u) => u.0.serialize(serializer),
8843            }
8844        }
8845    }
8846
8847    impl<'de> serde::de::Deserialize<'de> for SqlNetworkArchitecture {
8848        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8849        where
8850            D: serde::Deserializer<'de>,
8851        {
8852            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlNetworkArchitecture>::new(
8853                ".google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture",
8854            ))
8855        }
8856    }
8857}
8858
8859/// Gemini instance configuration.
8860#[derive(Clone, Default, PartialEq)]
8861#[non_exhaustive]
8862pub struct GeminiInstanceConfig {
8863    /// Output only. Whether Gemini is enabled.
8864    pub entitled: std::option::Option<bool>,
8865
8866    /// Output only. Whether the vacuum management is enabled.
8867    pub google_vacuum_mgmt_enabled: std::option::Option<bool>,
8868
8869    /// Output only. Whether canceling the out-of-memory (OOM) session is enabled.
8870    pub oom_session_cancel_enabled: std::option::Option<bool>,
8871
8872    /// Output only. Whether the active query is enabled.
8873    pub active_query_enabled: std::option::Option<bool>,
8874
8875    /// Output only. Whether the index advisor is enabled.
8876    pub index_advisor_enabled: std::option::Option<bool>,
8877
8878    /// Output only. Whether the flag recommender is enabled.
8879    pub flag_recommender_enabled: std::option::Option<bool>,
8880
8881    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8882}
8883
8884impl GeminiInstanceConfig {
8885    pub fn new() -> Self {
8886        std::default::Default::default()
8887    }
8888
8889    /// Sets the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
8890    ///
8891    /// # Example
8892    /// ```ignore,no_run
8893    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
8894    /// let x = GeminiInstanceConfig::new().set_entitled(true);
8895    /// ```
8896    pub fn set_entitled<T>(mut self, v: T) -> Self
8897    where
8898        T: std::convert::Into<bool>,
8899    {
8900        self.entitled = std::option::Option::Some(v.into());
8901        self
8902    }
8903
8904    /// Sets or clears the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
8905    ///
8906    /// # Example
8907    /// ```ignore,no_run
8908    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
8909    /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(Some(false));
8910    /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(None::<bool>);
8911    /// ```
8912    pub fn set_or_clear_entitled<T>(mut self, v: std::option::Option<T>) -> Self
8913    where
8914        T: std::convert::Into<bool>,
8915    {
8916        self.entitled = v.map(|x| x.into());
8917        self
8918    }
8919
8920    /// Sets the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
8921    ///
8922    /// # Example
8923    /// ```ignore,no_run
8924    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
8925    /// let x = GeminiInstanceConfig::new().set_google_vacuum_mgmt_enabled(true);
8926    /// ```
8927    pub fn set_google_vacuum_mgmt_enabled<T>(mut self, v: T) -> Self
8928    where
8929        T: std::convert::Into<bool>,
8930    {
8931        self.google_vacuum_mgmt_enabled = std::option::Option::Some(v.into());
8932        self
8933    }
8934
8935    /// Sets or clears the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
8936    ///
8937    /// # Example
8938    /// ```ignore,no_run
8939    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
8940    /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(Some(false));
8941    /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(None::<bool>);
8942    /// ```
8943    pub fn set_or_clear_google_vacuum_mgmt_enabled<T>(mut self, v: std::option::Option<T>) -> Self
8944    where
8945        T: std::convert::Into<bool>,
8946    {
8947        self.google_vacuum_mgmt_enabled = v.map(|x| x.into());
8948        self
8949    }
8950
8951    /// Sets the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
8952    ///
8953    /// # Example
8954    /// ```ignore,no_run
8955    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
8956    /// let x = GeminiInstanceConfig::new().set_oom_session_cancel_enabled(true);
8957    /// ```
8958    pub fn set_oom_session_cancel_enabled<T>(mut self, v: T) -> Self
8959    where
8960        T: std::convert::Into<bool>,
8961    {
8962        self.oom_session_cancel_enabled = std::option::Option::Some(v.into());
8963        self
8964    }
8965
8966    /// Sets or clears the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
8967    ///
8968    /// # Example
8969    /// ```ignore,no_run
8970    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
8971    /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(Some(false));
8972    /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(None::<bool>);
8973    /// ```
8974    pub fn set_or_clear_oom_session_cancel_enabled<T>(mut self, v: std::option::Option<T>) -> Self
8975    where
8976        T: std::convert::Into<bool>,
8977    {
8978        self.oom_session_cancel_enabled = v.map(|x| x.into());
8979        self
8980    }
8981
8982    /// Sets the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
8983    ///
8984    /// # Example
8985    /// ```ignore,no_run
8986    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
8987    /// let x = GeminiInstanceConfig::new().set_active_query_enabled(true);
8988    /// ```
8989    pub fn set_active_query_enabled<T>(mut self, v: T) -> Self
8990    where
8991        T: std::convert::Into<bool>,
8992    {
8993        self.active_query_enabled = std::option::Option::Some(v.into());
8994        self
8995    }
8996
8997    /// Sets or clears the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
8998    ///
8999    /// # Example
9000    /// ```ignore,no_run
9001    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
9002    /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(Some(false));
9003    /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(None::<bool>);
9004    /// ```
9005    pub fn set_or_clear_active_query_enabled<T>(mut self, v: std::option::Option<T>) -> Self
9006    where
9007        T: std::convert::Into<bool>,
9008    {
9009        self.active_query_enabled = v.map(|x| x.into());
9010        self
9011    }
9012
9013    /// Sets the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
9014    ///
9015    /// # Example
9016    /// ```ignore,no_run
9017    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
9018    /// let x = GeminiInstanceConfig::new().set_index_advisor_enabled(true);
9019    /// ```
9020    pub fn set_index_advisor_enabled<T>(mut self, v: T) -> Self
9021    where
9022        T: std::convert::Into<bool>,
9023    {
9024        self.index_advisor_enabled = std::option::Option::Some(v.into());
9025        self
9026    }
9027
9028    /// Sets or clears the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
9029    ///
9030    /// # Example
9031    /// ```ignore,no_run
9032    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
9033    /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(Some(false));
9034    /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(None::<bool>);
9035    /// ```
9036    pub fn set_or_clear_index_advisor_enabled<T>(mut self, v: std::option::Option<T>) -> Self
9037    where
9038        T: std::convert::Into<bool>,
9039    {
9040        self.index_advisor_enabled = v.map(|x| x.into());
9041        self
9042    }
9043
9044    /// Sets the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
9045    ///
9046    /// # Example
9047    /// ```ignore,no_run
9048    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
9049    /// let x = GeminiInstanceConfig::new().set_flag_recommender_enabled(true);
9050    /// ```
9051    pub fn set_flag_recommender_enabled<T>(mut self, v: T) -> Self
9052    where
9053        T: std::convert::Into<bool>,
9054    {
9055        self.flag_recommender_enabled = std::option::Option::Some(v.into());
9056        self
9057    }
9058
9059    /// Sets or clears the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
9060    ///
9061    /// # Example
9062    /// ```ignore,no_run
9063    /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
9064    /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(Some(false));
9065    /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(None::<bool>);
9066    /// ```
9067    pub fn set_or_clear_flag_recommender_enabled<T>(mut self, v: std::option::Option<T>) -> Self
9068    where
9069        T: std::convert::Into<bool>,
9070    {
9071        self.flag_recommender_enabled = v.map(|x| x.into());
9072        self
9073    }
9074}
9075
9076impl wkt::message::Message for GeminiInstanceConfig {
9077    fn typename() -> &'static str {
9078        "type.googleapis.com/google.cloud.sql.v1.GeminiInstanceConfig"
9079    }
9080}
9081
9082/// A primary instance and disaster recovery (DR) replica pair.
9083/// A DR replica is a cross-region replica that you designate for failover in
9084/// the event that the primary instance experiences regional failure.
9085/// Only applicable to MySQL.
9086#[derive(Clone, Default, PartialEq)]
9087#[non_exhaustive]
9088pub struct ReplicationCluster {
9089    /// Output only. If set, it indicates this instance has a private service
9090    /// access (PSA) dns endpoint that is pointing to the primary instance of the
9091    /// cluster. If this instance is the primary, the dns should be pointing to
9092    /// this instance. After Switchover or Replica failover, this DNS endpoint
9093    /// points to the promoted instance. This is a read-only field, returned to the
9094    /// user as information. This field can exist even if a standalone instance
9095    /// does not yet have a replica, or had a DR replica that was deleted.
9096    pub psa_write_endpoint: std::string::String,
9097
9098    /// Optional. If the instance is a primary instance, then this field identifies
9099    /// the disaster recovery (DR) replica. A DR replica is an optional
9100    /// configuration for Enterprise Plus edition instances. If the instance is a
9101    /// read replica, then the field is not set. Set this field to a replica name
9102    /// to designate a DR replica for a primary instance. Remove the replica name
9103    /// to remove the DR replica designation.
9104    pub failover_dr_replica_name: std::string::String,
9105
9106    /// Output only. Read-only field that indicates whether the replica is a DR
9107    /// replica. This field is not set if the instance is a primary instance.
9108    pub dr_replica: bool,
9109
9110    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9111}
9112
9113impl ReplicationCluster {
9114    pub fn new() -> Self {
9115        std::default::Default::default()
9116    }
9117
9118    /// Sets the value of [psa_write_endpoint][crate::model::ReplicationCluster::psa_write_endpoint].
9119    ///
9120    /// # Example
9121    /// ```ignore,no_run
9122    /// # use google_cloud_sql_v1::model::ReplicationCluster;
9123    /// let x = ReplicationCluster::new().set_psa_write_endpoint("example");
9124    /// ```
9125    pub fn set_psa_write_endpoint<T: std::convert::Into<std::string::String>>(
9126        mut self,
9127        v: T,
9128    ) -> Self {
9129        self.psa_write_endpoint = v.into();
9130        self
9131    }
9132
9133    /// Sets the value of [failover_dr_replica_name][crate::model::ReplicationCluster::failover_dr_replica_name].
9134    ///
9135    /// # Example
9136    /// ```ignore,no_run
9137    /// # use google_cloud_sql_v1::model::ReplicationCluster;
9138    /// let x = ReplicationCluster::new().set_failover_dr_replica_name("example");
9139    /// ```
9140    pub fn set_failover_dr_replica_name<T: std::convert::Into<std::string::String>>(
9141        mut self,
9142        v: T,
9143    ) -> Self {
9144        self.failover_dr_replica_name = v.into();
9145        self
9146    }
9147
9148    /// Sets the value of [dr_replica][crate::model::ReplicationCluster::dr_replica].
9149    ///
9150    /// # Example
9151    /// ```ignore,no_run
9152    /// # use google_cloud_sql_v1::model::ReplicationCluster;
9153    /// let x = ReplicationCluster::new().set_dr_replica(true);
9154    /// ```
9155    pub fn set_dr_replica<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9156        self.dr_replica = v.into();
9157        self
9158    }
9159}
9160
9161impl wkt::message::Message for ReplicationCluster {
9162    fn typename() -> &'static str {
9163        "type.googleapis.com/google.cloud.sql.v1.ReplicationCluster"
9164    }
9165}
9166
9167/// An available database version. It can be a major or a minor version.
9168#[derive(Clone, Default, PartialEq)]
9169#[non_exhaustive]
9170pub struct AvailableDatabaseVersion {
9171    /// The version's major version name.
9172    pub major_version: std::option::Option<std::string::String>,
9173
9174    /// The database version name. For MySQL 8.0, this string provides the database
9175    /// major and minor version.
9176    pub name: std::option::Option<std::string::String>,
9177
9178    /// The database version's display name.
9179    pub display_name: std::option::Option<std::string::String>,
9180
9181    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9182}
9183
9184impl AvailableDatabaseVersion {
9185    pub fn new() -> Self {
9186        std::default::Default::default()
9187    }
9188
9189    /// Sets the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
9190    ///
9191    /// # Example
9192    /// ```ignore,no_run
9193    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
9194    /// let x = AvailableDatabaseVersion::new().set_major_version("example");
9195    /// ```
9196    pub fn set_major_version<T>(mut self, v: T) -> Self
9197    where
9198        T: std::convert::Into<std::string::String>,
9199    {
9200        self.major_version = std::option::Option::Some(v.into());
9201        self
9202    }
9203
9204    /// Sets or clears the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
9205    ///
9206    /// # Example
9207    /// ```ignore,no_run
9208    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
9209    /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(Some("example"));
9210    /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(None::<String>);
9211    /// ```
9212    pub fn set_or_clear_major_version<T>(mut self, v: std::option::Option<T>) -> Self
9213    where
9214        T: std::convert::Into<std::string::String>,
9215    {
9216        self.major_version = v.map(|x| x.into());
9217        self
9218    }
9219
9220    /// Sets the value of [name][crate::model::AvailableDatabaseVersion::name].
9221    ///
9222    /// # Example
9223    /// ```ignore,no_run
9224    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
9225    /// let x = AvailableDatabaseVersion::new().set_name("example");
9226    /// ```
9227    pub fn set_name<T>(mut self, v: T) -> Self
9228    where
9229        T: std::convert::Into<std::string::String>,
9230    {
9231        self.name = std::option::Option::Some(v.into());
9232        self
9233    }
9234
9235    /// Sets or clears the value of [name][crate::model::AvailableDatabaseVersion::name].
9236    ///
9237    /// # Example
9238    /// ```ignore,no_run
9239    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
9240    /// let x = AvailableDatabaseVersion::new().set_or_clear_name(Some("example"));
9241    /// let x = AvailableDatabaseVersion::new().set_or_clear_name(None::<String>);
9242    /// ```
9243    pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
9244    where
9245        T: std::convert::Into<std::string::String>,
9246    {
9247        self.name = v.map(|x| x.into());
9248        self
9249    }
9250
9251    /// Sets the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
9252    ///
9253    /// # Example
9254    /// ```ignore,no_run
9255    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
9256    /// let x = AvailableDatabaseVersion::new().set_display_name("example");
9257    /// ```
9258    pub fn set_display_name<T>(mut self, v: T) -> Self
9259    where
9260        T: std::convert::Into<std::string::String>,
9261    {
9262        self.display_name = std::option::Option::Some(v.into());
9263        self
9264    }
9265
9266    /// Sets or clears the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
9267    ///
9268    /// # Example
9269    /// ```ignore,no_run
9270    /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
9271    /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(Some("example"));
9272    /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(None::<String>);
9273    /// ```
9274    pub fn set_or_clear_display_name<T>(mut self, v: std::option::Option<T>) -> Self
9275    where
9276        T: std::convert::Into<std::string::String>,
9277    {
9278        self.display_name = v.map(|x| x.into());
9279        self
9280    }
9281}
9282
9283impl wkt::message::Message for AvailableDatabaseVersion {
9284    fn typename() -> &'static str {
9285        "type.googleapis.com/google.cloud.sql.v1.AvailableDatabaseVersion"
9286    }
9287}
9288
9289/// Reschedule options for maintenance windows.
9290#[derive(Clone, Default, PartialEq)]
9291#[non_exhaustive]
9292pub struct SqlInstancesRescheduleMaintenanceRequestBody {
9293    /// Required. The type of the reschedule the user wants.
9294    pub reschedule: std::option::Option<
9295        crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
9296    >,
9297
9298    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9299}
9300
9301impl SqlInstancesRescheduleMaintenanceRequestBody {
9302    pub fn new() -> Self {
9303        std::default::Default::default()
9304    }
9305
9306    /// Sets the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
9307    ///
9308    /// # Example
9309    /// ```ignore,no_run
9310    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
9311    /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
9312    /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_reschedule(Reschedule::default()/* use setters */);
9313    /// ```
9314    pub fn set_reschedule<T>(mut self, v: T) -> Self
9315    where
9316        T: std::convert::Into<
9317                crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
9318            >,
9319    {
9320        self.reschedule = std::option::Option::Some(v.into());
9321        self
9322    }
9323
9324    /// Sets or clears the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
9325    ///
9326    /// # Example
9327    /// ```ignore,no_run
9328    /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
9329    /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
9330    /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(Some(Reschedule::default()/* use setters */));
9331    /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(None::<Reschedule>);
9332    /// ```
9333    pub fn set_or_clear_reschedule<T>(mut self, v: std::option::Option<T>) -> Self
9334    where
9335        T: std::convert::Into<
9336                crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
9337            >,
9338    {
9339        self.reschedule = v.map(|x| x.into());
9340        self
9341    }
9342}
9343
9344impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequestBody {
9345    fn typename() -> &'static str {
9346        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody"
9347    }
9348}
9349
9350/// Defines additional types related to [SqlInstancesRescheduleMaintenanceRequestBody].
9351pub mod sql_instances_reschedule_maintenance_request_body {
9352    #[allow(unused_imports)]
9353    use super::*;
9354
9355    #[derive(Clone, Default, PartialEq)]
9356    #[non_exhaustive]
9357    pub struct Reschedule {
9358        /// Required. The type of the reschedule.
9359        pub reschedule_type:
9360            crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
9361
9362        /// Optional. Timestamp when the maintenance shall be rescheduled to if
9363        /// reschedule_type=SPECIFIC_TIME, in
9364        /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
9365        /// `2012-11-15T16:19:00.094Z`.
9366        pub schedule_time: std::option::Option<wkt::Timestamp>,
9367
9368        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9369    }
9370
9371    impl Reschedule {
9372        pub fn new() -> Self {
9373            std::default::Default::default()
9374        }
9375
9376        /// Sets the value of [reschedule_type][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::reschedule_type].
9377        ///
9378        /// # Example
9379        /// ```ignore,no_run
9380        /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
9381        /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::RescheduleType;
9382        /// let x0 = Reschedule::new().set_reschedule_type(RescheduleType::Immediate);
9383        /// let x1 = Reschedule::new().set_reschedule_type(RescheduleType::NextAvailableWindow);
9384        /// let x2 = Reschedule::new().set_reschedule_type(RescheduleType::SpecificTime);
9385        /// ```
9386        pub fn set_reschedule_type<
9387            T: std::convert::Into<
9388                    crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
9389                >,
9390        >(
9391            mut self,
9392            v: T,
9393        ) -> Self {
9394            self.reschedule_type = v.into();
9395            self
9396        }
9397
9398        /// Sets the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
9399        ///
9400        /// # Example
9401        /// ```ignore,no_run
9402        /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
9403        /// use wkt::Timestamp;
9404        /// let x = Reschedule::new().set_schedule_time(Timestamp::default()/* use setters */);
9405        /// ```
9406        pub fn set_schedule_time<T>(mut self, v: T) -> Self
9407        where
9408            T: std::convert::Into<wkt::Timestamp>,
9409        {
9410            self.schedule_time = std::option::Option::Some(v.into());
9411            self
9412        }
9413
9414        /// Sets or clears the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
9415        ///
9416        /// # Example
9417        /// ```ignore,no_run
9418        /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
9419        /// use wkt::Timestamp;
9420        /// let x = Reschedule::new().set_or_clear_schedule_time(Some(Timestamp::default()/* use setters */));
9421        /// let x = Reschedule::new().set_or_clear_schedule_time(None::<Timestamp>);
9422        /// ```
9423        pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
9424        where
9425            T: std::convert::Into<wkt::Timestamp>,
9426        {
9427            self.schedule_time = v.map(|x| x.into());
9428            self
9429        }
9430    }
9431
9432    impl wkt::message::Message for Reschedule {
9433        fn typename() -> &'static str {
9434            "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule"
9435        }
9436    }
9437
9438    ///
9439    /// # Working with unknown values
9440    ///
9441    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9442    /// additional enum variants at any time. Adding new variants is not considered
9443    /// a breaking change. Applications should write their code in anticipation of:
9444    ///
9445    /// - New values appearing in future releases of the client library, **and**
9446    /// - New values received dynamically, without application changes.
9447    ///
9448    /// Please consult the [Working with enums] section in the user guide for some
9449    /// guidelines.
9450    ///
9451    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9452    #[derive(Clone, Debug, PartialEq)]
9453    #[non_exhaustive]
9454    pub enum RescheduleType {
9455        Unspecified,
9456        /// Reschedules maintenance to happen now (within 5 minutes).
9457        Immediate,
9458        /// Reschedules maintenance to occur within one week from the originally
9459        /// scheduled day and time.
9460        NextAvailableWindow,
9461        /// Reschedules maintenance to a specific time and day.
9462        SpecificTime,
9463        /// If set, the enum was initialized with an unknown value.
9464        ///
9465        /// Applications can examine the value using [RescheduleType::value] or
9466        /// [RescheduleType::name].
9467        UnknownValue(reschedule_type::UnknownValue),
9468    }
9469
9470    #[doc(hidden)]
9471    pub mod reschedule_type {
9472        #[allow(unused_imports)]
9473        use super::*;
9474        #[derive(Clone, Debug, PartialEq)]
9475        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9476    }
9477
9478    impl RescheduleType {
9479        /// Gets the enum value.
9480        ///
9481        /// Returns `None` if the enum contains an unknown value deserialized from
9482        /// the string representation of enums.
9483        pub fn value(&self) -> std::option::Option<i32> {
9484            match self {
9485                Self::Unspecified => std::option::Option::Some(0),
9486                Self::Immediate => std::option::Option::Some(1),
9487                Self::NextAvailableWindow => std::option::Option::Some(2),
9488                Self::SpecificTime => std::option::Option::Some(3),
9489                Self::UnknownValue(u) => u.0.value(),
9490            }
9491        }
9492
9493        /// Gets the enum value as a string.
9494        ///
9495        /// Returns `None` if the enum contains an unknown value deserialized from
9496        /// the integer representation of enums.
9497        pub fn name(&self) -> std::option::Option<&str> {
9498            match self {
9499                Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
9500                Self::Immediate => std::option::Option::Some("IMMEDIATE"),
9501                Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
9502                Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
9503                Self::UnknownValue(u) => u.0.name(),
9504            }
9505        }
9506    }
9507
9508    impl std::default::Default for RescheduleType {
9509        fn default() -> Self {
9510            use std::convert::From;
9511            Self::from(0)
9512        }
9513    }
9514
9515    impl std::fmt::Display for RescheduleType {
9516        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9517            wkt::internal::display_enum(f, self.name(), self.value())
9518        }
9519    }
9520
9521    impl std::convert::From<i32> for RescheduleType {
9522        fn from(value: i32) -> Self {
9523            match value {
9524                0 => Self::Unspecified,
9525                1 => Self::Immediate,
9526                2 => Self::NextAvailableWindow,
9527                3 => Self::SpecificTime,
9528                _ => Self::UnknownValue(reschedule_type::UnknownValue(
9529                    wkt::internal::UnknownEnumValue::Integer(value),
9530                )),
9531            }
9532        }
9533    }
9534
9535    impl std::convert::From<&str> for RescheduleType {
9536        fn from(value: &str) -> Self {
9537            use std::string::ToString;
9538            match value {
9539                "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
9540                "IMMEDIATE" => Self::Immediate,
9541                "NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
9542                "SPECIFIC_TIME" => Self::SpecificTime,
9543                _ => Self::UnknownValue(reschedule_type::UnknownValue(
9544                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9545                )),
9546            }
9547        }
9548    }
9549
9550    impl serde::ser::Serialize for RescheduleType {
9551        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9552        where
9553            S: serde::Serializer,
9554        {
9555            match self {
9556                Self::Unspecified => serializer.serialize_i32(0),
9557                Self::Immediate => serializer.serialize_i32(1),
9558                Self::NextAvailableWindow => serializer.serialize_i32(2),
9559                Self::SpecificTime => serializer.serialize_i32(3),
9560                Self::UnknownValue(u) => u.0.serialize(serializer),
9561            }
9562        }
9563    }
9564
9565    impl<'de> serde::de::Deserialize<'de> for RescheduleType {
9566        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9567        where
9568            D: serde::Deserializer<'de>,
9569        {
9570            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
9571                ".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType",
9572            ))
9573        }
9574    }
9575}
9576
9577/// Database instance demote primary instance context.
9578#[derive(Clone, Default, PartialEq)]
9579#[non_exhaustive]
9580pub struct DemoteMasterContext {
9581    /// This is always `sql#demoteMasterContext`.
9582    pub kind: std::string::String,
9583
9584    /// Verify the GTID consistency for demote operation. Default value:
9585    /// `True`. Setting this flag to `false` enables you to bypass the GTID
9586    /// consistency check between on-premises primary instance and Cloud SQL
9587    /// instance during the demotion operation but also exposes you to the risk of
9588    /// future replication failures. Change the value only if you know the reason
9589    /// for the GTID divergence and are confident that doing so will not cause any
9590    /// replication issues.
9591    pub verify_gtid_consistency: std::option::Option<wkt::BoolValue>,
9592
9593    /// The name of the instance which will act as on-premises primary instance
9594    /// in the replication setup.
9595    pub master_instance_name: std::string::String,
9596
9597    /// Configuration specific to read-replicas replicating from the on-premises
9598    /// primary instance.
9599    pub replica_configuration: std::option::Option<crate::model::DemoteMasterConfiguration>,
9600
9601    /// Flag to skip replication setup on the instance.
9602    pub skip_replication_setup: bool,
9603
9604    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9605}
9606
9607impl DemoteMasterContext {
9608    pub fn new() -> Self {
9609        std::default::Default::default()
9610    }
9611
9612    /// Sets the value of [kind][crate::model::DemoteMasterContext::kind].
9613    ///
9614    /// # Example
9615    /// ```ignore,no_run
9616    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
9617    /// let x = DemoteMasterContext::new().set_kind("example");
9618    /// ```
9619    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9620        self.kind = v.into();
9621        self
9622    }
9623
9624    /// Sets the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
9625    ///
9626    /// # Example
9627    /// ```ignore,no_run
9628    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
9629    /// use wkt::BoolValue;
9630    /// let x = DemoteMasterContext::new().set_verify_gtid_consistency(BoolValue::default()/* use setters */);
9631    /// ```
9632    pub fn set_verify_gtid_consistency<T>(mut self, v: T) -> Self
9633    where
9634        T: std::convert::Into<wkt::BoolValue>,
9635    {
9636        self.verify_gtid_consistency = std::option::Option::Some(v.into());
9637        self
9638    }
9639
9640    /// Sets or clears the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
9641    ///
9642    /// # Example
9643    /// ```ignore,no_run
9644    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
9645    /// use wkt::BoolValue;
9646    /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(Some(BoolValue::default()/* use setters */));
9647    /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(None::<BoolValue>);
9648    /// ```
9649    pub fn set_or_clear_verify_gtid_consistency<T>(mut self, v: std::option::Option<T>) -> Self
9650    where
9651        T: std::convert::Into<wkt::BoolValue>,
9652    {
9653        self.verify_gtid_consistency = v.map(|x| x.into());
9654        self
9655    }
9656
9657    /// Sets the value of [master_instance_name][crate::model::DemoteMasterContext::master_instance_name].
9658    ///
9659    /// # Example
9660    /// ```ignore,no_run
9661    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
9662    /// let x = DemoteMasterContext::new().set_master_instance_name("example");
9663    /// ```
9664    pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
9665        mut self,
9666        v: T,
9667    ) -> Self {
9668        self.master_instance_name = v.into();
9669        self
9670    }
9671
9672    /// Sets the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
9673    ///
9674    /// # Example
9675    /// ```ignore,no_run
9676    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
9677    /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
9678    /// let x = DemoteMasterContext::new().set_replica_configuration(DemoteMasterConfiguration::default()/* use setters */);
9679    /// ```
9680    pub fn set_replica_configuration<T>(mut self, v: T) -> Self
9681    where
9682        T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
9683    {
9684        self.replica_configuration = std::option::Option::Some(v.into());
9685        self
9686    }
9687
9688    /// Sets or clears the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
9689    ///
9690    /// # Example
9691    /// ```ignore,no_run
9692    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
9693    /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
9694    /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(Some(DemoteMasterConfiguration::default()/* use setters */));
9695    /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(None::<DemoteMasterConfiguration>);
9696    /// ```
9697    pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
9698    where
9699        T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
9700    {
9701        self.replica_configuration = v.map(|x| x.into());
9702        self
9703    }
9704
9705    /// Sets the value of [skip_replication_setup][crate::model::DemoteMasterContext::skip_replication_setup].
9706    ///
9707    /// # Example
9708    /// ```ignore,no_run
9709    /// # use google_cloud_sql_v1::model::DemoteMasterContext;
9710    /// let x = DemoteMasterContext::new().set_skip_replication_setup(true);
9711    /// ```
9712    pub fn set_skip_replication_setup<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9713        self.skip_replication_setup = v.into();
9714        self
9715    }
9716}
9717
9718impl wkt::message::Message for DemoteMasterContext {
9719    fn typename() -> &'static str {
9720        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterContext"
9721    }
9722}
9723
9724/// This context is used to demote an existing standalone instance to be
9725/// a Cloud SQL read replica for an external database server.
9726#[derive(Clone, Default, PartialEq)]
9727#[non_exhaustive]
9728pub struct DemoteContext {
9729    /// This is always `sql#demoteContext`.
9730    pub kind: std::string::String,
9731
9732    /// Required. The name of the instance which acts as the on-premises primary
9733    /// instance in the replication setup.
9734    pub source_representative_instance_name: std::string::String,
9735
9736    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9737}
9738
9739impl DemoteContext {
9740    pub fn new() -> Self {
9741        std::default::Default::default()
9742    }
9743
9744    /// Sets the value of [kind][crate::model::DemoteContext::kind].
9745    ///
9746    /// # Example
9747    /// ```ignore,no_run
9748    /// # use google_cloud_sql_v1::model::DemoteContext;
9749    /// let x = DemoteContext::new().set_kind("example");
9750    /// ```
9751    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9752        self.kind = v.into();
9753        self
9754    }
9755
9756    /// Sets the value of [source_representative_instance_name][crate::model::DemoteContext::source_representative_instance_name].
9757    ///
9758    /// # Example
9759    /// ```ignore,no_run
9760    /// # use google_cloud_sql_v1::model::DemoteContext;
9761    /// let x = DemoteContext::new().set_source_representative_instance_name("example");
9762    /// ```
9763    pub fn set_source_representative_instance_name<T: std::convert::Into<std::string::String>>(
9764        mut self,
9765        v: T,
9766    ) -> Self {
9767        self.source_representative_instance_name = v.into();
9768        self
9769    }
9770}
9771
9772impl wkt::message::Message for DemoteContext {
9773    fn typename() -> &'static str {
9774        "type.googleapis.com/google.cloud.sql.v1.DemoteContext"
9775    }
9776}
9777
9778/// Database instance failover context.
9779#[derive(Clone, Default, PartialEq)]
9780#[non_exhaustive]
9781pub struct FailoverContext {
9782    /// The current settings version of this instance. Request will be rejected if
9783    /// this version doesn't match the current settings version.
9784    pub settings_version: i64,
9785
9786    /// This is always `sql#failoverContext`.
9787    pub kind: std::string::String,
9788
9789    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9790}
9791
9792impl FailoverContext {
9793    pub fn new() -> Self {
9794        std::default::Default::default()
9795    }
9796
9797    /// Sets the value of [settings_version][crate::model::FailoverContext::settings_version].
9798    ///
9799    /// # Example
9800    /// ```ignore,no_run
9801    /// # use google_cloud_sql_v1::model::FailoverContext;
9802    /// let x = FailoverContext::new().set_settings_version(42);
9803    /// ```
9804    pub fn set_settings_version<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9805        self.settings_version = v.into();
9806        self
9807    }
9808
9809    /// Sets the value of [kind][crate::model::FailoverContext::kind].
9810    ///
9811    /// # Example
9812    /// ```ignore,no_run
9813    /// # use google_cloud_sql_v1::model::FailoverContext;
9814    /// let x = FailoverContext::new().set_kind("example");
9815    /// ```
9816    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9817        self.kind = v.into();
9818        self
9819    }
9820}
9821
9822impl wkt::message::Message for FailoverContext {
9823    fn typename() -> &'static str {
9824        "type.googleapis.com/google.cloud.sql.v1.FailoverContext"
9825    }
9826}
9827
9828/// Database instance restore from backup context.
9829/// Backup context contains source instance id and project id.
9830#[derive(Clone, Default, PartialEq)]
9831#[non_exhaustive]
9832pub struct RestoreBackupContext {
9833    /// This is always `sql#restoreBackupContext`.
9834    pub kind: std::string::String,
9835
9836    /// The ID of the backup run to restore from.
9837    pub backup_run_id: i64,
9838
9839    /// The ID of the instance that the backup was taken from.
9840    pub instance_id: std::string::String,
9841
9842    /// The full project ID of the source instance.
9843    pub project: std::string::String,
9844
9845    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9846}
9847
9848impl RestoreBackupContext {
9849    pub fn new() -> Self {
9850        std::default::Default::default()
9851    }
9852
9853    /// Sets the value of [kind][crate::model::RestoreBackupContext::kind].
9854    ///
9855    /// # Example
9856    /// ```ignore,no_run
9857    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
9858    /// let x = RestoreBackupContext::new().set_kind("example");
9859    /// ```
9860    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9861        self.kind = v.into();
9862        self
9863    }
9864
9865    /// Sets the value of [backup_run_id][crate::model::RestoreBackupContext::backup_run_id].
9866    ///
9867    /// # Example
9868    /// ```ignore,no_run
9869    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
9870    /// let x = RestoreBackupContext::new().set_backup_run_id(42);
9871    /// ```
9872    pub fn set_backup_run_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9873        self.backup_run_id = v.into();
9874        self
9875    }
9876
9877    /// Sets the value of [instance_id][crate::model::RestoreBackupContext::instance_id].
9878    ///
9879    /// # Example
9880    /// ```ignore,no_run
9881    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
9882    /// let x = RestoreBackupContext::new().set_instance_id("example");
9883    /// ```
9884    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9885        self.instance_id = v.into();
9886        self
9887    }
9888
9889    /// Sets the value of [project][crate::model::RestoreBackupContext::project].
9890    ///
9891    /// # Example
9892    /// ```ignore,no_run
9893    /// # use google_cloud_sql_v1::model::RestoreBackupContext;
9894    /// let x = RestoreBackupContext::new().set_project("example");
9895    /// ```
9896    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9897        self.project = v.into();
9898        self
9899    }
9900}
9901
9902impl wkt::message::Message for RestoreBackupContext {
9903    fn typename() -> &'static str {
9904        "type.googleapis.com/google.cloud.sql.v1.RestoreBackupContext"
9905    }
9906}
9907
9908/// Instance rotate server CA context.
9909#[derive(Clone, Default, PartialEq)]
9910#[non_exhaustive]
9911pub struct RotateServerCaContext {
9912    /// This is always `sql#rotateServerCaContext`.
9913    pub kind: std::string::String,
9914
9915    /// The fingerprint of the next version to be rotated to. If left unspecified,
9916    /// will be rotated to the most recently added server CA version.
9917    pub next_version: std::string::String,
9918
9919    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9920}
9921
9922impl RotateServerCaContext {
9923    pub fn new() -> Self {
9924        std::default::Default::default()
9925    }
9926
9927    /// Sets the value of [kind][crate::model::RotateServerCaContext::kind].
9928    ///
9929    /// # Example
9930    /// ```ignore,no_run
9931    /// # use google_cloud_sql_v1::model::RotateServerCaContext;
9932    /// let x = RotateServerCaContext::new().set_kind("example");
9933    /// ```
9934    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9935        self.kind = v.into();
9936        self
9937    }
9938
9939    /// Sets the value of [next_version][crate::model::RotateServerCaContext::next_version].
9940    ///
9941    /// # Example
9942    /// ```ignore,no_run
9943    /// # use google_cloud_sql_v1::model::RotateServerCaContext;
9944    /// let x = RotateServerCaContext::new().set_next_version("example");
9945    /// ```
9946    pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9947        self.next_version = v.into();
9948        self
9949    }
9950}
9951
9952impl wkt::message::Message for RotateServerCaContext {
9953    fn typename() -> &'static str {
9954        "type.googleapis.com/google.cloud.sql.v1.RotateServerCaContext"
9955    }
9956}
9957
9958/// Database Instance truncate log context.
9959#[derive(Clone, Default, PartialEq)]
9960#[non_exhaustive]
9961pub struct TruncateLogContext {
9962    /// This is always `sql#truncateLogContext`.
9963    pub kind: std::string::String,
9964
9965    /// The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
9966    /// `MYSQL_SLOW_TABLE`.
9967    pub log_type: std::string::String,
9968
9969    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9970}
9971
9972impl TruncateLogContext {
9973    pub fn new() -> Self {
9974        std::default::Default::default()
9975    }
9976
9977    /// Sets the value of [kind][crate::model::TruncateLogContext::kind].
9978    ///
9979    /// # Example
9980    /// ```ignore,no_run
9981    /// # use google_cloud_sql_v1::model::TruncateLogContext;
9982    /// let x = TruncateLogContext::new().set_kind("example");
9983    /// ```
9984    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9985        self.kind = v.into();
9986        self
9987    }
9988
9989    /// Sets the value of [log_type][crate::model::TruncateLogContext::log_type].
9990    ///
9991    /// # Example
9992    /// ```ignore,no_run
9993    /// # use google_cloud_sql_v1::model::TruncateLogContext;
9994    /// let x = TruncateLogContext::new().set_log_type("example");
9995    /// ```
9996    pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9997        self.log_type = v.into();
9998        self
9999    }
10000}
10001
10002impl wkt::message::Message for TruncateLogContext {
10003    fn typename() -> &'static str {
10004        "type.googleapis.com/google.cloud.sql.v1.TruncateLogContext"
10005    }
10006}
10007
10008/// External primary instance migration setting error/warning.
10009#[derive(Clone, Default, PartialEq)]
10010#[non_exhaustive]
10011pub struct SqlExternalSyncSettingError {
10012    /// Can be `sql#externalSyncSettingError` or
10013    /// `sql#externalSyncSettingWarning`.
10014    pub kind: std::string::String,
10015
10016    /// Identifies the specific error that occurred.
10017    pub r#type: crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
10018
10019    /// Additional information about the error encountered.
10020    pub detail: std::string::String,
10021
10022    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10023}
10024
10025impl SqlExternalSyncSettingError {
10026    pub fn new() -> Self {
10027        std::default::Default::default()
10028    }
10029
10030    /// Sets the value of [kind][crate::model::SqlExternalSyncSettingError::kind].
10031    ///
10032    /// # Example
10033    /// ```ignore,no_run
10034    /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
10035    /// let x = SqlExternalSyncSettingError::new().set_kind("example");
10036    /// ```
10037    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10038        self.kind = v.into();
10039        self
10040    }
10041
10042    /// Sets the value of [r#type][crate::model::SqlExternalSyncSettingError::type].
10043    ///
10044    /// # Example
10045    /// ```ignore,no_run
10046    /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
10047    /// use google_cloud_sql_v1::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType;
10048    /// let x0 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::ConnectionFailure);
10049    /// let x1 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::BinlogNotEnabled);
10050    /// let x2 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::IncompatibleDatabaseVersion);
10051    /// ```
10052    pub fn set_type<
10053        T: std::convert::Into<
10054                crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
10055            >,
10056    >(
10057        mut self,
10058        v: T,
10059    ) -> Self {
10060        self.r#type = v.into();
10061        self
10062    }
10063
10064    /// Sets the value of [detail][crate::model::SqlExternalSyncSettingError::detail].
10065    ///
10066    /// # Example
10067    /// ```ignore,no_run
10068    /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
10069    /// let x = SqlExternalSyncSettingError::new().set_detail("example");
10070    /// ```
10071    pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10072        self.detail = v.into();
10073        self
10074    }
10075}
10076
10077impl wkt::message::Message for SqlExternalSyncSettingError {
10078    fn typename() -> &'static str {
10079        "type.googleapis.com/google.cloud.sql.v1.SqlExternalSyncSettingError"
10080    }
10081}
10082
10083/// Defines additional types related to [SqlExternalSyncSettingError].
10084pub mod sql_external_sync_setting_error {
10085    #[allow(unused_imports)]
10086    use super::*;
10087
10088    ///
10089    /// # Working with unknown values
10090    ///
10091    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10092    /// additional enum variants at any time. Adding new variants is not considered
10093    /// a breaking change. Applications should write their code in anticipation of:
10094    ///
10095    /// - New values appearing in future releases of the client library, **and**
10096    /// - New values received dynamically, without application changes.
10097    ///
10098    /// Please consult the [Working with enums] section in the user guide for some
10099    /// guidelines.
10100    ///
10101    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10102    #[derive(Clone, Debug, PartialEq)]
10103    #[non_exhaustive]
10104    pub enum SqlExternalSyncSettingErrorType {
10105        Unspecified,
10106        ConnectionFailure,
10107        BinlogNotEnabled,
10108        IncompatibleDatabaseVersion,
10109        ReplicaAlreadySetup,
10110        /// The replication user is missing privileges that are required.
10111        InsufficientPrivilege,
10112        /// Unsupported migration type.
10113        UnsupportedMigrationType,
10114        /// No pglogical extension installed on databases, applicable for postgres.
10115        NoPglogicalInstalled,
10116        /// pglogical node already exists on databases, applicable for postgres.
10117        PglogicalNodeAlreadyExists,
10118        /// The value of parameter wal_level is not set to logical.
10119        InvalidWalLevel,
10120        /// The value of parameter shared_preload_libraries does not include
10121        /// pglogical.
10122        InvalidSharedPreloadLibrary,
10123        /// The value of parameter max_replication_slots is not sufficient.
10124        InsufficientMaxReplicationSlots,
10125        /// The value of parameter max_wal_senders is not sufficient.
10126        InsufficientMaxWalSenders,
10127        /// The value of parameter max_worker_processes is not sufficient.
10128        InsufficientMaxWorkerProcesses,
10129        /// Extensions installed are either not supported or having unsupported
10130        /// versions.
10131        UnsupportedExtensions,
10132        /// The value of parameter rds.logical_replication is not set to 1.
10133        InvalidRdsLogicalReplication,
10134        /// The primary instance logging setup doesn't allow EM sync.
10135        InvalidLoggingSetup,
10136        /// The primary instance database parameter setup doesn't allow EM sync.
10137        InvalidDbParam,
10138        /// The gtid_mode is not supported, applicable for MySQL.
10139        UnsupportedGtidMode,
10140        /// SQL Server Agent is not running.
10141        SqlserverAgentNotRunning,
10142        /// The table definition is not support due to missing primary key or replica
10143        /// identity, applicable for postgres.
10144        UnsupportedTableDefinition,
10145        /// The customer has a definer that will break EM setup.
10146        UnsupportedDefiner,
10147        /// SQL Server @@SERVERNAME does not match actual host name.
10148        SqlserverServernameMismatch,
10149        /// The primary instance has been setup and will fail the setup.
10150        PrimaryAlreadySetup,
10151        /// The primary instance has unsupported binary log format.
10152        UnsupportedBinlogFormat,
10153        /// The primary instance's binary log retention setting.
10154        BinlogRetentionSetting,
10155        /// The primary instance has tables with unsupported storage engine.
10156        UnsupportedStorageEngine,
10157        /// Source has tables with limited support
10158        /// eg: PostgreSQL tables without primary keys.
10159        LimitedSupportTables,
10160        /// The replica instance contains existing data.
10161        ExistingDataInReplica,
10162        /// The replication user is missing privileges that are optional.
10163        MissingOptionalPrivileges,
10164        /// Additional BACKUP_ADMIN privilege is granted to the replication user
10165        /// which may lock source MySQL 8 instance for DDLs during initial sync.
10166        RiskyBackupAdminPrivilege,
10167        /// The Cloud Storage bucket is missing necessary permissions.
10168        InsufficientGcsPermissions,
10169        /// The Cloud Storage bucket has an error in the file or contains invalid
10170        /// file information.
10171        InvalidFileInfo,
10172        /// The source instance has unsupported database settings for migration.
10173        UnsupportedDatabaseSettings,
10174        /// The replication user is missing parallel import specific privileges.
10175        /// (e.g. LOCK TABLES) for MySQL.
10176        MysqlParallelImportInsufficientPrivilege,
10177        /// The global variable local_infile is off on external server replica.
10178        LocalInfileOff,
10179        /// This code instructs customers to turn on point-in-time recovery manually
10180        /// for the instance after promoting the Cloud SQL for PostgreSQL instance.
10181        TurnOnPitrAfterPromote,
10182        /// The minor version of replica database is incompatible with the source.
10183        IncompatibleDatabaseMinorVersion,
10184        /// This warning message indicates that Cloud SQL uses the maximum number of
10185        /// subscriptions to migrate data from the source to the destination.
10186        SourceMaxSubscriptions,
10187        /// Unable to verify definers on the source for MySQL.
10188        UnableToVerifyDefiners,
10189        /// If a time out occurs while the subscription counts are calculated, then
10190        /// this value is set to 1. Otherwise, this value is set to 2.
10191        SubscriptionCalculationStatus,
10192        /// Count of subscriptions needed to sync source data for PostgreSQL
10193        /// database.
10194        PgSubscriptionCount,
10195        /// Final parallel level that is used to do migration.
10196        PgSyncParallelLevel,
10197        /// The disk size of the replica instance is smaller than the data size of
10198        /// the source instance.
10199        InsufficientDiskSize,
10200        /// The data size of the source instance is greater than 1 TB, the number of
10201        /// cores of the replica instance is less than 8, and the memory of the
10202        /// replica is less than 32 GB.
10203        InsufficientMachineTier,
10204        /// The warning message indicates the unsupported extensions will not be
10205        /// migrated to the destination.
10206        UnsupportedExtensionsNotMigrated,
10207        /// The warning message indicates the pg_cron extension and settings will not
10208        /// be migrated to the destination.
10209        ExtensionsNotMigrated,
10210        /// The error message indicates that pg_cron flags are enabled on the
10211        /// destination which is not supported during the migration.
10212        PgCronFlagEnabledInReplica,
10213        /// This error message indicates that the specified extensions are not
10214        /// enabled on destination instance. For example, before you can migrate
10215        /// data to the destination instance, you must enable the PGAudit extension
10216        /// on the instance.
10217        ExtensionsNotEnabledInReplica,
10218        /// The source database has generated columns that can't be migrated. Please
10219        /// change them to regular columns before migration.
10220        UnsupportedColumns,
10221        /// If set, the enum was initialized with an unknown value.
10222        ///
10223        /// Applications can examine the value using [SqlExternalSyncSettingErrorType::value] or
10224        /// [SqlExternalSyncSettingErrorType::name].
10225        UnknownValue(sql_external_sync_setting_error_type::UnknownValue),
10226    }
10227
10228    #[doc(hidden)]
10229    pub mod sql_external_sync_setting_error_type {
10230        #[allow(unused_imports)]
10231        use super::*;
10232        #[derive(Clone, Debug, PartialEq)]
10233        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10234    }
10235
10236    impl SqlExternalSyncSettingErrorType {
10237        /// Gets the enum value.
10238        ///
10239        /// Returns `None` if the enum contains an unknown value deserialized from
10240        /// the string representation of enums.
10241        pub fn value(&self) -> std::option::Option<i32> {
10242            match self {
10243                Self::Unspecified => std::option::Option::Some(0),
10244                Self::ConnectionFailure => std::option::Option::Some(1),
10245                Self::BinlogNotEnabled => std::option::Option::Some(2),
10246                Self::IncompatibleDatabaseVersion => std::option::Option::Some(3),
10247                Self::ReplicaAlreadySetup => std::option::Option::Some(4),
10248                Self::InsufficientPrivilege => std::option::Option::Some(5),
10249                Self::UnsupportedMigrationType => std::option::Option::Some(6),
10250                Self::NoPglogicalInstalled => std::option::Option::Some(7),
10251                Self::PglogicalNodeAlreadyExists => std::option::Option::Some(8),
10252                Self::InvalidWalLevel => std::option::Option::Some(9),
10253                Self::InvalidSharedPreloadLibrary => std::option::Option::Some(10),
10254                Self::InsufficientMaxReplicationSlots => std::option::Option::Some(11),
10255                Self::InsufficientMaxWalSenders => std::option::Option::Some(12),
10256                Self::InsufficientMaxWorkerProcesses => std::option::Option::Some(13),
10257                Self::UnsupportedExtensions => std::option::Option::Some(14),
10258                Self::InvalidRdsLogicalReplication => std::option::Option::Some(15),
10259                Self::InvalidLoggingSetup => std::option::Option::Some(16),
10260                Self::InvalidDbParam => std::option::Option::Some(17),
10261                Self::UnsupportedGtidMode => std::option::Option::Some(18),
10262                Self::SqlserverAgentNotRunning => std::option::Option::Some(19),
10263                Self::UnsupportedTableDefinition => std::option::Option::Some(20),
10264                Self::UnsupportedDefiner => std::option::Option::Some(21),
10265                Self::SqlserverServernameMismatch => std::option::Option::Some(22),
10266                Self::PrimaryAlreadySetup => std::option::Option::Some(23),
10267                Self::UnsupportedBinlogFormat => std::option::Option::Some(24),
10268                Self::BinlogRetentionSetting => std::option::Option::Some(25),
10269                Self::UnsupportedStorageEngine => std::option::Option::Some(26),
10270                Self::LimitedSupportTables => std::option::Option::Some(27),
10271                Self::ExistingDataInReplica => std::option::Option::Some(28),
10272                Self::MissingOptionalPrivileges => std::option::Option::Some(29),
10273                Self::RiskyBackupAdminPrivilege => std::option::Option::Some(30),
10274                Self::InsufficientGcsPermissions => std::option::Option::Some(31),
10275                Self::InvalidFileInfo => std::option::Option::Some(32),
10276                Self::UnsupportedDatabaseSettings => std::option::Option::Some(33),
10277                Self::MysqlParallelImportInsufficientPrivilege => std::option::Option::Some(34),
10278                Self::LocalInfileOff => std::option::Option::Some(35),
10279                Self::TurnOnPitrAfterPromote => std::option::Option::Some(36),
10280                Self::IncompatibleDatabaseMinorVersion => std::option::Option::Some(37),
10281                Self::SourceMaxSubscriptions => std::option::Option::Some(38),
10282                Self::UnableToVerifyDefiners => std::option::Option::Some(39),
10283                Self::SubscriptionCalculationStatus => std::option::Option::Some(40),
10284                Self::PgSubscriptionCount => std::option::Option::Some(41),
10285                Self::PgSyncParallelLevel => std::option::Option::Some(42),
10286                Self::InsufficientDiskSize => std::option::Option::Some(43),
10287                Self::InsufficientMachineTier => std::option::Option::Some(44),
10288                Self::UnsupportedExtensionsNotMigrated => std::option::Option::Some(45),
10289                Self::ExtensionsNotMigrated => std::option::Option::Some(46),
10290                Self::PgCronFlagEnabledInReplica => std::option::Option::Some(47),
10291                Self::ExtensionsNotEnabledInReplica => std::option::Option::Some(48),
10292                Self::UnsupportedColumns => std::option::Option::Some(49),
10293                Self::UnknownValue(u) => u.0.value(),
10294            }
10295        }
10296
10297        /// Gets the enum value as a string.
10298        ///
10299        /// Returns `None` if the enum contains an unknown value deserialized from
10300        /// the integer representation of enums.
10301        pub fn name(&self) -> std::option::Option<&str> {
10302            match self {
10303                Self::Unspecified => {
10304                    std::option::Option::Some("SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED")
10305                }
10306                Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
10307                Self::BinlogNotEnabled => std::option::Option::Some("BINLOG_NOT_ENABLED"),
10308                Self::IncompatibleDatabaseVersion => {
10309                    std::option::Option::Some("INCOMPATIBLE_DATABASE_VERSION")
10310                }
10311                Self::ReplicaAlreadySetup => std::option::Option::Some("REPLICA_ALREADY_SETUP"),
10312                Self::InsufficientPrivilege => std::option::Option::Some("INSUFFICIENT_PRIVILEGE"),
10313                Self::UnsupportedMigrationType => {
10314                    std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
10315                }
10316                Self::NoPglogicalInstalled => std::option::Option::Some("NO_PGLOGICAL_INSTALLED"),
10317                Self::PglogicalNodeAlreadyExists => {
10318                    std::option::Option::Some("PGLOGICAL_NODE_ALREADY_EXISTS")
10319                }
10320                Self::InvalidWalLevel => std::option::Option::Some("INVALID_WAL_LEVEL"),
10321                Self::InvalidSharedPreloadLibrary => {
10322                    std::option::Option::Some("INVALID_SHARED_PRELOAD_LIBRARY")
10323                }
10324                Self::InsufficientMaxReplicationSlots => {
10325                    std::option::Option::Some("INSUFFICIENT_MAX_REPLICATION_SLOTS")
10326                }
10327                Self::InsufficientMaxWalSenders => {
10328                    std::option::Option::Some("INSUFFICIENT_MAX_WAL_SENDERS")
10329                }
10330                Self::InsufficientMaxWorkerProcesses => {
10331                    std::option::Option::Some("INSUFFICIENT_MAX_WORKER_PROCESSES")
10332                }
10333                Self::UnsupportedExtensions => std::option::Option::Some("UNSUPPORTED_EXTENSIONS"),
10334                Self::InvalidRdsLogicalReplication => {
10335                    std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
10336                }
10337                Self::InvalidLoggingSetup => std::option::Option::Some("INVALID_LOGGING_SETUP"),
10338                Self::InvalidDbParam => std::option::Option::Some("INVALID_DB_PARAM"),
10339                Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
10340                Self::SqlserverAgentNotRunning => {
10341                    std::option::Option::Some("SQLSERVER_AGENT_NOT_RUNNING")
10342                }
10343                Self::UnsupportedTableDefinition => {
10344                    std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
10345                }
10346                Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
10347                Self::SqlserverServernameMismatch => {
10348                    std::option::Option::Some("SQLSERVER_SERVERNAME_MISMATCH")
10349                }
10350                Self::PrimaryAlreadySetup => std::option::Option::Some("PRIMARY_ALREADY_SETUP"),
10351                Self::UnsupportedBinlogFormat => {
10352                    std::option::Option::Some("UNSUPPORTED_BINLOG_FORMAT")
10353                }
10354                Self::BinlogRetentionSetting => {
10355                    std::option::Option::Some("BINLOG_RETENTION_SETTING")
10356                }
10357                Self::UnsupportedStorageEngine => {
10358                    std::option::Option::Some("UNSUPPORTED_STORAGE_ENGINE")
10359                }
10360                Self::LimitedSupportTables => std::option::Option::Some("LIMITED_SUPPORT_TABLES"),
10361                Self::ExistingDataInReplica => {
10362                    std::option::Option::Some("EXISTING_DATA_IN_REPLICA")
10363                }
10364                Self::MissingOptionalPrivileges => {
10365                    std::option::Option::Some("MISSING_OPTIONAL_PRIVILEGES")
10366                }
10367                Self::RiskyBackupAdminPrivilege => {
10368                    std::option::Option::Some("RISKY_BACKUP_ADMIN_PRIVILEGE")
10369                }
10370                Self::InsufficientGcsPermissions => {
10371                    std::option::Option::Some("INSUFFICIENT_GCS_PERMISSIONS")
10372                }
10373                Self::InvalidFileInfo => std::option::Option::Some("INVALID_FILE_INFO"),
10374                Self::UnsupportedDatabaseSettings => {
10375                    std::option::Option::Some("UNSUPPORTED_DATABASE_SETTINGS")
10376                }
10377                Self::MysqlParallelImportInsufficientPrivilege => {
10378                    std::option::Option::Some("MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
10379                }
10380                Self::LocalInfileOff => std::option::Option::Some("LOCAL_INFILE_OFF"),
10381                Self::TurnOnPitrAfterPromote => {
10382                    std::option::Option::Some("TURN_ON_PITR_AFTER_PROMOTE")
10383                }
10384                Self::IncompatibleDatabaseMinorVersion => {
10385                    std::option::Option::Some("INCOMPATIBLE_DATABASE_MINOR_VERSION")
10386                }
10387                Self::SourceMaxSubscriptions => {
10388                    std::option::Option::Some("SOURCE_MAX_SUBSCRIPTIONS")
10389                }
10390                Self::UnableToVerifyDefiners => {
10391                    std::option::Option::Some("UNABLE_TO_VERIFY_DEFINERS")
10392                }
10393                Self::SubscriptionCalculationStatus => {
10394                    std::option::Option::Some("SUBSCRIPTION_CALCULATION_STATUS")
10395                }
10396                Self::PgSubscriptionCount => std::option::Option::Some("PG_SUBSCRIPTION_COUNT"),
10397                Self::PgSyncParallelLevel => std::option::Option::Some("PG_SYNC_PARALLEL_LEVEL"),
10398                Self::InsufficientDiskSize => std::option::Option::Some("INSUFFICIENT_DISK_SIZE"),
10399                Self::InsufficientMachineTier => {
10400                    std::option::Option::Some("INSUFFICIENT_MACHINE_TIER")
10401                }
10402                Self::UnsupportedExtensionsNotMigrated => {
10403                    std::option::Option::Some("UNSUPPORTED_EXTENSIONS_NOT_MIGRATED")
10404                }
10405                Self::ExtensionsNotMigrated => std::option::Option::Some("EXTENSIONS_NOT_MIGRATED"),
10406                Self::PgCronFlagEnabledInReplica => {
10407                    std::option::Option::Some("PG_CRON_FLAG_ENABLED_IN_REPLICA")
10408                }
10409                Self::ExtensionsNotEnabledInReplica => {
10410                    std::option::Option::Some("EXTENSIONS_NOT_ENABLED_IN_REPLICA")
10411                }
10412                Self::UnsupportedColumns => std::option::Option::Some("UNSUPPORTED_COLUMNS"),
10413                Self::UnknownValue(u) => u.0.name(),
10414            }
10415        }
10416    }
10417
10418    impl std::default::Default for SqlExternalSyncSettingErrorType {
10419        fn default() -> Self {
10420            use std::convert::From;
10421            Self::from(0)
10422        }
10423    }
10424
10425    impl std::fmt::Display for SqlExternalSyncSettingErrorType {
10426        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10427            wkt::internal::display_enum(f, self.name(), self.value())
10428        }
10429    }
10430
10431    impl std::convert::From<i32> for SqlExternalSyncSettingErrorType {
10432        fn from(value: i32) -> Self {
10433            match value {
10434                0 => Self::Unspecified,
10435                1 => Self::ConnectionFailure,
10436                2 => Self::BinlogNotEnabled,
10437                3 => Self::IncompatibleDatabaseVersion,
10438                4 => Self::ReplicaAlreadySetup,
10439                5 => Self::InsufficientPrivilege,
10440                6 => Self::UnsupportedMigrationType,
10441                7 => Self::NoPglogicalInstalled,
10442                8 => Self::PglogicalNodeAlreadyExists,
10443                9 => Self::InvalidWalLevel,
10444                10 => Self::InvalidSharedPreloadLibrary,
10445                11 => Self::InsufficientMaxReplicationSlots,
10446                12 => Self::InsufficientMaxWalSenders,
10447                13 => Self::InsufficientMaxWorkerProcesses,
10448                14 => Self::UnsupportedExtensions,
10449                15 => Self::InvalidRdsLogicalReplication,
10450                16 => Self::InvalidLoggingSetup,
10451                17 => Self::InvalidDbParam,
10452                18 => Self::UnsupportedGtidMode,
10453                19 => Self::SqlserverAgentNotRunning,
10454                20 => Self::UnsupportedTableDefinition,
10455                21 => Self::UnsupportedDefiner,
10456                22 => Self::SqlserverServernameMismatch,
10457                23 => Self::PrimaryAlreadySetup,
10458                24 => Self::UnsupportedBinlogFormat,
10459                25 => Self::BinlogRetentionSetting,
10460                26 => Self::UnsupportedStorageEngine,
10461                27 => Self::LimitedSupportTables,
10462                28 => Self::ExistingDataInReplica,
10463                29 => Self::MissingOptionalPrivileges,
10464                30 => Self::RiskyBackupAdminPrivilege,
10465                31 => Self::InsufficientGcsPermissions,
10466                32 => Self::InvalidFileInfo,
10467                33 => Self::UnsupportedDatabaseSettings,
10468                34 => Self::MysqlParallelImportInsufficientPrivilege,
10469                35 => Self::LocalInfileOff,
10470                36 => Self::TurnOnPitrAfterPromote,
10471                37 => Self::IncompatibleDatabaseMinorVersion,
10472                38 => Self::SourceMaxSubscriptions,
10473                39 => Self::UnableToVerifyDefiners,
10474                40 => Self::SubscriptionCalculationStatus,
10475                41 => Self::PgSubscriptionCount,
10476                42 => Self::PgSyncParallelLevel,
10477                43 => Self::InsufficientDiskSize,
10478                44 => Self::InsufficientMachineTier,
10479                45 => Self::UnsupportedExtensionsNotMigrated,
10480                46 => Self::ExtensionsNotMigrated,
10481                47 => Self::PgCronFlagEnabledInReplica,
10482                48 => Self::ExtensionsNotEnabledInReplica,
10483                49 => Self::UnsupportedColumns,
10484                _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
10485                    wkt::internal::UnknownEnumValue::Integer(value),
10486                )),
10487            }
10488        }
10489    }
10490
10491    impl std::convert::From<&str> for SqlExternalSyncSettingErrorType {
10492        fn from(value: &str) -> Self {
10493            use std::string::ToString;
10494            match value {
10495                "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
10496                "CONNECTION_FAILURE" => Self::ConnectionFailure,
10497                "BINLOG_NOT_ENABLED" => Self::BinlogNotEnabled,
10498                "INCOMPATIBLE_DATABASE_VERSION" => Self::IncompatibleDatabaseVersion,
10499                "REPLICA_ALREADY_SETUP" => Self::ReplicaAlreadySetup,
10500                "INSUFFICIENT_PRIVILEGE" => Self::InsufficientPrivilege,
10501                "UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
10502                "NO_PGLOGICAL_INSTALLED" => Self::NoPglogicalInstalled,
10503                "PGLOGICAL_NODE_ALREADY_EXISTS" => Self::PglogicalNodeAlreadyExists,
10504                "INVALID_WAL_LEVEL" => Self::InvalidWalLevel,
10505                "INVALID_SHARED_PRELOAD_LIBRARY" => Self::InvalidSharedPreloadLibrary,
10506                "INSUFFICIENT_MAX_REPLICATION_SLOTS" => Self::InsufficientMaxReplicationSlots,
10507                "INSUFFICIENT_MAX_WAL_SENDERS" => Self::InsufficientMaxWalSenders,
10508                "INSUFFICIENT_MAX_WORKER_PROCESSES" => Self::InsufficientMaxWorkerProcesses,
10509                "UNSUPPORTED_EXTENSIONS" => Self::UnsupportedExtensions,
10510                "INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
10511                "INVALID_LOGGING_SETUP" => Self::InvalidLoggingSetup,
10512                "INVALID_DB_PARAM" => Self::InvalidDbParam,
10513                "UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
10514                "SQLSERVER_AGENT_NOT_RUNNING" => Self::SqlserverAgentNotRunning,
10515                "UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
10516                "UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
10517                "SQLSERVER_SERVERNAME_MISMATCH" => Self::SqlserverServernameMismatch,
10518                "PRIMARY_ALREADY_SETUP" => Self::PrimaryAlreadySetup,
10519                "UNSUPPORTED_BINLOG_FORMAT" => Self::UnsupportedBinlogFormat,
10520                "BINLOG_RETENTION_SETTING" => Self::BinlogRetentionSetting,
10521                "UNSUPPORTED_STORAGE_ENGINE" => Self::UnsupportedStorageEngine,
10522                "LIMITED_SUPPORT_TABLES" => Self::LimitedSupportTables,
10523                "EXISTING_DATA_IN_REPLICA" => Self::ExistingDataInReplica,
10524                "MISSING_OPTIONAL_PRIVILEGES" => Self::MissingOptionalPrivileges,
10525                "RISKY_BACKUP_ADMIN_PRIVILEGE" => Self::RiskyBackupAdminPrivilege,
10526                "INSUFFICIENT_GCS_PERMISSIONS" => Self::InsufficientGcsPermissions,
10527                "INVALID_FILE_INFO" => Self::InvalidFileInfo,
10528                "UNSUPPORTED_DATABASE_SETTINGS" => Self::UnsupportedDatabaseSettings,
10529                "MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
10530                    Self::MysqlParallelImportInsufficientPrivilege
10531                }
10532                "LOCAL_INFILE_OFF" => Self::LocalInfileOff,
10533                "TURN_ON_PITR_AFTER_PROMOTE" => Self::TurnOnPitrAfterPromote,
10534                "INCOMPATIBLE_DATABASE_MINOR_VERSION" => Self::IncompatibleDatabaseMinorVersion,
10535                "SOURCE_MAX_SUBSCRIPTIONS" => Self::SourceMaxSubscriptions,
10536                "UNABLE_TO_VERIFY_DEFINERS" => Self::UnableToVerifyDefiners,
10537                "SUBSCRIPTION_CALCULATION_STATUS" => Self::SubscriptionCalculationStatus,
10538                "PG_SUBSCRIPTION_COUNT" => Self::PgSubscriptionCount,
10539                "PG_SYNC_PARALLEL_LEVEL" => Self::PgSyncParallelLevel,
10540                "INSUFFICIENT_DISK_SIZE" => Self::InsufficientDiskSize,
10541                "INSUFFICIENT_MACHINE_TIER" => Self::InsufficientMachineTier,
10542                "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED" => Self::UnsupportedExtensionsNotMigrated,
10543                "EXTENSIONS_NOT_MIGRATED" => Self::ExtensionsNotMigrated,
10544                "PG_CRON_FLAG_ENABLED_IN_REPLICA" => Self::PgCronFlagEnabledInReplica,
10545                "EXTENSIONS_NOT_ENABLED_IN_REPLICA" => Self::ExtensionsNotEnabledInReplica,
10546                "UNSUPPORTED_COLUMNS" => Self::UnsupportedColumns,
10547                _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
10548                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10549                )),
10550            }
10551        }
10552    }
10553
10554    impl serde::ser::Serialize for SqlExternalSyncSettingErrorType {
10555        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10556        where
10557            S: serde::Serializer,
10558        {
10559            match self {
10560                Self::Unspecified => serializer.serialize_i32(0),
10561                Self::ConnectionFailure => serializer.serialize_i32(1),
10562                Self::BinlogNotEnabled => serializer.serialize_i32(2),
10563                Self::IncompatibleDatabaseVersion => serializer.serialize_i32(3),
10564                Self::ReplicaAlreadySetup => serializer.serialize_i32(4),
10565                Self::InsufficientPrivilege => serializer.serialize_i32(5),
10566                Self::UnsupportedMigrationType => serializer.serialize_i32(6),
10567                Self::NoPglogicalInstalled => serializer.serialize_i32(7),
10568                Self::PglogicalNodeAlreadyExists => serializer.serialize_i32(8),
10569                Self::InvalidWalLevel => serializer.serialize_i32(9),
10570                Self::InvalidSharedPreloadLibrary => serializer.serialize_i32(10),
10571                Self::InsufficientMaxReplicationSlots => serializer.serialize_i32(11),
10572                Self::InsufficientMaxWalSenders => serializer.serialize_i32(12),
10573                Self::InsufficientMaxWorkerProcesses => serializer.serialize_i32(13),
10574                Self::UnsupportedExtensions => serializer.serialize_i32(14),
10575                Self::InvalidRdsLogicalReplication => serializer.serialize_i32(15),
10576                Self::InvalidLoggingSetup => serializer.serialize_i32(16),
10577                Self::InvalidDbParam => serializer.serialize_i32(17),
10578                Self::UnsupportedGtidMode => serializer.serialize_i32(18),
10579                Self::SqlserverAgentNotRunning => serializer.serialize_i32(19),
10580                Self::UnsupportedTableDefinition => serializer.serialize_i32(20),
10581                Self::UnsupportedDefiner => serializer.serialize_i32(21),
10582                Self::SqlserverServernameMismatch => serializer.serialize_i32(22),
10583                Self::PrimaryAlreadySetup => serializer.serialize_i32(23),
10584                Self::UnsupportedBinlogFormat => serializer.serialize_i32(24),
10585                Self::BinlogRetentionSetting => serializer.serialize_i32(25),
10586                Self::UnsupportedStorageEngine => serializer.serialize_i32(26),
10587                Self::LimitedSupportTables => serializer.serialize_i32(27),
10588                Self::ExistingDataInReplica => serializer.serialize_i32(28),
10589                Self::MissingOptionalPrivileges => serializer.serialize_i32(29),
10590                Self::RiskyBackupAdminPrivilege => serializer.serialize_i32(30),
10591                Self::InsufficientGcsPermissions => serializer.serialize_i32(31),
10592                Self::InvalidFileInfo => serializer.serialize_i32(32),
10593                Self::UnsupportedDatabaseSettings => serializer.serialize_i32(33),
10594                Self::MysqlParallelImportInsufficientPrivilege => serializer.serialize_i32(34),
10595                Self::LocalInfileOff => serializer.serialize_i32(35),
10596                Self::TurnOnPitrAfterPromote => serializer.serialize_i32(36),
10597                Self::IncompatibleDatabaseMinorVersion => serializer.serialize_i32(37),
10598                Self::SourceMaxSubscriptions => serializer.serialize_i32(38),
10599                Self::UnableToVerifyDefiners => serializer.serialize_i32(39),
10600                Self::SubscriptionCalculationStatus => serializer.serialize_i32(40),
10601                Self::PgSubscriptionCount => serializer.serialize_i32(41),
10602                Self::PgSyncParallelLevel => serializer.serialize_i32(42),
10603                Self::InsufficientDiskSize => serializer.serialize_i32(43),
10604                Self::InsufficientMachineTier => serializer.serialize_i32(44),
10605                Self::UnsupportedExtensionsNotMigrated => serializer.serialize_i32(45),
10606                Self::ExtensionsNotMigrated => serializer.serialize_i32(46),
10607                Self::PgCronFlagEnabledInReplica => serializer.serialize_i32(47),
10608                Self::ExtensionsNotEnabledInReplica => serializer.serialize_i32(48),
10609                Self::UnsupportedColumns => serializer.serialize_i32(49),
10610                Self::UnknownValue(u) => u.0.serialize(serializer),
10611            }
10612        }
10613    }
10614
10615    impl<'de> serde::de::Deserialize<'de> for SqlExternalSyncSettingErrorType {
10616        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10617        where
10618            D: serde::Deserializer<'de>,
10619        {
10620            deserializer.deserialize_any(wkt::internal::EnumVisitor::<
10621                SqlExternalSyncSettingErrorType,
10622            >::new(
10623                ".google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType",
10624            ))
10625        }
10626    }
10627}
10628
10629/// On-premises instance configuration.
10630#[derive(Clone, Default, PartialEq)]
10631#[non_exhaustive]
10632pub struct OnPremisesConfiguration {
10633    /// The host and port of the on-premises instance in host:port format
10634    pub host_port: std::string::String,
10635
10636    /// This is always `sql#onPremisesConfiguration`.
10637    pub kind: std::string::String,
10638
10639    /// The username for connecting to on-premises instance.
10640    pub username: std::string::String,
10641
10642    /// The password for connecting to on-premises instance.
10643    pub password: std::string::String,
10644
10645    /// PEM representation of the trusted CA's x509 certificate.
10646    pub ca_certificate: std::string::String,
10647
10648    /// PEM representation of the replica's x509 certificate.
10649    pub client_certificate: std::string::String,
10650
10651    /// PEM representation of the replica's private key. The corresponsing public
10652    /// key is encoded in the client's certificate.
10653    pub client_key: std::string::String,
10654
10655    /// The dump file to create the Cloud SQL replica.
10656    pub dump_file_path: std::string::String,
10657
10658    /// The reference to Cloud SQL instance if the source is Cloud SQL.
10659    pub source_instance: std::option::Option<crate::model::InstanceReference>,
10660
10661    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10662}
10663
10664impl OnPremisesConfiguration {
10665    pub fn new() -> Self {
10666        std::default::Default::default()
10667    }
10668
10669    /// Sets the value of [host_port][crate::model::OnPremisesConfiguration::host_port].
10670    ///
10671    /// # Example
10672    /// ```ignore,no_run
10673    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
10674    /// let x = OnPremisesConfiguration::new().set_host_port("example");
10675    /// ```
10676    pub fn set_host_port<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10677        self.host_port = v.into();
10678        self
10679    }
10680
10681    /// Sets the value of [kind][crate::model::OnPremisesConfiguration::kind].
10682    ///
10683    /// # Example
10684    /// ```ignore,no_run
10685    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
10686    /// let x = OnPremisesConfiguration::new().set_kind("example");
10687    /// ```
10688    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10689        self.kind = v.into();
10690        self
10691    }
10692
10693    /// Sets the value of [username][crate::model::OnPremisesConfiguration::username].
10694    ///
10695    /// # Example
10696    /// ```ignore,no_run
10697    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
10698    /// let x = OnPremisesConfiguration::new().set_username("example");
10699    /// ```
10700    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10701        self.username = v.into();
10702        self
10703    }
10704
10705    /// Sets the value of [password][crate::model::OnPremisesConfiguration::password].
10706    ///
10707    /// # Example
10708    /// ```ignore,no_run
10709    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
10710    /// let x = OnPremisesConfiguration::new().set_password("example");
10711    /// ```
10712    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10713        self.password = v.into();
10714        self
10715    }
10716
10717    /// Sets the value of [ca_certificate][crate::model::OnPremisesConfiguration::ca_certificate].
10718    ///
10719    /// # Example
10720    /// ```ignore,no_run
10721    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
10722    /// let x = OnPremisesConfiguration::new().set_ca_certificate("example");
10723    /// ```
10724    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10725        self.ca_certificate = v.into();
10726        self
10727    }
10728
10729    /// Sets the value of [client_certificate][crate::model::OnPremisesConfiguration::client_certificate].
10730    ///
10731    /// # Example
10732    /// ```ignore,no_run
10733    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
10734    /// let x = OnPremisesConfiguration::new().set_client_certificate("example");
10735    /// ```
10736    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
10737        mut self,
10738        v: T,
10739    ) -> Self {
10740        self.client_certificate = v.into();
10741        self
10742    }
10743
10744    /// Sets the value of [client_key][crate::model::OnPremisesConfiguration::client_key].
10745    ///
10746    /// # Example
10747    /// ```ignore,no_run
10748    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
10749    /// let x = OnPremisesConfiguration::new().set_client_key("example");
10750    /// ```
10751    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10752        self.client_key = v.into();
10753        self
10754    }
10755
10756    /// Sets the value of [dump_file_path][crate::model::OnPremisesConfiguration::dump_file_path].
10757    ///
10758    /// # Example
10759    /// ```ignore,no_run
10760    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
10761    /// let x = OnPremisesConfiguration::new().set_dump_file_path("example");
10762    /// ```
10763    pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10764        self.dump_file_path = v.into();
10765        self
10766    }
10767
10768    /// Sets the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
10769    ///
10770    /// # Example
10771    /// ```ignore,no_run
10772    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
10773    /// use google_cloud_sql_v1::model::InstanceReference;
10774    /// let x = OnPremisesConfiguration::new().set_source_instance(InstanceReference::default()/* use setters */);
10775    /// ```
10776    pub fn set_source_instance<T>(mut self, v: T) -> Self
10777    where
10778        T: std::convert::Into<crate::model::InstanceReference>,
10779    {
10780        self.source_instance = std::option::Option::Some(v.into());
10781        self
10782    }
10783
10784    /// Sets or clears the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
10785    ///
10786    /// # Example
10787    /// ```ignore,no_run
10788    /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
10789    /// use google_cloud_sql_v1::model::InstanceReference;
10790    /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(Some(InstanceReference::default()/* use setters */));
10791    /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(None::<InstanceReference>);
10792    /// ```
10793    pub fn set_or_clear_source_instance<T>(mut self, v: std::option::Option<T>) -> Self
10794    where
10795        T: std::convert::Into<crate::model::InstanceReference>,
10796    {
10797        self.source_instance = v.map(|x| x.into());
10798        self
10799    }
10800}
10801
10802impl wkt::message::Message for OnPremisesConfiguration {
10803    fn typename() -> &'static str {
10804        "type.googleapis.com/google.cloud.sql.v1.OnPremisesConfiguration"
10805    }
10806}
10807
10808/// Read-replica configuration for connecting to the primary instance.
10809#[derive(Clone, Default, PartialEq)]
10810#[non_exhaustive]
10811pub struct ReplicaConfiguration {
10812    /// This is always `sql#replicaConfiguration`.
10813    pub kind: std::string::String,
10814
10815    /// MySQL specific configuration when replicating from a MySQL on-premises
10816    /// primary instance. Replication configuration information such as the
10817    /// username, password, certificates, and keys are not stored in the instance
10818    /// metadata. The configuration information is used only to set up the
10819    /// replication connection and is stored by MySQL in a file named
10820    /// `master.info` in the data directory.
10821    pub mysql_replica_configuration: std::option::Option<crate::model::MySqlReplicaConfiguration>,
10822
10823    /// Specifies if the replica is the failover target. If the field is set to
10824    /// `true`, the replica will be designated as a failover replica. In case the
10825    /// primary instance fails, the replica instance will be promoted as the new
10826    /// primary instance. Only one replica can be specified as failover target, and
10827    /// the replica has to be in different zone with the primary instance.
10828    pub failover_target: std::option::Option<wkt::BoolValue>,
10829
10830    /// Optional. Specifies if a SQL Server replica is a cascadable replica. A
10831    /// cascadable replica is a SQL Server cross region replica that supports
10832    /// replica(s) under it.
10833    pub cascadable_replica: std::option::Option<wkt::BoolValue>,
10834
10835    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10836}
10837
10838impl ReplicaConfiguration {
10839    pub fn new() -> Self {
10840        std::default::Default::default()
10841    }
10842
10843    /// Sets the value of [kind][crate::model::ReplicaConfiguration::kind].
10844    ///
10845    /// # Example
10846    /// ```ignore,no_run
10847    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
10848    /// let x = ReplicaConfiguration::new().set_kind("example");
10849    /// ```
10850    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10851        self.kind = v.into();
10852        self
10853    }
10854
10855    /// Sets the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
10856    ///
10857    /// # Example
10858    /// ```ignore,no_run
10859    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
10860    /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
10861    /// let x = ReplicaConfiguration::new().set_mysql_replica_configuration(MySqlReplicaConfiguration::default()/* use setters */);
10862    /// ```
10863    pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
10864    where
10865        T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
10866    {
10867        self.mysql_replica_configuration = std::option::Option::Some(v.into());
10868        self
10869    }
10870
10871    /// Sets or clears the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
10872    ///
10873    /// # Example
10874    /// ```ignore,no_run
10875    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
10876    /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
10877    /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(Some(MySqlReplicaConfiguration::default()/* use setters */));
10878    /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(None::<MySqlReplicaConfiguration>);
10879    /// ```
10880    pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
10881    where
10882        T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
10883    {
10884        self.mysql_replica_configuration = v.map(|x| x.into());
10885        self
10886    }
10887
10888    /// Sets the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
10889    ///
10890    /// # Example
10891    /// ```ignore,no_run
10892    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
10893    /// use wkt::BoolValue;
10894    /// let x = ReplicaConfiguration::new().set_failover_target(BoolValue::default()/* use setters */);
10895    /// ```
10896    pub fn set_failover_target<T>(mut self, v: T) -> Self
10897    where
10898        T: std::convert::Into<wkt::BoolValue>,
10899    {
10900        self.failover_target = std::option::Option::Some(v.into());
10901        self
10902    }
10903
10904    /// Sets or clears the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
10905    ///
10906    /// # Example
10907    /// ```ignore,no_run
10908    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
10909    /// use wkt::BoolValue;
10910    /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(Some(BoolValue::default()/* use setters */));
10911    /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(None::<BoolValue>);
10912    /// ```
10913    pub fn set_or_clear_failover_target<T>(mut self, v: std::option::Option<T>) -> Self
10914    where
10915        T: std::convert::Into<wkt::BoolValue>,
10916    {
10917        self.failover_target = v.map(|x| x.into());
10918        self
10919    }
10920
10921    /// Sets the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
10922    ///
10923    /// # Example
10924    /// ```ignore,no_run
10925    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
10926    /// use wkt::BoolValue;
10927    /// let x = ReplicaConfiguration::new().set_cascadable_replica(BoolValue::default()/* use setters */);
10928    /// ```
10929    pub fn set_cascadable_replica<T>(mut self, v: T) -> Self
10930    where
10931        T: std::convert::Into<wkt::BoolValue>,
10932    {
10933        self.cascadable_replica = std::option::Option::Some(v.into());
10934        self
10935    }
10936
10937    /// Sets or clears the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
10938    ///
10939    /// # Example
10940    /// ```ignore,no_run
10941    /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
10942    /// use wkt::BoolValue;
10943    /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(Some(BoolValue::default()/* use setters */));
10944    /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(None::<BoolValue>);
10945    /// ```
10946    pub fn set_or_clear_cascadable_replica<T>(mut self, v: std::option::Option<T>) -> Self
10947    where
10948        T: std::convert::Into<wkt::BoolValue>,
10949    {
10950        self.cascadable_replica = v.map(|x| x.into());
10951        self
10952    }
10953}
10954
10955impl wkt::message::Message for ReplicaConfiguration {
10956    fn typename() -> &'static str {
10957        "type.googleapis.com/google.cloud.sql.v1.ReplicaConfiguration"
10958    }
10959}
10960
10961/// Request to acquire a lease for SSRS.
10962#[derive(Clone, Default, PartialEq)]
10963#[non_exhaustive]
10964pub struct SqlInstancesAcquireSsrsLeaseRequest {
10965    /// Required. Cloud SQL instance ID. This doesn't include the project ID. It's
10966    /// composed of lowercase letters, numbers, and hyphens, and it must start with
10967    /// a letter. The total length must be 98 characters or less (Example:
10968    /// instance-id).
10969    pub instance: std::string::String,
10970
10971    /// Required. Project ID of the project that contains the instance (Example:
10972    /// project-id).
10973    pub project: std::string::String,
10974
10975    /// Required. The request body.
10976    pub body: std::option::Option<crate::model::InstancesAcquireSsrsLeaseRequest>,
10977
10978    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10979}
10980
10981impl SqlInstancesAcquireSsrsLeaseRequest {
10982    pub fn new() -> Self {
10983        std::default::Default::default()
10984    }
10985
10986    /// Sets the value of [instance][crate::model::SqlInstancesAcquireSsrsLeaseRequest::instance].
10987    ///
10988    /// # Example
10989    /// ```ignore,no_run
10990    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
10991    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_instance("example");
10992    /// ```
10993    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10994        self.instance = v.into();
10995        self
10996    }
10997
10998    /// Sets the value of [project][crate::model::SqlInstancesAcquireSsrsLeaseRequest::project].
10999    ///
11000    /// # Example
11001    /// ```ignore,no_run
11002    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
11003    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_project("example");
11004    /// ```
11005    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11006        self.project = v.into();
11007        self
11008    }
11009
11010    /// Sets the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
11011    ///
11012    /// # Example
11013    /// ```ignore,no_run
11014    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
11015    /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
11016    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_body(InstancesAcquireSsrsLeaseRequest::default()/* use setters */);
11017    /// ```
11018    pub fn set_body<T>(mut self, v: T) -> Self
11019    where
11020        T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
11021    {
11022        self.body = std::option::Option::Some(v.into());
11023        self
11024    }
11025
11026    /// Sets or clears the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
11027    ///
11028    /// # Example
11029    /// ```ignore,no_run
11030    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
11031    /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
11032    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(Some(InstancesAcquireSsrsLeaseRequest::default()/* use setters */));
11033    /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(None::<InstancesAcquireSsrsLeaseRequest>);
11034    /// ```
11035    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
11036    where
11037        T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
11038    {
11039        self.body = v.map(|x| x.into());
11040        self
11041    }
11042}
11043
11044impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseRequest {
11045    fn typename() -> &'static str {
11046        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest"
11047    }
11048}
11049
11050/// Response for the acquire SSRS lease request.
11051#[derive(Clone, Default, PartialEq)]
11052#[non_exhaustive]
11053pub struct SqlInstancesAcquireSsrsLeaseResponse {
11054    /// The unique identifier for this operation.
11055    pub operation_id: std::string::String,
11056
11057    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11058}
11059
11060impl SqlInstancesAcquireSsrsLeaseResponse {
11061    pub fn new() -> Self {
11062        std::default::Default::default()
11063    }
11064
11065    /// Sets the value of [operation_id][crate::model::SqlInstancesAcquireSsrsLeaseResponse::operation_id].
11066    ///
11067    /// # Example
11068    /// ```ignore,no_run
11069    /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseResponse;
11070    /// let x = SqlInstancesAcquireSsrsLeaseResponse::new().set_operation_id("example");
11071    /// ```
11072    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11073        self.operation_id = v.into();
11074        self
11075    }
11076}
11077
11078impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseResponse {
11079    fn typename() -> &'static str {
11080        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse"
11081    }
11082}
11083
11084/// Request to release a lease for SSRS.
11085#[derive(Clone, Default, PartialEq)]
11086#[non_exhaustive]
11087pub struct SqlInstancesReleaseSsrsLeaseRequest {
11088    /// Required. The Cloud SQL instance ID. This doesn't include the project ID.
11089    /// The instance ID contains lowercase letters, numbers, and hyphens, and it
11090    /// must start with a letter. This ID can have a maximum length of 98
11091    /// characters.
11092    pub instance: std::string::String,
11093
11094    /// Required. The project ID that contains the instance.
11095    pub project: std::string::String,
11096
11097    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11098}
11099
11100impl SqlInstancesReleaseSsrsLeaseRequest {
11101    pub fn new() -> Self {
11102        std::default::Default::default()
11103    }
11104
11105    /// Sets the value of [instance][crate::model::SqlInstancesReleaseSsrsLeaseRequest::instance].
11106    ///
11107    /// # Example
11108    /// ```ignore,no_run
11109    /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
11110    /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_instance("example");
11111    /// ```
11112    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11113        self.instance = v.into();
11114        self
11115    }
11116
11117    /// Sets the value of [project][crate::model::SqlInstancesReleaseSsrsLeaseRequest::project].
11118    ///
11119    /// # Example
11120    /// ```ignore,no_run
11121    /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
11122    /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_project("example");
11123    /// ```
11124    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11125        self.project = v.into();
11126        self
11127    }
11128}
11129
11130impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseRequest {
11131    fn typename() -> &'static str {
11132        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest"
11133    }
11134}
11135
11136/// Response for the release SSRS lease request.
11137#[derive(Clone, Default, PartialEq)]
11138#[non_exhaustive]
11139pub struct SqlInstancesReleaseSsrsLeaseResponse {
11140    /// The unique identifier for this operation.
11141    pub operation_id: std::string::String,
11142
11143    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11144}
11145
11146impl SqlInstancesReleaseSsrsLeaseResponse {
11147    pub fn new() -> Self {
11148        std::default::Default::default()
11149    }
11150
11151    /// Sets the value of [operation_id][crate::model::SqlInstancesReleaseSsrsLeaseResponse::operation_id].
11152    ///
11153    /// # Example
11154    /// ```ignore,no_run
11155    /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseResponse;
11156    /// let x = SqlInstancesReleaseSsrsLeaseResponse::new().set_operation_id("example");
11157    /// ```
11158    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11159        self.operation_id = v.into();
11160        self
11161    }
11162}
11163
11164impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseResponse {
11165    fn typename() -> &'static str {
11166        "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse"
11167    }
11168}
11169
11170/// Operations get request.
11171#[derive(Clone, Default, PartialEq)]
11172#[non_exhaustive]
11173pub struct SqlOperationsGetRequest {
11174    /// Instance operation ID.
11175    pub operation: std::string::String,
11176
11177    /// Project ID of the project that contains the instance.
11178    pub project: std::string::String,
11179
11180    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11181}
11182
11183impl SqlOperationsGetRequest {
11184    pub fn new() -> Self {
11185        std::default::Default::default()
11186    }
11187
11188    /// Sets the value of [operation][crate::model::SqlOperationsGetRequest::operation].
11189    ///
11190    /// # Example
11191    /// ```ignore,no_run
11192    /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
11193    /// let x = SqlOperationsGetRequest::new().set_operation("example");
11194    /// ```
11195    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11196        self.operation = v.into();
11197        self
11198    }
11199
11200    /// Sets the value of [project][crate::model::SqlOperationsGetRequest::project].
11201    ///
11202    /// # Example
11203    /// ```ignore,no_run
11204    /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
11205    /// let x = SqlOperationsGetRequest::new().set_project("example");
11206    /// ```
11207    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11208        self.project = v.into();
11209        self
11210    }
11211}
11212
11213impl wkt::message::Message for SqlOperationsGetRequest {
11214    fn typename() -> &'static str {
11215        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsGetRequest"
11216    }
11217}
11218
11219/// Operations list request.
11220#[derive(Clone, Default, PartialEq)]
11221#[non_exhaustive]
11222pub struct SqlOperationsListRequest {
11223    /// Cloud SQL instance ID. This does not include the project ID.
11224    pub instance: std::string::String,
11225
11226    /// Maximum number of operations per response.
11227    pub max_results: u32,
11228
11229    /// A previously-returned page token representing part of the larger set of
11230    /// results to view.
11231    pub page_token: std::string::String,
11232
11233    /// Project ID of the project that contains the instance.
11234    pub project: std::string::String,
11235
11236    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11237}
11238
11239impl SqlOperationsListRequest {
11240    pub fn new() -> Self {
11241        std::default::Default::default()
11242    }
11243
11244    /// Sets the value of [instance][crate::model::SqlOperationsListRequest::instance].
11245    ///
11246    /// # Example
11247    /// ```ignore,no_run
11248    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
11249    /// let x = SqlOperationsListRequest::new().set_instance("example");
11250    /// ```
11251    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11252        self.instance = v.into();
11253        self
11254    }
11255
11256    /// Sets the value of [max_results][crate::model::SqlOperationsListRequest::max_results].
11257    ///
11258    /// # Example
11259    /// ```ignore,no_run
11260    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
11261    /// let x = SqlOperationsListRequest::new().set_max_results(42_u32);
11262    /// ```
11263    pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
11264        self.max_results = v.into();
11265        self
11266    }
11267
11268    /// Sets the value of [page_token][crate::model::SqlOperationsListRequest::page_token].
11269    ///
11270    /// # Example
11271    /// ```ignore,no_run
11272    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
11273    /// let x = SqlOperationsListRequest::new().set_page_token("example");
11274    /// ```
11275    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11276        self.page_token = v.into();
11277        self
11278    }
11279
11280    /// Sets the value of [project][crate::model::SqlOperationsListRequest::project].
11281    ///
11282    /// # Example
11283    /// ```ignore,no_run
11284    /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
11285    /// let x = SqlOperationsListRequest::new().set_project("example");
11286    /// ```
11287    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11288        self.project = v.into();
11289        self
11290    }
11291}
11292
11293impl wkt::message::Message for SqlOperationsListRequest {
11294    fn typename() -> &'static str {
11295        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsListRequest"
11296    }
11297}
11298
11299/// Operations list response.
11300#[derive(Clone, Default, PartialEq)]
11301#[non_exhaustive]
11302pub struct OperationsListResponse {
11303    /// This is always `sql#operationsList`.
11304    pub kind: std::string::String,
11305
11306    /// List of operation resources.
11307    pub items: std::vec::Vec<crate::model::Operation>,
11308
11309    /// The continuation token, used to page through large result sets. Provide
11310    /// this value in a subsequent request to return the next page of results.
11311    pub next_page_token: std::string::String,
11312
11313    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11314}
11315
11316impl OperationsListResponse {
11317    pub fn new() -> Self {
11318        std::default::Default::default()
11319    }
11320
11321    /// Sets the value of [kind][crate::model::OperationsListResponse::kind].
11322    ///
11323    /// # Example
11324    /// ```ignore,no_run
11325    /// # use google_cloud_sql_v1::model::OperationsListResponse;
11326    /// let x = OperationsListResponse::new().set_kind("example");
11327    /// ```
11328    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11329        self.kind = v.into();
11330        self
11331    }
11332
11333    /// Sets the value of [items][crate::model::OperationsListResponse::items].
11334    ///
11335    /// # Example
11336    /// ```ignore,no_run
11337    /// # use google_cloud_sql_v1::model::OperationsListResponse;
11338    /// use google_cloud_sql_v1::model::Operation;
11339    /// let x = OperationsListResponse::new()
11340    ///     .set_items([
11341    ///         Operation::default()/* use setters */,
11342    ///         Operation::default()/* use (different) setters */,
11343    ///     ]);
11344    /// ```
11345    pub fn set_items<T, V>(mut self, v: T) -> Self
11346    where
11347        T: std::iter::IntoIterator<Item = V>,
11348        V: std::convert::Into<crate::model::Operation>,
11349    {
11350        use std::iter::Iterator;
11351        self.items = v.into_iter().map(|i| i.into()).collect();
11352        self
11353    }
11354
11355    /// Sets the value of [next_page_token][crate::model::OperationsListResponse::next_page_token].
11356    ///
11357    /// # Example
11358    /// ```ignore,no_run
11359    /// # use google_cloud_sql_v1::model::OperationsListResponse;
11360    /// let x = OperationsListResponse::new().set_next_page_token("example");
11361    /// ```
11362    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11363        self.next_page_token = v.into();
11364        self
11365    }
11366}
11367
11368impl wkt::message::Message for OperationsListResponse {
11369    fn typename() -> &'static str {
11370        "type.googleapis.com/google.cloud.sql.v1.OperationsListResponse"
11371    }
11372}
11373
11374#[doc(hidden)]
11375impl gax::paginator::internal::PageableResponse for OperationsListResponse {
11376    type PageItem = crate::model::Operation;
11377
11378    fn items(self) -> std::vec::Vec<Self::PageItem> {
11379        self.items
11380    }
11381
11382    fn next_page_token(&self) -> std::string::String {
11383        use std::clone::Clone;
11384        self.next_page_token.clone()
11385    }
11386}
11387
11388/// Operations cancel request.
11389#[derive(Clone, Default, PartialEq)]
11390#[non_exhaustive]
11391pub struct SqlOperationsCancelRequest {
11392    /// Instance operation ID.
11393    pub operation: std::string::String,
11394
11395    /// Project ID of the project that contains the instance.
11396    pub project: std::string::String,
11397
11398    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11399}
11400
11401impl SqlOperationsCancelRequest {
11402    pub fn new() -> Self {
11403        std::default::Default::default()
11404    }
11405
11406    /// Sets the value of [operation][crate::model::SqlOperationsCancelRequest::operation].
11407    ///
11408    /// # Example
11409    /// ```ignore,no_run
11410    /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
11411    /// let x = SqlOperationsCancelRequest::new().set_operation("example");
11412    /// ```
11413    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11414        self.operation = v.into();
11415        self
11416    }
11417
11418    /// Sets the value of [project][crate::model::SqlOperationsCancelRequest::project].
11419    ///
11420    /// # Example
11421    /// ```ignore,no_run
11422    /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
11423    /// let x = SqlOperationsCancelRequest::new().set_project("example");
11424    /// ```
11425    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11426        self.project = v.into();
11427        self
11428    }
11429}
11430
11431impl wkt::message::Message for SqlOperationsCancelRequest {
11432    fn typename() -> &'static str {
11433        "type.googleapis.com/google.cloud.sql.v1.SqlOperationsCancelRequest"
11434    }
11435}
11436
11437/// An entry for an Access Control list.
11438#[derive(Clone, Default, PartialEq)]
11439#[non_exhaustive]
11440pub struct AclEntry {
11441    /// The allowlisted value for the access control list.
11442    pub value: std::string::String,
11443
11444    /// The time when this access control entry expires in
11445    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
11446    /// `2012-11-15T16:19:00.094Z`.
11447    pub expiration_time: std::option::Option<wkt::Timestamp>,
11448
11449    /// Optional. A label to identify this entry.
11450    pub name: std::string::String,
11451
11452    /// This is always `sql#aclEntry`.
11453    pub kind: std::string::String,
11454
11455    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11456}
11457
11458impl AclEntry {
11459    pub fn new() -> Self {
11460        std::default::Default::default()
11461    }
11462
11463    /// Sets the value of [value][crate::model::AclEntry::value].
11464    ///
11465    /// # Example
11466    /// ```ignore,no_run
11467    /// # use google_cloud_sql_v1::model::AclEntry;
11468    /// let x = AclEntry::new().set_value("example");
11469    /// ```
11470    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11471        self.value = v.into();
11472        self
11473    }
11474
11475    /// Sets the value of [expiration_time][crate::model::AclEntry::expiration_time].
11476    ///
11477    /// # Example
11478    /// ```ignore,no_run
11479    /// # use google_cloud_sql_v1::model::AclEntry;
11480    /// use wkt::Timestamp;
11481    /// let x = AclEntry::new().set_expiration_time(Timestamp::default()/* use setters */);
11482    /// ```
11483    pub fn set_expiration_time<T>(mut self, v: T) -> Self
11484    where
11485        T: std::convert::Into<wkt::Timestamp>,
11486    {
11487        self.expiration_time = std::option::Option::Some(v.into());
11488        self
11489    }
11490
11491    /// Sets or clears the value of [expiration_time][crate::model::AclEntry::expiration_time].
11492    ///
11493    /// # Example
11494    /// ```ignore,no_run
11495    /// # use google_cloud_sql_v1::model::AclEntry;
11496    /// use wkt::Timestamp;
11497    /// let x = AclEntry::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
11498    /// let x = AclEntry::new().set_or_clear_expiration_time(None::<Timestamp>);
11499    /// ```
11500    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
11501    where
11502        T: std::convert::Into<wkt::Timestamp>,
11503    {
11504        self.expiration_time = v.map(|x| x.into());
11505        self
11506    }
11507
11508    /// Sets the value of [name][crate::model::AclEntry::name].
11509    ///
11510    /// # Example
11511    /// ```ignore,no_run
11512    /// # use google_cloud_sql_v1::model::AclEntry;
11513    /// let x = AclEntry::new().set_name("example");
11514    /// ```
11515    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11516        self.name = v.into();
11517        self
11518    }
11519
11520    /// Sets the value of [kind][crate::model::AclEntry::kind].
11521    ///
11522    /// # Example
11523    /// ```ignore,no_run
11524    /// # use google_cloud_sql_v1::model::AclEntry;
11525    /// let x = AclEntry::new().set_kind("example");
11526    /// ```
11527    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11528        self.kind = v.into();
11529        self
11530    }
11531}
11532
11533impl wkt::message::Message for AclEntry {
11534    fn typename() -> &'static str {
11535        "type.googleapis.com/google.cloud.sql.v1.AclEntry"
11536    }
11537}
11538
11539/// An Admin API warning message.
11540#[derive(Clone, Default, PartialEq)]
11541#[non_exhaustive]
11542pub struct ApiWarning {
11543    /// Code to uniquely identify the warning type.
11544    pub code: crate::model::api_warning::SqlApiWarningCode,
11545
11546    /// The warning message.
11547    pub message: std::string::String,
11548
11549    /// The region name for REGION_UNREACHABLE warning.
11550    pub region: std::string::String,
11551
11552    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11553}
11554
11555impl ApiWarning {
11556    pub fn new() -> Self {
11557        std::default::Default::default()
11558    }
11559
11560    /// Sets the value of [code][crate::model::ApiWarning::code].
11561    ///
11562    /// # Example
11563    /// ```ignore,no_run
11564    /// # use google_cloud_sql_v1::model::ApiWarning;
11565    /// use google_cloud_sql_v1::model::api_warning::SqlApiWarningCode;
11566    /// let x0 = ApiWarning::new().set_code(SqlApiWarningCode::RegionUnreachable);
11567    /// let x1 = ApiWarning::new().set_code(SqlApiWarningCode::MaxResultsExceedsLimit);
11568    /// let x2 = ApiWarning::new().set_code(SqlApiWarningCode::CompromisedCredentials);
11569    /// ```
11570    pub fn set_code<T: std::convert::Into<crate::model::api_warning::SqlApiWarningCode>>(
11571        mut self,
11572        v: T,
11573    ) -> Self {
11574        self.code = v.into();
11575        self
11576    }
11577
11578    /// Sets the value of [message][crate::model::ApiWarning::message].
11579    ///
11580    /// # Example
11581    /// ```ignore,no_run
11582    /// # use google_cloud_sql_v1::model::ApiWarning;
11583    /// let x = ApiWarning::new().set_message("example");
11584    /// ```
11585    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11586        self.message = v.into();
11587        self
11588    }
11589
11590    /// Sets the value of [region][crate::model::ApiWarning::region].
11591    ///
11592    /// # Example
11593    /// ```ignore,no_run
11594    /// # use google_cloud_sql_v1::model::ApiWarning;
11595    /// let x = ApiWarning::new().set_region("example");
11596    /// ```
11597    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11598        self.region = v.into();
11599        self
11600    }
11601}
11602
11603impl wkt::message::Message for ApiWarning {
11604    fn typename() -> &'static str {
11605        "type.googleapis.com/google.cloud.sql.v1.ApiWarning"
11606    }
11607}
11608
11609/// Defines additional types related to [ApiWarning].
11610pub mod api_warning {
11611    #[allow(unused_imports)]
11612    use super::*;
11613
11614    ///
11615    /// # Working with unknown values
11616    ///
11617    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11618    /// additional enum variants at any time. Adding new variants is not considered
11619    /// a breaking change. Applications should write their code in anticipation of:
11620    ///
11621    /// - New values appearing in future releases of the client library, **and**
11622    /// - New values received dynamically, without application changes.
11623    ///
11624    /// Please consult the [Working with enums] section in the user guide for some
11625    /// guidelines.
11626    ///
11627    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11628    #[derive(Clone, Debug, PartialEq)]
11629    #[non_exhaustive]
11630    pub enum SqlApiWarningCode {
11631        /// An unknown or unset warning type from Cloud SQL API.
11632        Unspecified,
11633        /// Warning when one or more regions are not reachable.  The returned result
11634        /// set may be incomplete.
11635        RegionUnreachable,
11636        /// Warning when user provided maxResults parameter exceeds the limit.  The
11637        /// returned result set may be incomplete.
11638        MaxResultsExceedsLimit,
11639        /// Warning when user tries to create/update a user with credentials that
11640        /// have previously been compromised by a public data breach.
11641        CompromisedCredentials,
11642        /// Warning when the operation succeeds but some non-critical workflow state
11643        /// failed.
11644        InternalStateFailure,
11645        /// If set, the enum was initialized with an unknown value.
11646        ///
11647        /// Applications can examine the value using [SqlApiWarningCode::value] or
11648        /// [SqlApiWarningCode::name].
11649        UnknownValue(sql_api_warning_code::UnknownValue),
11650    }
11651
11652    #[doc(hidden)]
11653    pub mod sql_api_warning_code {
11654        #[allow(unused_imports)]
11655        use super::*;
11656        #[derive(Clone, Debug, PartialEq)]
11657        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11658    }
11659
11660    impl SqlApiWarningCode {
11661        /// Gets the enum value.
11662        ///
11663        /// Returns `None` if the enum contains an unknown value deserialized from
11664        /// the string representation of enums.
11665        pub fn value(&self) -> std::option::Option<i32> {
11666            match self {
11667                Self::Unspecified => std::option::Option::Some(0),
11668                Self::RegionUnreachable => std::option::Option::Some(1),
11669                Self::MaxResultsExceedsLimit => std::option::Option::Some(2),
11670                Self::CompromisedCredentials => std::option::Option::Some(3),
11671                Self::InternalStateFailure => std::option::Option::Some(4),
11672                Self::UnknownValue(u) => u.0.value(),
11673            }
11674        }
11675
11676        /// Gets the enum value as a string.
11677        ///
11678        /// Returns `None` if the enum contains an unknown value deserialized from
11679        /// the integer representation of enums.
11680        pub fn name(&self) -> std::option::Option<&str> {
11681            match self {
11682                Self::Unspecified => std::option::Option::Some("SQL_API_WARNING_CODE_UNSPECIFIED"),
11683                Self::RegionUnreachable => std::option::Option::Some("REGION_UNREACHABLE"),
11684                Self::MaxResultsExceedsLimit => {
11685                    std::option::Option::Some("MAX_RESULTS_EXCEEDS_LIMIT")
11686                }
11687                Self::CompromisedCredentials => {
11688                    std::option::Option::Some("COMPROMISED_CREDENTIALS")
11689                }
11690                Self::InternalStateFailure => std::option::Option::Some("INTERNAL_STATE_FAILURE"),
11691                Self::UnknownValue(u) => u.0.name(),
11692            }
11693        }
11694    }
11695
11696    impl std::default::Default for SqlApiWarningCode {
11697        fn default() -> Self {
11698            use std::convert::From;
11699            Self::from(0)
11700        }
11701    }
11702
11703    impl std::fmt::Display for SqlApiWarningCode {
11704        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11705            wkt::internal::display_enum(f, self.name(), self.value())
11706        }
11707    }
11708
11709    impl std::convert::From<i32> for SqlApiWarningCode {
11710        fn from(value: i32) -> Self {
11711            match value {
11712                0 => Self::Unspecified,
11713                1 => Self::RegionUnreachable,
11714                2 => Self::MaxResultsExceedsLimit,
11715                3 => Self::CompromisedCredentials,
11716                4 => Self::InternalStateFailure,
11717                _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
11718                    wkt::internal::UnknownEnumValue::Integer(value),
11719                )),
11720            }
11721        }
11722    }
11723
11724    impl std::convert::From<&str> for SqlApiWarningCode {
11725        fn from(value: &str) -> Self {
11726            use std::string::ToString;
11727            match value {
11728                "SQL_API_WARNING_CODE_UNSPECIFIED" => Self::Unspecified,
11729                "REGION_UNREACHABLE" => Self::RegionUnreachable,
11730                "MAX_RESULTS_EXCEEDS_LIMIT" => Self::MaxResultsExceedsLimit,
11731                "COMPROMISED_CREDENTIALS" => Self::CompromisedCredentials,
11732                "INTERNAL_STATE_FAILURE" => Self::InternalStateFailure,
11733                _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
11734                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11735                )),
11736            }
11737        }
11738    }
11739
11740    impl serde::ser::Serialize for SqlApiWarningCode {
11741        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11742        where
11743            S: serde::Serializer,
11744        {
11745            match self {
11746                Self::Unspecified => serializer.serialize_i32(0),
11747                Self::RegionUnreachable => serializer.serialize_i32(1),
11748                Self::MaxResultsExceedsLimit => serializer.serialize_i32(2),
11749                Self::CompromisedCredentials => serializer.serialize_i32(3),
11750                Self::InternalStateFailure => serializer.serialize_i32(4),
11751                Self::UnknownValue(u) => u.0.serialize(serializer),
11752            }
11753        }
11754    }
11755
11756    impl<'de> serde::de::Deserialize<'de> for SqlApiWarningCode {
11757        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11758        where
11759            D: serde::Deserializer<'de>,
11760        {
11761            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlApiWarningCode>::new(
11762                ".google.cloud.sql.v1.ApiWarning.SqlApiWarningCode",
11763            ))
11764        }
11765    }
11766}
11767
11768/// We currently only support backup retention by specifying the number
11769/// of backups we will retain.
11770#[derive(Clone, Default, PartialEq)]
11771#[non_exhaustive]
11772pub struct BackupRetentionSettings {
11773    /// The unit that 'retained_backups' represents.
11774    pub retention_unit: crate::model::backup_retention_settings::RetentionUnit,
11775
11776    /// Depending on the value of retention_unit, this is used to determine
11777    /// if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
11778    /// retain this many backups.
11779    pub retained_backups: std::option::Option<wkt::Int32Value>,
11780
11781    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11782}
11783
11784impl BackupRetentionSettings {
11785    pub fn new() -> Self {
11786        std::default::Default::default()
11787    }
11788
11789    /// Sets the value of [retention_unit][crate::model::BackupRetentionSettings::retention_unit].
11790    ///
11791    /// # Example
11792    /// ```ignore,no_run
11793    /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
11794    /// use google_cloud_sql_v1::model::backup_retention_settings::RetentionUnit;
11795    /// let x0 = BackupRetentionSettings::new().set_retention_unit(RetentionUnit::Count);
11796    /// ```
11797    pub fn set_retention_unit<
11798        T: std::convert::Into<crate::model::backup_retention_settings::RetentionUnit>,
11799    >(
11800        mut self,
11801        v: T,
11802    ) -> Self {
11803        self.retention_unit = v.into();
11804        self
11805    }
11806
11807    /// Sets the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
11808    ///
11809    /// # Example
11810    /// ```ignore,no_run
11811    /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
11812    /// use wkt::Int32Value;
11813    /// let x = BackupRetentionSettings::new().set_retained_backups(Int32Value::default()/* use setters */);
11814    /// ```
11815    pub fn set_retained_backups<T>(mut self, v: T) -> Self
11816    where
11817        T: std::convert::Into<wkt::Int32Value>,
11818    {
11819        self.retained_backups = std::option::Option::Some(v.into());
11820        self
11821    }
11822
11823    /// Sets or clears the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
11824    ///
11825    /// # Example
11826    /// ```ignore,no_run
11827    /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
11828    /// use wkt::Int32Value;
11829    /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(Some(Int32Value::default()/* use setters */));
11830    /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(None::<Int32Value>);
11831    /// ```
11832    pub fn set_or_clear_retained_backups<T>(mut self, v: std::option::Option<T>) -> Self
11833    where
11834        T: std::convert::Into<wkt::Int32Value>,
11835    {
11836        self.retained_backups = v.map(|x| x.into());
11837        self
11838    }
11839}
11840
11841impl wkt::message::Message for BackupRetentionSettings {
11842    fn typename() -> &'static str {
11843        "type.googleapis.com/google.cloud.sql.v1.BackupRetentionSettings"
11844    }
11845}
11846
11847/// Defines additional types related to [BackupRetentionSettings].
11848pub mod backup_retention_settings {
11849    #[allow(unused_imports)]
11850    use super::*;
11851
11852    /// The units that retained_backups specifies, we only support COUNT.
11853    ///
11854    /// # Working with unknown values
11855    ///
11856    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11857    /// additional enum variants at any time. Adding new variants is not considered
11858    /// a breaking change. Applications should write their code in anticipation of:
11859    ///
11860    /// - New values appearing in future releases of the client library, **and**
11861    /// - New values received dynamically, without application changes.
11862    ///
11863    /// Please consult the [Working with enums] section in the user guide for some
11864    /// guidelines.
11865    ///
11866    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11867    #[derive(Clone, Debug, PartialEq)]
11868    #[non_exhaustive]
11869    pub enum RetentionUnit {
11870        /// Backup retention unit is unspecified, will be treated as COUNT.
11871        Unspecified,
11872        /// Retention will be by count, eg. "retain the most recent 7 backups".
11873        Count,
11874        /// If set, the enum was initialized with an unknown value.
11875        ///
11876        /// Applications can examine the value using [RetentionUnit::value] or
11877        /// [RetentionUnit::name].
11878        UnknownValue(retention_unit::UnknownValue),
11879    }
11880
11881    #[doc(hidden)]
11882    pub mod retention_unit {
11883        #[allow(unused_imports)]
11884        use super::*;
11885        #[derive(Clone, Debug, PartialEq)]
11886        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11887    }
11888
11889    impl RetentionUnit {
11890        /// Gets the enum value.
11891        ///
11892        /// Returns `None` if the enum contains an unknown value deserialized from
11893        /// the string representation of enums.
11894        pub fn value(&self) -> std::option::Option<i32> {
11895            match self {
11896                Self::Unspecified => std::option::Option::Some(0),
11897                Self::Count => std::option::Option::Some(1),
11898                Self::UnknownValue(u) => u.0.value(),
11899            }
11900        }
11901
11902        /// Gets the enum value as a string.
11903        ///
11904        /// Returns `None` if the enum contains an unknown value deserialized from
11905        /// the integer representation of enums.
11906        pub fn name(&self) -> std::option::Option<&str> {
11907            match self {
11908                Self::Unspecified => std::option::Option::Some("RETENTION_UNIT_UNSPECIFIED"),
11909                Self::Count => std::option::Option::Some("COUNT"),
11910                Self::UnknownValue(u) => u.0.name(),
11911            }
11912        }
11913    }
11914
11915    impl std::default::Default for RetentionUnit {
11916        fn default() -> Self {
11917            use std::convert::From;
11918            Self::from(0)
11919        }
11920    }
11921
11922    impl std::fmt::Display for RetentionUnit {
11923        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11924            wkt::internal::display_enum(f, self.name(), self.value())
11925        }
11926    }
11927
11928    impl std::convert::From<i32> for RetentionUnit {
11929        fn from(value: i32) -> Self {
11930            match value {
11931                0 => Self::Unspecified,
11932                1 => Self::Count,
11933                _ => Self::UnknownValue(retention_unit::UnknownValue(
11934                    wkt::internal::UnknownEnumValue::Integer(value),
11935                )),
11936            }
11937        }
11938    }
11939
11940    impl std::convert::From<&str> for RetentionUnit {
11941        fn from(value: &str) -> Self {
11942            use std::string::ToString;
11943            match value {
11944                "RETENTION_UNIT_UNSPECIFIED" => Self::Unspecified,
11945                "COUNT" => Self::Count,
11946                _ => Self::UnknownValue(retention_unit::UnknownValue(
11947                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11948                )),
11949            }
11950        }
11951    }
11952
11953    impl serde::ser::Serialize for RetentionUnit {
11954        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11955        where
11956            S: serde::Serializer,
11957        {
11958            match self {
11959                Self::Unspecified => serializer.serialize_i32(0),
11960                Self::Count => serializer.serialize_i32(1),
11961                Self::UnknownValue(u) => u.0.serialize(serializer),
11962            }
11963        }
11964    }
11965
11966    impl<'de> serde::de::Deserialize<'de> for RetentionUnit {
11967        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11968        where
11969            D: serde::Deserializer<'de>,
11970        {
11971            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RetentionUnit>::new(
11972                ".google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit",
11973            ))
11974        }
11975    }
11976}
11977
11978/// Database instance backup configuration.
11979#[derive(Clone, Default, PartialEq)]
11980#[non_exhaustive]
11981pub struct BackupConfiguration {
11982    /// Start time for the daily backup configuration in UTC timezone in the 24
11983    /// hour format - `HH:MM`.
11984    pub start_time: std::string::String,
11985
11986    /// Whether this configuration is enabled.
11987    pub enabled: std::option::Option<wkt::BoolValue>,
11988
11989    /// This is always `sql#backupConfiguration`.
11990    pub kind: std::string::String,
11991
11992    /// (MySQL only) Whether binary log is enabled. If backup configuration is
11993    /// disabled, binarylog must be disabled as well.
11994    pub binary_log_enabled: std::option::Option<wkt::BoolValue>,
11995
11996    /// Reserved for future use.
11997    pub replication_log_archiving_enabled: std::option::Option<wkt::BoolValue>,
11998
11999    /// Location of the backup
12000    pub location: std::string::String,
12001
12002    /// Whether point in time recovery is enabled.
12003    pub point_in_time_recovery_enabled: std::option::Option<wkt::BoolValue>,
12004
12005    /// Backup retention settings.
12006    pub backup_retention_settings: std::option::Option<crate::model::BackupRetentionSettings>,
12007
12008    /// The number of days of transaction logs we retain for point in time
12009    /// restore, from 1-7.
12010    pub transaction_log_retention_days: std::option::Option<wkt::Int32Value>,
12011
12012    /// Output only. This value contains the storage location of transactional logs
12013    /// used to perform point-in-time recovery (PITR) for the database.
12014    pub transactional_log_storage_state:
12015        std::option::Option<crate::model::backup_configuration::TransactionalLogStorageState>,
12016
12017    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12018}
12019
12020impl BackupConfiguration {
12021    pub fn new() -> Self {
12022        std::default::Default::default()
12023    }
12024
12025    /// Sets the value of [start_time][crate::model::BackupConfiguration::start_time].
12026    ///
12027    /// # Example
12028    /// ```ignore,no_run
12029    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12030    /// let x = BackupConfiguration::new().set_start_time("example");
12031    /// ```
12032    pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12033        self.start_time = v.into();
12034        self
12035    }
12036
12037    /// Sets the value of [enabled][crate::model::BackupConfiguration::enabled].
12038    ///
12039    /// # Example
12040    /// ```ignore,no_run
12041    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12042    /// use wkt::BoolValue;
12043    /// let x = BackupConfiguration::new().set_enabled(BoolValue::default()/* use setters */);
12044    /// ```
12045    pub fn set_enabled<T>(mut self, v: T) -> Self
12046    where
12047        T: std::convert::Into<wkt::BoolValue>,
12048    {
12049        self.enabled = std::option::Option::Some(v.into());
12050        self
12051    }
12052
12053    /// Sets or clears the value of [enabled][crate::model::BackupConfiguration::enabled].
12054    ///
12055    /// # Example
12056    /// ```ignore,no_run
12057    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12058    /// use wkt::BoolValue;
12059    /// let x = BackupConfiguration::new().set_or_clear_enabled(Some(BoolValue::default()/* use setters */));
12060    /// let x = BackupConfiguration::new().set_or_clear_enabled(None::<BoolValue>);
12061    /// ```
12062    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
12063    where
12064        T: std::convert::Into<wkt::BoolValue>,
12065    {
12066        self.enabled = v.map(|x| x.into());
12067        self
12068    }
12069
12070    /// Sets the value of [kind][crate::model::BackupConfiguration::kind].
12071    ///
12072    /// # Example
12073    /// ```ignore,no_run
12074    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12075    /// let x = BackupConfiguration::new().set_kind("example");
12076    /// ```
12077    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12078        self.kind = v.into();
12079        self
12080    }
12081
12082    /// Sets the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
12083    ///
12084    /// # Example
12085    /// ```ignore,no_run
12086    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12087    /// use wkt::BoolValue;
12088    /// let x = BackupConfiguration::new().set_binary_log_enabled(BoolValue::default()/* use setters */);
12089    /// ```
12090    pub fn set_binary_log_enabled<T>(mut self, v: T) -> Self
12091    where
12092        T: std::convert::Into<wkt::BoolValue>,
12093    {
12094        self.binary_log_enabled = std::option::Option::Some(v.into());
12095        self
12096    }
12097
12098    /// Sets or clears the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
12099    ///
12100    /// # Example
12101    /// ```ignore,no_run
12102    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12103    /// use wkt::BoolValue;
12104    /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(Some(BoolValue::default()/* use setters */));
12105    /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(None::<BoolValue>);
12106    /// ```
12107    pub fn set_or_clear_binary_log_enabled<T>(mut self, v: std::option::Option<T>) -> Self
12108    where
12109        T: std::convert::Into<wkt::BoolValue>,
12110    {
12111        self.binary_log_enabled = v.map(|x| x.into());
12112        self
12113    }
12114
12115    /// Sets the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
12116    ///
12117    /// # Example
12118    /// ```ignore,no_run
12119    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12120    /// use wkt::BoolValue;
12121    /// let x = BackupConfiguration::new().set_replication_log_archiving_enabled(BoolValue::default()/* use setters */);
12122    /// ```
12123    pub fn set_replication_log_archiving_enabled<T>(mut self, v: T) -> Self
12124    where
12125        T: std::convert::Into<wkt::BoolValue>,
12126    {
12127        self.replication_log_archiving_enabled = std::option::Option::Some(v.into());
12128        self
12129    }
12130
12131    /// Sets or clears the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
12132    ///
12133    /// # Example
12134    /// ```ignore,no_run
12135    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12136    /// use wkt::BoolValue;
12137    /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(Some(BoolValue::default()/* use setters */));
12138    /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(None::<BoolValue>);
12139    /// ```
12140    pub fn set_or_clear_replication_log_archiving_enabled<T>(
12141        mut self,
12142        v: std::option::Option<T>,
12143    ) -> Self
12144    where
12145        T: std::convert::Into<wkt::BoolValue>,
12146    {
12147        self.replication_log_archiving_enabled = v.map(|x| x.into());
12148        self
12149    }
12150
12151    /// Sets the value of [location][crate::model::BackupConfiguration::location].
12152    ///
12153    /// # Example
12154    /// ```ignore,no_run
12155    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12156    /// let x = BackupConfiguration::new().set_location("example");
12157    /// ```
12158    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12159        self.location = v.into();
12160        self
12161    }
12162
12163    /// Sets the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
12164    ///
12165    /// # Example
12166    /// ```ignore,no_run
12167    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12168    /// use wkt::BoolValue;
12169    /// let x = BackupConfiguration::new().set_point_in_time_recovery_enabled(BoolValue::default()/* use setters */);
12170    /// ```
12171    pub fn set_point_in_time_recovery_enabled<T>(mut self, v: T) -> Self
12172    where
12173        T: std::convert::Into<wkt::BoolValue>,
12174    {
12175        self.point_in_time_recovery_enabled = std::option::Option::Some(v.into());
12176        self
12177    }
12178
12179    /// Sets or clears the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
12180    ///
12181    /// # Example
12182    /// ```ignore,no_run
12183    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12184    /// use wkt::BoolValue;
12185    /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(Some(BoolValue::default()/* use setters */));
12186    /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(None::<BoolValue>);
12187    /// ```
12188    pub fn set_or_clear_point_in_time_recovery_enabled<T>(
12189        mut self,
12190        v: std::option::Option<T>,
12191    ) -> Self
12192    where
12193        T: std::convert::Into<wkt::BoolValue>,
12194    {
12195        self.point_in_time_recovery_enabled = v.map(|x| x.into());
12196        self
12197    }
12198
12199    /// Sets the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
12200    ///
12201    /// # Example
12202    /// ```ignore,no_run
12203    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12204    /// use google_cloud_sql_v1::model::BackupRetentionSettings;
12205    /// let x = BackupConfiguration::new().set_backup_retention_settings(BackupRetentionSettings::default()/* use setters */);
12206    /// ```
12207    pub fn set_backup_retention_settings<T>(mut self, v: T) -> Self
12208    where
12209        T: std::convert::Into<crate::model::BackupRetentionSettings>,
12210    {
12211        self.backup_retention_settings = std::option::Option::Some(v.into());
12212        self
12213    }
12214
12215    /// Sets or clears the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
12216    ///
12217    /// # Example
12218    /// ```ignore,no_run
12219    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12220    /// use google_cloud_sql_v1::model::BackupRetentionSettings;
12221    /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(Some(BackupRetentionSettings::default()/* use setters */));
12222    /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(None::<BackupRetentionSettings>);
12223    /// ```
12224    pub fn set_or_clear_backup_retention_settings<T>(mut self, v: std::option::Option<T>) -> Self
12225    where
12226        T: std::convert::Into<crate::model::BackupRetentionSettings>,
12227    {
12228        self.backup_retention_settings = v.map(|x| x.into());
12229        self
12230    }
12231
12232    /// Sets the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
12233    ///
12234    /// # Example
12235    /// ```ignore,no_run
12236    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12237    /// use wkt::Int32Value;
12238    /// let x = BackupConfiguration::new().set_transaction_log_retention_days(Int32Value::default()/* use setters */);
12239    /// ```
12240    pub fn set_transaction_log_retention_days<T>(mut self, v: T) -> Self
12241    where
12242        T: std::convert::Into<wkt::Int32Value>,
12243    {
12244        self.transaction_log_retention_days = std::option::Option::Some(v.into());
12245        self
12246    }
12247
12248    /// Sets or clears the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
12249    ///
12250    /// # Example
12251    /// ```ignore,no_run
12252    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12253    /// use wkt::Int32Value;
12254    /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(Some(Int32Value::default()/* use setters */));
12255    /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(None::<Int32Value>);
12256    /// ```
12257    pub fn set_or_clear_transaction_log_retention_days<T>(
12258        mut self,
12259        v: std::option::Option<T>,
12260    ) -> Self
12261    where
12262        T: std::convert::Into<wkt::Int32Value>,
12263    {
12264        self.transaction_log_retention_days = v.map(|x| x.into());
12265        self
12266    }
12267
12268    /// Sets the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
12269    ///
12270    /// # Example
12271    /// ```ignore,no_run
12272    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12273    /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
12274    /// let x0 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::Disk);
12275    /// let x1 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchingToCloudStorage);
12276    /// let x2 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchedToCloudStorage);
12277    /// ```
12278    pub fn set_transactional_log_storage_state<T>(mut self, v: T) -> Self
12279    where
12280        T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
12281    {
12282        self.transactional_log_storage_state = std::option::Option::Some(v.into());
12283        self
12284    }
12285
12286    /// Sets or clears the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
12287    ///
12288    /// # Example
12289    /// ```ignore,no_run
12290    /// # use google_cloud_sql_v1::model::BackupConfiguration;
12291    /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
12292    /// let x0 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::Disk));
12293    /// let x1 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchingToCloudStorage));
12294    /// let x2 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchedToCloudStorage));
12295    /// let x_none = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(None::<TransactionalLogStorageState>);
12296    /// ```
12297    pub fn set_or_clear_transactional_log_storage_state<T>(
12298        mut self,
12299        v: std::option::Option<T>,
12300    ) -> Self
12301    where
12302        T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
12303    {
12304        self.transactional_log_storage_state = v.map(|x| x.into());
12305        self
12306    }
12307}
12308
12309impl wkt::message::Message for BackupConfiguration {
12310    fn typename() -> &'static str {
12311        "type.googleapis.com/google.cloud.sql.v1.BackupConfiguration"
12312    }
12313}
12314
12315/// Defines additional types related to [BackupConfiguration].
12316pub mod backup_configuration {
12317    #[allow(unused_imports)]
12318    use super::*;
12319
12320    /// This value contains the storage location of the transactional logs
12321    /// used to perform point-in-time recovery (PITR) for the database.
12322    ///
12323    /// # Working with unknown values
12324    ///
12325    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12326    /// additional enum variants at any time. Adding new variants is not considered
12327    /// a breaking change. Applications should write their code in anticipation of:
12328    ///
12329    /// - New values appearing in future releases of the client library, **and**
12330    /// - New values received dynamically, without application changes.
12331    ///
12332    /// Please consult the [Working with enums] section in the user guide for some
12333    /// guidelines.
12334    ///
12335    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12336    #[derive(Clone, Debug, PartialEq)]
12337    #[non_exhaustive]
12338    pub enum TransactionalLogStorageState {
12339        /// Unspecified.
12340        Unspecified,
12341        /// The transaction logs used for PITR for the instance are stored
12342        /// on a data disk.
12343        Disk,
12344        /// The transaction logs used for PITR for the instance are switching from
12345        /// being stored on a data disk to being stored in Cloud Storage.
12346        /// Only applicable to MySQL.
12347        SwitchingToCloudStorage,
12348        /// The transaction logs used for PITR for the instance are now stored
12349        /// in Cloud Storage. Previously, they were stored on a data disk.
12350        /// Only applicable to MySQL.
12351        SwitchedToCloudStorage,
12352        /// The transaction logs used for PITR for the instance are stored in
12353        /// Cloud Storage. Only applicable to MySQL and PostgreSQL.
12354        CloudStorage,
12355        /// If set, the enum was initialized with an unknown value.
12356        ///
12357        /// Applications can examine the value using [TransactionalLogStorageState::value] or
12358        /// [TransactionalLogStorageState::name].
12359        UnknownValue(transactional_log_storage_state::UnknownValue),
12360    }
12361
12362    #[doc(hidden)]
12363    pub mod transactional_log_storage_state {
12364        #[allow(unused_imports)]
12365        use super::*;
12366        #[derive(Clone, Debug, PartialEq)]
12367        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12368    }
12369
12370    impl TransactionalLogStorageState {
12371        /// Gets the enum value.
12372        ///
12373        /// Returns `None` if the enum contains an unknown value deserialized from
12374        /// the string representation of enums.
12375        pub fn value(&self) -> std::option::Option<i32> {
12376            match self {
12377                Self::Unspecified => std::option::Option::Some(0),
12378                Self::Disk => std::option::Option::Some(1),
12379                Self::SwitchingToCloudStorage => std::option::Option::Some(2),
12380                Self::SwitchedToCloudStorage => std::option::Option::Some(3),
12381                Self::CloudStorage => std::option::Option::Some(4),
12382                Self::UnknownValue(u) => u.0.value(),
12383            }
12384        }
12385
12386        /// Gets the enum value as a string.
12387        ///
12388        /// Returns `None` if the enum contains an unknown value deserialized from
12389        /// the integer representation of enums.
12390        pub fn name(&self) -> std::option::Option<&str> {
12391            match self {
12392                Self::Unspecified => {
12393                    std::option::Option::Some("TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED")
12394                }
12395                Self::Disk => std::option::Option::Some("DISK"),
12396                Self::SwitchingToCloudStorage => {
12397                    std::option::Option::Some("SWITCHING_TO_CLOUD_STORAGE")
12398                }
12399                Self::SwitchedToCloudStorage => {
12400                    std::option::Option::Some("SWITCHED_TO_CLOUD_STORAGE")
12401                }
12402                Self::CloudStorage => std::option::Option::Some("CLOUD_STORAGE"),
12403                Self::UnknownValue(u) => u.0.name(),
12404            }
12405        }
12406    }
12407
12408    impl std::default::Default for TransactionalLogStorageState {
12409        fn default() -> Self {
12410            use std::convert::From;
12411            Self::from(0)
12412        }
12413    }
12414
12415    impl std::fmt::Display for TransactionalLogStorageState {
12416        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12417            wkt::internal::display_enum(f, self.name(), self.value())
12418        }
12419    }
12420
12421    impl std::convert::From<i32> for TransactionalLogStorageState {
12422        fn from(value: i32) -> Self {
12423            match value {
12424                0 => Self::Unspecified,
12425                1 => Self::Disk,
12426                2 => Self::SwitchingToCloudStorage,
12427                3 => Self::SwitchedToCloudStorage,
12428                4 => Self::CloudStorage,
12429                _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
12430                    wkt::internal::UnknownEnumValue::Integer(value),
12431                )),
12432            }
12433        }
12434    }
12435
12436    impl std::convert::From<&str> for TransactionalLogStorageState {
12437        fn from(value: &str) -> Self {
12438            use std::string::ToString;
12439            match value {
12440                "TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED" => Self::Unspecified,
12441                "DISK" => Self::Disk,
12442                "SWITCHING_TO_CLOUD_STORAGE" => Self::SwitchingToCloudStorage,
12443                "SWITCHED_TO_CLOUD_STORAGE" => Self::SwitchedToCloudStorage,
12444                "CLOUD_STORAGE" => Self::CloudStorage,
12445                _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
12446                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12447                )),
12448            }
12449        }
12450    }
12451
12452    impl serde::ser::Serialize for TransactionalLogStorageState {
12453        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12454        where
12455            S: serde::Serializer,
12456        {
12457            match self {
12458                Self::Unspecified => serializer.serialize_i32(0),
12459                Self::Disk => serializer.serialize_i32(1),
12460                Self::SwitchingToCloudStorage => serializer.serialize_i32(2),
12461                Self::SwitchedToCloudStorage => serializer.serialize_i32(3),
12462                Self::CloudStorage => serializer.serialize_i32(4),
12463                Self::UnknownValue(u) => u.0.serialize(serializer),
12464            }
12465        }
12466    }
12467
12468    impl<'de> serde::de::Deserialize<'de> for TransactionalLogStorageState {
12469        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12470        where
12471            D: serde::Deserializer<'de>,
12472        {
12473            deserializer.deserialize_any(
12474                wkt::internal::EnumVisitor::<TransactionalLogStorageState>::new(
12475                    ".google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState",
12476                ),
12477            )
12478        }
12479    }
12480}
12481
12482/// Perform disk shrink context.
12483#[derive(Clone, Default, PartialEq)]
12484#[non_exhaustive]
12485pub struct PerformDiskShrinkContext {
12486    /// The target disk shrink size in GigaBytes.
12487    pub target_size_gb: i64,
12488
12489    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12490}
12491
12492impl PerformDiskShrinkContext {
12493    pub fn new() -> Self {
12494        std::default::Default::default()
12495    }
12496
12497    /// Sets the value of [target_size_gb][crate::model::PerformDiskShrinkContext::target_size_gb].
12498    ///
12499    /// # Example
12500    /// ```ignore,no_run
12501    /// # use google_cloud_sql_v1::model::PerformDiskShrinkContext;
12502    /// let x = PerformDiskShrinkContext::new().set_target_size_gb(42);
12503    /// ```
12504    pub fn set_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12505        self.target_size_gb = v.into();
12506        self
12507    }
12508}
12509
12510impl wkt::message::Message for PerformDiskShrinkContext {
12511    fn typename() -> &'static str {
12512        "type.googleapis.com/google.cloud.sql.v1.PerformDiskShrinkContext"
12513    }
12514}
12515
12516/// Backup context.
12517#[derive(Clone, Default, PartialEq)]
12518#[non_exhaustive]
12519pub struct BackupContext {
12520    /// The identifier of the backup.
12521    pub backup_id: i64,
12522
12523    /// This is always `sql#backupContext`.
12524    pub kind: std::string::String,
12525
12526    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12527}
12528
12529impl BackupContext {
12530    pub fn new() -> Self {
12531        std::default::Default::default()
12532    }
12533
12534    /// Sets the value of [backup_id][crate::model::BackupContext::backup_id].
12535    ///
12536    /// # Example
12537    /// ```ignore,no_run
12538    /// # use google_cloud_sql_v1::model::BackupContext;
12539    /// let x = BackupContext::new().set_backup_id(42);
12540    /// ```
12541    pub fn set_backup_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12542        self.backup_id = v.into();
12543        self
12544    }
12545
12546    /// Sets the value of [kind][crate::model::BackupContext::kind].
12547    ///
12548    /// # Example
12549    /// ```ignore,no_run
12550    /// # use google_cloud_sql_v1::model::BackupContext;
12551    /// let x = BackupContext::new().set_kind("example");
12552    /// ```
12553    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12554        self.kind = v.into();
12555        self
12556    }
12557}
12558
12559impl wkt::message::Message for BackupContext {
12560    fn typename() -> &'static str {
12561        "type.googleapis.com/google.cloud.sql.v1.BackupContext"
12562    }
12563}
12564
12565/// Represents a SQL database on the Cloud SQL instance.
12566#[derive(Clone, Default, PartialEq)]
12567#[non_exhaustive]
12568pub struct Database {
12569    /// This is always `sql#database`.
12570    pub kind: std::string::String,
12571
12572    /// The Cloud SQL charset value.
12573    pub charset: std::string::String,
12574
12575    /// The Cloud SQL collation value.
12576    pub collation: std::string::String,
12577
12578    /// This field is deprecated and will be removed from a future version of the
12579    /// API.
12580    pub etag: std::string::String,
12581
12582    /// The name of the database in the Cloud SQL instance. This does not include
12583    /// the project ID or instance name.
12584    pub name: std::string::String,
12585
12586    /// The name of the Cloud SQL instance. This does not include the project ID.
12587    pub instance: std::string::String,
12588
12589    /// The URI of this resource.
12590    pub self_link: std::string::String,
12591
12592    /// The project ID of the project containing the Cloud SQL database. The Google
12593    /// apps domain is prefixed if applicable.
12594    pub project: std::string::String,
12595
12596    pub database_details: std::option::Option<crate::model::database::DatabaseDetails>,
12597
12598    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12599}
12600
12601impl Database {
12602    pub fn new() -> Self {
12603        std::default::Default::default()
12604    }
12605
12606    /// Sets the value of [kind][crate::model::Database::kind].
12607    ///
12608    /// # Example
12609    /// ```ignore,no_run
12610    /// # use google_cloud_sql_v1::model::Database;
12611    /// let x = Database::new().set_kind("example");
12612    /// ```
12613    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12614        self.kind = v.into();
12615        self
12616    }
12617
12618    /// Sets the value of [charset][crate::model::Database::charset].
12619    ///
12620    /// # Example
12621    /// ```ignore,no_run
12622    /// # use google_cloud_sql_v1::model::Database;
12623    /// let x = Database::new().set_charset("example");
12624    /// ```
12625    pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12626        self.charset = v.into();
12627        self
12628    }
12629
12630    /// Sets the value of [collation][crate::model::Database::collation].
12631    ///
12632    /// # Example
12633    /// ```ignore,no_run
12634    /// # use google_cloud_sql_v1::model::Database;
12635    /// let x = Database::new().set_collation("example");
12636    /// ```
12637    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12638        self.collation = v.into();
12639        self
12640    }
12641
12642    /// Sets the value of [etag][crate::model::Database::etag].
12643    ///
12644    /// # Example
12645    /// ```ignore,no_run
12646    /// # use google_cloud_sql_v1::model::Database;
12647    /// let x = Database::new().set_etag("example");
12648    /// ```
12649    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12650        self.etag = v.into();
12651        self
12652    }
12653
12654    /// Sets the value of [name][crate::model::Database::name].
12655    ///
12656    /// # Example
12657    /// ```ignore,no_run
12658    /// # use google_cloud_sql_v1::model::Database;
12659    /// let x = Database::new().set_name("example");
12660    /// ```
12661    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12662        self.name = v.into();
12663        self
12664    }
12665
12666    /// Sets the value of [instance][crate::model::Database::instance].
12667    ///
12668    /// # Example
12669    /// ```ignore,no_run
12670    /// # use google_cloud_sql_v1::model::Database;
12671    /// let x = Database::new().set_instance("example");
12672    /// ```
12673    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12674        self.instance = v.into();
12675        self
12676    }
12677
12678    /// Sets the value of [self_link][crate::model::Database::self_link].
12679    ///
12680    /// # Example
12681    /// ```ignore,no_run
12682    /// # use google_cloud_sql_v1::model::Database;
12683    /// let x = Database::new().set_self_link("example");
12684    /// ```
12685    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12686        self.self_link = v.into();
12687        self
12688    }
12689
12690    /// Sets the value of [project][crate::model::Database::project].
12691    ///
12692    /// # Example
12693    /// ```ignore,no_run
12694    /// # use google_cloud_sql_v1::model::Database;
12695    /// let x = Database::new().set_project("example");
12696    /// ```
12697    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12698        self.project = v.into();
12699        self
12700    }
12701
12702    /// Sets the value of [database_details][crate::model::Database::database_details].
12703    ///
12704    /// Note that all the setters affecting `database_details` are mutually
12705    /// exclusive.
12706    ///
12707    /// # Example
12708    /// ```ignore,no_run
12709    /// # use google_cloud_sql_v1::model::Database;
12710    /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
12711    /// let x = Database::new().set_database_details(Some(
12712    ///     google_cloud_sql_v1::model::database::DatabaseDetails::SqlserverDatabaseDetails(SqlServerDatabaseDetails::default().into())));
12713    /// ```
12714    pub fn set_database_details<
12715        T: std::convert::Into<std::option::Option<crate::model::database::DatabaseDetails>>,
12716    >(
12717        mut self,
12718        v: T,
12719    ) -> Self {
12720        self.database_details = v.into();
12721        self
12722    }
12723
12724    /// The value of [database_details][crate::model::Database::database_details]
12725    /// if it holds a `SqlserverDatabaseDetails`, `None` if the field is not set or
12726    /// holds a different branch.
12727    pub fn sqlserver_database_details(
12728        &self,
12729    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerDatabaseDetails>> {
12730        #[allow(unreachable_patterns)]
12731        self.database_details.as_ref().and_then(|v| match v {
12732            crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v) => {
12733                std::option::Option::Some(v)
12734            }
12735            _ => std::option::Option::None,
12736        })
12737    }
12738
12739    /// Sets the value of [database_details][crate::model::Database::database_details]
12740    /// to hold a `SqlserverDatabaseDetails`.
12741    ///
12742    /// Note that all the setters affecting `database_details` are
12743    /// mutually exclusive.
12744    ///
12745    /// # Example
12746    /// ```ignore,no_run
12747    /// # use google_cloud_sql_v1::model::Database;
12748    /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
12749    /// let x = Database::new().set_sqlserver_database_details(SqlServerDatabaseDetails::default()/* use setters */);
12750    /// assert!(x.sqlserver_database_details().is_some());
12751    /// ```
12752    pub fn set_sqlserver_database_details<
12753        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerDatabaseDetails>>,
12754    >(
12755        mut self,
12756        v: T,
12757    ) -> Self {
12758        self.database_details = std::option::Option::Some(
12759            crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v.into()),
12760        );
12761        self
12762    }
12763}
12764
12765impl wkt::message::Message for Database {
12766    fn typename() -> &'static str {
12767        "type.googleapis.com/google.cloud.sql.v1.Database"
12768    }
12769}
12770
12771/// Defines additional types related to [Database].
12772pub mod database {
12773    #[allow(unused_imports)]
12774    use super::*;
12775
12776    #[derive(Clone, Debug, PartialEq)]
12777    #[non_exhaustive]
12778    pub enum DatabaseDetails {
12779        SqlserverDatabaseDetails(std::boxed::Box<crate::model::SqlServerDatabaseDetails>),
12780    }
12781}
12782
12783/// Represents a Sql Server database on the Cloud SQL instance.
12784#[derive(Clone, Default, PartialEq)]
12785#[non_exhaustive]
12786pub struct SqlServerDatabaseDetails {
12787    /// The version of SQL Server with which the database is to be made compatible
12788    pub compatibility_level: i32,
12789
12790    /// The recovery model of a SQL Server database
12791    pub recovery_model: std::string::String,
12792
12793    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12794}
12795
12796impl SqlServerDatabaseDetails {
12797    pub fn new() -> Self {
12798        std::default::Default::default()
12799    }
12800
12801    /// Sets the value of [compatibility_level][crate::model::SqlServerDatabaseDetails::compatibility_level].
12802    ///
12803    /// # Example
12804    /// ```ignore,no_run
12805    /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
12806    /// let x = SqlServerDatabaseDetails::new().set_compatibility_level(42);
12807    /// ```
12808    pub fn set_compatibility_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12809        self.compatibility_level = v.into();
12810        self
12811    }
12812
12813    /// Sets the value of [recovery_model][crate::model::SqlServerDatabaseDetails::recovery_model].
12814    ///
12815    /// # Example
12816    /// ```ignore,no_run
12817    /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
12818    /// let x = SqlServerDatabaseDetails::new().set_recovery_model("example");
12819    /// ```
12820    pub fn set_recovery_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12821        self.recovery_model = v.into();
12822        self
12823    }
12824}
12825
12826impl wkt::message::Message for SqlServerDatabaseDetails {
12827    fn typename() -> &'static str {
12828        "type.googleapis.com/google.cloud.sql.v1.SqlServerDatabaseDetails"
12829    }
12830}
12831
12832/// Database flags for Cloud SQL instances.
12833#[derive(Clone, Default, PartialEq)]
12834#[non_exhaustive]
12835pub struct DatabaseFlags {
12836    /// The name of the flag. These flags are passed at instance startup, so
12837    /// include both server options and system variables. Flags are
12838    /// specified with underscores, not hyphens. For more information, see
12839    /// [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
12840    /// in the Cloud SQL documentation.
12841    pub name: std::string::String,
12842
12843    /// The value of the flag. Boolean flags are set to `on` for true
12844    /// and `off` for false. This field must be omitted if the flag
12845    /// doesn't take a value.
12846    pub value: std::string::String,
12847
12848    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12849}
12850
12851impl DatabaseFlags {
12852    pub fn new() -> Self {
12853        std::default::Default::default()
12854    }
12855
12856    /// Sets the value of [name][crate::model::DatabaseFlags::name].
12857    ///
12858    /// # Example
12859    /// ```ignore,no_run
12860    /// # use google_cloud_sql_v1::model::DatabaseFlags;
12861    /// let x = DatabaseFlags::new().set_name("example");
12862    /// ```
12863    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12864        self.name = v.into();
12865        self
12866    }
12867
12868    /// Sets the value of [value][crate::model::DatabaseFlags::value].
12869    ///
12870    /// # Example
12871    /// ```ignore,no_run
12872    /// # use google_cloud_sql_v1::model::DatabaseFlags;
12873    /// let x = DatabaseFlags::new().set_value("example");
12874    /// ```
12875    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12876        self.value = v.into();
12877        self
12878    }
12879}
12880
12881impl wkt::message::Message for DatabaseFlags {
12882    fn typename() -> &'static str {
12883        "type.googleapis.com/google.cloud.sql.v1.DatabaseFlags"
12884    }
12885}
12886
12887/// MySQL-specific external server sync settings.
12888#[derive(Clone, Default, PartialEq)]
12889#[non_exhaustive]
12890pub struct MySqlSyncConfig {
12891    /// Flags to use for the initial dump.
12892    pub initial_sync_flags: std::vec::Vec<crate::model::SyncFlags>,
12893
12894    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12895}
12896
12897impl MySqlSyncConfig {
12898    pub fn new() -> Self {
12899        std::default::Default::default()
12900    }
12901
12902    /// Sets the value of [initial_sync_flags][crate::model::MySqlSyncConfig::initial_sync_flags].
12903    ///
12904    /// # Example
12905    /// ```ignore,no_run
12906    /// # use google_cloud_sql_v1::model::MySqlSyncConfig;
12907    /// use google_cloud_sql_v1::model::SyncFlags;
12908    /// let x = MySqlSyncConfig::new()
12909    ///     .set_initial_sync_flags([
12910    ///         SyncFlags::default()/* use setters */,
12911    ///         SyncFlags::default()/* use (different) setters */,
12912    ///     ]);
12913    /// ```
12914    pub fn set_initial_sync_flags<T, V>(mut self, v: T) -> Self
12915    where
12916        T: std::iter::IntoIterator<Item = V>,
12917        V: std::convert::Into<crate::model::SyncFlags>,
12918    {
12919        use std::iter::Iterator;
12920        self.initial_sync_flags = v.into_iter().map(|i| i.into()).collect();
12921        self
12922    }
12923}
12924
12925impl wkt::message::Message for MySqlSyncConfig {
12926    fn typename() -> &'static str {
12927        "type.googleapis.com/google.cloud.sql.v1.MySqlSyncConfig"
12928    }
12929}
12930
12931/// Initial sync flags for certain Cloud SQL APIs.
12932/// Currently used for the MySQL external server initial dump.
12933#[derive(Clone, Default, PartialEq)]
12934#[non_exhaustive]
12935pub struct SyncFlags {
12936    /// The name of the flag.
12937    pub name: std::string::String,
12938
12939    /// The value of the flag. This field must be omitted if the flag
12940    /// doesn't take a value.
12941    pub value: std::string::String,
12942
12943    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12944}
12945
12946impl SyncFlags {
12947    pub fn new() -> Self {
12948        std::default::Default::default()
12949    }
12950
12951    /// Sets the value of [name][crate::model::SyncFlags::name].
12952    ///
12953    /// # Example
12954    /// ```ignore,no_run
12955    /// # use google_cloud_sql_v1::model::SyncFlags;
12956    /// let x = SyncFlags::new().set_name("example");
12957    /// ```
12958    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12959        self.name = v.into();
12960        self
12961    }
12962
12963    /// Sets the value of [value][crate::model::SyncFlags::value].
12964    ///
12965    /// # Example
12966    /// ```ignore,no_run
12967    /// # use google_cloud_sql_v1::model::SyncFlags;
12968    /// let x = SyncFlags::new().set_value("example");
12969    /// ```
12970    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12971        self.value = v.into();
12972        self
12973    }
12974}
12975
12976impl wkt::message::Message for SyncFlags {
12977    fn typename() -> &'static str {
12978        "type.googleapis.com/google.cloud.sql.v1.SyncFlags"
12979    }
12980}
12981
12982/// Reference to another Cloud SQL instance.
12983#[derive(Clone, Default, PartialEq)]
12984#[non_exhaustive]
12985pub struct InstanceReference {
12986    /// The name of the Cloud SQL instance being referenced.
12987    /// This does not include the project ID.
12988    pub name: std::string::String,
12989
12990    /// The region of the Cloud SQL instance being referenced.
12991    pub region: std::string::String,
12992
12993    /// The project ID of the Cloud SQL instance being referenced.
12994    /// The default is the same project ID as the instance references it.
12995    pub project: std::string::String,
12996
12997    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12998}
12999
13000impl InstanceReference {
13001    pub fn new() -> Self {
13002        std::default::Default::default()
13003    }
13004
13005    /// Sets the value of [name][crate::model::InstanceReference::name].
13006    ///
13007    /// # Example
13008    /// ```ignore,no_run
13009    /// # use google_cloud_sql_v1::model::InstanceReference;
13010    /// let x = InstanceReference::new().set_name("example");
13011    /// ```
13012    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13013        self.name = v.into();
13014        self
13015    }
13016
13017    /// Sets the value of [region][crate::model::InstanceReference::region].
13018    ///
13019    /// # Example
13020    /// ```ignore,no_run
13021    /// # use google_cloud_sql_v1::model::InstanceReference;
13022    /// let x = InstanceReference::new().set_region("example");
13023    /// ```
13024    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13025        self.region = v.into();
13026        self
13027    }
13028
13029    /// Sets the value of [project][crate::model::InstanceReference::project].
13030    ///
13031    /// # Example
13032    /// ```ignore,no_run
13033    /// # use google_cloud_sql_v1::model::InstanceReference;
13034    /// let x = InstanceReference::new().set_project("example");
13035    /// ```
13036    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13037        self.project = v.into();
13038        self
13039    }
13040}
13041
13042impl wkt::message::Message for InstanceReference {
13043    fn typename() -> &'static str {
13044        "type.googleapis.com/google.cloud.sql.v1.InstanceReference"
13045    }
13046}
13047
13048/// Read-replica configuration for connecting to the on-premises primary
13049/// instance.
13050#[derive(Clone, Default, PartialEq)]
13051#[non_exhaustive]
13052pub struct DemoteMasterConfiguration {
13053    /// This is always `sql#demoteMasterConfiguration`.
13054    pub kind: std::string::String,
13055
13056    /// MySQL specific configuration when replicating from a MySQL on-premises
13057    /// primary instance. Replication configuration information such as the
13058    /// username, password, certificates, and keys are not stored in the instance
13059    /// metadata. The configuration information is used only to set up the
13060    /// replication connection and is stored by MySQL in a file named
13061    /// `master.info` in the data directory.
13062    pub mysql_replica_configuration:
13063        std::option::Option<crate::model::DemoteMasterMySqlReplicaConfiguration>,
13064
13065    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13066}
13067
13068impl DemoteMasterConfiguration {
13069    pub fn new() -> Self {
13070        std::default::Default::default()
13071    }
13072
13073    /// Sets the value of [kind][crate::model::DemoteMasterConfiguration::kind].
13074    ///
13075    /// # Example
13076    /// ```ignore,no_run
13077    /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
13078    /// let x = DemoteMasterConfiguration::new().set_kind("example");
13079    /// ```
13080    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13081        self.kind = v.into();
13082        self
13083    }
13084
13085    /// Sets the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
13086    ///
13087    /// # Example
13088    /// ```ignore,no_run
13089    /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
13090    /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
13091    /// let x = DemoteMasterConfiguration::new().set_mysql_replica_configuration(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */);
13092    /// ```
13093    pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
13094    where
13095        T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
13096    {
13097        self.mysql_replica_configuration = std::option::Option::Some(v.into());
13098        self
13099    }
13100
13101    /// Sets or clears the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
13102    ///
13103    /// # Example
13104    /// ```ignore,no_run
13105    /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
13106    /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
13107    /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(Some(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */));
13108    /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(None::<DemoteMasterMySqlReplicaConfiguration>);
13109    /// ```
13110    pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
13111    where
13112        T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
13113    {
13114        self.mysql_replica_configuration = v.map(|x| x.into());
13115        self
13116    }
13117}
13118
13119impl wkt::message::Message for DemoteMasterConfiguration {
13120    fn typename() -> &'static str {
13121        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterConfiguration"
13122    }
13123}
13124
13125/// Read-replica configuration specific to MySQL databases.
13126#[derive(Clone, Default, PartialEq)]
13127#[non_exhaustive]
13128pub struct DemoteMasterMySqlReplicaConfiguration {
13129    /// This is always `sql#demoteMasterMysqlReplicaConfiguration`.
13130    pub kind: std::string::String,
13131
13132    /// The username for the replication connection.
13133    pub username: std::string::String,
13134
13135    /// The password for the replication connection.
13136    pub password: std::string::String,
13137
13138    /// PEM representation of the replica's private key. The corresponsing public
13139    /// key is encoded in the client's certificate. The format of the replica's
13140    /// private key can be either PKCS #1 or PKCS #8.
13141    pub client_key: std::string::String,
13142
13143    /// PEM representation of the replica's x509 certificate.
13144    pub client_certificate: std::string::String,
13145
13146    /// PEM representation of the trusted CA's x509 certificate.
13147    pub ca_certificate: std::string::String,
13148
13149    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13150}
13151
13152impl DemoteMasterMySqlReplicaConfiguration {
13153    pub fn new() -> Self {
13154        std::default::Default::default()
13155    }
13156
13157    /// Sets the value of [kind][crate::model::DemoteMasterMySqlReplicaConfiguration::kind].
13158    ///
13159    /// # Example
13160    /// ```ignore,no_run
13161    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
13162    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_kind("example");
13163    /// ```
13164    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13165        self.kind = v.into();
13166        self
13167    }
13168
13169    /// Sets the value of [username][crate::model::DemoteMasterMySqlReplicaConfiguration::username].
13170    ///
13171    /// # Example
13172    /// ```ignore,no_run
13173    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
13174    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_username("example");
13175    /// ```
13176    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13177        self.username = v.into();
13178        self
13179    }
13180
13181    /// Sets the value of [password][crate::model::DemoteMasterMySqlReplicaConfiguration::password].
13182    ///
13183    /// # Example
13184    /// ```ignore,no_run
13185    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
13186    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_password("example");
13187    /// ```
13188    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13189        self.password = v.into();
13190        self
13191    }
13192
13193    /// Sets the value of [client_key][crate::model::DemoteMasterMySqlReplicaConfiguration::client_key].
13194    ///
13195    /// # Example
13196    /// ```ignore,no_run
13197    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
13198    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_key("example");
13199    /// ```
13200    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13201        self.client_key = v.into();
13202        self
13203    }
13204
13205    /// Sets the value of [client_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::client_certificate].
13206    ///
13207    /// # Example
13208    /// ```ignore,no_run
13209    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
13210    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_certificate("example");
13211    /// ```
13212    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
13213        mut self,
13214        v: T,
13215    ) -> Self {
13216        self.client_certificate = v.into();
13217        self
13218    }
13219
13220    /// Sets the value of [ca_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::ca_certificate].
13221    ///
13222    /// # Example
13223    /// ```ignore,no_run
13224    /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
13225    /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_ca_certificate("example");
13226    /// ```
13227    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13228        self.ca_certificate = v.into();
13229        self
13230    }
13231}
13232
13233impl wkt::message::Message for DemoteMasterMySqlReplicaConfiguration {
13234    fn typename() -> &'static str {
13235        "type.googleapis.com/google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration"
13236    }
13237}
13238
13239/// Database instance export context.
13240#[derive(Clone, Default, PartialEq)]
13241#[non_exhaustive]
13242pub struct ExportContext {
13243    /// The path to the file in Google Cloud Storage where the export will be
13244    /// stored. The URI is in the form `gs://bucketName/fileName`. If the file
13245    /// already exists, the request succeeds, but the operation fails. If
13246    /// `fileType` is `SQL` and the filename ends with .gz,
13247    /// the contents are compressed.
13248    pub uri: std::string::String,
13249
13250    /// Databases to be exported. <br /> `MySQL instances:` If
13251    /// `fileType` is `SQL` and no database is specified, all
13252    /// databases are exported, except for the `mysql` system database.
13253    /// If `fileType` is `CSV`, you can specify one database,
13254    /// either by using this property or by using the
13255    /// `csvExportOptions.selectQuery` property, which takes precedence
13256    /// over this property. <br /> `PostgreSQL instances:` You must specify
13257    /// one database to be exported. If `fileType` is `CSV`,
13258    /// this database must match the one specified in the
13259    /// `csvExportOptions.selectQuery` property. <br /> `SQL Server
13260    /// instances:` You must specify one database to be exported, and the
13261    /// `fileType` must be `BAK`.
13262    pub databases: std::vec::Vec<std::string::String>,
13263
13264    /// This is always `sql#exportContext`.
13265    pub kind: std::string::String,
13266
13267    /// Options for exporting data as SQL statements.
13268    pub sql_export_options: std::option::Option<crate::model::export_context::SqlExportOptions>,
13269
13270    /// Options for exporting data as CSV. `MySQL` and `PostgreSQL`
13271    /// instances only.
13272    pub csv_export_options: std::option::Option<crate::model::export_context::SqlCsvExportOptions>,
13273
13274    /// The file type for the specified uri.
13275    pub file_type: crate::model::SqlFileType,
13276
13277    /// Option for export offload.
13278    pub offload: std::option::Option<wkt::BoolValue>,
13279
13280    /// Options for exporting data as BAK files.
13281    pub bak_export_options: std::option::Option<crate::model::export_context::SqlBakExportOptions>,
13282
13283    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13284}
13285
13286impl ExportContext {
13287    pub fn new() -> Self {
13288        std::default::Default::default()
13289    }
13290
13291    /// Sets the value of [uri][crate::model::ExportContext::uri].
13292    ///
13293    /// # Example
13294    /// ```ignore,no_run
13295    /// # use google_cloud_sql_v1::model::ExportContext;
13296    /// let x = ExportContext::new().set_uri("example");
13297    /// ```
13298    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13299        self.uri = v.into();
13300        self
13301    }
13302
13303    /// Sets the value of [databases][crate::model::ExportContext::databases].
13304    ///
13305    /// # Example
13306    /// ```ignore,no_run
13307    /// # use google_cloud_sql_v1::model::ExportContext;
13308    /// let x = ExportContext::new().set_databases(["a", "b", "c"]);
13309    /// ```
13310    pub fn set_databases<T, V>(mut self, v: T) -> Self
13311    where
13312        T: std::iter::IntoIterator<Item = V>,
13313        V: std::convert::Into<std::string::String>,
13314    {
13315        use std::iter::Iterator;
13316        self.databases = v.into_iter().map(|i| i.into()).collect();
13317        self
13318    }
13319
13320    /// Sets the value of [kind][crate::model::ExportContext::kind].
13321    ///
13322    /// # Example
13323    /// ```ignore,no_run
13324    /// # use google_cloud_sql_v1::model::ExportContext;
13325    /// let x = ExportContext::new().set_kind("example");
13326    /// ```
13327    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13328        self.kind = v.into();
13329        self
13330    }
13331
13332    /// Sets the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
13333    ///
13334    /// # Example
13335    /// ```ignore,no_run
13336    /// # use google_cloud_sql_v1::model::ExportContext;
13337    /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
13338    /// let x = ExportContext::new().set_sql_export_options(SqlExportOptions::default()/* use setters */);
13339    /// ```
13340    pub fn set_sql_export_options<T>(mut self, v: T) -> Self
13341    where
13342        T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
13343    {
13344        self.sql_export_options = std::option::Option::Some(v.into());
13345        self
13346    }
13347
13348    /// Sets or clears the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
13349    ///
13350    /// # Example
13351    /// ```ignore,no_run
13352    /// # use google_cloud_sql_v1::model::ExportContext;
13353    /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
13354    /// let x = ExportContext::new().set_or_clear_sql_export_options(Some(SqlExportOptions::default()/* use setters */));
13355    /// let x = ExportContext::new().set_or_clear_sql_export_options(None::<SqlExportOptions>);
13356    /// ```
13357    pub fn set_or_clear_sql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
13358    where
13359        T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
13360    {
13361        self.sql_export_options = v.map(|x| x.into());
13362        self
13363    }
13364
13365    /// Sets the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
13366    ///
13367    /// # Example
13368    /// ```ignore,no_run
13369    /// # use google_cloud_sql_v1::model::ExportContext;
13370    /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
13371    /// let x = ExportContext::new().set_csv_export_options(SqlCsvExportOptions::default()/* use setters */);
13372    /// ```
13373    pub fn set_csv_export_options<T>(mut self, v: T) -> Self
13374    where
13375        T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
13376    {
13377        self.csv_export_options = std::option::Option::Some(v.into());
13378        self
13379    }
13380
13381    /// Sets or clears the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
13382    ///
13383    /// # Example
13384    /// ```ignore,no_run
13385    /// # use google_cloud_sql_v1::model::ExportContext;
13386    /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
13387    /// let x = ExportContext::new().set_or_clear_csv_export_options(Some(SqlCsvExportOptions::default()/* use setters */));
13388    /// let x = ExportContext::new().set_or_clear_csv_export_options(None::<SqlCsvExportOptions>);
13389    /// ```
13390    pub fn set_or_clear_csv_export_options<T>(mut self, v: std::option::Option<T>) -> Self
13391    where
13392        T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
13393    {
13394        self.csv_export_options = v.map(|x| x.into());
13395        self
13396    }
13397
13398    /// Sets the value of [file_type][crate::model::ExportContext::file_type].
13399    ///
13400    /// # Example
13401    /// ```ignore,no_run
13402    /// # use google_cloud_sql_v1::model::ExportContext;
13403    /// use google_cloud_sql_v1::model::SqlFileType;
13404    /// let x0 = ExportContext::new().set_file_type(SqlFileType::Sql);
13405    /// let x1 = ExportContext::new().set_file_type(SqlFileType::Csv);
13406    /// let x2 = ExportContext::new().set_file_type(SqlFileType::Bak);
13407    /// ```
13408    pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
13409        self.file_type = v.into();
13410        self
13411    }
13412
13413    /// Sets the value of [offload][crate::model::ExportContext::offload].
13414    ///
13415    /// # Example
13416    /// ```ignore,no_run
13417    /// # use google_cloud_sql_v1::model::ExportContext;
13418    /// use wkt::BoolValue;
13419    /// let x = ExportContext::new().set_offload(BoolValue::default()/* use setters */);
13420    /// ```
13421    pub fn set_offload<T>(mut self, v: T) -> Self
13422    where
13423        T: std::convert::Into<wkt::BoolValue>,
13424    {
13425        self.offload = std::option::Option::Some(v.into());
13426        self
13427    }
13428
13429    /// Sets or clears the value of [offload][crate::model::ExportContext::offload].
13430    ///
13431    /// # Example
13432    /// ```ignore,no_run
13433    /// # use google_cloud_sql_v1::model::ExportContext;
13434    /// use wkt::BoolValue;
13435    /// let x = ExportContext::new().set_or_clear_offload(Some(BoolValue::default()/* use setters */));
13436    /// let x = ExportContext::new().set_or_clear_offload(None::<BoolValue>);
13437    /// ```
13438    pub fn set_or_clear_offload<T>(mut self, v: std::option::Option<T>) -> Self
13439    where
13440        T: std::convert::Into<wkt::BoolValue>,
13441    {
13442        self.offload = v.map(|x| x.into());
13443        self
13444    }
13445
13446    /// Sets the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
13447    ///
13448    /// # Example
13449    /// ```ignore,no_run
13450    /// # use google_cloud_sql_v1::model::ExportContext;
13451    /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
13452    /// let x = ExportContext::new().set_bak_export_options(SqlBakExportOptions::default()/* use setters */);
13453    /// ```
13454    pub fn set_bak_export_options<T>(mut self, v: T) -> Self
13455    where
13456        T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
13457    {
13458        self.bak_export_options = std::option::Option::Some(v.into());
13459        self
13460    }
13461
13462    /// Sets or clears the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
13463    ///
13464    /// # Example
13465    /// ```ignore,no_run
13466    /// # use google_cloud_sql_v1::model::ExportContext;
13467    /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
13468    /// let x = ExportContext::new().set_or_clear_bak_export_options(Some(SqlBakExportOptions::default()/* use setters */));
13469    /// let x = ExportContext::new().set_or_clear_bak_export_options(None::<SqlBakExportOptions>);
13470    /// ```
13471    pub fn set_or_clear_bak_export_options<T>(mut self, v: std::option::Option<T>) -> Self
13472    where
13473        T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
13474    {
13475        self.bak_export_options = v.map(|x| x.into());
13476        self
13477    }
13478}
13479
13480impl wkt::message::Message for ExportContext {
13481    fn typename() -> &'static str {
13482        "type.googleapis.com/google.cloud.sql.v1.ExportContext"
13483    }
13484}
13485
13486/// Defines additional types related to [ExportContext].
13487pub mod export_context {
13488    #[allow(unused_imports)]
13489    use super::*;
13490
13491    #[derive(Clone, Default, PartialEq)]
13492    #[non_exhaustive]
13493    pub struct SqlCsvExportOptions {
13494        /// The select query used to extract the data.
13495        pub select_query: std::string::String,
13496
13497        /// Specifies the character that should appear before a data character that
13498        /// needs to be escaped.
13499        pub escape_character: std::string::String,
13500
13501        /// Specifies the quoting character to be used when a data value is quoted.
13502        pub quote_character: std::string::String,
13503
13504        /// Specifies the character that separates columns within each row (line) of
13505        /// the file.
13506        pub fields_terminated_by: std::string::String,
13507
13508        /// This is used to separate lines. If a line does not contain all fields,
13509        /// the rest of the columns are set to their default values.
13510        pub lines_terminated_by: std::string::String,
13511
13512        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13513    }
13514
13515    impl SqlCsvExportOptions {
13516        pub fn new() -> Self {
13517            std::default::Default::default()
13518        }
13519
13520        /// Sets the value of [select_query][crate::model::export_context::SqlCsvExportOptions::select_query].
13521        ///
13522        /// # Example
13523        /// ```ignore,no_run
13524        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
13525        /// let x = SqlCsvExportOptions::new().set_select_query("example");
13526        /// ```
13527        pub fn set_select_query<T: std::convert::Into<std::string::String>>(
13528            mut self,
13529            v: T,
13530        ) -> Self {
13531            self.select_query = v.into();
13532            self
13533        }
13534
13535        /// Sets the value of [escape_character][crate::model::export_context::SqlCsvExportOptions::escape_character].
13536        ///
13537        /// # Example
13538        /// ```ignore,no_run
13539        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
13540        /// let x = SqlCsvExportOptions::new().set_escape_character("example");
13541        /// ```
13542        pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
13543            mut self,
13544            v: T,
13545        ) -> Self {
13546            self.escape_character = v.into();
13547            self
13548        }
13549
13550        /// Sets the value of [quote_character][crate::model::export_context::SqlCsvExportOptions::quote_character].
13551        ///
13552        /// # Example
13553        /// ```ignore,no_run
13554        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
13555        /// let x = SqlCsvExportOptions::new().set_quote_character("example");
13556        /// ```
13557        pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
13558            mut self,
13559            v: T,
13560        ) -> Self {
13561            self.quote_character = v.into();
13562            self
13563        }
13564
13565        /// Sets the value of [fields_terminated_by][crate::model::export_context::SqlCsvExportOptions::fields_terminated_by].
13566        ///
13567        /// # Example
13568        /// ```ignore,no_run
13569        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
13570        /// let x = SqlCsvExportOptions::new().set_fields_terminated_by("example");
13571        /// ```
13572        pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
13573            mut self,
13574            v: T,
13575        ) -> Self {
13576            self.fields_terminated_by = v.into();
13577            self
13578        }
13579
13580        /// Sets the value of [lines_terminated_by][crate::model::export_context::SqlCsvExportOptions::lines_terminated_by].
13581        ///
13582        /// # Example
13583        /// ```ignore,no_run
13584        /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
13585        /// let x = SqlCsvExportOptions::new().set_lines_terminated_by("example");
13586        /// ```
13587        pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
13588            mut self,
13589            v: T,
13590        ) -> Self {
13591            self.lines_terminated_by = v.into();
13592            self
13593        }
13594    }
13595
13596    impl wkt::message::Message for SqlCsvExportOptions {
13597        fn typename() -> &'static str {
13598            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlCsvExportOptions"
13599        }
13600    }
13601
13602    #[derive(Clone, Default, PartialEq)]
13603    #[non_exhaustive]
13604    pub struct SqlExportOptions {
13605        /// Tables to export, or that were exported, from the specified database. If
13606        /// you specify tables, specify one and only one database. For PostgreSQL
13607        /// instances, you can specify only one table.
13608        pub tables: std::vec::Vec<std::string::String>,
13609
13610        /// Export only schemas.
13611        pub schema_only: std::option::Option<wkt::BoolValue>,
13612
13613        pub mysql_export_options: std::option::Option<
13614            crate::model::export_context::sql_export_options::MysqlExportOptions,
13615        >,
13616
13617        /// Optional. The number of threads to use for parallel export.
13618        pub threads: std::option::Option<wkt::Int32Value>,
13619
13620        /// Optional. Whether or not the export should be parallel.
13621        pub parallel: std::option::Option<wkt::BoolValue>,
13622
13623        /// Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
13624        pub postgres_export_options: std::option::Option<
13625            crate::model::export_context::sql_export_options::PostgresExportOptions,
13626        >,
13627
13628        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13629    }
13630
13631    impl SqlExportOptions {
13632        pub fn new() -> Self {
13633            std::default::Default::default()
13634        }
13635
13636        /// Sets the value of [tables][crate::model::export_context::SqlExportOptions::tables].
13637        ///
13638        /// # Example
13639        /// ```ignore,no_run
13640        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
13641        /// let x = SqlExportOptions::new().set_tables(["a", "b", "c"]);
13642        /// ```
13643        pub fn set_tables<T, V>(mut self, v: T) -> Self
13644        where
13645            T: std::iter::IntoIterator<Item = V>,
13646            V: std::convert::Into<std::string::String>,
13647        {
13648            use std::iter::Iterator;
13649            self.tables = v.into_iter().map(|i| i.into()).collect();
13650            self
13651        }
13652
13653        /// Sets the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
13654        ///
13655        /// # Example
13656        /// ```ignore,no_run
13657        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
13658        /// use wkt::BoolValue;
13659        /// let x = SqlExportOptions::new().set_schema_only(BoolValue::default()/* use setters */);
13660        /// ```
13661        pub fn set_schema_only<T>(mut self, v: T) -> Self
13662        where
13663            T: std::convert::Into<wkt::BoolValue>,
13664        {
13665            self.schema_only = std::option::Option::Some(v.into());
13666            self
13667        }
13668
13669        /// Sets or clears the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
13670        ///
13671        /// # Example
13672        /// ```ignore,no_run
13673        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
13674        /// use wkt::BoolValue;
13675        /// let x = SqlExportOptions::new().set_or_clear_schema_only(Some(BoolValue::default()/* use setters */));
13676        /// let x = SqlExportOptions::new().set_or_clear_schema_only(None::<BoolValue>);
13677        /// ```
13678        pub fn set_or_clear_schema_only<T>(mut self, v: std::option::Option<T>) -> Self
13679        where
13680            T: std::convert::Into<wkt::BoolValue>,
13681        {
13682            self.schema_only = v.map(|x| x.into());
13683            self
13684        }
13685
13686        /// Sets the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
13687        ///
13688        /// # Example
13689        /// ```ignore,no_run
13690        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
13691        /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
13692        /// let x = SqlExportOptions::new().set_mysql_export_options(MysqlExportOptions::default()/* use setters */);
13693        /// ```
13694        pub fn set_mysql_export_options<T>(mut self, v: T) -> Self
13695        where
13696            T: std::convert::Into<
13697                    crate::model::export_context::sql_export_options::MysqlExportOptions,
13698                >,
13699        {
13700            self.mysql_export_options = std::option::Option::Some(v.into());
13701            self
13702        }
13703
13704        /// Sets or clears the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
13705        ///
13706        /// # Example
13707        /// ```ignore,no_run
13708        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
13709        /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
13710        /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(Some(MysqlExportOptions::default()/* use setters */));
13711        /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(None::<MysqlExportOptions>);
13712        /// ```
13713        pub fn set_or_clear_mysql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
13714        where
13715            T: std::convert::Into<
13716                    crate::model::export_context::sql_export_options::MysqlExportOptions,
13717                >,
13718        {
13719            self.mysql_export_options = v.map(|x| x.into());
13720            self
13721        }
13722
13723        /// Sets the value of [threads][crate::model::export_context::SqlExportOptions::threads].
13724        ///
13725        /// # Example
13726        /// ```ignore,no_run
13727        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
13728        /// use wkt::Int32Value;
13729        /// let x = SqlExportOptions::new().set_threads(Int32Value::default()/* use setters */);
13730        /// ```
13731        pub fn set_threads<T>(mut self, v: T) -> Self
13732        where
13733            T: std::convert::Into<wkt::Int32Value>,
13734        {
13735            self.threads = std::option::Option::Some(v.into());
13736            self
13737        }
13738
13739        /// Sets or clears the value of [threads][crate::model::export_context::SqlExportOptions::threads].
13740        ///
13741        /// # Example
13742        /// ```ignore,no_run
13743        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
13744        /// use wkt::Int32Value;
13745        /// let x = SqlExportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
13746        /// let x = SqlExportOptions::new().set_or_clear_threads(None::<Int32Value>);
13747        /// ```
13748        pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
13749        where
13750            T: std::convert::Into<wkt::Int32Value>,
13751        {
13752            self.threads = v.map(|x| x.into());
13753            self
13754        }
13755
13756        /// Sets the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
13757        ///
13758        /// # Example
13759        /// ```ignore,no_run
13760        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
13761        /// use wkt::BoolValue;
13762        /// let x = SqlExportOptions::new().set_parallel(BoolValue::default()/* use setters */);
13763        /// ```
13764        pub fn set_parallel<T>(mut self, v: T) -> Self
13765        where
13766            T: std::convert::Into<wkt::BoolValue>,
13767        {
13768            self.parallel = std::option::Option::Some(v.into());
13769            self
13770        }
13771
13772        /// Sets or clears the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
13773        ///
13774        /// # Example
13775        /// ```ignore,no_run
13776        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
13777        /// use wkt::BoolValue;
13778        /// let x = SqlExportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
13779        /// let x = SqlExportOptions::new().set_or_clear_parallel(None::<BoolValue>);
13780        /// ```
13781        pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
13782        where
13783            T: std::convert::Into<wkt::BoolValue>,
13784        {
13785            self.parallel = v.map(|x| x.into());
13786            self
13787        }
13788
13789        /// Sets the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
13790        ///
13791        /// # Example
13792        /// ```ignore,no_run
13793        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
13794        /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
13795        /// let x = SqlExportOptions::new().set_postgres_export_options(PostgresExportOptions::default()/* use setters */);
13796        /// ```
13797        pub fn set_postgres_export_options<T>(mut self, v: T) -> Self
13798        where
13799            T: std::convert::Into<
13800                    crate::model::export_context::sql_export_options::PostgresExportOptions,
13801                >,
13802        {
13803            self.postgres_export_options = std::option::Option::Some(v.into());
13804            self
13805        }
13806
13807        /// Sets or clears the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
13808        ///
13809        /// # Example
13810        /// ```ignore,no_run
13811        /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
13812        /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
13813        /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(Some(PostgresExportOptions::default()/* use setters */));
13814        /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(None::<PostgresExportOptions>);
13815        /// ```
13816        pub fn set_or_clear_postgres_export_options<T>(mut self, v: std::option::Option<T>) -> Self
13817        where
13818            T: std::convert::Into<
13819                    crate::model::export_context::sql_export_options::PostgresExportOptions,
13820                >,
13821        {
13822            self.postgres_export_options = v.map(|x| x.into());
13823            self
13824        }
13825    }
13826
13827    impl wkt::message::Message for SqlExportOptions {
13828        fn typename() -> &'static str {
13829            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions"
13830        }
13831    }
13832
13833    /// Defines additional types related to [SqlExportOptions].
13834    pub mod sql_export_options {
13835        #[allow(unused_imports)]
13836        use super::*;
13837
13838        /// Options for exporting from MySQL.
13839        #[derive(Clone, Default, PartialEq)]
13840        #[non_exhaustive]
13841        pub struct MysqlExportOptions {
13842            /// Option to include SQL statement required to set up replication. If set
13843            /// to `1`, the dump file includes a CHANGE MASTER TO statement with the
13844            /// binary log coordinates, and --set-gtid-purged is set to ON. If set to
13845            /// `2`, the CHANGE MASTER TO statement is written as a SQL comment and
13846            /// has no effect. If set to any value other than `1`, --set-gtid-purged
13847            /// is set to OFF.
13848            pub master_data: std::option::Option<wkt::Int32Value>,
13849
13850            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13851        }
13852
13853        impl MysqlExportOptions {
13854            pub fn new() -> Self {
13855                std::default::Default::default()
13856            }
13857
13858            /// Sets the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
13859            ///
13860            /// # Example
13861            /// ```ignore,no_run
13862            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
13863            /// use wkt::Int32Value;
13864            /// let x = MysqlExportOptions::new().set_master_data(Int32Value::default()/* use setters */);
13865            /// ```
13866            pub fn set_master_data<T>(mut self, v: T) -> Self
13867            where
13868                T: std::convert::Into<wkt::Int32Value>,
13869            {
13870                self.master_data = std::option::Option::Some(v.into());
13871                self
13872            }
13873
13874            /// Sets or clears the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
13875            ///
13876            /// # Example
13877            /// ```ignore,no_run
13878            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
13879            /// use wkt::Int32Value;
13880            /// let x = MysqlExportOptions::new().set_or_clear_master_data(Some(Int32Value::default()/* use setters */));
13881            /// let x = MysqlExportOptions::new().set_or_clear_master_data(None::<Int32Value>);
13882            /// ```
13883            pub fn set_or_clear_master_data<T>(mut self, v: std::option::Option<T>) -> Self
13884            where
13885                T: std::convert::Into<wkt::Int32Value>,
13886            {
13887                self.master_data = v.map(|x| x.into());
13888                self
13889            }
13890        }
13891
13892        impl wkt::message::Message for MysqlExportOptions {
13893            fn typename() -> &'static str {
13894                "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions"
13895            }
13896        }
13897
13898        /// Options for exporting from a Cloud SQL for PostgreSQL instance.
13899        #[derive(Clone, Default, PartialEq)]
13900        #[non_exhaustive]
13901        pub struct PostgresExportOptions {
13902            /// Optional. Use this option to include DROP \<object\> SQL statements.
13903            /// These statements are used to delete database objects before running the
13904            /// import operation.
13905            pub clean: std::option::Option<wkt::BoolValue>,
13906
13907            /// Optional. Option to include an IF EXISTS SQL statement with each DROP
13908            /// statement produced by clean.
13909            pub if_exists: std::option::Option<wkt::BoolValue>,
13910
13911            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13912        }
13913
13914        impl PostgresExportOptions {
13915            pub fn new() -> Self {
13916                std::default::Default::default()
13917            }
13918
13919            /// Sets the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
13920            ///
13921            /// # Example
13922            /// ```ignore,no_run
13923            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
13924            /// use wkt::BoolValue;
13925            /// let x = PostgresExportOptions::new().set_clean(BoolValue::default()/* use setters */);
13926            /// ```
13927            pub fn set_clean<T>(mut self, v: T) -> Self
13928            where
13929                T: std::convert::Into<wkt::BoolValue>,
13930            {
13931                self.clean = std::option::Option::Some(v.into());
13932                self
13933            }
13934
13935            /// Sets or clears the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
13936            ///
13937            /// # Example
13938            /// ```ignore,no_run
13939            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
13940            /// use wkt::BoolValue;
13941            /// let x = PostgresExportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
13942            /// let x = PostgresExportOptions::new().set_or_clear_clean(None::<BoolValue>);
13943            /// ```
13944            pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
13945            where
13946                T: std::convert::Into<wkt::BoolValue>,
13947            {
13948                self.clean = v.map(|x| x.into());
13949                self
13950            }
13951
13952            /// Sets the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
13953            ///
13954            /// # Example
13955            /// ```ignore,no_run
13956            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
13957            /// use wkt::BoolValue;
13958            /// let x = PostgresExportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
13959            /// ```
13960            pub fn set_if_exists<T>(mut self, v: T) -> Self
13961            where
13962                T: std::convert::Into<wkt::BoolValue>,
13963            {
13964                self.if_exists = std::option::Option::Some(v.into());
13965                self
13966            }
13967
13968            /// Sets or clears the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
13969            ///
13970            /// # Example
13971            /// ```ignore,no_run
13972            /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
13973            /// use wkt::BoolValue;
13974            /// let x = PostgresExportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
13975            /// let x = PostgresExportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
13976            /// ```
13977            pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
13978            where
13979                T: std::convert::Into<wkt::BoolValue>,
13980            {
13981                self.if_exists = v.map(|x| x.into());
13982                self
13983            }
13984        }
13985
13986        impl wkt::message::Message for PostgresExportOptions {
13987            fn typename() -> &'static str {
13988                "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions"
13989            }
13990        }
13991    }
13992
13993    /// Options for exporting BAK files (SQL Server-only)
13994    #[derive(Clone, Default, PartialEq)]
13995    #[non_exhaustive]
13996    pub struct SqlBakExportOptions {
13997        /// Whether or not the export should be striped.
13998        pub striped: std::option::Option<wkt::BoolValue>,
13999
14000        /// Option for specifying how many stripes to use for the export.
14001        /// If blank, and the value of the striped field is true,
14002        /// the number of stripes is automatically chosen.
14003        pub stripe_count: std::option::Option<wkt::Int32Value>,
14004
14005        /// Type of this bak file will be export, FULL or DIFF, SQL Server only
14006        pub bak_type: crate::model::BakType,
14007
14008        /// Deprecated: copy_only is deprecated. Use differential_base instead
14009        #[deprecated]
14010        pub copy_only: std::option::Option<wkt::BoolValue>,
14011
14012        /// Whether or not the backup can be used as a differential base
14013        /// copy_only backup can not be served as differential base
14014        pub differential_base: std::option::Option<wkt::BoolValue>,
14015
14016        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14017    }
14018
14019    impl SqlBakExportOptions {
14020        pub fn new() -> Self {
14021            std::default::Default::default()
14022        }
14023
14024        /// Sets the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
14025        ///
14026        /// # Example
14027        /// ```ignore,no_run
14028        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
14029        /// use wkt::BoolValue;
14030        /// let x = SqlBakExportOptions::new().set_striped(BoolValue::default()/* use setters */);
14031        /// ```
14032        pub fn set_striped<T>(mut self, v: T) -> Self
14033        where
14034            T: std::convert::Into<wkt::BoolValue>,
14035        {
14036            self.striped = std::option::Option::Some(v.into());
14037            self
14038        }
14039
14040        /// Sets or clears the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
14041        ///
14042        /// # Example
14043        /// ```ignore,no_run
14044        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
14045        /// use wkt::BoolValue;
14046        /// let x = SqlBakExportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
14047        /// let x = SqlBakExportOptions::new().set_or_clear_striped(None::<BoolValue>);
14048        /// ```
14049        pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
14050        where
14051            T: std::convert::Into<wkt::BoolValue>,
14052        {
14053            self.striped = v.map(|x| x.into());
14054            self
14055        }
14056
14057        /// Sets the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
14058        ///
14059        /// # Example
14060        /// ```ignore,no_run
14061        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
14062        /// use wkt::Int32Value;
14063        /// let x = SqlBakExportOptions::new().set_stripe_count(Int32Value::default()/* use setters */);
14064        /// ```
14065        pub fn set_stripe_count<T>(mut self, v: T) -> Self
14066        where
14067            T: std::convert::Into<wkt::Int32Value>,
14068        {
14069            self.stripe_count = std::option::Option::Some(v.into());
14070            self
14071        }
14072
14073        /// Sets or clears the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
14074        ///
14075        /// # Example
14076        /// ```ignore,no_run
14077        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
14078        /// use wkt::Int32Value;
14079        /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(Some(Int32Value::default()/* use setters */));
14080        /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(None::<Int32Value>);
14081        /// ```
14082        pub fn set_or_clear_stripe_count<T>(mut self, v: std::option::Option<T>) -> Self
14083        where
14084            T: std::convert::Into<wkt::Int32Value>,
14085        {
14086            self.stripe_count = v.map(|x| x.into());
14087            self
14088        }
14089
14090        /// Sets the value of [bak_type][crate::model::export_context::SqlBakExportOptions::bak_type].
14091        ///
14092        /// # Example
14093        /// ```ignore,no_run
14094        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
14095        /// use google_cloud_sql_v1::model::BakType;
14096        /// let x0 = SqlBakExportOptions::new().set_bak_type(BakType::Full);
14097        /// let x1 = SqlBakExportOptions::new().set_bak_type(BakType::Diff);
14098        /// let x2 = SqlBakExportOptions::new().set_bak_type(BakType::Tlog);
14099        /// ```
14100        pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
14101            self.bak_type = v.into();
14102            self
14103        }
14104
14105        /// Sets the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
14106        ///
14107        /// # Example
14108        /// ```ignore,no_run
14109        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
14110        /// use wkt::BoolValue;
14111        /// let x = SqlBakExportOptions::new().set_copy_only(BoolValue::default()/* use setters */);
14112        /// ```
14113        #[deprecated]
14114        pub fn set_copy_only<T>(mut self, v: T) -> Self
14115        where
14116            T: std::convert::Into<wkt::BoolValue>,
14117        {
14118            self.copy_only = std::option::Option::Some(v.into());
14119            self
14120        }
14121
14122        /// Sets or clears the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
14123        ///
14124        /// # Example
14125        /// ```ignore,no_run
14126        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
14127        /// use wkt::BoolValue;
14128        /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(Some(BoolValue::default()/* use setters */));
14129        /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(None::<BoolValue>);
14130        /// ```
14131        #[deprecated]
14132        pub fn set_or_clear_copy_only<T>(mut self, v: std::option::Option<T>) -> Self
14133        where
14134            T: std::convert::Into<wkt::BoolValue>,
14135        {
14136            self.copy_only = v.map(|x| x.into());
14137            self
14138        }
14139
14140        /// Sets the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
14141        ///
14142        /// # Example
14143        /// ```ignore,no_run
14144        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
14145        /// use wkt::BoolValue;
14146        /// let x = SqlBakExportOptions::new().set_differential_base(BoolValue::default()/* use setters */);
14147        /// ```
14148        pub fn set_differential_base<T>(mut self, v: T) -> Self
14149        where
14150            T: std::convert::Into<wkt::BoolValue>,
14151        {
14152            self.differential_base = std::option::Option::Some(v.into());
14153            self
14154        }
14155
14156        /// Sets or clears the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
14157        ///
14158        /// # Example
14159        /// ```ignore,no_run
14160        /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
14161        /// use wkt::BoolValue;
14162        /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(Some(BoolValue::default()/* use setters */));
14163        /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(None::<BoolValue>);
14164        /// ```
14165        pub fn set_or_clear_differential_base<T>(mut self, v: std::option::Option<T>) -> Self
14166        where
14167            T: std::convert::Into<wkt::BoolValue>,
14168        {
14169            self.differential_base = v.map(|x| x.into());
14170            self
14171        }
14172    }
14173
14174    impl wkt::message::Message for SqlBakExportOptions {
14175        fn typename() -> &'static str {
14176            "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlBakExportOptions"
14177        }
14178    }
14179}
14180
14181/// Database instance import context.
14182#[derive(Clone, Default, PartialEq)]
14183#[non_exhaustive]
14184pub struct ImportContext {
14185    /// Path to the import file in Cloud Storage, in the form
14186    /// `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
14187    /// when `fileType` is `SQL`. The instance must have
14188    /// write permissions to the bucket and read access to the file.
14189    pub uri: std::string::String,
14190
14191    /// The target database for the import. If `fileType` is `SQL`, this field
14192    /// is required only if the import file does not specify a database, and is
14193    /// overridden by any database specification in the import file. If
14194    /// `fileType` is `CSV`, one database must be specified.
14195    pub database: std::string::String,
14196
14197    /// This is always `sql#importContext`.
14198    pub kind: std::string::String,
14199
14200    /// The file type for the specified uri.\`SQL`: The file
14201    /// contains SQL statements. \`CSV`: The file contains CSV data.
14202    pub file_type: crate::model::SqlFileType,
14203
14204    /// Options for importing data as CSV.
14205    pub csv_import_options: std::option::Option<crate::model::import_context::SqlCsvImportOptions>,
14206
14207    /// The PostgreSQL user for this import operation. PostgreSQL instances only.
14208    pub import_user: std::string::String,
14209
14210    /// Import parameters specific to SQL Server .BAK files
14211    pub bak_import_options: std::option::Option<crate::model::import_context::SqlBakImportOptions>,
14212
14213    /// Optional. Options for importing data from SQL statements.
14214    pub sql_import_options: std::option::Option<crate::model::import_context::SqlImportOptions>,
14215
14216    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14217}
14218
14219impl ImportContext {
14220    pub fn new() -> Self {
14221        std::default::Default::default()
14222    }
14223
14224    /// Sets the value of [uri][crate::model::ImportContext::uri].
14225    ///
14226    /// # Example
14227    /// ```ignore,no_run
14228    /// # use google_cloud_sql_v1::model::ImportContext;
14229    /// let x = ImportContext::new().set_uri("example");
14230    /// ```
14231    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14232        self.uri = v.into();
14233        self
14234    }
14235
14236    /// Sets the value of [database][crate::model::ImportContext::database].
14237    ///
14238    /// # Example
14239    /// ```ignore,no_run
14240    /// # use google_cloud_sql_v1::model::ImportContext;
14241    /// let x = ImportContext::new().set_database("example");
14242    /// ```
14243    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14244        self.database = v.into();
14245        self
14246    }
14247
14248    /// Sets the value of [kind][crate::model::ImportContext::kind].
14249    ///
14250    /// # Example
14251    /// ```ignore,no_run
14252    /// # use google_cloud_sql_v1::model::ImportContext;
14253    /// let x = ImportContext::new().set_kind("example");
14254    /// ```
14255    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14256        self.kind = v.into();
14257        self
14258    }
14259
14260    /// Sets the value of [file_type][crate::model::ImportContext::file_type].
14261    ///
14262    /// # Example
14263    /// ```ignore,no_run
14264    /// # use google_cloud_sql_v1::model::ImportContext;
14265    /// use google_cloud_sql_v1::model::SqlFileType;
14266    /// let x0 = ImportContext::new().set_file_type(SqlFileType::Sql);
14267    /// let x1 = ImportContext::new().set_file_type(SqlFileType::Csv);
14268    /// let x2 = ImportContext::new().set_file_type(SqlFileType::Bak);
14269    /// ```
14270    pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
14271        self.file_type = v.into();
14272        self
14273    }
14274
14275    /// Sets the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
14276    ///
14277    /// # Example
14278    /// ```ignore,no_run
14279    /// # use google_cloud_sql_v1::model::ImportContext;
14280    /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
14281    /// let x = ImportContext::new().set_csv_import_options(SqlCsvImportOptions::default()/* use setters */);
14282    /// ```
14283    pub fn set_csv_import_options<T>(mut self, v: T) -> Self
14284    where
14285        T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
14286    {
14287        self.csv_import_options = std::option::Option::Some(v.into());
14288        self
14289    }
14290
14291    /// Sets or clears the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
14292    ///
14293    /// # Example
14294    /// ```ignore,no_run
14295    /// # use google_cloud_sql_v1::model::ImportContext;
14296    /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
14297    /// let x = ImportContext::new().set_or_clear_csv_import_options(Some(SqlCsvImportOptions::default()/* use setters */));
14298    /// let x = ImportContext::new().set_or_clear_csv_import_options(None::<SqlCsvImportOptions>);
14299    /// ```
14300    pub fn set_or_clear_csv_import_options<T>(mut self, v: std::option::Option<T>) -> Self
14301    where
14302        T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
14303    {
14304        self.csv_import_options = v.map(|x| x.into());
14305        self
14306    }
14307
14308    /// Sets the value of [import_user][crate::model::ImportContext::import_user].
14309    ///
14310    /// # Example
14311    /// ```ignore,no_run
14312    /// # use google_cloud_sql_v1::model::ImportContext;
14313    /// let x = ImportContext::new().set_import_user("example");
14314    /// ```
14315    pub fn set_import_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14316        self.import_user = v.into();
14317        self
14318    }
14319
14320    /// Sets the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
14321    ///
14322    /// # Example
14323    /// ```ignore,no_run
14324    /// # use google_cloud_sql_v1::model::ImportContext;
14325    /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
14326    /// let x = ImportContext::new().set_bak_import_options(SqlBakImportOptions::default()/* use setters */);
14327    /// ```
14328    pub fn set_bak_import_options<T>(mut self, v: T) -> Self
14329    where
14330        T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
14331    {
14332        self.bak_import_options = std::option::Option::Some(v.into());
14333        self
14334    }
14335
14336    /// Sets or clears the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
14337    ///
14338    /// # Example
14339    /// ```ignore,no_run
14340    /// # use google_cloud_sql_v1::model::ImportContext;
14341    /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
14342    /// let x = ImportContext::new().set_or_clear_bak_import_options(Some(SqlBakImportOptions::default()/* use setters */));
14343    /// let x = ImportContext::new().set_or_clear_bak_import_options(None::<SqlBakImportOptions>);
14344    /// ```
14345    pub fn set_or_clear_bak_import_options<T>(mut self, v: std::option::Option<T>) -> Self
14346    where
14347        T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
14348    {
14349        self.bak_import_options = v.map(|x| x.into());
14350        self
14351    }
14352
14353    /// Sets the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
14354    ///
14355    /// # Example
14356    /// ```ignore,no_run
14357    /// # use google_cloud_sql_v1::model::ImportContext;
14358    /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
14359    /// let x = ImportContext::new().set_sql_import_options(SqlImportOptions::default()/* use setters */);
14360    /// ```
14361    pub fn set_sql_import_options<T>(mut self, v: T) -> Self
14362    where
14363        T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
14364    {
14365        self.sql_import_options = std::option::Option::Some(v.into());
14366        self
14367    }
14368
14369    /// Sets or clears the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
14370    ///
14371    /// # Example
14372    /// ```ignore,no_run
14373    /// # use google_cloud_sql_v1::model::ImportContext;
14374    /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
14375    /// let x = ImportContext::new().set_or_clear_sql_import_options(Some(SqlImportOptions::default()/* use setters */));
14376    /// let x = ImportContext::new().set_or_clear_sql_import_options(None::<SqlImportOptions>);
14377    /// ```
14378    pub fn set_or_clear_sql_import_options<T>(mut self, v: std::option::Option<T>) -> Self
14379    where
14380        T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
14381    {
14382        self.sql_import_options = v.map(|x| x.into());
14383        self
14384    }
14385}
14386
14387impl wkt::message::Message for ImportContext {
14388    fn typename() -> &'static str {
14389        "type.googleapis.com/google.cloud.sql.v1.ImportContext"
14390    }
14391}
14392
14393/// Defines additional types related to [ImportContext].
14394pub mod import_context {
14395    #[allow(unused_imports)]
14396    use super::*;
14397
14398    #[derive(Clone, Default, PartialEq)]
14399    #[non_exhaustive]
14400    pub struct SqlImportOptions {
14401        /// Optional. The number of threads to use for parallel import.
14402        pub threads: std::option::Option<wkt::Int32Value>,
14403
14404        /// Optional. Whether or not the import should be parallel.
14405        pub parallel: std::option::Option<wkt::BoolValue>,
14406
14407        /// Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
14408        pub postgres_import_options: std::option::Option<
14409            crate::model::import_context::sql_import_options::PostgresImportOptions,
14410        >,
14411
14412        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14413    }
14414
14415    impl SqlImportOptions {
14416        pub fn new() -> Self {
14417            std::default::Default::default()
14418        }
14419
14420        /// Sets the value of [threads][crate::model::import_context::SqlImportOptions::threads].
14421        ///
14422        /// # Example
14423        /// ```ignore,no_run
14424        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
14425        /// use wkt::Int32Value;
14426        /// let x = SqlImportOptions::new().set_threads(Int32Value::default()/* use setters */);
14427        /// ```
14428        pub fn set_threads<T>(mut self, v: T) -> Self
14429        where
14430            T: std::convert::Into<wkt::Int32Value>,
14431        {
14432            self.threads = std::option::Option::Some(v.into());
14433            self
14434        }
14435
14436        /// Sets or clears the value of [threads][crate::model::import_context::SqlImportOptions::threads].
14437        ///
14438        /// # Example
14439        /// ```ignore,no_run
14440        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
14441        /// use wkt::Int32Value;
14442        /// let x = SqlImportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
14443        /// let x = SqlImportOptions::new().set_or_clear_threads(None::<Int32Value>);
14444        /// ```
14445        pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
14446        where
14447            T: std::convert::Into<wkt::Int32Value>,
14448        {
14449            self.threads = v.map(|x| x.into());
14450            self
14451        }
14452
14453        /// Sets the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
14454        ///
14455        /// # Example
14456        /// ```ignore,no_run
14457        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
14458        /// use wkt::BoolValue;
14459        /// let x = SqlImportOptions::new().set_parallel(BoolValue::default()/* use setters */);
14460        /// ```
14461        pub fn set_parallel<T>(mut self, v: T) -> Self
14462        where
14463            T: std::convert::Into<wkt::BoolValue>,
14464        {
14465            self.parallel = std::option::Option::Some(v.into());
14466            self
14467        }
14468
14469        /// Sets or clears the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
14470        ///
14471        /// # Example
14472        /// ```ignore,no_run
14473        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
14474        /// use wkt::BoolValue;
14475        /// let x = SqlImportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
14476        /// let x = SqlImportOptions::new().set_or_clear_parallel(None::<BoolValue>);
14477        /// ```
14478        pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
14479        where
14480            T: std::convert::Into<wkt::BoolValue>,
14481        {
14482            self.parallel = v.map(|x| x.into());
14483            self
14484        }
14485
14486        /// Sets the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
14487        ///
14488        /// # Example
14489        /// ```ignore,no_run
14490        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
14491        /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
14492        /// let x = SqlImportOptions::new().set_postgres_import_options(PostgresImportOptions::default()/* use setters */);
14493        /// ```
14494        pub fn set_postgres_import_options<T>(mut self, v: T) -> Self
14495        where
14496            T: std::convert::Into<
14497                    crate::model::import_context::sql_import_options::PostgresImportOptions,
14498                >,
14499        {
14500            self.postgres_import_options = std::option::Option::Some(v.into());
14501            self
14502        }
14503
14504        /// Sets or clears the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
14505        ///
14506        /// # Example
14507        /// ```ignore,no_run
14508        /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
14509        /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
14510        /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(Some(PostgresImportOptions::default()/* use setters */));
14511        /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(None::<PostgresImportOptions>);
14512        /// ```
14513        pub fn set_or_clear_postgres_import_options<T>(mut self, v: std::option::Option<T>) -> Self
14514        where
14515            T: std::convert::Into<
14516                    crate::model::import_context::sql_import_options::PostgresImportOptions,
14517                >,
14518        {
14519            self.postgres_import_options = v.map(|x| x.into());
14520            self
14521        }
14522    }
14523
14524    impl wkt::message::Message for SqlImportOptions {
14525        fn typename() -> &'static str {
14526            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions"
14527        }
14528    }
14529
14530    /// Defines additional types related to [SqlImportOptions].
14531    pub mod sql_import_options {
14532        #[allow(unused_imports)]
14533        use super::*;
14534
14535        #[derive(Clone, Default, PartialEq)]
14536        #[non_exhaustive]
14537        pub struct PostgresImportOptions {
14538            /// Optional. The --clean flag for the pg_restore utility. This flag
14539            /// applies only if you enabled Cloud SQL to import files in parallel.
14540            pub clean: std::option::Option<wkt::BoolValue>,
14541
14542            /// Optional. The --if-exists flag for the pg_restore utility. This flag
14543            /// applies only if you enabled Cloud SQL to import files in parallel.
14544            pub if_exists: std::option::Option<wkt::BoolValue>,
14545
14546            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14547        }
14548
14549        impl PostgresImportOptions {
14550            pub fn new() -> Self {
14551                std::default::Default::default()
14552            }
14553
14554            /// Sets the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
14555            ///
14556            /// # Example
14557            /// ```ignore,no_run
14558            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
14559            /// use wkt::BoolValue;
14560            /// let x = PostgresImportOptions::new().set_clean(BoolValue::default()/* use setters */);
14561            /// ```
14562            pub fn set_clean<T>(mut self, v: T) -> Self
14563            where
14564                T: std::convert::Into<wkt::BoolValue>,
14565            {
14566                self.clean = std::option::Option::Some(v.into());
14567                self
14568            }
14569
14570            /// Sets or clears the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
14571            ///
14572            /// # Example
14573            /// ```ignore,no_run
14574            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
14575            /// use wkt::BoolValue;
14576            /// let x = PostgresImportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
14577            /// let x = PostgresImportOptions::new().set_or_clear_clean(None::<BoolValue>);
14578            /// ```
14579            pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
14580            where
14581                T: std::convert::Into<wkt::BoolValue>,
14582            {
14583                self.clean = v.map(|x| x.into());
14584                self
14585            }
14586
14587            /// Sets the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
14588            ///
14589            /// # Example
14590            /// ```ignore,no_run
14591            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
14592            /// use wkt::BoolValue;
14593            /// let x = PostgresImportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
14594            /// ```
14595            pub fn set_if_exists<T>(mut self, v: T) -> Self
14596            where
14597                T: std::convert::Into<wkt::BoolValue>,
14598            {
14599                self.if_exists = std::option::Option::Some(v.into());
14600                self
14601            }
14602
14603            /// Sets or clears the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
14604            ///
14605            /// # Example
14606            /// ```ignore,no_run
14607            /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
14608            /// use wkt::BoolValue;
14609            /// let x = PostgresImportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
14610            /// let x = PostgresImportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
14611            /// ```
14612            pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
14613            where
14614                T: std::convert::Into<wkt::BoolValue>,
14615            {
14616                self.if_exists = v.map(|x| x.into());
14617                self
14618            }
14619        }
14620
14621        impl wkt::message::Message for PostgresImportOptions {
14622            fn typename() -> &'static str {
14623                "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions"
14624            }
14625        }
14626    }
14627
14628    #[derive(Clone, Default, PartialEq)]
14629    #[non_exhaustive]
14630    pub struct SqlCsvImportOptions {
14631        /// The table to which CSV data is imported.
14632        pub table: std::string::String,
14633
14634        /// The columns to which CSV data is imported. If not specified, all columns
14635        /// of the database table are loaded with CSV data.
14636        pub columns: std::vec::Vec<std::string::String>,
14637
14638        /// Specifies the character that should appear before a data character that
14639        /// needs to be escaped.
14640        pub escape_character: std::string::String,
14641
14642        /// Specifies the quoting character to be used when a data value is quoted.
14643        pub quote_character: std::string::String,
14644
14645        /// Specifies the character that separates columns within each row (line) of
14646        /// the file.
14647        pub fields_terminated_by: std::string::String,
14648
14649        /// This is used to separate lines. If a line does not contain all fields,
14650        /// the rest of the columns are set to their default values.
14651        pub lines_terminated_by: std::string::String,
14652
14653        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14654    }
14655
14656    impl SqlCsvImportOptions {
14657        pub fn new() -> Self {
14658            std::default::Default::default()
14659        }
14660
14661        /// Sets the value of [table][crate::model::import_context::SqlCsvImportOptions::table].
14662        ///
14663        /// # Example
14664        /// ```ignore,no_run
14665        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
14666        /// let x = SqlCsvImportOptions::new().set_table("example");
14667        /// ```
14668        pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14669            self.table = v.into();
14670            self
14671        }
14672
14673        /// Sets the value of [columns][crate::model::import_context::SqlCsvImportOptions::columns].
14674        ///
14675        /// # Example
14676        /// ```ignore,no_run
14677        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
14678        /// let x = SqlCsvImportOptions::new().set_columns(["a", "b", "c"]);
14679        /// ```
14680        pub fn set_columns<T, V>(mut self, v: T) -> Self
14681        where
14682            T: std::iter::IntoIterator<Item = V>,
14683            V: std::convert::Into<std::string::String>,
14684        {
14685            use std::iter::Iterator;
14686            self.columns = v.into_iter().map(|i| i.into()).collect();
14687            self
14688        }
14689
14690        /// Sets the value of [escape_character][crate::model::import_context::SqlCsvImportOptions::escape_character].
14691        ///
14692        /// # Example
14693        /// ```ignore,no_run
14694        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
14695        /// let x = SqlCsvImportOptions::new().set_escape_character("example");
14696        /// ```
14697        pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
14698            mut self,
14699            v: T,
14700        ) -> Self {
14701            self.escape_character = v.into();
14702            self
14703        }
14704
14705        /// Sets the value of [quote_character][crate::model::import_context::SqlCsvImportOptions::quote_character].
14706        ///
14707        /// # Example
14708        /// ```ignore,no_run
14709        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
14710        /// let x = SqlCsvImportOptions::new().set_quote_character("example");
14711        /// ```
14712        pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
14713            mut self,
14714            v: T,
14715        ) -> Self {
14716            self.quote_character = v.into();
14717            self
14718        }
14719
14720        /// Sets the value of [fields_terminated_by][crate::model::import_context::SqlCsvImportOptions::fields_terminated_by].
14721        ///
14722        /// # Example
14723        /// ```ignore,no_run
14724        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
14725        /// let x = SqlCsvImportOptions::new().set_fields_terminated_by("example");
14726        /// ```
14727        pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
14728            mut self,
14729            v: T,
14730        ) -> Self {
14731            self.fields_terminated_by = v.into();
14732            self
14733        }
14734
14735        /// Sets the value of [lines_terminated_by][crate::model::import_context::SqlCsvImportOptions::lines_terminated_by].
14736        ///
14737        /// # Example
14738        /// ```ignore,no_run
14739        /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
14740        /// let x = SqlCsvImportOptions::new().set_lines_terminated_by("example");
14741        /// ```
14742        pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
14743            mut self,
14744            v: T,
14745        ) -> Self {
14746            self.lines_terminated_by = v.into();
14747            self
14748        }
14749    }
14750
14751    impl wkt::message::Message for SqlCsvImportOptions {
14752        fn typename() -> &'static str {
14753            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlCsvImportOptions"
14754        }
14755    }
14756
14757    #[derive(Clone, Default, PartialEq)]
14758    #[non_exhaustive]
14759    pub struct SqlBakImportOptions {
14760        pub encryption_options: std::option::Option<
14761            crate::model::import_context::sql_bak_import_options::EncryptionOptions,
14762        >,
14763
14764        /// Whether or not the backup set being restored is striped.
14765        /// Applies only to Cloud SQL for SQL Server.
14766        pub striped: std::option::Option<wkt::BoolValue>,
14767
14768        /// Whether or not the backup importing will restore database
14769        /// with NORECOVERY option
14770        /// Applies only to Cloud SQL for SQL Server.
14771        pub no_recovery: std::option::Option<wkt::BoolValue>,
14772
14773        /// Whether or not the backup importing request will just bring database
14774        /// online without downloading Bak content only one of "no_recovery" and
14775        /// "recovery_only" can be true otherwise error will return. Applies only to
14776        /// Cloud SQL for SQL Server.
14777        pub recovery_only: std::option::Option<wkt::BoolValue>,
14778
14779        /// Type of the bak content, FULL or DIFF
14780        pub bak_type: crate::model::BakType,
14781
14782        /// Optional. The timestamp when the import should stop. This timestamp is in
14783        /// the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
14784        /// `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
14785        /// keyword and applies to Cloud SQL for SQL Server only.
14786        pub stop_at: std::option::Option<wkt::Timestamp>,
14787
14788        /// Optional. The marked transaction where the import should stop. This field
14789        /// is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
14790        /// Server only.
14791        pub stop_at_mark: std::string::String,
14792
14793        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14794    }
14795
14796    impl SqlBakImportOptions {
14797        pub fn new() -> Self {
14798            std::default::Default::default()
14799        }
14800
14801        /// Sets the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
14802        ///
14803        /// # Example
14804        /// ```ignore,no_run
14805        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
14806        /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
14807        /// let x = SqlBakImportOptions::new().set_encryption_options(EncryptionOptions::default()/* use setters */);
14808        /// ```
14809        pub fn set_encryption_options<T>(mut self, v: T) -> Self
14810        where
14811            T: std::convert::Into<
14812                    crate::model::import_context::sql_bak_import_options::EncryptionOptions,
14813                >,
14814        {
14815            self.encryption_options = std::option::Option::Some(v.into());
14816            self
14817        }
14818
14819        /// Sets or clears the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
14820        ///
14821        /// # Example
14822        /// ```ignore,no_run
14823        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
14824        /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
14825        /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(Some(EncryptionOptions::default()/* use setters */));
14826        /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(None::<EncryptionOptions>);
14827        /// ```
14828        pub fn set_or_clear_encryption_options<T>(mut self, v: std::option::Option<T>) -> Self
14829        where
14830            T: std::convert::Into<
14831                    crate::model::import_context::sql_bak_import_options::EncryptionOptions,
14832                >,
14833        {
14834            self.encryption_options = v.map(|x| x.into());
14835            self
14836        }
14837
14838        /// Sets the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
14839        ///
14840        /// # Example
14841        /// ```ignore,no_run
14842        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
14843        /// use wkt::BoolValue;
14844        /// let x = SqlBakImportOptions::new().set_striped(BoolValue::default()/* use setters */);
14845        /// ```
14846        pub fn set_striped<T>(mut self, v: T) -> Self
14847        where
14848            T: std::convert::Into<wkt::BoolValue>,
14849        {
14850            self.striped = std::option::Option::Some(v.into());
14851            self
14852        }
14853
14854        /// Sets or clears the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
14855        ///
14856        /// # Example
14857        /// ```ignore,no_run
14858        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
14859        /// use wkt::BoolValue;
14860        /// let x = SqlBakImportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
14861        /// let x = SqlBakImportOptions::new().set_or_clear_striped(None::<BoolValue>);
14862        /// ```
14863        pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
14864        where
14865            T: std::convert::Into<wkt::BoolValue>,
14866        {
14867            self.striped = v.map(|x| x.into());
14868            self
14869        }
14870
14871        /// Sets the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
14872        ///
14873        /// # Example
14874        /// ```ignore,no_run
14875        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
14876        /// use wkt::BoolValue;
14877        /// let x = SqlBakImportOptions::new().set_no_recovery(BoolValue::default()/* use setters */);
14878        /// ```
14879        pub fn set_no_recovery<T>(mut self, v: T) -> Self
14880        where
14881            T: std::convert::Into<wkt::BoolValue>,
14882        {
14883            self.no_recovery = std::option::Option::Some(v.into());
14884            self
14885        }
14886
14887        /// Sets or clears the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
14888        ///
14889        /// # Example
14890        /// ```ignore,no_run
14891        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
14892        /// use wkt::BoolValue;
14893        /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(Some(BoolValue::default()/* use setters */));
14894        /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(None::<BoolValue>);
14895        /// ```
14896        pub fn set_or_clear_no_recovery<T>(mut self, v: std::option::Option<T>) -> Self
14897        where
14898            T: std::convert::Into<wkt::BoolValue>,
14899        {
14900            self.no_recovery = v.map(|x| x.into());
14901            self
14902        }
14903
14904        /// Sets the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
14905        ///
14906        /// # Example
14907        /// ```ignore,no_run
14908        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
14909        /// use wkt::BoolValue;
14910        /// let x = SqlBakImportOptions::new().set_recovery_only(BoolValue::default()/* use setters */);
14911        /// ```
14912        pub fn set_recovery_only<T>(mut self, v: T) -> Self
14913        where
14914            T: std::convert::Into<wkt::BoolValue>,
14915        {
14916            self.recovery_only = std::option::Option::Some(v.into());
14917            self
14918        }
14919
14920        /// Sets or clears the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
14921        ///
14922        /// # Example
14923        /// ```ignore,no_run
14924        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
14925        /// use wkt::BoolValue;
14926        /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(Some(BoolValue::default()/* use setters */));
14927        /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(None::<BoolValue>);
14928        /// ```
14929        pub fn set_or_clear_recovery_only<T>(mut self, v: std::option::Option<T>) -> Self
14930        where
14931            T: std::convert::Into<wkt::BoolValue>,
14932        {
14933            self.recovery_only = v.map(|x| x.into());
14934            self
14935        }
14936
14937        /// Sets the value of [bak_type][crate::model::import_context::SqlBakImportOptions::bak_type].
14938        ///
14939        /// # Example
14940        /// ```ignore,no_run
14941        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
14942        /// use google_cloud_sql_v1::model::BakType;
14943        /// let x0 = SqlBakImportOptions::new().set_bak_type(BakType::Full);
14944        /// let x1 = SqlBakImportOptions::new().set_bak_type(BakType::Diff);
14945        /// let x2 = SqlBakImportOptions::new().set_bak_type(BakType::Tlog);
14946        /// ```
14947        pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
14948            self.bak_type = v.into();
14949            self
14950        }
14951
14952        /// Sets the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
14953        ///
14954        /// # Example
14955        /// ```ignore,no_run
14956        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
14957        /// use wkt::Timestamp;
14958        /// let x = SqlBakImportOptions::new().set_stop_at(Timestamp::default()/* use setters */);
14959        /// ```
14960        pub fn set_stop_at<T>(mut self, v: T) -> Self
14961        where
14962            T: std::convert::Into<wkt::Timestamp>,
14963        {
14964            self.stop_at = std::option::Option::Some(v.into());
14965            self
14966        }
14967
14968        /// Sets or clears the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
14969        ///
14970        /// # Example
14971        /// ```ignore,no_run
14972        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
14973        /// use wkt::Timestamp;
14974        /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(Some(Timestamp::default()/* use setters */));
14975        /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(None::<Timestamp>);
14976        /// ```
14977        pub fn set_or_clear_stop_at<T>(mut self, v: std::option::Option<T>) -> Self
14978        where
14979            T: std::convert::Into<wkt::Timestamp>,
14980        {
14981            self.stop_at = v.map(|x| x.into());
14982            self
14983        }
14984
14985        /// Sets the value of [stop_at_mark][crate::model::import_context::SqlBakImportOptions::stop_at_mark].
14986        ///
14987        /// # Example
14988        /// ```ignore,no_run
14989        /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
14990        /// let x = SqlBakImportOptions::new().set_stop_at_mark("example");
14991        /// ```
14992        pub fn set_stop_at_mark<T: std::convert::Into<std::string::String>>(
14993            mut self,
14994            v: T,
14995        ) -> Self {
14996            self.stop_at_mark = v.into();
14997            self
14998        }
14999    }
15000
15001    impl wkt::message::Message for SqlBakImportOptions {
15002        fn typename() -> &'static str {
15003            "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions"
15004        }
15005    }
15006
15007    /// Defines additional types related to [SqlBakImportOptions].
15008    pub mod sql_bak_import_options {
15009        #[allow(unused_imports)]
15010        use super::*;
15011
15012        #[derive(Clone, Default, PartialEq)]
15013        #[non_exhaustive]
15014        pub struct EncryptionOptions {
15015            /// Path to the Certificate (.cer) in Cloud Storage, in the form
15016            /// `gs://bucketName/fileName`. The instance must have
15017            /// write permissions to the bucket and read access to the file.
15018            pub cert_path: std::string::String,
15019
15020            /// Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
15021            /// form `gs://bucketName/fileName`. The instance must have
15022            /// write permissions to the bucket and read access to the file.
15023            pub pvk_path: std::string::String,
15024
15025            /// Password that encrypts the private key
15026            pub pvk_password: std::string::String,
15027
15028            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15029        }
15030
15031        impl EncryptionOptions {
15032            pub fn new() -> Self {
15033                std::default::Default::default()
15034            }
15035
15036            /// Sets the value of [cert_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::cert_path].
15037            ///
15038            /// # Example
15039            /// ```ignore,no_run
15040            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
15041            /// let x = EncryptionOptions::new().set_cert_path("example");
15042            /// ```
15043            pub fn set_cert_path<T: std::convert::Into<std::string::String>>(
15044                mut self,
15045                v: T,
15046            ) -> Self {
15047                self.cert_path = v.into();
15048                self
15049            }
15050
15051            /// Sets the value of [pvk_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_path].
15052            ///
15053            /// # Example
15054            /// ```ignore,no_run
15055            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
15056            /// let x = EncryptionOptions::new().set_pvk_path("example");
15057            /// ```
15058            pub fn set_pvk_path<T: std::convert::Into<std::string::String>>(
15059                mut self,
15060                v: T,
15061            ) -> Self {
15062                self.pvk_path = v.into();
15063                self
15064            }
15065
15066            /// Sets the value of [pvk_password][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_password].
15067            ///
15068            /// # Example
15069            /// ```ignore,no_run
15070            /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
15071            /// let x = EncryptionOptions::new().set_pvk_password("example");
15072            /// ```
15073            pub fn set_pvk_password<T: std::convert::Into<std::string::String>>(
15074                mut self,
15075                v: T,
15076            ) -> Self {
15077                self.pvk_password = v.into();
15078                self
15079            }
15080        }
15081
15082        impl wkt::message::Message for EncryptionOptions {
15083            fn typename() -> &'static str {
15084                "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions"
15085            }
15086        }
15087    }
15088}
15089
15090/// IP Management configuration.
15091#[derive(Clone, Default, PartialEq)]
15092#[non_exhaustive]
15093pub struct IpConfiguration {
15094    /// Whether the instance is assigned a public IP address or not.
15095    pub ipv4_enabled: std::option::Option<wkt::BoolValue>,
15096
15097    /// The resource link for the VPC network from which the Cloud SQL instance is
15098    /// accessible for private IP. For example,
15099    /// `/projects/myProject/global/networks/default`. This setting can
15100    /// be updated, but it cannot be removed after it is set.
15101    pub private_network: std::string::String,
15102
15103    /// Use `ssl_mode` instead.
15104    ///
15105    /// Whether SSL/TLS connections over IP are enforced.
15106    /// If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
15107    /// For SSL/TLS connections, the client certificate won't be verified. If
15108    /// set to true, then only allow connections encrypted with SSL/TLS and with
15109    /// valid client certificates. If you want to enforce SSL/TLS without enforcing
15110    /// the requirement for valid client certificates, then use the `ssl_mode` flag
15111    /// instead of the `require_ssl` flag.
15112    pub require_ssl: std::option::Option<wkt::BoolValue>,
15113
15114    /// The list of external networks that are allowed to connect to the instance
15115    /// using the IP. In 'CIDR' notation, also known as 'slash' notation (for
15116    /// example: `157.197.200.0/24`).
15117    pub authorized_networks: std::vec::Vec<crate::model::AclEntry>,
15118
15119    /// The name of the allocated ip range for the private ip Cloud SQL instance.
15120    /// For example: "google-managed-services-default". If set, the instance ip
15121    /// will be created in the allocated range. The range name must comply with
15122    /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
15123    /// must be 1-63 characters long and match the regular expression
15124    /// `[a-z]([-a-z0-9]*[a-z0-9])?.`
15125    pub allocated_ip_range: std::string::String,
15126
15127    /// Controls connectivity to private IP instances from Google services,
15128    /// such as BigQuery.
15129    pub enable_private_path_for_google_cloud_services: std::option::Option<wkt::BoolValue>,
15130
15131    /// Specify how SSL/TLS is enforced in database connections. If you must use
15132    /// the `require_ssl` flag for backward compatibility, then only the following
15133    /// value pairs are valid:
15134    ///
15135    /// For PostgreSQL and MySQL:
15136    ///
15137    /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
15138    /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
15139    /// * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
15140    ///
15141    /// For SQL Server:
15142    ///
15143    /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
15144    /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
15145    ///
15146    /// The value of `ssl_mode` has priority over the value of `require_ssl`.
15147    ///
15148    /// For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
15149    /// `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
15150    /// connections, while `require_ssl=false` means accept both non-SSL
15151    /// and SSL connections. In this case, MySQL and PostgreSQL databases respect
15152    /// `ssl_mode` and accepts only SSL connections.
15153    pub ssl_mode: crate::model::ip_configuration::SslMode,
15154
15155    /// PSC settings for this instance.
15156    pub psc_config: std::option::Option<crate::model::PscConfig>,
15157
15158    /// Specify what type of CA is used for the server certificate.
15159    pub server_ca_mode: std::option::Option<crate::model::ip_configuration::CaMode>,
15160
15161    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15162}
15163
15164impl IpConfiguration {
15165    pub fn new() -> Self {
15166        std::default::Default::default()
15167    }
15168
15169    /// Sets the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
15170    ///
15171    /// # Example
15172    /// ```ignore,no_run
15173    /// # use google_cloud_sql_v1::model::IpConfiguration;
15174    /// use wkt::BoolValue;
15175    /// let x = IpConfiguration::new().set_ipv4_enabled(BoolValue::default()/* use setters */);
15176    /// ```
15177    pub fn set_ipv4_enabled<T>(mut self, v: T) -> Self
15178    where
15179        T: std::convert::Into<wkt::BoolValue>,
15180    {
15181        self.ipv4_enabled = std::option::Option::Some(v.into());
15182        self
15183    }
15184
15185    /// Sets or clears the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
15186    ///
15187    /// # Example
15188    /// ```ignore,no_run
15189    /// # use google_cloud_sql_v1::model::IpConfiguration;
15190    /// use wkt::BoolValue;
15191    /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(Some(BoolValue::default()/* use setters */));
15192    /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(None::<BoolValue>);
15193    /// ```
15194    pub fn set_or_clear_ipv4_enabled<T>(mut self, v: std::option::Option<T>) -> Self
15195    where
15196        T: std::convert::Into<wkt::BoolValue>,
15197    {
15198        self.ipv4_enabled = v.map(|x| x.into());
15199        self
15200    }
15201
15202    /// Sets the value of [private_network][crate::model::IpConfiguration::private_network].
15203    ///
15204    /// # Example
15205    /// ```ignore,no_run
15206    /// # use google_cloud_sql_v1::model::IpConfiguration;
15207    /// let x = IpConfiguration::new().set_private_network("example");
15208    /// ```
15209    pub fn set_private_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15210        self.private_network = v.into();
15211        self
15212    }
15213
15214    /// Sets the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
15215    ///
15216    /// # Example
15217    /// ```ignore,no_run
15218    /// # use google_cloud_sql_v1::model::IpConfiguration;
15219    /// use wkt::BoolValue;
15220    /// let x = IpConfiguration::new().set_require_ssl(BoolValue::default()/* use setters */);
15221    /// ```
15222    pub fn set_require_ssl<T>(mut self, v: T) -> Self
15223    where
15224        T: std::convert::Into<wkt::BoolValue>,
15225    {
15226        self.require_ssl = std::option::Option::Some(v.into());
15227        self
15228    }
15229
15230    /// Sets or clears the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
15231    ///
15232    /// # Example
15233    /// ```ignore,no_run
15234    /// # use google_cloud_sql_v1::model::IpConfiguration;
15235    /// use wkt::BoolValue;
15236    /// let x = IpConfiguration::new().set_or_clear_require_ssl(Some(BoolValue::default()/* use setters */));
15237    /// let x = IpConfiguration::new().set_or_clear_require_ssl(None::<BoolValue>);
15238    /// ```
15239    pub fn set_or_clear_require_ssl<T>(mut self, v: std::option::Option<T>) -> Self
15240    where
15241        T: std::convert::Into<wkt::BoolValue>,
15242    {
15243        self.require_ssl = v.map(|x| x.into());
15244        self
15245    }
15246
15247    /// Sets the value of [authorized_networks][crate::model::IpConfiguration::authorized_networks].
15248    ///
15249    /// # Example
15250    /// ```ignore,no_run
15251    /// # use google_cloud_sql_v1::model::IpConfiguration;
15252    /// use google_cloud_sql_v1::model::AclEntry;
15253    /// let x = IpConfiguration::new()
15254    ///     .set_authorized_networks([
15255    ///         AclEntry::default()/* use setters */,
15256    ///         AclEntry::default()/* use (different) setters */,
15257    ///     ]);
15258    /// ```
15259    pub fn set_authorized_networks<T, V>(mut self, v: T) -> Self
15260    where
15261        T: std::iter::IntoIterator<Item = V>,
15262        V: std::convert::Into<crate::model::AclEntry>,
15263    {
15264        use std::iter::Iterator;
15265        self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
15266        self
15267    }
15268
15269    /// Sets the value of [allocated_ip_range][crate::model::IpConfiguration::allocated_ip_range].
15270    ///
15271    /// # Example
15272    /// ```ignore,no_run
15273    /// # use google_cloud_sql_v1::model::IpConfiguration;
15274    /// let x = IpConfiguration::new().set_allocated_ip_range("example");
15275    /// ```
15276    pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
15277        mut self,
15278        v: T,
15279    ) -> Self {
15280        self.allocated_ip_range = v.into();
15281        self
15282    }
15283
15284    /// Sets the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
15285    ///
15286    /// # Example
15287    /// ```ignore,no_run
15288    /// # use google_cloud_sql_v1::model::IpConfiguration;
15289    /// use wkt::BoolValue;
15290    /// let x = IpConfiguration::new().set_enable_private_path_for_google_cloud_services(BoolValue::default()/* use setters */);
15291    /// ```
15292    pub fn set_enable_private_path_for_google_cloud_services<T>(mut self, v: T) -> Self
15293    where
15294        T: std::convert::Into<wkt::BoolValue>,
15295    {
15296        self.enable_private_path_for_google_cloud_services = std::option::Option::Some(v.into());
15297        self
15298    }
15299
15300    /// Sets or clears the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
15301    ///
15302    /// # Example
15303    /// ```ignore,no_run
15304    /// # use google_cloud_sql_v1::model::IpConfiguration;
15305    /// use wkt::BoolValue;
15306    /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(Some(BoolValue::default()/* use setters */));
15307    /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(None::<BoolValue>);
15308    /// ```
15309    pub fn set_or_clear_enable_private_path_for_google_cloud_services<T>(
15310        mut self,
15311        v: std::option::Option<T>,
15312    ) -> Self
15313    where
15314        T: std::convert::Into<wkt::BoolValue>,
15315    {
15316        self.enable_private_path_for_google_cloud_services = v.map(|x| x.into());
15317        self
15318    }
15319
15320    /// Sets the value of [ssl_mode][crate::model::IpConfiguration::ssl_mode].
15321    ///
15322    /// # Example
15323    /// ```ignore,no_run
15324    /// # use google_cloud_sql_v1::model::IpConfiguration;
15325    /// use google_cloud_sql_v1::model::ip_configuration::SslMode;
15326    /// let x0 = IpConfiguration::new().set_ssl_mode(SslMode::AllowUnencryptedAndEncrypted);
15327    /// let x1 = IpConfiguration::new().set_ssl_mode(SslMode::EncryptedOnly);
15328    /// let x2 = IpConfiguration::new().set_ssl_mode(SslMode::TrustedClientCertificateRequired);
15329    /// ```
15330    pub fn set_ssl_mode<T: std::convert::Into<crate::model::ip_configuration::SslMode>>(
15331        mut self,
15332        v: T,
15333    ) -> Self {
15334        self.ssl_mode = v.into();
15335        self
15336    }
15337
15338    /// Sets the value of [psc_config][crate::model::IpConfiguration::psc_config].
15339    ///
15340    /// # Example
15341    /// ```ignore,no_run
15342    /// # use google_cloud_sql_v1::model::IpConfiguration;
15343    /// use google_cloud_sql_v1::model::PscConfig;
15344    /// let x = IpConfiguration::new().set_psc_config(PscConfig::default()/* use setters */);
15345    /// ```
15346    pub fn set_psc_config<T>(mut self, v: T) -> Self
15347    where
15348        T: std::convert::Into<crate::model::PscConfig>,
15349    {
15350        self.psc_config = std::option::Option::Some(v.into());
15351        self
15352    }
15353
15354    /// Sets or clears the value of [psc_config][crate::model::IpConfiguration::psc_config].
15355    ///
15356    /// # Example
15357    /// ```ignore,no_run
15358    /// # use google_cloud_sql_v1::model::IpConfiguration;
15359    /// use google_cloud_sql_v1::model::PscConfig;
15360    /// let x = IpConfiguration::new().set_or_clear_psc_config(Some(PscConfig::default()/* use setters */));
15361    /// let x = IpConfiguration::new().set_or_clear_psc_config(None::<PscConfig>);
15362    /// ```
15363    pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
15364    where
15365        T: std::convert::Into<crate::model::PscConfig>,
15366    {
15367        self.psc_config = v.map(|x| x.into());
15368        self
15369    }
15370
15371    /// Sets the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
15372    ///
15373    /// # Example
15374    /// ```ignore,no_run
15375    /// # use google_cloud_sql_v1::model::IpConfiguration;
15376    /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
15377    /// let x0 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
15378    /// let x1 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
15379    /// ```
15380    pub fn set_server_ca_mode<T>(mut self, v: T) -> Self
15381    where
15382        T: std::convert::Into<crate::model::ip_configuration::CaMode>,
15383    {
15384        self.server_ca_mode = std::option::Option::Some(v.into());
15385        self
15386    }
15387
15388    /// Sets or clears the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
15389    ///
15390    /// # Example
15391    /// ```ignore,no_run
15392    /// # use google_cloud_sql_v1::model::IpConfiguration;
15393    /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
15394    /// let x0 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedInternalCa));
15395    /// let x1 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedCasCa));
15396    /// let x_none = IpConfiguration::new().set_or_clear_server_ca_mode(None::<CaMode>);
15397    /// ```
15398    pub fn set_or_clear_server_ca_mode<T>(mut self, v: std::option::Option<T>) -> Self
15399    where
15400        T: std::convert::Into<crate::model::ip_configuration::CaMode>,
15401    {
15402        self.server_ca_mode = v.map(|x| x.into());
15403        self
15404    }
15405}
15406
15407impl wkt::message::Message for IpConfiguration {
15408    fn typename() -> &'static str {
15409        "type.googleapis.com/google.cloud.sql.v1.IpConfiguration"
15410    }
15411}
15412
15413/// Defines additional types related to [IpConfiguration].
15414pub mod ip_configuration {
15415    #[allow(unused_imports)]
15416    use super::*;
15417
15418    /// The SSL options for database connections.
15419    ///
15420    /// # Working with unknown values
15421    ///
15422    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15423    /// additional enum variants at any time. Adding new variants is not considered
15424    /// a breaking change. Applications should write their code in anticipation of:
15425    ///
15426    /// - New values appearing in future releases of the client library, **and**
15427    /// - New values received dynamically, without application changes.
15428    ///
15429    /// Please consult the [Working with enums] section in the user guide for some
15430    /// guidelines.
15431    ///
15432    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15433    #[derive(Clone, Debug, PartialEq)]
15434    #[non_exhaustive]
15435    pub enum SslMode {
15436        /// The SSL mode is unknown.
15437        Unspecified,
15438        /// Allow non-SSL/non-TLS and SSL/TLS connections.
15439        /// For SSL connections to MySQL and PostgreSQL, the client certificate
15440        /// isn't verified.
15441        ///
15442        /// When this value is used, the legacy `require_ssl` flag must be false or
15443        /// cleared to avoid a conflict between the values of the two flags.
15444        AllowUnencryptedAndEncrypted,
15445        /// Only allow connections encrypted with SSL/TLS.
15446        /// For SSL connections to MySQL and PostgreSQL, the client certificate
15447        /// isn't verified.
15448        ///
15449        /// When this value is used, the legacy `require_ssl` flag must be false or
15450        /// cleared to avoid a conflict between the values of the two flags.
15451        EncryptedOnly,
15452        /// Only allow connections encrypted with SSL/TLS and with valid
15453        /// client certificates.
15454        ///
15455        /// When this value is used, the legacy `require_ssl` flag must be true or
15456        /// cleared to avoid the conflict between values of two flags.
15457        /// PostgreSQL clients or users that connect using IAM database
15458        /// authentication must use either the
15459        /// [Cloud SQL Auth
15460        /// Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
15461        /// [Cloud SQL
15462        /// Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
15463        /// to enforce client identity verification.
15464        ///
15465        /// Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
15466        TrustedClientCertificateRequired,
15467        /// If set, the enum was initialized with an unknown value.
15468        ///
15469        /// Applications can examine the value using [SslMode::value] or
15470        /// [SslMode::name].
15471        UnknownValue(ssl_mode::UnknownValue),
15472    }
15473
15474    #[doc(hidden)]
15475    pub mod ssl_mode {
15476        #[allow(unused_imports)]
15477        use super::*;
15478        #[derive(Clone, Debug, PartialEq)]
15479        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15480    }
15481
15482    impl SslMode {
15483        /// Gets the enum value.
15484        ///
15485        /// Returns `None` if the enum contains an unknown value deserialized from
15486        /// the string representation of enums.
15487        pub fn value(&self) -> std::option::Option<i32> {
15488            match self {
15489                Self::Unspecified => std::option::Option::Some(0),
15490                Self::AllowUnencryptedAndEncrypted => std::option::Option::Some(1),
15491                Self::EncryptedOnly => std::option::Option::Some(2),
15492                Self::TrustedClientCertificateRequired => std::option::Option::Some(3),
15493                Self::UnknownValue(u) => u.0.value(),
15494            }
15495        }
15496
15497        /// Gets the enum value as a string.
15498        ///
15499        /// Returns `None` if the enum contains an unknown value deserialized from
15500        /// the integer representation of enums.
15501        pub fn name(&self) -> std::option::Option<&str> {
15502            match self {
15503                Self::Unspecified => std::option::Option::Some("SSL_MODE_UNSPECIFIED"),
15504                Self::AllowUnencryptedAndEncrypted => {
15505                    std::option::Option::Some("ALLOW_UNENCRYPTED_AND_ENCRYPTED")
15506                }
15507                Self::EncryptedOnly => std::option::Option::Some("ENCRYPTED_ONLY"),
15508                Self::TrustedClientCertificateRequired => {
15509                    std::option::Option::Some("TRUSTED_CLIENT_CERTIFICATE_REQUIRED")
15510                }
15511                Self::UnknownValue(u) => u.0.name(),
15512            }
15513        }
15514    }
15515
15516    impl std::default::Default for SslMode {
15517        fn default() -> Self {
15518            use std::convert::From;
15519            Self::from(0)
15520        }
15521    }
15522
15523    impl std::fmt::Display for SslMode {
15524        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15525            wkt::internal::display_enum(f, self.name(), self.value())
15526        }
15527    }
15528
15529    impl std::convert::From<i32> for SslMode {
15530        fn from(value: i32) -> Self {
15531            match value {
15532                0 => Self::Unspecified,
15533                1 => Self::AllowUnencryptedAndEncrypted,
15534                2 => Self::EncryptedOnly,
15535                3 => Self::TrustedClientCertificateRequired,
15536                _ => Self::UnknownValue(ssl_mode::UnknownValue(
15537                    wkt::internal::UnknownEnumValue::Integer(value),
15538                )),
15539            }
15540        }
15541    }
15542
15543    impl std::convert::From<&str> for SslMode {
15544        fn from(value: &str) -> Self {
15545            use std::string::ToString;
15546            match value {
15547                "SSL_MODE_UNSPECIFIED" => Self::Unspecified,
15548                "ALLOW_UNENCRYPTED_AND_ENCRYPTED" => Self::AllowUnencryptedAndEncrypted,
15549                "ENCRYPTED_ONLY" => Self::EncryptedOnly,
15550                "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" => Self::TrustedClientCertificateRequired,
15551                _ => Self::UnknownValue(ssl_mode::UnknownValue(
15552                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15553                )),
15554            }
15555        }
15556    }
15557
15558    impl serde::ser::Serialize for SslMode {
15559        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15560        where
15561            S: serde::Serializer,
15562        {
15563            match self {
15564                Self::Unspecified => serializer.serialize_i32(0),
15565                Self::AllowUnencryptedAndEncrypted => serializer.serialize_i32(1),
15566                Self::EncryptedOnly => serializer.serialize_i32(2),
15567                Self::TrustedClientCertificateRequired => serializer.serialize_i32(3),
15568                Self::UnknownValue(u) => u.0.serialize(serializer),
15569            }
15570        }
15571    }
15572
15573    impl<'de> serde::de::Deserialize<'de> for SslMode {
15574        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15575        where
15576            D: serde::Deserializer<'de>,
15577        {
15578            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslMode>::new(
15579                ".google.cloud.sql.v1.IpConfiguration.SslMode",
15580            ))
15581        }
15582    }
15583
15584    /// Various Certificate Authority (CA) modes for certificate signing.
15585    ///
15586    /// # Working with unknown values
15587    ///
15588    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15589    /// additional enum variants at any time. Adding new variants is not considered
15590    /// a breaking change. Applications should write their code in anticipation of:
15591    ///
15592    /// - New values appearing in future releases of the client library, **and**
15593    /// - New values received dynamically, without application changes.
15594    ///
15595    /// Please consult the [Working with enums] section in the user guide for some
15596    /// guidelines.
15597    ///
15598    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15599    #[derive(Clone, Debug, PartialEq)]
15600    #[non_exhaustive]
15601    pub enum CaMode {
15602        /// CA mode is unknown.
15603        Unspecified,
15604        /// Google-managed self-signed internal CA.
15605        GoogleManagedInternalCa,
15606        /// Google-managed regional CA part of root CA hierarchy hosted on Google
15607        /// Cloud's Certificate Authority Service (CAS).
15608        GoogleManagedCasCa,
15609        /// If set, the enum was initialized with an unknown value.
15610        ///
15611        /// Applications can examine the value using [CaMode::value] or
15612        /// [CaMode::name].
15613        UnknownValue(ca_mode::UnknownValue),
15614    }
15615
15616    #[doc(hidden)]
15617    pub mod ca_mode {
15618        #[allow(unused_imports)]
15619        use super::*;
15620        #[derive(Clone, Debug, PartialEq)]
15621        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15622    }
15623
15624    impl CaMode {
15625        /// Gets the enum value.
15626        ///
15627        /// Returns `None` if the enum contains an unknown value deserialized from
15628        /// the string representation of enums.
15629        pub fn value(&self) -> std::option::Option<i32> {
15630            match self {
15631                Self::Unspecified => std::option::Option::Some(0),
15632                Self::GoogleManagedInternalCa => std::option::Option::Some(1),
15633                Self::GoogleManagedCasCa => std::option::Option::Some(2),
15634                Self::UnknownValue(u) => u.0.value(),
15635            }
15636        }
15637
15638        /// Gets the enum value as a string.
15639        ///
15640        /// Returns `None` if the enum contains an unknown value deserialized from
15641        /// the integer representation of enums.
15642        pub fn name(&self) -> std::option::Option<&str> {
15643            match self {
15644                Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
15645                Self::GoogleManagedInternalCa => {
15646                    std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
15647                }
15648                Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
15649                Self::UnknownValue(u) => u.0.name(),
15650            }
15651        }
15652    }
15653
15654    impl std::default::Default for CaMode {
15655        fn default() -> Self {
15656            use std::convert::From;
15657            Self::from(0)
15658        }
15659    }
15660
15661    impl std::fmt::Display for CaMode {
15662        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15663            wkt::internal::display_enum(f, self.name(), self.value())
15664        }
15665    }
15666
15667    impl std::convert::From<i32> for CaMode {
15668        fn from(value: i32) -> Self {
15669            match value {
15670                0 => Self::Unspecified,
15671                1 => Self::GoogleManagedInternalCa,
15672                2 => Self::GoogleManagedCasCa,
15673                _ => Self::UnknownValue(ca_mode::UnknownValue(
15674                    wkt::internal::UnknownEnumValue::Integer(value),
15675                )),
15676            }
15677        }
15678    }
15679
15680    impl std::convert::From<&str> for CaMode {
15681        fn from(value: &str) -> Self {
15682            use std::string::ToString;
15683            match value {
15684                "CA_MODE_UNSPECIFIED" => Self::Unspecified,
15685                "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
15686                "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
15687                _ => Self::UnknownValue(ca_mode::UnknownValue(
15688                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15689                )),
15690            }
15691        }
15692    }
15693
15694    impl serde::ser::Serialize for CaMode {
15695        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15696        where
15697            S: serde::Serializer,
15698        {
15699            match self {
15700                Self::Unspecified => serializer.serialize_i32(0),
15701                Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
15702                Self::GoogleManagedCasCa => serializer.serialize_i32(2),
15703                Self::UnknownValue(u) => u.0.serialize(serializer),
15704            }
15705        }
15706    }
15707
15708    impl<'de> serde::de::Deserialize<'de> for CaMode {
15709        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15710        where
15711            D: serde::Deserializer<'de>,
15712        {
15713            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
15714                ".google.cloud.sql.v1.IpConfiguration.CaMode",
15715            ))
15716        }
15717    }
15718}
15719
15720/// PSC settings for a Cloud SQL instance.
15721#[derive(Clone, Default, PartialEq)]
15722#[non_exhaustive]
15723pub struct PscConfig {
15724    /// Whether PSC connectivity is enabled for this instance.
15725    pub psc_enabled: std::option::Option<bool>,
15726
15727    /// Optional. The list of consumer projects that are allow-listed for PSC
15728    /// connections to this instance. This instance can be connected to with PSC
15729    /// from any network in these projects.
15730    ///
15731    /// Each consumer project in this list may be represented by a project number
15732    /// (numeric) or by a project id (alphanumeric).
15733    pub allowed_consumer_projects: std::vec::Vec<std::string::String>,
15734
15735    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15736}
15737
15738impl PscConfig {
15739    pub fn new() -> Self {
15740        std::default::Default::default()
15741    }
15742
15743    /// Sets the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
15744    ///
15745    /// # Example
15746    /// ```ignore,no_run
15747    /// # use google_cloud_sql_v1::model::PscConfig;
15748    /// let x = PscConfig::new().set_psc_enabled(true);
15749    /// ```
15750    pub fn set_psc_enabled<T>(mut self, v: T) -> Self
15751    where
15752        T: std::convert::Into<bool>,
15753    {
15754        self.psc_enabled = std::option::Option::Some(v.into());
15755        self
15756    }
15757
15758    /// Sets or clears the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
15759    ///
15760    /// # Example
15761    /// ```ignore,no_run
15762    /// # use google_cloud_sql_v1::model::PscConfig;
15763    /// let x = PscConfig::new().set_or_clear_psc_enabled(Some(false));
15764    /// let x = PscConfig::new().set_or_clear_psc_enabled(None::<bool>);
15765    /// ```
15766    pub fn set_or_clear_psc_enabled<T>(mut self, v: std::option::Option<T>) -> Self
15767    where
15768        T: std::convert::Into<bool>,
15769    {
15770        self.psc_enabled = v.map(|x| x.into());
15771        self
15772    }
15773
15774    /// Sets the value of [allowed_consumer_projects][crate::model::PscConfig::allowed_consumer_projects].
15775    ///
15776    /// # Example
15777    /// ```ignore,no_run
15778    /// # use google_cloud_sql_v1::model::PscConfig;
15779    /// let x = PscConfig::new().set_allowed_consumer_projects(["a", "b", "c"]);
15780    /// ```
15781    pub fn set_allowed_consumer_projects<T, V>(mut self, v: T) -> Self
15782    where
15783        T: std::iter::IntoIterator<Item = V>,
15784        V: std::convert::Into<std::string::String>,
15785    {
15786        use std::iter::Iterator;
15787        self.allowed_consumer_projects = v.into_iter().map(|i| i.into()).collect();
15788        self
15789    }
15790}
15791
15792impl wkt::message::Message for PscConfig {
15793    fn typename() -> &'static str {
15794        "type.googleapis.com/google.cloud.sql.v1.PscConfig"
15795    }
15796}
15797
15798/// Preferred location. This specifies where a Cloud SQL instance is located.
15799/// Note that if the preferred location is not available, the instance will be
15800/// located as close as possible within the region. Only one location may be
15801/// specified.
15802#[derive(Clone, Default, PartialEq)]
15803#[non_exhaustive]
15804pub struct LocationPreference {
15805    /// The App Engine application to follow, it must be in the same region as the
15806    /// Cloud SQL instance. WARNING: Changing this might restart the instance.
15807    #[deprecated]
15808    pub follow_gae_application: std::string::String,
15809
15810    /// The preferred Compute Engine zone (for example: us-central1-a,
15811    /// us-central1-b, etc.). WARNING: Changing this might restart the instance.
15812    pub zone: std::string::String,
15813
15814    /// The preferred Compute Engine zone for the secondary/failover
15815    /// (for example: us-central1-a, us-central1-b, etc.).
15816    /// To disable this field, set it to 'no_secondary_zone'.
15817    pub secondary_zone: std::string::String,
15818
15819    /// This is always `sql#locationPreference`.
15820    pub kind: std::string::String,
15821
15822    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15823}
15824
15825impl LocationPreference {
15826    pub fn new() -> Self {
15827        std::default::Default::default()
15828    }
15829
15830    /// Sets the value of [follow_gae_application][crate::model::LocationPreference::follow_gae_application].
15831    ///
15832    /// # Example
15833    /// ```ignore,no_run
15834    /// # use google_cloud_sql_v1::model::LocationPreference;
15835    /// let x = LocationPreference::new().set_follow_gae_application("example");
15836    /// ```
15837    #[deprecated]
15838    pub fn set_follow_gae_application<T: std::convert::Into<std::string::String>>(
15839        mut self,
15840        v: T,
15841    ) -> Self {
15842        self.follow_gae_application = v.into();
15843        self
15844    }
15845
15846    /// Sets the value of [zone][crate::model::LocationPreference::zone].
15847    ///
15848    /// # Example
15849    /// ```ignore,no_run
15850    /// # use google_cloud_sql_v1::model::LocationPreference;
15851    /// let x = LocationPreference::new().set_zone("example");
15852    /// ```
15853    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15854        self.zone = v.into();
15855        self
15856    }
15857
15858    /// Sets the value of [secondary_zone][crate::model::LocationPreference::secondary_zone].
15859    ///
15860    /// # Example
15861    /// ```ignore,no_run
15862    /// # use google_cloud_sql_v1::model::LocationPreference;
15863    /// let x = LocationPreference::new().set_secondary_zone("example");
15864    /// ```
15865    pub fn set_secondary_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15866        self.secondary_zone = v.into();
15867        self
15868    }
15869
15870    /// Sets the value of [kind][crate::model::LocationPreference::kind].
15871    ///
15872    /// # Example
15873    /// ```ignore,no_run
15874    /// # use google_cloud_sql_v1::model::LocationPreference;
15875    /// let x = LocationPreference::new().set_kind("example");
15876    /// ```
15877    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15878        self.kind = v.into();
15879        self
15880    }
15881}
15882
15883impl wkt::message::Message for LocationPreference {
15884    fn typename() -> &'static str {
15885        "type.googleapis.com/google.cloud.sql.v1.LocationPreference"
15886    }
15887}
15888
15889/// Maintenance window. This specifies when a Cloud SQL instance is
15890/// restarted for system maintenance purposes.
15891#[derive(Clone, Default, PartialEq)]
15892#[non_exhaustive]
15893pub struct MaintenanceWindow {
15894    /// Hour of day - 0 to 23. Specify in the UTC time zone.
15895    pub hour: std::option::Option<wkt::Int32Value>,
15896
15897    /// Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
15898    /// `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
15899    /// Returned in output as an integer, 1 to 7, where `1` equals Monday.
15900    pub day: std::option::Option<wkt::Int32Value>,
15901
15902    /// Maintenance timing settings: `canary`, `stable`, or `week5`.
15903    /// For more information, see [About maintenance on Cloud SQL
15904    /// instances](https://cloud.google.com/sql/docs/mysql/maintenance).
15905    pub update_track: crate::model::SqlUpdateTrack,
15906
15907    /// This is always `sql#maintenanceWindow`.
15908    pub kind: std::string::String,
15909
15910    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15911}
15912
15913impl MaintenanceWindow {
15914    pub fn new() -> Self {
15915        std::default::Default::default()
15916    }
15917
15918    /// Sets the value of [hour][crate::model::MaintenanceWindow::hour].
15919    ///
15920    /// # Example
15921    /// ```ignore,no_run
15922    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
15923    /// use wkt::Int32Value;
15924    /// let x = MaintenanceWindow::new().set_hour(Int32Value::default()/* use setters */);
15925    /// ```
15926    pub fn set_hour<T>(mut self, v: T) -> Self
15927    where
15928        T: std::convert::Into<wkt::Int32Value>,
15929    {
15930        self.hour = std::option::Option::Some(v.into());
15931        self
15932    }
15933
15934    /// Sets or clears the value of [hour][crate::model::MaintenanceWindow::hour].
15935    ///
15936    /// # Example
15937    /// ```ignore,no_run
15938    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
15939    /// use wkt::Int32Value;
15940    /// let x = MaintenanceWindow::new().set_or_clear_hour(Some(Int32Value::default()/* use setters */));
15941    /// let x = MaintenanceWindow::new().set_or_clear_hour(None::<Int32Value>);
15942    /// ```
15943    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
15944    where
15945        T: std::convert::Into<wkt::Int32Value>,
15946    {
15947        self.hour = v.map(|x| x.into());
15948        self
15949    }
15950
15951    /// Sets the value of [day][crate::model::MaintenanceWindow::day].
15952    ///
15953    /// # Example
15954    /// ```ignore,no_run
15955    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
15956    /// use wkt::Int32Value;
15957    /// let x = MaintenanceWindow::new().set_day(Int32Value::default()/* use setters */);
15958    /// ```
15959    pub fn set_day<T>(mut self, v: T) -> Self
15960    where
15961        T: std::convert::Into<wkt::Int32Value>,
15962    {
15963        self.day = std::option::Option::Some(v.into());
15964        self
15965    }
15966
15967    /// Sets or clears the value of [day][crate::model::MaintenanceWindow::day].
15968    ///
15969    /// # Example
15970    /// ```ignore,no_run
15971    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
15972    /// use wkt::Int32Value;
15973    /// let x = MaintenanceWindow::new().set_or_clear_day(Some(Int32Value::default()/* use setters */));
15974    /// let x = MaintenanceWindow::new().set_or_clear_day(None::<Int32Value>);
15975    /// ```
15976    pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
15977    where
15978        T: std::convert::Into<wkt::Int32Value>,
15979    {
15980        self.day = v.map(|x| x.into());
15981        self
15982    }
15983
15984    /// Sets the value of [update_track][crate::model::MaintenanceWindow::update_track].
15985    ///
15986    /// # Example
15987    /// ```ignore,no_run
15988    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
15989    /// use google_cloud_sql_v1::model::SqlUpdateTrack;
15990    /// let x0 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Canary);
15991    /// let x1 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Stable);
15992    /// let x2 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Week5);
15993    /// ```
15994    pub fn set_update_track<T: std::convert::Into<crate::model::SqlUpdateTrack>>(
15995        mut self,
15996        v: T,
15997    ) -> Self {
15998        self.update_track = v.into();
15999        self
16000    }
16001
16002    /// Sets the value of [kind][crate::model::MaintenanceWindow::kind].
16003    ///
16004    /// # Example
16005    /// ```ignore,no_run
16006    /// # use google_cloud_sql_v1::model::MaintenanceWindow;
16007    /// let x = MaintenanceWindow::new().set_kind("example");
16008    /// ```
16009    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16010        self.kind = v.into();
16011        self
16012    }
16013}
16014
16015impl wkt::message::Message for MaintenanceWindow {
16016    fn typename() -> &'static str {
16017        "type.googleapis.com/google.cloud.sql.v1.MaintenanceWindow"
16018    }
16019}
16020
16021/// Deny maintenance Periods. This specifies a date range during when all CSA
16022/// rollout will be denied.
16023#[derive(Clone, Default, PartialEq)]
16024#[non_exhaustive]
16025pub struct DenyMaintenancePeriod {
16026    /// "deny maintenance period" start date. If the year of the start date is
16027    /// empty, the year of the end date also must be empty. In this case, it means
16028    /// the deny maintenance period recurs every year. The date is in format
16029    /// yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
16030    pub start_date: std::string::String,
16031
16032    /// "deny maintenance period" end date. If the year of the end date is empty,
16033    /// the year of the start date also must be empty. In this case, it means the
16034    /// no maintenance interval recurs every year. The date is in format yyyy-mm-dd
16035    /// i.e., 2020-11-01, or mm-dd, i.e., 11-01
16036    pub end_date: std::string::String,
16037
16038    /// Time in UTC when the "deny maintenance period" starts on start_date and
16039    /// ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
16040    pub time: std::string::String,
16041
16042    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16043}
16044
16045impl DenyMaintenancePeriod {
16046    pub fn new() -> Self {
16047        std::default::Default::default()
16048    }
16049
16050    /// Sets the value of [start_date][crate::model::DenyMaintenancePeriod::start_date].
16051    ///
16052    /// # Example
16053    /// ```ignore,no_run
16054    /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
16055    /// let x = DenyMaintenancePeriod::new().set_start_date("example");
16056    /// ```
16057    pub fn set_start_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16058        self.start_date = v.into();
16059        self
16060    }
16061
16062    /// Sets the value of [end_date][crate::model::DenyMaintenancePeriod::end_date].
16063    ///
16064    /// # Example
16065    /// ```ignore,no_run
16066    /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
16067    /// let x = DenyMaintenancePeriod::new().set_end_date("example");
16068    /// ```
16069    pub fn set_end_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16070        self.end_date = v.into();
16071        self
16072    }
16073
16074    /// Sets the value of [time][crate::model::DenyMaintenancePeriod::time].
16075    ///
16076    /// # Example
16077    /// ```ignore,no_run
16078    /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
16079    /// let x = DenyMaintenancePeriod::new().set_time("example");
16080    /// ```
16081    pub fn set_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16082        self.time = v.into();
16083        self
16084    }
16085}
16086
16087impl wkt::message::Message for DenyMaintenancePeriod {
16088    fn typename() -> &'static str {
16089        "type.googleapis.com/google.cloud.sql.v1.DenyMaintenancePeriod"
16090    }
16091}
16092
16093/// Insights configuration. This specifies when Cloud SQL Insights feature is
16094/// enabled and optional configuration.
16095#[derive(Clone, Default, PartialEq)]
16096#[non_exhaustive]
16097pub struct InsightsConfig {
16098    /// Whether Query Insights feature is enabled.
16099    pub query_insights_enabled: bool,
16100
16101    /// Whether Query Insights will record client address when enabled.
16102    pub record_client_address: bool,
16103
16104    /// Whether Query Insights will record application tags from query when
16105    /// enabled.
16106    pub record_application_tags: bool,
16107
16108    /// Maximum query length stored in bytes. Default value: 1024 bytes.
16109    /// Range: 256-4500 bytes. Query length more than this field value will be
16110    /// truncated to this value. When unset, query length will be the default
16111    /// value. Changing query length will restart the database.
16112    pub query_string_length: std::option::Option<wkt::Int32Value>,
16113
16114    /// Number of query execution plans captured by Insights per minute
16115    /// for all queries combined. Default is 5.
16116    pub query_plans_per_minute: std::option::Option<wkt::Int32Value>,
16117
16118    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16119}
16120
16121impl InsightsConfig {
16122    pub fn new() -> Self {
16123        std::default::Default::default()
16124    }
16125
16126    /// Sets the value of [query_insights_enabled][crate::model::InsightsConfig::query_insights_enabled].
16127    ///
16128    /// # Example
16129    /// ```ignore,no_run
16130    /// # use google_cloud_sql_v1::model::InsightsConfig;
16131    /// let x = InsightsConfig::new().set_query_insights_enabled(true);
16132    /// ```
16133    pub fn set_query_insights_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16134        self.query_insights_enabled = v.into();
16135        self
16136    }
16137
16138    /// Sets the value of [record_client_address][crate::model::InsightsConfig::record_client_address].
16139    ///
16140    /// # Example
16141    /// ```ignore,no_run
16142    /// # use google_cloud_sql_v1::model::InsightsConfig;
16143    /// let x = InsightsConfig::new().set_record_client_address(true);
16144    /// ```
16145    pub fn set_record_client_address<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16146        self.record_client_address = v.into();
16147        self
16148    }
16149
16150    /// Sets the value of [record_application_tags][crate::model::InsightsConfig::record_application_tags].
16151    ///
16152    /// # Example
16153    /// ```ignore,no_run
16154    /// # use google_cloud_sql_v1::model::InsightsConfig;
16155    /// let x = InsightsConfig::new().set_record_application_tags(true);
16156    /// ```
16157    pub fn set_record_application_tags<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16158        self.record_application_tags = v.into();
16159        self
16160    }
16161
16162    /// Sets the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
16163    ///
16164    /// # Example
16165    /// ```ignore,no_run
16166    /// # use google_cloud_sql_v1::model::InsightsConfig;
16167    /// use wkt::Int32Value;
16168    /// let x = InsightsConfig::new().set_query_string_length(Int32Value::default()/* use setters */);
16169    /// ```
16170    pub fn set_query_string_length<T>(mut self, v: T) -> Self
16171    where
16172        T: std::convert::Into<wkt::Int32Value>,
16173    {
16174        self.query_string_length = std::option::Option::Some(v.into());
16175        self
16176    }
16177
16178    /// Sets or clears the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
16179    ///
16180    /// # Example
16181    /// ```ignore,no_run
16182    /// # use google_cloud_sql_v1::model::InsightsConfig;
16183    /// use wkt::Int32Value;
16184    /// let x = InsightsConfig::new().set_or_clear_query_string_length(Some(Int32Value::default()/* use setters */));
16185    /// let x = InsightsConfig::new().set_or_clear_query_string_length(None::<Int32Value>);
16186    /// ```
16187    pub fn set_or_clear_query_string_length<T>(mut self, v: std::option::Option<T>) -> Self
16188    where
16189        T: std::convert::Into<wkt::Int32Value>,
16190    {
16191        self.query_string_length = v.map(|x| x.into());
16192        self
16193    }
16194
16195    /// Sets the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
16196    ///
16197    /// # Example
16198    /// ```ignore,no_run
16199    /// # use google_cloud_sql_v1::model::InsightsConfig;
16200    /// use wkt::Int32Value;
16201    /// let x = InsightsConfig::new().set_query_plans_per_minute(Int32Value::default()/* use setters */);
16202    /// ```
16203    pub fn set_query_plans_per_minute<T>(mut self, v: T) -> Self
16204    where
16205        T: std::convert::Into<wkt::Int32Value>,
16206    {
16207        self.query_plans_per_minute = std::option::Option::Some(v.into());
16208        self
16209    }
16210
16211    /// Sets or clears the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
16212    ///
16213    /// # Example
16214    /// ```ignore,no_run
16215    /// # use google_cloud_sql_v1::model::InsightsConfig;
16216    /// use wkt::Int32Value;
16217    /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(Some(Int32Value::default()/* use setters */));
16218    /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(None::<Int32Value>);
16219    /// ```
16220    pub fn set_or_clear_query_plans_per_minute<T>(mut self, v: std::option::Option<T>) -> Self
16221    where
16222        T: std::convert::Into<wkt::Int32Value>,
16223    {
16224        self.query_plans_per_minute = v.map(|x| x.into());
16225        self
16226    }
16227}
16228
16229impl wkt::message::Message for InsightsConfig {
16230    fn typename() -> &'static str {
16231        "type.googleapis.com/google.cloud.sql.v1.InsightsConfig"
16232    }
16233}
16234
16235/// Read-replica configuration specific to MySQL databases.
16236#[derive(Clone, Default, PartialEq)]
16237#[non_exhaustive]
16238pub struct MySqlReplicaConfiguration {
16239    /// Path to a SQL dump file in Google Cloud Storage from which the replica
16240    /// instance is to be created. The URI is in the form gs://bucketName/fileName.
16241    /// Compressed gzip files (.gz) are also supported.
16242    /// Dumps have the binlog co-ordinates from which replication
16243    /// begins. This can be accomplished by setting --master-data to 1 when using
16244    /// mysqldump.
16245    pub dump_file_path: std::string::String,
16246
16247    /// The username for the replication connection.
16248    pub username: std::string::String,
16249
16250    /// The password for the replication connection.
16251    pub password: std::string::String,
16252
16253    /// Seconds to wait between connect retries. MySQL's default is 60 seconds.
16254    pub connect_retry_interval: std::option::Option<wkt::Int32Value>,
16255
16256    /// Interval in milliseconds between replication heartbeats.
16257    pub master_heartbeat_period: std::option::Option<wkt::Int64Value>,
16258
16259    /// PEM representation of the trusted CA's x509 certificate.
16260    pub ca_certificate: std::string::String,
16261
16262    /// PEM representation of the replica's x509 certificate.
16263    pub client_certificate: std::string::String,
16264
16265    /// PEM representation of the replica's private key. The corresponsing public
16266    /// key is encoded in the client's certificate.
16267    pub client_key: std::string::String,
16268
16269    /// A list of permissible ciphers to use for SSL encryption.
16270    pub ssl_cipher: std::string::String,
16271
16272    /// Whether or not to check the primary instance's Common Name value in the
16273    /// certificate that it sends during the SSL handshake.
16274    pub verify_server_certificate: std::option::Option<wkt::BoolValue>,
16275
16276    /// This is always `sql#mysqlReplicaConfiguration`.
16277    pub kind: std::string::String,
16278
16279    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16280}
16281
16282impl MySqlReplicaConfiguration {
16283    pub fn new() -> Self {
16284        std::default::Default::default()
16285    }
16286
16287    /// Sets the value of [dump_file_path][crate::model::MySqlReplicaConfiguration::dump_file_path].
16288    ///
16289    /// # Example
16290    /// ```ignore,no_run
16291    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16292    /// let x = MySqlReplicaConfiguration::new().set_dump_file_path("example");
16293    /// ```
16294    pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16295        self.dump_file_path = v.into();
16296        self
16297    }
16298
16299    /// Sets the value of [username][crate::model::MySqlReplicaConfiguration::username].
16300    ///
16301    /// # Example
16302    /// ```ignore,no_run
16303    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16304    /// let x = MySqlReplicaConfiguration::new().set_username("example");
16305    /// ```
16306    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16307        self.username = v.into();
16308        self
16309    }
16310
16311    /// Sets the value of [password][crate::model::MySqlReplicaConfiguration::password].
16312    ///
16313    /// # Example
16314    /// ```ignore,no_run
16315    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16316    /// let x = MySqlReplicaConfiguration::new().set_password("example");
16317    /// ```
16318    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16319        self.password = v.into();
16320        self
16321    }
16322
16323    /// Sets the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
16324    ///
16325    /// # Example
16326    /// ```ignore,no_run
16327    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16328    /// use wkt::Int32Value;
16329    /// let x = MySqlReplicaConfiguration::new().set_connect_retry_interval(Int32Value::default()/* use setters */);
16330    /// ```
16331    pub fn set_connect_retry_interval<T>(mut self, v: T) -> Self
16332    where
16333        T: std::convert::Into<wkt::Int32Value>,
16334    {
16335        self.connect_retry_interval = std::option::Option::Some(v.into());
16336        self
16337    }
16338
16339    /// Sets or clears the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
16340    ///
16341    /// # Example
16342    /// ```ignore,no_run
16343    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16344    /// use wkt::Int32Value;
16345    /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(Some(Int32Value::default()/* use setters */));
16346    /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(None::<Int32Value>);
16347    /// ```
16348    pub fn set_or_clear_connect_retry_interval<T>(mut self, v: std::option::Option<T>) -> Self
16349    where
16350        T: std::convert::Into<wkt::Int32Value>,
16351    {
16352        self.connect_retry_interval = v.map(|x| x.into());
16353        self
16354    }
16355
16356    /// Sets the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
16357    ///
16358    /// # Example
16359    /// ```ignore,no_run
16360    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16361    /// use wkt::Int64Value;
16362    /// let x = MySqlReplicaConfiguration::new().set_master_heartbeat_period(Int64Value::default()/* use setters */);
16363    /// ```
16364    pub fn set_master_heartbeat_period<T>(mut self, v: T) -> Self
16365    where
16366        T: std::convert::Into<wkt::Int64Value>,
16367    {
16368        self.master_heartbeat_period = std::option::Option::Some(v.into());
16369        self
16370    }
16371
16372    /// Sets or clears the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
16373    ///
16374    /// # Example
16375    /// ```ignore,no_run
16376    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16377    /// use wkt::Int64Value;
16378    /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(Some(Int64Value::default()/* use setters */));
16379    /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(None::<Int64Value>);
16380    /// ```
16381    pub fn set_or_clear_master_heartbeat_period<T>(mut self, v: std::option::Option<T>) -> Self
16382    where
16383        T: std::convert::Into<wkt::Int64Value>,
16384    {
16385        self.master_heartbeat_period = v.map(|x| x.into());
16386        self
16387    }
16388
16389    /// Sets the value of [ca_certificate][crate::model::MySqlReplicaConfiguration::ca_certificate].
16390    ///
16391    /// # Example
16392    /// ```ignore,no_run
16393    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16394    /// let x = MySqlReplicaConfiguration::new().set_ca_certificate("example");
16395    /// ```
16396    pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16397        self.ca_certificate = v.into();
16398        self
16399    }
16400
16401    /// Sets the value of [client_certificate][crate::model::MySqlReplicaConfiguration::client_certificate].
16402    ///
16403    /// # Example
16404    /// ```ignore,no_run
16405    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16406    /// let x = MySqlReplicaConfiguration::new().set_client_certificate("example");
16407    /// ```
16408    pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
16409        mut self,
16410        v: T,
16411    ) -> Self {
16412        self.client_certificate = v.into();
16413        self
16414    }
16415
16416    /// Sets the value of [client_key][crate::model::MySqlReplicaConfiguration::client_key].
16417    ///
16418    /// # Example
16419    /// ```ignore,no_run
16420    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16421    /// let x = MySqlReplicaConfiguration::new().set_client_key("example");
16422    /// ```
16423    pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16424        self.client_key = v.into();
16425        self
16426    }
16427
16428    /// Sets the value of [ssl_cipher][crate::model::MySqlReplicaConfiguration::ssl_cipher].
16429    ///
16430    /// # Example
16431    /// ```ignore,no_run
16432    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16433    /// let x = MySqlReplicaConfiguration::new().set_ssl_cipher("example");
16434    /// ```
16435    pub fn set_ssl_cipher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16436        self.ssl_cipher = v.into();
16437        self
16438    }
16439
16440    /// Sets the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
16441    ///
16442    /// # Example
16443    /// ```ignore,no_run
16444    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16445    /// use wkt::BoolValue;
16446    /// let x = MySqlReplicaConfiguration::new().set_verify_server_certificate(BoolValue::default()/* use setters */);
16447    /// ```
16448    pub fn set_verify_server_certificate<T>(mut self, v: T) -> Self
16449    where
16450        T: std::convert::Into<wkt::BoolValue>,
16451    {
16452        self.verify_server_certificate = std::option::Option::Some(v.into());
16453        self
16454    }
16455
16456    /// Sets or clears the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
16457    ///
16458    /// # Example
16459    /// ```ignore,no_run
16460    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16461    /// use wkt::BoolValue;
16462    /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(Some(BoolValue::default()/* use setters */));
16463    /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(None::<BoolValue>);
16464    /// ```
16465    pub fn set_or_clear_verify_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
16466    where
16467        T: std::convert::Into<wkt::BoolValue>,
16468    {
16469        self.verify_server_certificate = v.map(|x| x.into());
16470        self
16471    }
16472
16473    /// Sets the value of [kind][crate::model::MySqlReplicaConfiguration::kind].
16474    ///
16475    /// # Example
16476    /// ```ignore,no_run
16477    /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16478    /// let x = MySqlReplicaConfiguration::new().set_kind("example");
16479    /// ```
16480    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16481        self.kind = v.into();
16482        self
16483    }
16484}
16485
16486impl wkt::message::Message for MySqlReplicaConfiguration {
16487    fn typename() -> &'static str {
16488        "type.googleapis.com/google.cloud.sql.v1.MySqlReplicaConfiguration"
16489    }
16490}
16491
16492/// Disk encryption configuration for an instance.
16493#[derive(Clone, Default, PartialEq)]
16494#[non_exhaustive]
16495pub struct DiskEncryptionConfiguration {
16496    /// Resource name of KMS key for disk encryption
16497    pub kms_key_name: std::string::String,
16498
16499    /// This is always `sql#diskEncryptionConfiguration`.
16500    pub kind: std::string::String,
16501
16502    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16503}
16504
16505impl DiskEncryptionConfiguration {
16506    pub fn new() -> Self {
16507        std::default::Default::default()
16508    }
16509
16510    /// Sets the value of [kms_key_name][crate::model::DiskEncryptionConfiguration::kms_key_name].
16511    ///
16512    /// # Example
16513    /// ```ignore,no_run
16514    /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
16515    /// let x = DiskEncryptionConfiguration::new().set_kms_key_name("example");
16516    /// ```
16517    pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16518        self.kms_key_name = v.into();
16519        self
16520    }
16521
16522    /// Sets the value of [kind][crate::model::DiskEncryptionConfiguration::kind].
16523    ///
16524    /// # Example
16525    /// ```ignore,no_run
16526    /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
16527    /// let x = DiskEncryptionConfiguration::new().set_kind("example");
16528    /// ```
16529    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16530        self.kind = v.into();
16531        self
16532    }
16533}
16534
16535impl wkt::message::Message for DiskEncryptionConfiguration {
16536    fn typename() -> &'static str {
16537        "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionConfiguration"
16538    }
16539}
16540
16541/// Disk encryption status for an instance.
16542#[derive(Clone, Default, PartialEq)]
16543#[non_exhaustive]
16544pub struct DiskEncryptionStatus {
16545    /// KMS key version used to encrypt the Cloud SQL instance resource
16546    pub kms_key_version_name: std::string::String,
16547
16548    /// This is always `sql#diskEncryptionStatus`.
16549    pub kind: std::string::String,
16550
16551    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16552}
16553
16554impl DiskEncryptionStatus {
16555    pub fn new() -> Self {
16556        std::default::Default::default()
16557    }
16558
16559    /// Sets the value of [kms_key_version_name][crate::model::DiskEncryptionStatus::kms_key_version_name].
16560    ///
16561    /// # Example
16562    /// ```ignore,no_run
16563    /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
16564    /// let x = DiskEncryptionStatus::new().set_kms_key_version_name("example");
16565    /// ```
16566    pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
16567        mut self,
16568        v: T,
16569    ) -> Self {
16570        self.kms_key_version_name = v.into();
16571        self
16572    }
16573
16574    /// Sets the value of [kind][crate::model::DiskEncryptionStatus::kind].
16575    ///
16576    /// # Example
16577    /// ```ignore,no_run
16578    /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
16579    /// let x = DiskEncryptionStatus::new().set_kind("example");
16580    /// ```
16581    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16582        self.kind = v.into();
16583        self
16584    }
16585}
16586
16587impl wkt::message::Message for DiskEncryptionStatus {
16588    fn typename() -> &'static str {
16589        "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionStatus"
16590    }
16591}
16592
16593/// Database instance IP mapping
16594#[derive(Clone, Default, PartialEq)]
16595#[non_exhaustive]
16596pub struct IpMapping {
16597    /// The type of this IP address. A `PRIMARY` address is a public address that
16598    /// can accept incoming connections. A `PRIVATE` address is a private address
16599    /// that can accept incoming connections. An `OUTGOING` address is the source
16600    /// address of connections originating from the instance, if supported.
16601    pub r#type: crate::model::SqlIpAddressType,
16602
16603    /// The IP address assigned.
16604    pub ip_address: std::string::String,
16605
16606    /// The due time for this IP to be retired in
16607    /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
16608    /// `2012-11-15T16:19:00.094Z`. This field is only available when
16609    /// the IP is scheduled to be retired.
16610    pub time_to_retire: std::option::Option<wkt::Timestamp>,
16611
16612    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16613}
16614
16615impl IpMapping {
16616    pub fn new() -> Self {
16617        std::default::Default::default()
16618    }
16619
16620    /// Sets the value of [r#type][crate::model::IpMapping::type].
16621    ///
16622    /// # Example
16623    /// ```ignore,no_run
16624    /// # use google_cloud_sql_v1::model::IpMapping;
16625    /// use google_cloud_sql_v1::model::SqlIpAddressType;
16626    /// let x0 = IpMapping::new().set_type(SqlIpAddressType::Primary);
16627    /// let x1 = IpMapping::new().set_type(SqlIpAddressType::Outgoing);
16628    /// let x2 = IpMapping::new().set_type(SqlIpAddressType::Private);
16629    /// ```
16630    pub fn set_type<T: std::convert::Into<crate::model::SqlIpAddressType>>(mut self, v: T) -> Self {
16631        self.r#type = v.into();
16632        self
16633    }
16634
16635    /// Sets the value of [ip_address][crate::model::IpMapping::ip_address].
16636    ///
16637    /// # Example
16638    /// ```ignore,no_run
16639    /// # use google_cloud_sql_v1::model::IpMapping;
16640    /// let x = IpMapping::new().set_ip_address("example");
16641    /// ```
16642    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16643        self.ip_address = v.into();
16644        self
16645    }
16646
16647    /// Sets the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
16648    ///
16649    /// # Example
16650    /// ```ignore,no_run
16651    /// # use google_cloud_sql_v1::model::IpMapping;
16652    /// use wkt::Timestamp;
16653    /// let x = IpMapping::new().set_time_to_retire(Timestamp::default()/* use setters */);
16654    /// ```
16655    pub fn set_time_to_retire<T>(mut self, v: T) -> Self
16656    where
16657        T: std::convert::Into<wkt::Timestamp>,
16658    {
16659        self.time_to_retire = std::option::Option::Some(v.into());
16660        self
16661    }
16662
16663    /// Sets or clears the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
16664    ///
16665    /// # Example
16666    /// ```ignore,no_run
16667    /// # use google_cloud_sql_v1::model::IpMapping;
16668    /// use wkt::Timestamp;
16669    /// let x = IpMapping::new().set_or_clear_time_to_retire(Some(Timestamp::default()/* use setters */));
16670    /// let x = IpMapping::new().set_or_clear_time_to_retire(None::<Timestamp>);
16671    /// ```
16672    pub fn set_or_clear_time_to_retire<T>(mut self, v: std::option::Option<T>) -> Self
16673    where
16674        T: std::convert::Into<wkt::Timestamp>,
16675    {
16676        self.time_to_retire = v.map(|x| x.into());
16677        self
16678    }
16679}
16680
16681impl wkt::message::Message for IpMapping {
16682    fn typename() -> &'static str {
16683        "type.googleapis.com/google.cloud.sql.v1.IpMapping"
16684    }
16685}
16686
16687/// An Operation resource.&nbsp;For successful operations that return an
16688/// Operation resource, only the fields relevant to the operation are populated
16689/// in the resource.
16690#[derive(Clone, Default, PartialEq)]
16691#[non_exhaustive]
16692pub struct Operation {
16693    /// This is always `sql#operation`.
16694    pub kind: std::string::String,
16695
16696    pub target_link: std::string::String,
16697
16698    /// The status of an operation.
16699    pub status: crate::model::operation::SqlOperationStatus,
16700
16701    /// The email address of the user who initiated this operation.
16702    pub user: std::string::String,
16703
16704    /// The time this operation was enqueued in UTC timezone in [RFC
16705    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
16706    /// `2012-11-15T16:19:00.094Z`.
16707    pub insert_time: std::option::Option<wkt::Timestamp>,
16708
16709    /// The time this operation actually started in UTC timezone in [RFC
16710    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
16711    /// `2012-11-15T16:19:00.094Z`.
16712    pub start_time: std::option::Option<wkt::Timestamp>,
16713
16714    /// The time this operation finished in UTC timezone in [RFC
16715    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
16716    /// `2012-11-15T16:19:00.094Z`.
16717    pub end_time: std::option::Option<wkt::Timestamp>,
16718
16719    /// If errors occurred during processing of this operation, this field will be
16720    /// populated.
16721    pub error: std::option::Option<crate::model::OperationErrors>,
16722
16723    /// An Admin API warning message.
16724    pub api_warning: std::option::Option<crate::model::ApiWarning>,
16725
16726    /// The type of the operation. Valid values are:
16727    ///
16728    /// * `CREATE`
16729    /// * `DELETE`
16730    /// * `UPDATE`
16731    /// * `RESTART`
16732    /// * `IMPORT`
16733    /// * `EXPORT`
16734    /// * `BACKUP_VOLUME`
16735    /// * `RESTORE_VOLUME`
16736    /// * `CREATE_USER`
16737    /// * `DELETE_USER`
16738    /// * `CREATE_DATABASE`
16739    /// * `DELETE_DATABASE`
16740    pub operation_type: crate::model::operation::SqlOperationType,
16741
16742    /// The context for import operation, if applicable.
16743    pub import_context: std::option::Option<crate::model::ImportContext>,
16744
16745    /// The context for export operation, if applicable.
16746    pub export_context: std::option::Option<crate::model::ExportContext>,
16747
16748    /// The context for backup operation, if applicable.
16749    pub backup_context: std::option::Option<crate::model::BackupContext>,
16750
16751    /// An identifier that uniquely identifies the operation. You can use this
16752    /// identifier to retrieve the Operations resource that has information about
16753    /// the operation.
16754    pub name: std::string::String,
16755
16756    /// Name of the database instance related to this operation.
16757    pub target_id: std::string::String,
16758
16759    /// The URI of this resource.
16760    pub self_link: std::string::String,
16761
16762    /// The project ID of the target instance related to this operation.
16763    pub target_project: std::string::String,
16764
16765    /// The context for acquire SSRS lease operation, if applicable.
16766    pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
16767
16768    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16769}
16770
16771impl Operation {
16772    pub fn new() -> Self {
16773        std::default::Default::default()
16774    }
16775
16776    /// Sets the value of [kind][crate::model::Operation::kind].
16777    ///
16778    /// # Example
16779    /// ```ignore,no_run
16780    /// # use google_cloud_sql_v1::model::Operation;
16781    /// let x = Operation::new().set_kind("example");
16782    /// ```
16783    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16784        self.kind = v.into();
16785        self
16786    }
16787
16788    /// Sets the value of [target_link][crate::model::Operation::target_link].
16789    ///
16790    /// # Example
16791    /// ```ignore,no_run
16792    /// # use google_cloud_sql_v1::model::Operation;
16793    /// let x = Operation::new().set_target_link("example");
16794    /// ```
16795    pub fn set_target_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16796        self.target_link = v.into();
16797        self
16798    }
16799
16800    /// Sets the value of [status][crate::model::Operation::status].
16801    ///
16802    /// # Example
16803    /// ```ignore,no_run
16804    /// # use google_cloud_sql_v1::model::Operation;
16805    /// use google_cloud_sql_v1::model::operation::SqlOperationStatus;
16806    /// let x0 = Operation::new().set_status(SqlOperationStatus::Pending);
16807    /// let x1 = Operation::new().set_status(SqlOperationStatus::Running);
16808    /// let x2 = Operation::new().set_status(SqlOperationStatus::Done);
16809    /// ```
16810    pub fn set_status<T: std::convert::Into<crate::model::operation::SqlOperationStatus>>(
16811        mut self,
16812        v: T,
16813    ) -> Self {
16814        self.status = v.into();
16815        self
16816    }
16817
16818    /// Sets the value of [user][crate::model::Operation::user].
16819    ///
16820    /// # Example
16821    /// ```ignore,no_run
16822    /// # use google_cloud_sql_v1::model::Operation;
16823    /// let x = Operation::new().set_user("example");
16824    /// ```
16825    pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16826        self.user = v.into();
16827        self
16828    }
16829
16830    /// Sets the value of [insert_time][crate::model::Operation::insert_time].
16831    ///
16832    /// # Example
16833    /// ```ignore,no_run
16834    /// # use google_cloud_sql_v1::model::Operation;
16835    /// use wkt::Timestamp;
16836    /// let x = Operation::new().set_insert_time(Timestamp::default()/* use setters */);
16837    /// ```
16838    pub fn set_insert_time<T>(mut self, v: T) -> Self
16839    where
16840        T: std::convert::Into<wkt::Timestamp>,
16841    {
16842        self.insert_time = std::option::Option::Some(v.into());
16843        self
16844    }
16845
16846    /// Sets or clears the value of [insert_time][crate::model::Operation::insert_time].
16847    ///
16848    /// # Example
16849    /// ```ignore,no_run
16850    /// # use google_cloud_sql_v1::model::Operation;
16851    /// use wkt::Timestamp;
16852    /// let x = Operation::new().set_or_clear_insert_time(Some(Timestamp::default()/* use setters */));
16853    /// let x = Operation::new().set_or_clear_insert_time(None::<Timestamp>);
16854    /// ```
16855    pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
16856    where
16857        T: std::convert::Into<wkt::Timestamp>,
16858    {
16859        self.insert_time = v.map(|x| x.into());
16860        self
16861    }
16862
16863    /// Sets the value of [start_time][crate::model::Operation::start_time].
16864    ///
16865    /// # Example
16866    /// ```ignore,no_run
16867    /// # use google_cloud_sql_v1::model::Operation;
16868    /// use wkt::Timestamp;
16869    /// let x = Operation::new().set_start_time(Timestamp::default()/* use setters */);
16870    /// ```
16871    pub fn set_start_time<T>(mut self, v: T) -> Self
16872    where
16873        T: std::convert::Into<wkt::Timestamp>,
16874    {
16875        self.start_time = std::option::Option::Some(v.into());
16876        self
16877    }
16878
16879    /// Sets or clears the value of [start_time][crate::model::Operation::start_time].
16880    ///
16881    /// # Example
16882    /// ```ignore,no_run
16883    /// # use google_cloud_sql_v1::model::Operation;
16884    /// use wkt::Timestamp;
16885    /// let x = Operation::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
16886    /// let x = Operation::new().set_or_clear_start_time(None::<Timestamp>);
16887    /// ```
16888    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
16889    where
16890        T: std::convert::Into<wkt::Timestamp>,
16891    {
16892        self.start_time = v.map(|x| x.into());
16893        self
16894    }
16895
16896    /// Sets the value of [end_time][crate::model::Operation::end_time].
16897    ///
16898    /// # Example
16899    /// ```ignore,no_run
16900    /// # use google_cloud_sql_v1::model::Operation;
16901    /// use wkt::Timestamp;
16902    /// let x = Operation::new().set_end_time(Timestamp::default()/* use setters */);
16903    /// ```
16904    pub fn set_end_time<T>(mut self, v: T) -> Self
16905    where
16906        T: std::convert::Into<wkt::Timestamp>,
16907    {
16908        self.end_time = std::option::Option::Some(v.into());
16909        self
16910    }
16911
16912    /// Sets or clears the value of [end_time][crate::model::Operation::end_time].
16913    ///
16914    /// # Example
16915    /// ```ignore,no_run
16916    /// # use google_cloud_sql_v1::model::Operation;
16917    /// use wkt::Timestamp;
16918    /// let x = Operation::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
16919    /// let x = Operation::new().set_or_clear_end_time(None::<Timestamp>);
16920    /// ```
16921    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
16922    where
16923        T: std::convert::Into<wkt::Timestamp>,
16924    {
16925        self.end_time = v.map(|x| x.into());
16926        self
16927    }
16928
16929    /// Sets the value of [error][crate::model::Operation::error].
16930    ///
16931    /// # Example
16932    /// ```ignore,no_run
16933    /// # use google_cloud_sql_v1::model::Operation;
16934    /// use google_cloud_sql_v1::model::OperationErrors;
16935    /// let x = Operation::new().set_error(OperationErrors::default()/* use setters */);
16936    /// ```
16937    pub fn set_error<T>(mut self, v: T) -> Self
16938    where
16939        T: std::convert::Into<crate::model::OperationErrors>,
16940    {
16941        self.error = std::option::Option::Some(v.into());
16942        self
16943    }
16944
16945    /// Sets or clears the value of [error][crate::model::Operation::error].
16946    ///
16947    /// # Example
16948    /// ```ignore,no_run
16949    /// # use google_cloud_sql_v1::model::Operation;
16950    /// use google_cloud_sql_v1::model::OperationErrors;
16951    /// let x = Operation::new().set_or_clear_error(Some(OperationErrors::default()/* use setters */));
16952    /// let x = Operation::new().set_or_clear_error(None::<OperationErrors>);
16953    /// ```
16954    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
16955    where
16956        T: std::convert::Into<crate::model::OperationErrors>,
16957    {
16958        self.error = v.map(|x| x.into());
16959        self
16960    }
16961
16962    /// Sets the value of [api_warning][crate::model::Operation::api_warning].
16963    ///
16964    /// # Example
16965    /// ```ignore,no_run
16966    /// # use google_cloud_sql_v1::model::Operation;
16967    /// use google_cloud_sql_v1::model::ApiWarning;
16968    /// let x = Operation::new().set_api_warning(ApiWarning::default()/* use setters */);
16969    /// ```
16970    pub fn set_api_warning<T>(mut self, v: T) -> Self
16971    where
16972        T: std::convert::Into<crate::model::ApiWarning>,
16973    {
16974        self.api_warning = std::option::Option::Some(v.into());
16975        self
16976    }
16977
16978    /// Sets or clears the value of [api_warning][crate::model::Operation::api_warning].
16979    ///
16980    /// # Example
16981    /// ```ignore,no_run
16982    /// # use google_cloud_sql_v1::model::Operation;
16983    /// use google_cloud_sql_v1::model::ApiWarning;
16984    /// let x = Operation::new().set_or_clear_api_warning(Some(ApiWarning::default()/* use setters */));
16985    /// let x = Operation::new().set_or_clear_api_warning(None::<ApiWarning>);
16986    /// ```
16987    pub fn set_or_clear_api_warning<T>(mut self, v: std::option::Option<T>) -> Self
16988    where
16989        T: std::convert::Into<crate::model::ApiWarning>,
16990    {
16991        self.api_warning = v.map(|x| x.into());
16992        self
16993    }
16994
16995    /// Sets the value of [operation_type][crate::model::Operation::operation_type].
16996    ///
16997    /// # Example
16998    /// ```ignore,no_run
16999    /// # use google_cloud_sql_v1::model::Operation;
17000    /// use google_cloud_sql_v1::model::operation::SqlOperationType;
17001    /// let x0 = Operation::new().set_operation_type(SqlOperationType::Import);
17002    /// let x1 = Operation::new().set_operation_type(SqlOperationType::Export);
17003    /// let x2 = Operation::new().set_operation_type(SqlOperationType::Create);
17004    /// ```
17005    pub fn set_operation_type<T: std::convert::Into<crate::model::operation::SqlOperationType>>(
17006        mut self,
17007        v: T,
17008    ) -> Self {
17009        self.operation_type = v.into();
17010        self
17011    }
17012
17013    /// Sets the value of [import_context][crate::model::Operation::import_context].
17014    ///
17015    /// # Example
17016    /// ```ignore,no_run
17017    /// # use google_cloud_sql_v1::model::Operation;
17018    /// use google_cloud_sql_v1::model::ImportContext;
17019    /// let x = Operation::new().set_import_context(ImportContext::default()/* use setters */);
17020    /// ```
17021    pub fn set_import_context<T>(mut self, v: T) -> Self
17022    where
17023        T: std::convert::Into<crate::model::ImportContext>,
17024    {
17025        self.import_context = std::option::Option::Some(v.into());
17026        self
17027    }
17028
17029    /// Sets or clears the value of [import_context][crate::model::Operation::import_context].
17030    ///
17031    /// # Example
17032    /// ```ignore,no_run
17033    /// # use google_cloud_sql_v1::model::Operation;
17034    /// use google_cloud_sql_v1::model::ImportContext;
17035    /// let x = Operation::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
17036    /// let x = Operation::new().set_or_clear_import_context(None::<ImportContext>);
17037    /// ```
17038    pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
17039    where
17040        T: std::convert::Into<crate::model::ImportContext>,
17041    {
17042        self.import_context = v.map(|x| x.into());
17043        self
17044    }
17045
17046    /// Sets the value of [export_context][crate::model::Operation::export_context].
17047    ///
17048    /// # Example
17049    /// ```ignore,no_run
17050    /// # use google_cloud_sql_v1::model::Operation;
17051    /// use google_cloud_sql_v1::model::ExportContext;
17052    /// let x = Operation::new().set_export_context(ExportContext::default()/* use setters */);
17053    /// ```
17054    pub fn set_export_context<T>(mut self, v: T) -> Self
17055    where
17056        T: std::convert::Into<crate::model::ExportContext>,
17057    {
17058        self.export_context = std::option::Option::Some(v.into());
17059        self
17060    }
17061
17062    /// Sets or clears the value of [export_context][crate::model::Operation::export_context].
17063    ///
17064    /// # Example
17065    /// ```ignore,no_run
17066    /// # use google_cloud_sql_v1::model::Operation;
17067    /// use google_cloud_sql_v1::model::ExportContext;
17068    /// let x = Operation::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
17069    /// let x = Operation::new().set_or_clear_export_context(None::<ExportContext>);
17070    /// ```
17071    pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
17072    where
17073        T: std::convert::Into<crate::model::ExportContext>,
17074    {
17075        self.export_context = v.map(|x| x.into());
17076        self
17077    }
17078
17079    /// Sets the value of [backup_context][crate::model::Operation::backup_context].
17080    ///
17081    /// # Example
17082    /// ```ignore,no_run
17083    /// # use google_cloud_sql_v1::model::Operation;
17084    /// use google_cloud_sql_v1::model::BackupContext;
17085    /// let x = Operation::new().set_backup_context(BackupContext::default()/* use setters */);
17086    /// ```
17087    pub fn set_backup_context<T>(mut self, v: T) -> Self
17088    where
17089        T: std::convert::Into<crate::model::BackupContext>,
17090    {
17091        self.backup_context = std::option::Option::Some(v.into());
17092        self
17093    }
17094
17095    /// Sets or clears the value of [backup_context][crate::model::Operation::backup_context].
17096    ///
17097    /// # Example
17098    /// ```ignore,no_run
17099    /// # use google_cloud_sql_v1::model::Operation;
17100    /// use google_cloud_sql_v1::model::BackupContext;
17101    /// let x = Operation::new().set_or_clear_backup_context(Some(BackupContext::default()/* use setters */));
17102    /// let x = Operation::new().set_or_clear_backup_context(None::<BackupContext>);
17103    /// ```
17104    pub fn set_or_clear_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
17105    where
17106        T: std::convert::Into<crate::model::BackupContext>,
17107    {
17108        self.backup_context = v.map(|x| x.into());
17109        self
17110    }
17111
17112    /// Sets the value of [name][crate::model::Operation::name].
17113    ///
17114    /// # Example
17115    /// ```ignore,no_run
17116    /// # use google_cloud_sql_v1::model::Operation;
17117    /// let x = Operation::new().set_name("example");
17118    /// ```
17119    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17120        self.name = v.into();
17121        self
17122    }
17123
17124    /// Sets the value of [target_id][crate::model::Operation::target_id].
17125    ///
17126    /// # Example
17127    /// ```ignore,no_run
17128    /// # use google_cloud_sql_v1::model::Operation;
17129    /// let x = Operation::new().set_target_id("example");
17130    /// ```
17131    pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17132        self.target_id = v.into();
17133        self
17134    }
17135
17136    /// Sets the value of [self_link][crate::model::Operation::self_link].
17137    ///
17138    /// # Example
17139    /// ```ignore,no_run
17140    /// # use google_cloud_sql_v1::model::Operation;
17141    /// let x = Operation::new().set_self_link("example");
17142    /// ```
17143    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17144        self.self_link = v.into();
17145        self
17146    }
17147
17148    /// Sets the value of [target_project][crate::model::Operation::target_project].
17149    ///
17150    /// # Example
17151    /// ```ignore,no_run
17152    /// # use google_cloud_sql_v1::model::Operation;
17153    /// let x = Operation::new().set_target_project("example");
17154    /// ```
17155    pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17156        self.target_project = v.into();
17157        self
17158    }
17159
17160    /// Sets the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
17161    ///
17162    /// # Example
17163    /// ```ignore,no_run
17164    /// # use google_cloud_sql_v1::model::Operation;
17165    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
17166    /// let x = Operation::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
17167    /// ```
17168    pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
17169    where
17170        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
17171    {
17172        self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
17173        self
17174    }
17175
17176    /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
17177    ///
17178    /// # Example
17179    /// ```ignore,no_run
17180    /// # use google_cloud_sql_v1::model::Operation;
17181    /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
17182    /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
17183    /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
17184    /// ```
17185    pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
17186    where
17187        T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
17188    {
17189        self.acquire_ssrs_lease_context = v.map(|x| x.into());
17190        self
17191    }
17192}
17193
17194impl wkt::message::Message for Operation {
17195    fn typename() -> &'static str {
17196        "type.googleapis.com/google.cloud.sql.v1.Operation"
17197    }
17198}
17199
17200/// Defines additional types related to [Operation].
17201pub mod operation {
17202    #[allow(unused_imports)]
17203    use super::*;
17204
17205    /// The type of Cloud SQL operation.
17206    ///
17207    /// # Working with unknown values
17208    ///
17209    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17210    /// additional enum variants at any time. Adding new variants is not considered
17211    /// a breaking change. Applications should write their code in anticipation of:
17212    ///
17213    /// - New values appearing in future releases of the client library, **and**
17214    /// - New values received dynamically, without application changes.
17215    ///
17216    /// Please consult the [Working with enums] section in the user guide for some
17217    /// guidelines.
17218    ///
17219    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17220    #[derive(Clone, Debug, PartialEq)]
17221    #[non_exhaustive]
17222    pub enum SqlOperationType {
17223        /// Unknown operation type.
17224        Unspecified,
17225        /// Imports data into a Cloud SQL instance.
17226        Import,
17227        /// Exports data from a Cloud SQL instance to a Cloud Storage
17228        /// bucket.
17229        Export,
17230        /// Creates a new Cloud SQL instance.
17231        Create,
17232        /// Updates the settings of a Cloud SQL instance.
17233        Update,
17234        /// Deletes a Cloud SQL instance.
17235        Delete,
17236        /// Restarts the Cloud SQL instance.
17237        Restart,
17238        #[deprecated]
17239        Backup,
17240        #[deprecated]
17241        Snapshot,
17242        /// Performs instance backup.
17243        BackupVolume,
17244        /// Deletes an instance backup.
17245        DeleteVolume,
17246        /// Restores an instance backup.
17247        RestoreVolume,
17248        /// Injects a privileged user in mysql for MOB instances.
17249        InjectUser,
17250        /// Clones a Cloud SQL instance.
17251        Clone,
17252        /// Stops replication on a Cloud SQL read replica instance.
17253        StopReplica,
17254        /// Starts replication on a Cloud SQL read replica instance.
17255        StartReplica,
17256        /// Promotes a Cloud SQL replica instance.
17257        PromoteReplica,
17258        /// Creates a Cloud SQL replica instance.
17259        CreateReplica,
17260        /// Creates a new user in a Cloud SQL instance.
17261        CreateUser,
17262        /// Deletes a user from a Cloud SQL instance.
17263        DeleteUser,
17264        /// Updates an existing user in a Cloud SQL instance.
17265        UpdateUser,
17266        /// Creates a database in the Cloud SQL instance.
17267        CreateDatabase,
17268        /// Deletes a database in the Cloud SQL instance.
17269        DeleteDatabase,
17270        /// Updates a database in the Cloud SQL instance.
17271        UpdateDatabase,
17272        /// Performs failover of an HA-enabled Cloud SQL
17273        /// failover replica.
17274        Failover,
17275        /// Deletes the backup taken by a backup run.
17276        DeleteBackup,
17277        RecreateReplica,
17278        /// Truncates a general or slow log table in MySQL.
17279        TruncateLog,
17280        /// Demotes the stand-alone instance to be a Cloud SQL
17281        /// read replica for an external database server.
17282        DemoteMaster,
17283        /// Indicates that the instance is currently in maintenance. Maintenance
17284        /// typically causes the instance to be unavailable for 1-3 minutes.
17285        Maintenance,
17286        /// This field is deprecated, and will be removed in future version of API.
17287        #[deprecated]
17288        EnablePrivateIp,
17289        #[deprecated]
17290        DeferMaintenance,
17291        /// Creates clone instance.
17292        #[deprecated]
17293        CreateClone,
17294        /// Reschedule maintenance to another time.
17295        RescheduleMaintenance,
17296        /// Starts external sync of a Cloud SQL EM replica to an external primary
17297        /// instance.
17298        StartExternalSync,
17299        /// Recovers logs from an instance's old data disk.
17300        LogCleanup,
17301        /// Performs auto-restart of an HA-enabled Cloud SQL database for auto
17302        /// recovery.
17303        AutoRestart,
17304        /// Re-encrypts CMEK instances with latest key version.
17305        Reencrypt,
17306        /// Switches the roles of the primary and replica pair. The target instance
17307        /// should be the replica.
17308        Switchover,
17309        /// Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
17310        AcquireSsrsLease,
17311        /// Release a lease for the setup of SQL Server Reporting Services (SSRS).
17312        ReleaseSsrsLease,
17313        /// Reconfigures old primary after a promote replica operation. Effect of a
17314        /// promote operation to the old primary is executed in this operation,
17315        /// asynchronously from the promote replica operation executed to the
17316        /// replica.
17317        ReconfigureOldPrimary,
17318        /// Indicates that the instance, its read replicas, and its cascading
17319        /// replicas are in maintenance. Maintenance typically gets initiated on
17320        /// groups of replicas first, followed by the primary instance. For each
17321        /// instance, maintenance typically causes the instance to be unavailable for
17322        /// 1-3 minutes.
17323        ClusterMaintenance,
17324        /// Indicates that the instance (and any of its replicas) are currently in
17325        /// maintenance. This is initiated as a self-service request by using SSM.
17326        /// Maintenance typically causes the instance to be unavailable for 1-3
17327        /// minutes.
17328        SelfServiceMaintenance,
17329        /// Switches a primary instance to a replica. This operation runs as part of
17330        /// a switchover operation to the original primary instance.
17331        SwitchoverToReplica,
17332        /// Updates the major version of a Cloud SQL instance.
17333        MajorVersionUpgrade,
17334        /// If set, the enum was initialized with an unknown value.
17335        ///
17336        /// Applications can examine the value using [SqlOperationType::value] or
17337        /// [SqlOperationType::name].
17338        UnknownValue(sql_operation_type::UnknownValue),
17339    }
17340
17341    #[doc(hidden)]
17342    pub mod sql_operation_type {
17343        #[allow(unused_imports)]
17344        use super::*;
17345        #[derive(Clone, Debug, PartialEq)]
17346        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17347    }
17348
17349    impl SqlOperationType {
17350        /// Gets the enum value.
17351        ///
17352        /// Returns `None` if the enum contains an unknown value deserialized from
17353        /// the string representation of enums.
17354        pub fn value(&self) -> std::option::Option<i32> {
17355            match self {
17356                Self::Unspecified => std::option::Option::Some(0),
17357                Self::Import => std::option::Option::Some(1),
17358                Self::Export => std::option::Option::Some(2),
17359                Self::Create => std::option::Option::Some(3),
17360                Self::Update => std::option::Option::Some(4),
17361                Self::Delete => std::option::Option::Some(5),
17362                Self::Restart => std::option::Option::Some(6),
17363                Self::Backup => std::option::Option::Some(7),
17364                Self::Snapshot => std::option::Option::Some(8),
17365                Self::BackupVolume => std::option::Option::Some(9),
17366                Self::DeleteVolume => std::option::Option::Some(10),
17367                Self::RestoreVolume => std::option::Option::Some(11),
17368                Self::InjectUser => std::option::Option::Some(12),
17369                Self::Clone => std::option::Option::Some(14),
17370                Self::StopReplica => std::option::Option::Some(15),
17371                Self::StartReplica => std::option::Option::Some(16),
17372                Self::PromoteReplica => std::option::Option::Some(17),
17373                Self::CreateReplica => std::option::Option::Some(18),
17374                Self::CreateUser => std::option::Option::Some(19),
17375                Self::DeleteUser => std::option::Option::Some(20),
17376                Self::UpdateUser => std::option::Option::Some(21),
17377                Self::CreateDatabase => std::option::Option::Some(22),
17378                Self::DeleteDatabase => std::option::Option::Some(23),
17379                Self::UpdateDatabase => std::option::Option::Some(24),
17380                Self::Failover => std::option::Option::Some(25),
17381                Self::DeleteBackup => std::option::Option::Some(26),
17382                Self::RecreateReplica => std::option::Option::Some(27),
17383                Self::TruncateLog => std::option::Option::Some(28),
17384                Self::DemoteMaster => std::option::Option::Some(29),
17385                Self::Maintenance => std::option::Option::Some(30),
17386                Self::EnablePrivateIp => std::option::Option::Some(31),
17387                Self::DeferMaintenance => std::option::Option::Some(32),
17388                Self::CreateClone => std::option::Option::Some(33),
17389                Self::RescheduleMaintenance => std::option::Option::Some(34),
17390                Self::StartExternalSync => std::option::Option::Some(35),
17391                Self::LogCleanup => std::option::Option::Some(36),
17392                Self::AutoRestart => std::option::Option::Some(37),
17393                Self::Reencrypt => std::option::Option::Some(38),
17394                Self::Switchover => std::option::Option::Some(39),
17395                Self::AcquireSsrsLease => std::option::Option::Some(42),
17396                Self::ReleaseSsrsLease => std::option::Option::Some(43),
17397                Self::ReconfigureOldPrimary => std::option::Option::Some(44),
17398                Self::ClusterMaintenance => std::option::Option::Some(45),
17399                Self::SelfServiceMaintenance => std::option::Option::Some(46),
17400                Self::SwitchoverToReplica => std::option::Option::Some(47),
17401                Self::MajorVersionUpgrade => std::option::Option::Some(48),
17402                Self::UnknownValue(u) => u.0.value(),
17403            }
17404        }
17405
17406        /// Gets the enum value as a string.
17407        ///
17408        /// Returns `None` if the enum contains an unknown value deserialized from
17409        /// the integer representation of enums.
17410        pub fn name(&self) -> std::option::Option<&str> {
17411            match self {
17412                Self::Unspecified => std::option::Option::Some("SQL_OPERATION_TYPE_UNSPECIFIED"),
17413                Self::Import => std::option::Option::Some("IMPORT"),
17414                Self::Export => std::option::Option::Some("EXPORT"),
17415                Self::Create => std::option::Option::Some("CREATE"),
17416                Self::Update => std::option::Option::Some("UPDATE"),
17417                Self::Delete => std::option::Option::Some("DELETE"),
17418                Self::Restart => std::option::Option::Some("RESTART"),
17419                Self::Backup => std::option::Option::Some("BACKUP"),
17420                Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
17421                Self::BackupVolume => std::option::Option::Some("BACKUP_VOLUME"),
17422                Self::DeleteVolume => std::option::Option::Some("DELETE_VOLUME"),
17423                Self::RestoreVolume => std::option::Option::Some("RESTORE_VOLUME"),
17424                Self::InjectUser => std::option::Option::Some("INJECT_USER"),
17425                Self::Clone => std::option::Option::Some("CLONE"),
17426                Self::StopReplica => std::option::Option::Some("STOP_REPLICA"),
17427                Self::StartReplica => std::option::Option::Some("START_REPLICA"),
17428                Self::PromoteReplica => std::option::Option::Some("PROMOTE_REPLICA"),
17429                Self::CreateReplica => std::option::Option::Some("CREATE_REPLICA"),
17430                Self::CreateUser => std::option::Option::Some("CREATE_USER"),
17431                Self::DeleteUser => std::option::Option::Some("DELETE_USER"),
17432                Self::UpdateUser => std::option::Option::Some("UPDATE_USER"),
17433                Self::CreateDatabase => std::option::Option::Some("CREATE_DATABASE"),
17434                Self::DeleteDatabase => std::option::Option::Some("DELETE_DATABASE"),
17435                Self::UpdateDatabase => std::option::Option::Some("UPDATE_DATABASE"),
17436                Self::Failover => std::option::Option::Some("FAILOVER"),
17437                Self::DeleteBackup => std::option::Option::Some("DELETE_BACKUP"),
17438                Self::RecreateReplica => std::option::Option::Some("RECREATE_REPLICA"),
17439                Self::TruncateLog => std::option::Option::Some("TRUNCATE_LOG"),
17440                Self::DemoteMaster => std::option::Option::Some("DEMOTE_MASTER"),
17441                Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
17442                Self::EnablePrivateIp => std::option::Option::Some("ENABLE_PRIVATE_IP"),
17443                Self::DeferMaintenance => std::option::Option::Some("DEFER_MAINTENANCE"),
17444                Self::CreateClone => std::option::Option::Some("CREATE_CLONE"),
17445                Self::RescheduleMaintenance => std::option::Option::Some("RESCHEDULE_MAINTENANCE"),
17446                Self::StartExternalSync => std::option::Option::Some("START_EXTERNAL_SYNC"),
17447                Self::LogCleanup => std::option::Option::Some("LOG_CLEANUP"),
17448                Self::AutoRestart => std::option::Option::Some("AUTO_RESTART"),
17449                Self::Reencrypt => std::option::Option::Some("REENCRYPT"),
17450                Self::Switchover => std::option::Option::Some("SWITCHOVER"),
17451                Self::AcquireSsrsLease => std::option::Option::Some("ACQUIRE_SSRS_LEASE"),
17452                Self::ReleaseSsrsLease => std::option::Option::Some("RELEASE_SSRS_LEASE"),
17453                Self::ReconfigureOldPrimary => std::option::Option::Some("RECONFIGURE_OLD_PRIMARY"),
17454                Self::ClusterMaintenance => std::option::Option::Some("CLUSTER_MAINTENANCE"),
17455                Self::SelfServiceMaintenance => {
17456                    std::option::Option::Some("SELF_SERVICE_MAINTENANCE")
17457                }
17458                Self::SwitchoverToReplica => std::option::Option::Some("SWITCHOVER_TO_REPLICA"),
17459                Self::MajorVersionUpgrade => std::option::Option::Some("MAJOR_VERSION_UPGRADE"),
17460                Self::UnknownValue(u) => u.0.name(),
17461            }
17462        }
17463    }
17464
17465    impl std::default::Default for SqlOperationType {
17466        fn default() -> Self {
17467            use std::convert::From;
17468            Self::from(0)
17469        }
17470    }
17471
17472    impl std::fmt::Display for SqlOperationType {
17473        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17474            wkt::internal::display_enum(f, self.name(), self.value())
17475        }
17476    }
17477
17478    impl std::convert::From<i32> for SqlOperationType {
17479        fn from(value: i32) -> Self {
17480            match value {
17481                0 => Self::Unspecified,
17482                1 => Self::Import,
17483                2 => Self::Export,
17484                3 => Self::Create,
17485                4 => Self::Update,
17486                5 => Self::Delete,
17487                6 => Self::Restart,
17488                7 => Self::Backup,
17489                8 => Self::Snapshot,
17490                9 => Self::BackupVolume,
17491                10 => Self::DeleteVolume,
17492                11 => Self::RestoreVolume,
17493                12 => Self::InjectUser,
17494                14 => Self::Clone,
17495                15 => Self::StopReplica,
17496                16 => Self::StartReplica,
17497                17 => Self::PromoteReplica,
17498                18 => Self::CreateReplica,
17499                19 => Self::CreateUser,
17500                20 => Self::DeleteUser,
17501                21 => Self::UpdateUser,
17502                22 => Self::CreateDatabase,
17503                23 => Self::DeleteDatabase,
17504                24 => Self::UpdateDatabase,
17505                25 => Self::Failover,
17506                26 => Self::DeleteBackup,
17507                27 => Self::RecreateReplica,
17508                28 => Self::TruncateLog,
17509                29 => Self::DemoteMaster,
17510                30 => Self::Maintenance,
17511                31 => Self::EnablePrivateIp,
17512                32 => Self::DeferMaintenance,
17513                33 => Self::CreateClone,
17514                34 => Self::RescheduleMaintenance,
17515                35 => Self::StartExternalSync,
17516                36 => Self::LogCleanup,
17517                37 => Self::AutoRestart,
17518                38 => Self::Reencrypt,
17519                39 => Self::Switchover,
17520                42 => Self::AcquireSsrsLease,
17521                43 => Self::ReleaseSsrsLease,
17522                44 => Self::ReconfigureOldPrimary,
17523                45 => Self::ClusterMaintenance,
17524                46 => Self::SelfServiceMaintenance,
17525                47 => Self::SwitchoverToReplica,
17526                48 => Self::MajorVersionUpgrade,
17527                _ => Self::UnknownValue(sql_operation_type::UnknownValue(
17528                    wkt::internal::UnknownEnumValue::Integer(value),
17529                )),
17530            }
17531        }
17532    }
17533
17534    impl std::convert::From<&str> for SqlOperationType {
17535        fn from(value: &str) -> Self {
17536            use std::string::ToString;
17537            match value {
17538                "SQL_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
17539                "IMPORT" => Self::Import,
17540                "EXPORT" => Self::Export,
17541                "CREATE" => Self::Create,
17542                "UPDATE" => Self::Update,
17543                "DELETE" => Self::Delete,
17544                "RESTART" => Self::Restart,
17545                "BACKUP" => Self::Backup,
17546                "SNAPSHOT" => Self::Snapshot,
17547                "BACKUP_VOLUME" => Self::BackupVolume,
17548                "DELETE_VOLUME" => Self::DeleteVolume,
17549                "RESTORE_VOLUME" => Self::RestoreVolume,
17550                "INJECT_USER" => Self::InjectUser,
17551                "CLONE" => Self::Clone,
17552                "STOP_REPLICA" => Self::StopReplica,
17553                "START_REPLICA" => Self::StartReplica,
17554                "PROMOTE_REPLICA" => Self::PromoteReplica,
17555                "CREATE_REPLICA" => Self::CreateReplica,
17556                "CREATE_USER" => Self::CreateUser,
17557                "DELETE_USER" => Self::DeleteUser,
17558                "UPDATE_USER" => Self::UpdateUser,
17559                "CREATE_DATABASE" => Self::CreateDatabase,
17560                "DELETE_DATABASE" => Self::DeleteDatabase,
17561                "UPDATE_DATABASE" => Self::UpdateDatabase,
17562                "FAILOVER" => Self::Failover,
17563                "DELETE_BACKUP" => Self::DeleteBackup,
17564                "RECREATE_REPLICA" => Self::RecreateReplica,
17565                "TRUNCATE_LOG" => Self::TruncateLog,
17566                "DEMOTE_MASTER" => Self::DemoteMaster,
17567                "MAINTENANCE" => Self::Maintenance,
17568                "ENABLE_PRIVATE_IP" => Self::EnablePrivateIp,
17569                "DEFER_MAINTENANCE" => Self::DeferMaintenance,
17570                "CREATE_CLONE" => Self::CreateClone,
17571                "RESCHEDULE_MAINTENANCE" => Self::RescheduleMaintenance,
17572                "START_EXTERNAL_SYNC" => Self::StartExternalSync,
17573                "LOG_CLEANUP" => Self::LogCleanup,
17574                "AUTO_RESTART" => Self::AutoRestart,
17575                "REENCRYPT" => Self::Reencrypt,
17576                "SWITCHOVER" => Self::Switchover,
17577                "ACQUIRE_SSRS_LEASE" => Self::AcquireSsrsLease,
17578                "RELEASE_SSRS_LEASE" => Self::ReleaseSsrsLease,
17579                "RECONFIGURE_OLD_PRIMARY" => Self::ReconfigureOldPrimary,
17580                "CLUSTER_MAINTENANCE" => Self::ClusterMaintenance,
17581                "SELF_SERVICE_MAINTENANCE" => Self::SelfServiceMaintenance,
17582                "SWITCHOVER_TO_REPLICA" => Self::SwitchoverToReplica,
17583                "MAJOR_VERSION_UPGRADE" => Self::MajorVersionUpgrade,
17584                _ => Self::UnknownValue(sql_operation_type::UnknownValue(
17585                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17586                )),
17587            }
17588        }
17589    }
17590
17591    impl serde::ser::Serialize for SqlOperationType {
17592        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17593        where
17594            S: serde::Serializer,
17595        {
17596            match self {
17597                Self::Unspecified => serializer.serialize_i32(0),
17598                Self::Import => serializer.serialize_i32(1),
17599                Self::Export => serializer.serialize_i32(2),
17600                Self::Create => serializer.serialize_i32(3),
17601                Self::Update => serializer.serialize_i32(4),
17602                Self::Delete => serializer.serialize_i32(5),
17603                Self::Restart => serializer.serialize_i32(6),
17604                Self::Backup => serializer.serialize_i32(7),
17605                Self::Snapshot => serializer.serialize_i32(8),
17606                Self::BackupVolume => serializer.serialize_i32(9),
17607                Self::DeleteVolume => serializer.serialize_i32(10),
17608                Self::RestoreVolume => serializer.serialize_i32(11),
17609                Self::InjectUser => serializer.serialize_i32(12),
17610                Self::Clone => serializer.serialize_i32(14),
17611                Self::StopReplica => serializer.serialize_i32(15),
17612                Self::StartReplica => serializer.serialize_i32(16),
17613                Self::PromoteReplica => serializer.serialize_i32(17),
17614                Self::CreateReplica => serializer.serialize_i32(18),
17615                Self::CreateUser => serializer.serialize_i32(19),
17616                Self::DeleteUser => serializer.serialize_i32(20),
17617                Self::UpdateUser => serializer.serialize_i32(21),
17618                Self::CreateDatabase => serializer.serialize_i32(22),
17619                Self::DeleteDatabase => serializer.serialize_i32(23),
17620                Self::UpdateDatabase => serializer.serialize_i32(24),
17621                Self::Failover => serializer.serialize_i32(25),
17622                Self::DeleteBackup => serializer.serialize_i32(26),
17623                Self::RecreateReplica => serializer.serialize_i32(27),
17624                Self::TruncateLog => serializer.serialize_i32(28),
17625                Self::DemoteMaster => serializer.serialize_i32(29),
17626                Self::Maintenance => serializer.serialize_i32(30),
17627                Self::EnablePrivateIp => serializer.serialize_i32(31),
17628                Self::DeferMaintenance => serializer.serialize_i32(32),
17629                Self::CreateClone => serializer.serialize_i32(33),
17630                Self::RescheduleMaintenance => serializer.serialize_i32(34),
17631                Self::StartExternalSync => serializer.serialize_i32(35),
17632                Self::LogCleanup => serializer.serialize_i32(36),
17633                Self::AutoRestart => serializer.serialize_i32(37),
17634                Self::Reencrypt => serializer.serialize_i32(38),
17635                Self::Switchover => serializer.serialize_i32(39),
17636                Self::AcquireSsrsLease => serializer.serialize_i32(42),
17637                Self::ReleaseSsrsLease => serializer.serialize_i32(43),
17638                Self::ReconfigureOldPrimary => serializer.serialize_i32(44),
17639                Self::ClusterMaintenance => serializer.serialize_i32(45),
17640                Self::SelfServiceMaintenance => serializer.serialize_i32(46),
17641                Self::SwitchoverToReplica => serializer.serialize_i32(47),
17642                Self::MajorVersionUpgrade => serializer.serialize_i32(48),
17643                Self::UnknownValue(u) => u.0.serialize(serializer),
17644            }
17645        }
17646    }
17647
17648    impl<'de> serde::de::Deserialize<'de> for SqlOperationType {
17649        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17650        where
17651            D: serde::Deserializer<'de>,
17652        {
17653            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationType>::new(
17654                ".google.cloud.sql.v1.Operation.SqlOperationType",
17655            ))
17656        }
17657    }
17658
17659    /// The status of an operation.
17660    ///
17661    /// # Working with unknown values
17662    ///
17663    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17664    /// additional enum variants at any time. Adding new variants is not considered
17665    /// a breaking change. Applications should write their code in anticipation of:
17666    ///
17667    /// - New values appearing in future releases of the client library, **and**
17668    /// - New values received dynamically, without application changes.
17669    ///
17670    /// Please consult the [Working with enums] section in the user guide for some
17671    /// guidelines.
17672    ///
17673    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17674    #[derive(Clone, Debug, PartialEq)]
17675    #[non_exhaustive]
17676    pub enum SqlOperationStatus {
17677        /// The state of the operation is unknown.
17678        Unspecified,
17679        /// The operation has been queued, but has not started yet.
17680        Pending,
17681        /// The operation is running.
17682        Running,
17683        /// The operation completed.
17684        Done,
17685        /// If set, the enum was initialized with an unknown value.
17686        ///
17687        /// Applications can examine the value using [SqlOperationStatus::value] or
17688        /// [SqlOperationStatus::name].
17689        UnknownValue(sql_operation_status::UnknownValue),
17690    }
17691
17692    #[doc(hidden)]
17693    pub mod sql_operation_status {
17694        #[allow(unused_imports)]
17695        use super::*;
17696        #[derive(Clone, Debug, PartialEq)]
17697        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17698    }
17699
17700    impl SqlOperationStatus {
17701        /// Gets the enum value.
17702        ///
17703        /// Returns `None` if the enum contains an unknown value deserialized from
17704        /// the string representation of enums.
17705        pub fn value(&self) -> std::option::Option<i32> {
17706            match self {
17707                Self::Unspecified => std::option::Option::Some(0),
17708                Self::Pending => std::option::Option::Some(1),
17709                Self::Running => std::option::Option::Some(2),
17710                Self::Done => std::option::Option::Some(3),
17711                Self::UnknownValue(u) => u.0.value(),
17712            }
17713        }
17714
17715        /// Gets the enum value as a string.
17716        ///
17717        /// Returns `None` if the enum contains an unknown value deserialized from
17718        /// the integer representation of enums.
17719        pub fn name(&self) -> std::option::Option<&str> {
17720            match self {
17721                Self::Unspecified => std::option::Option::Some("SQL_OPERATION_STATUS_UNSPECIFIED"),
17722                Self::Pending => std::option::Option::Some("PENDING"),
17723                Self::Running => std::option::Option::Some("RUNNING"),
17724                Self::Done => std::option::Option::Some("DONE"),
17725                Self::UnknownValue(u) => u.0.name(),
17726            }
17727        }
17728    }
17729
17730    impl std::default::Default for SqlOperationStatus {
17731        fn default() -> Self {
17732            use std::convert::From;
17733            Self::from(0)
17734        }
17735    }
17736
17737    impl std::fmt::Display for SqlOperationStatus {
17738        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17739            wkt::internal::display_enum(f, self.name(), self.value())
17740        }
17741    }
17742
17743    impl std::convert::From<i32> for SqlOperationStatus {
17744        fn from(value: i32) -> Self {
17745            match value {
17746                0 => Self::Unspecified,
17747                1 => Self::Pending,
17748                2 => Self::Running,
17749                3 => Self::Done,
17750                _ => Self::UnknownValue(sql_operation_status::UnknownValue(
17751                    wkt::internal::UnknownEnumValue::Integer(value),
17752                )),
17753            }
17754        }
17755    }
17756
17757    impl std::convert::From<&str> for SqlOperationStatus {
17758        fn from(value: &str) -> Self {
17759            use std::string::ToString;
17760            match value {
17761                "SQL_OPERATION_STATUS_UNSPECIFIED" => Self::Unspecified,
17762                "PENDING" => Self::Pending,
17763                "RUNNING" => Self::Running,
17764                "DONE" => Self::Done,
17765                _ => Self::UnknownValue(sql_operation_status::UnknownValue(
17766                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17767                )),
17768            }
17769        }
17770    }
17771
17772    impl serde::ser::Serialize for SqlOperationStatus {
17773        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17774        where
17775            S: serde::Serializer,
17776        {
17777            match self {
17778                Self::Unspecified => serializer.serialize_i32(0),
17779                Self::Pending => serializer.serialize_i32(1),
17780                Self::Running => serializer.serialize_i32(2),
17781                Self::Done => serializer.serialize_i32(3),
17782                Self::UnknownValue(u) => u.0.serialize(serializer),
17783            }
17784        }
17785    }
17786
17787    impl<'de> serde::de::Deserialize<'de> for SqlOperationStatus {
17788        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17789        where
17790            D: serde::Deserializer<'de>,
17791        {
17792            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationStatus>::new(
17793                ".google.cloud.sql.v1.Operation.SqlOperationStatus",
17794            ))
17795        }
17796    }
17797}
17798
17799/// Database instance operation error.
17800#[derive(Clone, Default, PartialEq)]
17801#[non_exhaustive]
17802pub struct OperationError {
17803    /// This is always `sql#operationError`.
17804    pub kind: std::string::String,
17805
17806    /// Identifies the specific error that occurred.
17807    pub code: std::string::String,
17808
17809    /// Additional information about the error encountered.
17810    pub message: std::string::String,
17811
17812    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17813}
17814
17815impl OperationError {
17816    pub fn new() -> Self {
17817        std::default::Default::default()
17818    }
17819
17820    /// Sets the value of [kind][crate::model::OperationError::kind].
17821    ///
17822    /// # Example
17823    /// ```ignore,no_run
17824    /// # use google_cloud_sql_v1::model::OperationError;
17825    /// let x = OperationError::new().set_kind("example");
17826    /// ```
17827    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17828        self.kind = v.into();
17829        self
17830    }
17831
17832    /// Sets the value of [code][crate::model::OperationError::code].
17833    ///
17834    /// # Example
17835    /// ```ignore,no_run
17836    /// # use google_cloud_sql_v1::model::OperationError;
17837    /// let x = OperationError::new().set_code("example");
17838    /// ```
17839    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17840        self.code = v.into();
17841        self
17842    }
17843
17844    /// Sets the value of [message][crate::model::OperationError::message].
17845    ///
17846    /// # Example
17847    /// ```ignore,no_run
17848    /// # use google_cloud_sql_v1::model::OperationError;
17849    /// let x = OperationError::new().set_message("example");
17850    /// ```
17851    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17852        self.message = v.into();
17853        self
17854    }
17855}
17856
17857impl wkt::message::Message for OperationError {
17858    fn typename() -> &'static str {
17859        "type.googleapis.com/google.cloud.sql.v1.OperationError"
17860    }
17861}
17862
17863/// Database instance operation errors list wrapper.
17864#[derive(Clone, Default, PartialEq)]
17865#[non_exhaustive]
17866pub struct OperationErrors {
17867    /// This is always `sql#operationErrors`.
17868    pub kind: std::string::String,
17869
17870    /// The list of errors encountered while processing this operation.
17871    pub errors: std::vec::Vec<crate::model::OperationError>,
17872
17873    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17874}
17875
17876impl OperationErrors {
17877    pub fn new() -> Self {
17878        std::default::Default::default()
17879    }
17880
17881    /// Sets the value of [kind][crate::model::OperationErrors::kind].
17882    ///
17883    /// # Example
17884    /// ```ignore,no_run
17885    /// # use google_cloud_sql_v1::model::OperationErrors;
17886    /// let x = OperationErrors::new().set_kind("example");
17887    /// ```
17888    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17889        self.kind = v.into();
17890        self
17891    }
17892
17893    /// Sets the value of [errors][crate::model::OperationErrors::errors].
17894    ///
17895    /// # Example
17896    /// ```ignore,no_run
17897    /// # use google_cloud_sql_v1::model::OperationErrors;
17898    /// use google_cloud_sql_v1::model::OperationError;
17899    /// let x = OperationErrors::new()
17900    ///     .set_errors([
17901    ///         OperationError::default()/* use setters */,
17902    ///         OperationError::default()/* use (different) setters */,
17903    ///     ]);
17904    /// ```
17905    pub fn set_errors<T, V>(mut self, v: T) -> Self
17906    where
17907        T: std::iter::IntoIterator<Item = V>,
17908        V: std::convert::Into<crate::model::OperationError>,
17909    {
17910        use std::iter::Iterator;
17911        self.errors = v.into_iter().map(|i| i.into()).collect();
17912        self
17913    }
17914}
17915
17916impl wkt::message::Message for OperationErrors {
17917    fn typename() -> &'static str {
17918        "type.googleapis.com/google.cloud.sql.v1.OperationErrors"
17919    }
17920}
17921
17922/// Database instance local user password validation policy
17923#[derive(Clone, Default, PartialEq)]
17924#[non_exhaustive]
17925pub struct PasswordValidationPolicy {
17926    /// Minimum number of characters allowed.
17927    pub min_length: std::option::Option<wkt::Int32Value>,
17928
17929    /// The complexity of the password.
17930    pub complexity: crate::model::password_validation_policy::Complexity,
17931
17932    /// Number of previous passwords that cannot be reused.
17933    pub reuse_interval: std::option::Option<wkt::Int32Value>,
17934
17935    /// Disallow username as a part of the password.
17936    pub disallow_username_substring: std::option::Option<wkt::BoolValue>,
17937
17938    /// Minimum interval after which the password can be changed. This flag is only
17939    /// supported for PostgreSQL.
17940    pub password_change_interval: std::option::Option<wkt::Duration>,
17941
17942    /// Whether the password policy is enabled or not.
17943    pub enable_password_policy: std::option::Option<wkt::BoolValue>,
17944
17945    /// This field is deprecated and will be removed in a future version of the
17946    /// API.
17947    #[deprecated]
17948    pub disallow_compromised_credentials: std::option::Option<wkt::BoolValue>,
17949
17950    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17951}
17952
17953impl PasswordValidationPolicy {
17954    pub fn new() -> Self {
17955        std::default::Default::default()
17956    }
17957
17958    /// Sets the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
17959    ///
17960    /// # Example
17961    /// ```ignore,no_run
17962    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
17963    /// use wkt::Int32Value;
17964    /// let x = PasswordValidationPolicy::new().set_min_length(Int32Value::default()/* use setters */);
17965    /// ```
17966    pub fn set_min_length<T>(mut self, v: T) -> Self
17967    where
17968        T: std::convert::Into<wkt::Int32Value>,
17969    {
17970        self.min_length = std::option::Option::Some(v.into());
17971        self
17972    }
17973
17974    /// Sets or clears the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
17975    ///
17976    /// # Example
17977    /// ```ignore,no_run
17978    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
17979    /// use wkt::Int32Value;
17980    /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(Some(Int32Value::default()/* use setters */));
17981    /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(None::<Int32Value>);
17982    /// ```
17983    pub fn set_or_clear_min_length<T>(mut self, v: std::option::Option<T>) -> Self
17984    where
17985        T: std::convert::Into<wkt::Int32Value>,
17986    {
17987        self.min_length = v.map(|x| x.into());
17988        self
17989    }
17990
17991    /// Sets the value of [complexity][crate::model::PasswordValidationPolicy::complexity].
17992    ///
17993    /// # Example
17994    /// ```ignore,no_run
17995    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
17996    /// use google_cloud_sql_v1::model::password_validation_policy::Complexity;
17997    /// let x0 = PasswordValidationPolicy::new().set_complexity(Complexity::Default);
17998    /// ```
17999    pub fn set_complexity<
18000        T: std::convert::Into<crate::model::password_validation_policy::Complexity>,
18001    >(
18002        mut self,
18003        v: T,
18004    ) -> Self {
18005        self.complexity = v.into();
18006        self
18007    }
18008
18009    /// Sets the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
18010    ///
18011    /// # Example
18012    /// ```ignore,no_run
18013    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
18014    /// use wkt::Int32Value;
18015    /// let x = PasswordValidationPolicy::new().set_reuse_interval(Int32Value::default()/* use setters */);
18016    /// ```
18017    pub fn set_reuse_interval<T>(mut self, v: T) -> Self
18018    where
18019        T: std::convert::Into<wkt::Int32Value>,
18020    {
18021        self.reuse_interval = std::option::Option::Some(v.into());
18022        self
18023    }
18024
18025    /// Sets or clears the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
18026    ///
18027    /// # Example
18028    /// ```ignore,no_run
18029    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
18030    /// use wkt::Int32Value;
18031    /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(Some(Int32Value::default()/* use setters */));
18032    /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(None::<Int32Value>);
18033    /// ```
18034    pub fn set_or_clear_reuse_interval<T>(mut self, v: std::option::Option<T>) -> Self
18035    where
18036        T: std::convert::Into<wkt::Int32Value>,
18037    {
18038        self.reuse_interval = v.map(|x| x.into());
18039        self
18040    }
18041
18042    /// Sets the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
18043    ///
18044    /// # Example
18045    /// ```ignore,no_run
18046    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
18047    /// use wkt::BoolValue;
18048    /// let x = PasswordValidationPolicy::new().set_disallow_username_substring(BoolValue::default()/* use setters */);
18049    /// ```
18050    pub fn set_disallow_username_substring<T>(mut self, v: T) -> Self
18051    where
18052        T: std::convert::Into<wkt::BoolValue>,
18053    {
18054        self.disallow_username_substring = std::option::Option::Some(v.into());
18055        self
18056    }
18057
18058    /// Sets or clears the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
18059    ///
18060    /// # Example
18061    /// ```ignore,no_run
18062    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
18063    /// use wkt::BoolValue;
18064    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(Some(BoolValue::default()/* use setters */));
18065    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(None::<BoolValue>);
18066    /// ```
18067    pub fn set_or_clear_disallow_username_substring<T>(mut self, v: std::option::Option<T>) -> Self
18068    where
18069        T: std::convert::Into<wkt::BoolValue>,
18070    {
18071        self.disallow_username_substring = v.map(|x| x.into());
18072        self
18073    }
18074
18075    /// Sets the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
18076    ///
18077    /// # Example
18078    /// ```ignore,no_run
18079    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
18080    /// use wkt::Duration;
18081    /// let x = PasswordValidationPolicy::new().set_password_change_interval(Duration::default()/* use setters */);
18082    /// ```
18083    pub fn set_password_change_interval<T>(mut self, v: T) -> Self
18084    where
18085        T: std::convert::Into<wkt::Duration>,
18086    {
18087        self.password_change_interval = std::option::Option::Some(v.into());
18088        self
18089    }
18090
18091    /// Sets or clears the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
18092    ///
18093    /// # Example
18094    /// ```ignore,no_run
18095    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
18096    /// use wkt::Duration;
18097    /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(Some(Duration::default()/* use setters */));
18098    /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(None::<Duration>);
18099    /// ```
18100    pub fn set_or_clear_password_change_interval<T>(mut self, v: std::option::Option<T>) -> Self
18101    where
18102        T: std::convert::Into<wkt::Duration>,
18103    {
18104        self.password_change_interval = v.map(|x| x.into());
18105        self
18106    }
18107
18108    /// Sets the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
18109    ///
18110    /// # Example
18111    /// ```ignore,no_run
18112    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
18113    /// use wkt::BoolValue;
18114    /// let x = PasswordValidationPolicy::new().set_enable_password_policy(BoolValue::default()/* use setters */);
18115    /// ```
18116    pub fn set_enable_password_policy<T>(mut self, v: T) -> Self
18117    where
18118        T: std::convert::Into<wkt::BoolValue>,
18119    {
18120        self.enable_password_policy = std::option::Option::Some(v.into());
18121        self
18122    }
18123
18124    /// Sets or clears the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
18125    ///
18126    /// # Example
18127    /// ```ignore,no_run
18128    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
18129    /// use wkt::BoolValue;
18130    /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(Some(BoolValue::default()/* use setters */));
18131    /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(None::<BoolValue>);
18132    /// ```
18133    pub fn set_or_clear_enable_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
18134    where
18135        T: std::convert::Into<wkt::BoolValue>,
18136    {
18137        self.enable_password_policy = v.map(|x| x.into());
18138        self
18139    }
18140
18141    /// Sets the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
18142    ///
18143    /// # Example
18144    /// ```ignore,no_run
18145    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
18146    /// use wkt::BoolValue;
18147    /// let x = PasswordValidationPolicy::new().set_disallow_compromised_credentials(BoolValue::default()/* use setters */);
18148    /// ```
18149    #[deprecated]
18150    pub fn set_disallow_compromised_credentials<T>(mut self, v: T) -> Self
18151    where
18152        T: std::convert::Into<wkt::BoolValue>,
18153    {
18154        self.disallow_compromised_credentials = std::option::Option::Some(v.into());
18155        self
18156    }
18157
18158    /// Sets or clears the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
18159    ///
18160    /// # Example
18161    /// ```ignore,no_run
18162    /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
18163    /// use wkt::BoolValue;
18164    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(Some(BoolValue::default()/* use setters */));
18165    /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(None::<BoolValue>);
18166    /// ```
18167    #[deprecated]
18168    pub fn set_or_clear_disallow_compromised_credentials<T>(
18169        mut self,
18170        v: std::option::Option<T>,
18171    ) -> Self
18172    where
18173        T: std::convert::Into<wkt::BoolValue>,
18174    {
18175        self.disallow_compromised_credentials = v.map(|x| x.into());
18176        self
18177    }
18178}
18179
18180impl wkt::message::Message for PasswordValidationPolicy {
18181    fn typename() -> &'static str {
18182        "type.googleapis.com/google.cloud.sql.v1.PasswordValidationPolicy"
18183    }
18184}
18185
18186/// Defines additional types related to [PasswordValidationPolicy].
18187pub mod password_validation_policy {
18188    #[allow(unused_imports)]
18189    use super::*;
18190
18191    /// The complexity choices of the password.
18192    ///
18193    /// # Working with unknown values
18194    ///
18195    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18196    /// additional enum variants at any time. Adding new variants is not considered
18197    /// a breaking change. Applications should write their code in anticipation of:
18198    ///
18199    /// - New values appearing in future releases of the client library, **and**
18200    /// - New values received dynamically, without application changes.
18201    ///
18202    /// Please consult the [Working with enums] section in the user guide for some
18203    /// guidelines.
18204    ///
18205    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18206    #[derive(Clone, Debug, PartialEq)]
18207    #[non_exhaustive]
18208    pub enum Complexity {
18209        /// Complexity check is not specified.
18210        Unspecified,
18211        /// A combination of lowercase, uppercase, numeric, and non-alphanumeric
18212        /// characters.
18213        Default,
18214        /// If set, the enum was initialized with an unknown value.
18215        ///
18216        /// Applications can examine the value using [Complexity::value] or
18217        /// [Complexity::name].
18218        UnknownValue(complexity::UnknownValue),
18219    }
18220
18221    #[doc(hidden)]
18222    pub mod complexity {
18223        #[allow(unused_imports)]
18224        use super::*;
18225        #[derive(Clone, Debug, PartialEq)]
18226        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18227    }
18228
18229    impl Complexity {
18230        /// Gets the enum value.
18231        ///
18232        /// Returns `None` if the enum contains an unknown value deserialized from
18233        /// the string representation of enums.
18234        pub fn value(&self) -> std::option::Option<i32> {
18235            match self {
18236                Self::Unspecified => std::option::Option::Some(0),
18237                Self::Default => std::option::Option::Some(1),
18238                Self::UnknownValue(u) => u.0.value(),
18239            }
18240        }
18241
18242        /// Gets the enum value as a string.
18243        ///
18244        /// Returns `None` if the enum contains an unknown value deserialized from
18245        /// the integer representation of enums.
18246        pub fn name(&self) -> std::option::Option<&str> {
18247            match self {
18248                Self::Unspecified => std::option::Option::Some("COMPLEXITY_UNSPECIFIED"),
18249                Self::Default => std::option::Option::Some("COMPLEXITY_DEFAULT"),
18250                Self::UnknownValue(u) => u.0.name(),
18251            }
18252        }
18253    }
18254
18255    impl std::default::Default for Complexity {
18256        fn default() -> Self {
18257            use std::convert::From;
18258            Self::from(0)
18259        }
18260    }
18261
18262    impl std::fmt::Display for Complexity {
18263        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18264            wkt::internal::display_enum(f, self.name(), self.value())
18265        }
18266    }
18267
18268    impl std::convert::From<i32> for Complexity {
18269        fn from(value: i32) -> Self {
18270            match value {
18271                0 => Self::Unspecified,
18272                1 => Self::Default,
18273                _ => Self::UnknownValue(complexity::UnknownValue(
18274                    wkt::internal::UnknownEnumValue::Integer(value),
18275                )),
18276            }
18277        }
18278    }
18279
18280    impl std::convert::From<&str> for Complexity {
18281        fn from(value: &str) -> Self {
18282            use std::string::ToString;
18283            match value {
18284                "COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
18285                "COMPLEXITY_DEFAULT" => Self::Default,
18286                _ => Self::UnknownValue(complexity::UnknownValue(
18287                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18288                )),
18289            }
18290        }
18291    }
18292
18293    impl serde::ser::Serialize for Complexity {
18294        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18295        where
18296            S: serde::Serializer,
18297        {
18298            match self {
18299                Self::Unspecified => serializer.serialize_i32(0),
18300                Self::Default => serializer.serialize_i32(1),
18301                Self::UnknownValue(u) => u.0.serialize(serializer),
18302            }
18303        }
18304    }
18305
18306    impl<'de> serde::de::Deserialize<'de> for Complexity {
18307        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18308        where
18309            D: serde::Deserializer<'de>,
18310        {
18311            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Complexity>::new(
18312                ".google.cloud.sql.v1.PasswordValidationPolicy.Complexity",
18313            ))
18314        }
18315    }
18316}
18317
18318/// Data cache configurations.
18319#[derive(Clone, Default, PartialEq)]
18320#[non_exhaustive]
18321pub struct DataCacheConfig {
18322    /// Whether data cache is enabled for the instance.
18323    pub data_cache_enabled: bool,
18324
18325    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18326}
18327
18328impl DataCacheConfig {
18329    pub fn new() -> Self {
18330        std::default::Default::default()
18331    }
18332
18333    /// Sets the value of [data_cache_enabled][crate::model::DataCacheConfig::data_cache_enabled].
18334    ///
18335    /// # Example
18336    /// ```ignore,no_run
18337    /// # use google_cloud_sql_v1::model::DataCacheConfig;
18338    /// let x = DataCacheConfig::new().set_data_cache_enabled(true);
18339    /// ```
18340    pub fn set_data_cache_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18341        self.data_cache_enabled = v.into();
18342        self
18343    }
18344}
18345
18346impl wkt::message::Message for DataCacheConfig {
18347    fn typename() -> &'static str {
18348        "type.googleapis.com/google.cloud.sql.v1.DataCacheConfig"
18349    }
18350}
18351
18352/// Database instance settings.
18353#[derive(Clone, Default, PartialEq)]
18354#[non_exhaustive]
18355pub struct Settings {
18356    /// The version of instance settings. This is a required field for update
18357    /// method to make sure concurrent updates are handled properly. During update,
18358    /// use the most recent settingsVersion value for this instance and do not try
18359    /// to update this value.
18360    pub settings_version: std::option::Option<wkt::Int64Value>,
18361
18362    /// The App Engine app IDs that can access this instance.
18363    /// (Deprecated) Applied to First Generation instances only.
18364    #[deprecated]
18365    pub authorized_gae_applications: std::vec::Vec<std::string::String>,
18366
18367    /// The tier (or machine type) for this instance, for example
18368    /// `db-custom-1-3840`. WARNING: Changing this restarts the instance.
18369    pub tier: std::string::String,
18370
18371    /// This is always `sql#settings`.
18372    pub kind: std::string::String,
18373
18374    /// User-provided labels, represented as a dictionary where each label is a
18375    /// single key value pair.
18376    pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
18377
18378    /// Availability type. Potential values:
18379    ///
18380    /// * `ZONAL`: The instance serves data from only one zone. Outages in that
18381    ///   zone affect data accessibility.
18382    /// * `REGIONAL`: The instance can serve data from more than one zone in a
18383    ///   region (it is highly available)./
18384    ///
18385    /// For more information, see [Overview of the High Availability
18386    /// Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
18387    pub availability_type: crate::model::SqlAvailabilityType,
18388
18389    /// The pricing plan for this instance. This can be either `PER_USE` or
18390    /// `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
18391    pub pricing_plan: crate::model::SqlPricingPlan,
18392
18393    /// The type of replication this instance uses. This can be either
18394    /// `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
18395    /// applicable to First Generation instances.
18396    #[deprecated]
18397    pub replication_type: crate::model::SqlReplicationType,
18398
18399    /// The maximum size to which storage capacity can be automatically increased.
18400    /// The default value is 0, which specifies that there is no limit.
18401    pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
18402
18403    /// The activation policy specifies when the instance is activated; it is
18404    /// applicable only when the instance state is RUNNABLE. Valid values:
18405    ///
18406    /// * `ALWAYS`: The instance is on, and remains so even in the absence of
18407    ///   connection requests.
18408    /// * `NEVER`: The instance is off; it is not activated, even if a
18409    ///   connection request arrives.
18410    pub activation_policy: crate::model::settings::SqlActivationPolicy,
18411
18412    /// The settings for IP Management. This allows to enable or disable the
18413    /// instance IP and manage which external networks can connect to the instance.
18414    /// The IPv4 address cannot be disabled for Second Generation instances.
18415    pub ip_configuration: std::option::Option<crate::model::IpConfiguration>,
18416
18417    /// Configuration to increase storage size automatically. The default value is
18418    /// true.
18419    pub storage_auto_resize: std::option::Option<wkt::BoolValue>,
18420
18421    /// The location preference settings. This allows the instance to be located as
18422    /// near as possible to either an App Engine app or Compute Engine zone for
18423    /// better performance. App Engine co-location was only applicable to First
18424    /// Generation instances.
18425    pub location_preference: std::option::Option<crate::model::LocationPreference>,
18426
18427    /// The database flags passed to the instance at startup.
18428    pub database_flags: std::vec::Vec<crate::model::DatabaseFlags>,
18429
18430    /// The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
18431    /// First Generation instances.
18432    pub data_disk_type: crate::model::SqlDataDiskType,
18433
18434    /// The maintenance window for this instance. This specifies when the instance
18435    /// can be restarted for maintenance purposes.
18436    pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,
18437
18438    /// The daily backup configuration for the instance.
18439    pub backup_configuration: std::option::Option<crate::model::BackupConfiguration>,
18440
18441    /// Configuration specific to read replica instances. Indicates whether
18442    /// replication is enabled or not. WARNING: Changing this restarts the
18443    /// instance.
18444    pub database_replication_enabled: std::option::Option<wkt::BoolValue>,
18445
18446    /// Configuration specific to read replica instances. Indicates whether
18447    /// database flags for crash-safe replication are enabled. This property was
18448    /// only applicable to First Generation instances.
18449    #[deprecated]
18450    pub crash_safe_replication_enabled: std::option::Option<wkt::BoolValue>,
18451
18452    /// The size of data disk, in GB. The data disk size minimum is 10GB.
18453    pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
18454
18455    /// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
18456    pub active_directory_config: std::option::Option<crate::model::SqlActiveDirectoryConfig>,
18457
18458    /// The name of server Instance collation.
18459    pub collation: std::string::String,
18460
18461    /// Deny maintenance periods
18462    pub deny_maintenance_periods: std::vec::Vec<crate::model::DenyMaintenancePeriod>,
18463
18464    /// Insights configuration, for now relevant only for Postgres.
18465    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
18466
18467    /// The local user password validation policy of the instance.
18468    pub password_validation_policy: std::option::Option<crate::model::PasswordValidationPolicy>,
18469
18470    /// SQL Server specific audit configuration.
18471    pub sql_server_audit_config: std::option::Option<crate::model::SqlServerAuditConfig>,
18472
18473    /// Optional. The edition of the instance.
18474    pub edition: crate::model::settings::Edition,
18475
18476    /// Specifies if connections must use Cloud SQL connectors.
18477    /// Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
18478    /// can be connected without Cloud SQL
18479    /// Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
18480    /// Connectors).
18481    ///
18482    /// Note that using REQUIRED disables all existing authorized networks. If
18483    /// this field is not specified when creating a new instance, NOT_REQUIRED is
18484    /// used. If this field is not specified when patching or updating an existing
18485    /// instance, it is left unchanged in the instance.
18486    pub connector_enforcement: crate::model::settings::ConnectorEnforcement,
18487
18488    /// Configuration to protect against accidental instance deletion.
18489    pub deletion_protection_enabled: std::option::Option<wkt::BoolValue>,
18490
18491    /// Server timezone, relevant only for Cloud SQL for SQL Server.
18492    pub time_zone: std::string::String,
18493
18494    /// Specifies advanced machine configuration for the instances relevant only
18495    /// for SQL Server.
18496    pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
18497
18498    /// Configuration for data cache.
18499    pub data_cache_config: std::option::Option<crate::model::DataCacheConfig>,
18500
18501    /// Optional. When this parameter is set to true, Cloud SQL instances can
18502    /// connect to Vertex AI to pass requests for real-time predictions and
18503    /// insights to the AI. The default value is false. This applies only to Cloud
18504    /// SQL for PostgreSQL instances.
18505    pub enable_google_ml_integration: std::option::Option<wkt::BoolValue>,
18506
18507    /// Optional. By default, Cloud SQL instances have schema extraction disabled
18508    /// for Dataplex. When this parameter is set to true, schema extraction for
18509    /// Dataplex on Cloud SQL instances is activated.
18510    pub enable_dataplex_integration: std::option::Option<wkt::BoolValue>,
18511
18512    /// Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
18513    /// parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
18514    /// versions. The MySQL version must be 8.0.35 or higher.
18515    pub auto_upgrade_enabled: std::option::Option<bool>,
18516
18517    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18518}
18519
18520impl Settings {
18521    pub fn new() -> Self {
18522        std::default::Default::default()
18523    }
18524
18525    /// Sets the value of [settings_version][crate::model::Settings::settings_version].
18526    ///
18527    /// # Example
18528    /// ```ignore,no_run
18529    /// # use google_cloud_sql_v1::model::Settings;
18530    /// use wkt::Int64Value;
18531    /// let x = Settings::new().set_settings_version(Int64Value::default()/* use setters */);
18532    /// ```
18533    pub fn set_settings_version<T>(mut self, v: T) -> Self
18534    where
18535        T: std::convert::Into<wkt::Int64Value>,
18536    {
18537        self.settings_version = std::option::Option::Some(v.into());
18538        self
18539    }
18540
18541    /// Sets or clears the value of [settings_version][crate::model::Settings::settings_version].
18542    ///
18543    /// # Example
18544    /// ```ignore,no_run
18545    /// # use google_cloud_sql_v1::model::Settings;
18546    /// use wkt::Int64Value;
18547    /// let x = Settings::new().set_or_clear_settings_version(Some(Int64Value::default()/* use setters */));
18548    /// let x = Settings::new().set_or_clear_settings_version(None::<Int64Value>);
18549    /// ```
18550    pub fn set_or_clear_settings_version<T>(mut self, v: std::option::Option<T>) -> Self
18551    where
18552        T: std::convert::Into<wkt::Int64Value>,
18553    {
18554        self.settings_version = v.map(|x| x.into());
18555        self
18556    }
18557
18558    /// Sets the value of [authorized_gae_applications][crate::model::Settings::authorized_gae_applications].
18559    ///
18560    /// # Example
18561    /// ```ignore,no_run
18562    /// # use google_cloud_sql_v1::model::Settings;
18563    /// let x = Settings::new().set_authorized_gae_applications(["a", "b", "c"]);
18564    /// ```
18565    #[deprecated]
18566    pub fn set_authorized_gae_applications<T, V>(mut self, v: T) -> Self
18567    where
18568        T: std::iter::IntoIterator<Item = V>,
18569        V: std::convert::Into<std::string::String>,
18570    {
18571        use std::iter::Iterator;
18572        self.authorized_gae_applications = v.into_iter().map(|i| i.into()).collect();
18573        self
18574    }
18575
18576    /// Sets the value of [tier][crate::model::Settings::tier].
18577    ///
18578    /// # Example
18579    /// ```ignore,no_run
18580    /// # use google_cloud_sql_v1::model::Settings;
18581    /// let x = Settings::new().set_tier("example");
18582    /// ```
18583    pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18584        self.tier = v.into();
18585        self
18586    }
18587
18588    /// Sets the value of [kind][crate::model::Settings::kind].
18589    ///
18590    /// # Example
18591    /// ```ignore,no_run
18592    /// # use google_cloud_sql_v1::model::Settings;
18593    /// let x = Settings::new().set_kind("example");
18594    /// ```
18595    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18596        self.kind = v.into();
18597        self
18598    }
18599
18600    /// Sets the value of [user_labels][crate::model::Settings::user_labels].
18601    ///
18602    /// # Example
18603    /// ```ignore,no_run
18604    /// # use google_cloud_sql_v1::model::Settings;
18605    /// let x = Settings::new().set_user_labels([
18606    ///     ("key0", "abc"),
18607    ///     ("key1", "xyz"),
18608    /// ]);
18609    /// ```
18610    pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
18611    where
18612        T: std::iter::IntoIterator<Item = (K, V)>,
18613        K: std::convert::Into<std::string::String>,
18614        V: std::convert::Into<std::string::String>,
18615    {
18616        use std::iter::Iterator;
18617        self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18618        self
18619    }
18620
18621    /// Sets the value of [availability_type][crate::model::Settings::availability_type].
18622    ///
18623    /// # Example
18624    /// ```ignore,no_run
18625    /// # use google_cloud_sql_v1::model::Settings;
18626    /// use google_cloud_sql_v1::model::SqlAvailabilityType;
18627    /// let x0 = Settings::new().set_availability_type(SqlAvailabilityType::Zonal);
18628    /// let x1 = Settings::new().set_availability_type(SqlAvailabilityType::Regional);
18629    /// ```
18630    pub fn set_availability_type<T: std::convert::Into<crate::model::SqlAvailabilityType>>(
18631        mut self,
18632        v: T,
18633    ) -> Self {
18634        self.availability_type = v.into();
18635        self
18636    }
18637
18638    /// Sets the value of [pricing_plan][crate::model::Settings::pricing_plan].
18639    ///
18640    /// # Example
18641    /// ```ignore,no_run
18642    /// # use google_cloud_sql_v1::model::Settings;
18643    /// use google_cloud_sql_v1::model::SqlPricingPlan;
18644    /// let x0 = Settings::new().set_pricing_plan(SqlPricingPlan::Package);
18645    /// let x1 = Settings::new().set_pricing_plan(SqlPricingPlan::PerUse);
18646    /// ```
18647    pub fn set_pricing_plan<T: std::convert::Into<crate::model::SqlPricingPlan>>(
18648        mut self,
18649        v: T,
18650    ) -> Self {
18651        self.pricing_plan = v.into();
18652        self
18653    }
18654
18655    /// Sets the value of [replication_type][crate::model::Settings::replication_type].
18656    ///
18657    /// # Example
18658    /// ```ignore,no_run
18659    /// # use google_cloud_sql_v1::model::Settings;
18660    /// use google_cloud_sql_v1::model::SqlReplicationType;
18661    /// let x0 = Settings::new().set_replication_type(SqlReplicationType::Synchronous);
18662    /// let x1 = Settings::new().set_replication_type(SqlReplicationType::Asynchronous);
18663    /// ```
18664    #[deprecated]
18665    pub fn set_replication_type<T: std::convert::Into<crate::model::SqlReplicationType>>(
18666        mut self,
18667        v: T,
18668    ) -> Self {
18669        self.replication_type = v.into();
18670        self
18671    }
18672
18673    /// Sets the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
18674    ///
18675    /// # Example
18676    /// ```ignore,no_run
18677    /// # use google_cloud_sql_v1::model::Settings;
18678    /// use wkt::Int64Value;
18679    /// let x = Settings::new().set_storage_auto_resize_limit(Int64Value::default()/* use setters */);
18680    /// ```
18681    pub fn set_storage_auto_resize_limit<T>(mut self, v: T) -> Self
18682    where
18683        T: std::convert::Into<wkt::Int64Value>,
18684    {
18685        self.storage_auto_resize_limit = std::option::Option::Some(v.into());
18686        self
18687    }
18688
18689    /// Sets or clears the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
18690    ///
18691    /// # Example
18692    /// ```ignore,no_run
18693    /// # use google_cloud_sql_v1::model::Settings;
18694    /// use wkt::Int64Value;
18695    /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(Some(Int64Value::default()/* use setters */));
18696    /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(None::<Int64Value>);
18697    /// ```
18698    pub fn set_or_clear_storage_auto_resize_limit<T>(mut self, v: std::option::Option<T>) -> Self
18699    where
18700        T: std::convert::Into<wkt::Int64Value>,
18701    {
18702        self.storage_auto_resize_limit = v.map(|x| x.into());
18703        self
18704    }
18705
18706    /// Sets the value of [activation_policy][crate::model::Settings::activation_policy].
18707    ///
18708    /// # Example
18709    /// ```ignore,no_run
18710    /// # use google_cloud_sql_v1::model::Settings;
18711    /// use google_cloud_sql_v1::model::settings::SqlActivationPolicy;
18712    /// let x0 = Settings::new().set_activation_policy(SqlActivationPolicy::Always);
18713    /// let x1 = Settings::new().set_activation_policy(SqlActivationPolicy::Never);
18714    /// ```
18715    pub fn set_activation_policy<
18716        T: std::convert::Into<crate::model::settings::SqlActivationPolicy>,
18717    >(
18718        mut self,
18719        v: T,
18720    ) -> Self {
18721        self.activation_policy = v.into();
18722        self
18723    }
18724
18725    /// Sets the value of [ip_configuration][crate::model::Settings::ip_configuration].
18726    ///
18727    /// # Example
18728    /// ```ignore,no_run
18729    /// # use google_cloud_sql_v1::model::Settings;
18730    /// use google_cloud_sql_v1::model::IpConfiguration;
18731    /// let x = Settings::new().set_ip_configuration(IpConfiguration::default()/* use setters */);
18732    /// ```
18733    pub fn set_ip_configuration<T>(mut self, v: T) -> Self
18734    where
18735        T: std::convert::Into<crate::model::IpConfiguration>,
18736    {
18737        self.ip_configuration = std::option::Option::Some(v.into());
18738        self
18739    }
18740
18741    /// Sets or clears the value of [ip_configuration][crate::model::Settings::ip_configuration].
18742    ///
18743    /// # Example
18744    /// ```ignore,no_run
18745    /// # use google_cloud_sql_v1::model::Settings;
18746    /// use google_cloud_sql_v1::model::IpConfiguration;
18747    /// let x = Settings::new().set_or_clear_ip_configuration(Some(IpConfiguration::default()/* use setters */));
18748    /// let x = Settings::new().set_or_clear_ip_configuration(None::<IpConfiguration>);
18749    /// ```
18750    pub fn set_or_clear_ip_configuration<T>(mut self, v: std::option::Option<T>) -> Self
18751    where
18752        T: std::convert::Into<crate::model::IpConfiguration>,
18753    {
18754        self.ip_configuration = v.map(|x| x.into());
18755        self
18756    }
18757
18758    /// Sets the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
18759    ///
18760    /// # Example
18761    /// ```ignore,no_run
18762    /// # use google_cloud_sql_v1::model::Settings;
18763    /// use wkt::BoolValue;
18764    /// let x = Settings::new().set_storage_auto_resize(BoolValue::default()/* use setters */);
18765    /// ```
18766    pub fn set_storage_auto_resize<T>(mut self, v: T) -> Self
18767    where
18768        T: std::convert::Into<wkt::BoolValue>,
18769    {
18770        self.storage_auto_resize = std::option::Option::Some(v.into());
18771        self
18772    }
18773
18774    /// Sets or clears the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
18775    ///
18776    /// # Example
18777    /// ```ignore,no_run
18778    /// # use google_cloud_sql_v1::model::Settings;
18779    /// use wkt::BoolValue;
18780    /// let x = Settings::new().set_or_clear_storage_auto_resize(Some(BoolValue::default()/* use setters */));
18781    /// let x = Settings::new().set_or_clear_storage_auto_resize(None::<BoolValue>);
18782    /// ```
18783    pub fn set_or_clear_storage_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
18784    where
18785        T: std::convert::Into<wkt::BoolValue>,
18786    {
18787        self.storage_auto_resize = v.map(|x| x.into());
18788        self
18789    }
18790
18791    /// Sets the value of [location_preference][crate::model::Settings::location_preference].
18792    ///
18793    /// # Example
18794    /// ```ignore,no_run
18795    /// # use google_cloud_sql_v1::model::Settings;
18796    /// use google_cloud_sql_v1::model::LocationPreference;
18797    /// let x = Settings::new().set_location_preference(LocationPreference::default()/* use setters */);
18798    /// ```
18799    pub fn set_location_preference<T>(mut self, v: T) -> Self
18800    where
18801        T: std::convert::Into<crate::model::LocationPreference>,
18802    {
18803        self.location_preference = std::option::Option::Some(v.into());
18804        self
18805    }
18806
18807    /// Sets or clears the value of [location_preference][crate::model::Settings::location_preference].
18808    ///
18809    /// # Example
18810    /// ```ignore,no_run
18811    /// # use google_cloud_sql_v1::model::Settings;
18812    /// use google_cloud_sql_v1::model::LocationPreference;
18813    /// let x = Settings::new().set_or_clear_location_preference(Some(LocationPreference::default()/* use setters */));
18814    /// let x = Settings::new().set_or_clear_location_preference(None::<LocationPreference>);
18815    /// ```
18816    pub fn set_or_clear_location_preference<T>(mut self, v: std::option::Option<T>) -> Self
18817    where
18818        T: std::convert::Into<crate::model::LocationPreference>,
18819    {
18820        self.location_preference = v.map(|x| x.into());
18821        self
18822    }
18823
18824    /// Sets the value of [database_flags][crate::model::Settings::database_flags].
18825    ///
18826    /// # Example
18827    /// ```ignore,no_run
18828    /// # use google_cloud_sql_v1::model::Settings;
18829    /// use google_cloud_sql_v1::model::DatabaseFlags;
18830    /// let x = Settings::new()
18831    ///     .set_database_flags([
18832    ///         DatabaseFlags::default()/* use setters */,
18833    ///         DatabaseFlags::default()/* use (different) setters */,
18834    ///     ]);
18835    /// ```
18836    pub fn set_database_flags<T, V>(mut self, v: T) -> Self
18837    where
18838        T: std::iter::IntoIterator<Item = V>,
18839        V: std::convert::Into<crate::model::DatabaseFlags>,
18840    {
18841        use std::iter::Iterator;
18842        self.database_flags = v.into_iter().map(|i| i.into()).collect();
18843        self
18844    }
18845
18846    /// Sets the value of [data_disk_type][crate::model::Settings::data_disk_type].
18847    ///
18848    /// # Example
18849    /// ```ignore,no_run
18850    /// # use google_cloud_sql_v1::model::Settings;
18851    /// use google_cloud_sql_v1::model::SqlDataDiskType;
18852    /// let x0 = Settings::new().set_data_disk_type(SqlDataDiskType::PdSsd);
18853    /// let x1 = Settings::new().set_data_disk_type(SqlDataDiskType::PdHdd);
18854    /// ```
18855    pub fn set_data_disk_type<T: std::convert::Into<crate::model::SqlDataDiskType>>(
18856        mut self,
18857        v: T,
18858    ) -> Self {
18859        self.data_disk_type = v.into();
18860        self
18861    }
18862
18863    /// Sets the value of [maintenance_window][crate::model::Settings::maintenance_window].
18864    ///
18865    /// # Example
18866    /// ```ignore,no_run
18867    /// # use google_cloud_sql_v1::model::Settings;
18868    /// use google_cloud_sql_v1::model::MaintenanceWindow;
18869    /// let x = Settings::new().set_maintenance_window(MaintenanceWindow::default()/* use setters */);
18870    /// ```
18871    pub fn set_maintenance_window<T>(mut self, v: T) -> Self
18872    where
18873        T: std::convert::Into<crate::model::MaintenanceWindow>,
18874    {
18875        self.maintenance_window = std::option::Option::Some(v.into());
18876        self
18877    }
18878
18879    /// Sets or clears the value of [maintenance_window][crate::model::Settings::maintenance_window].
18880    ///
18881    /// # Example
18882    /// ```ignore,no_run
18883    /// # use google_cloud_sql_v1::model::Settings;
18884    /// use google_cloud_sql_v1::model::MaintenanceWindow;
18885    /// let x = Settings::new().set_or_clear_maintenance_window(Some(MaintenanceWindow::default()/* use setters */));
18886    /// let x = Settings::new().set_or_clear_maintenance_window(None::<MaintenanceWindow>);
18887    /// ```
18888    pub fn set_or_clear_maintenance_window<T>(mut self, v: std::option::Option<T>) -> Self
18889    where
18890        T: std::convert::Into<crate::model::MaintenanceWindow>,
18891    {
18892        self.maintenance_window = v.map(|x| x.into());
18893        self
18894    }
18895
18896    /// Sets the value of [backup_configuration][crate::model::Settings::backup_configuration].
18897    ///
18898    /// # Example
18899    /// ```ignore,no_run
18900    /// # use google_cloud_sql_v1::model::Settings;
18901    /// use google_cloud_sql_v1::model::BackupConfiguration;
18902    /// let x = Settings::new().set_backup_configuration(BackupConfiguration::default()/* use setters */);
18903    /// ```
18904    pub fn set_backup_configuration<T>(mut self, v: T) -> Self
18905    where
18906        T: std::convert::Into<crate::model::BackupConfiguration>,
18907    {
18908        self.backup_configuration = std::option::Option::Some(v.into());
18909        self
18910    }
18911
18912    /// Sets or clears the value of [backup_configuration][crate::model::Settings::backup_configuration].
18913    ///
18914    /// # Example
18915    /// ```ignore,no_run
18916    /// # use google_cloud_sql_v1::model::Settings;
18917    /// use google_cloud_sql_v1::model::BackupConfiguration;
18918    /// let x = Settings::new().set_or_clear_backup_configuration(Some(BackupConfiguration::default()/* use setters */));
18919    /// let x = Settings::new().set_or_clear_backup_configuration(None::<BackupConfiguration>);
18920    /// ```
18921    pub fn set_or_clear_backup_configuration<T>(mut self, v: std::option::Option<T>) -> Self
18922    where
18923        T: std::convert::Into<crate::model::BackupConfiguration>,
18924    {
18925        self.backup_configuration = v.map(|x| x.into());
18926        self
18927    }
18928
18929    /// Sets the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
18930    ///
18931    /// # Example
18932    /// ```ignore,no_run
18933    /// # use google_cloud_sql_v1::model::Settings;
18934    /// use wkt::BoolValue;
18935    /// let x = Settings::new().set_database_replication_enabled(BoolValue::default()/* use setters */);
18936    /// ```
18937    pub fn set_database_replication_enabled<T>(mut self, v: T) -> Self
18938    where
18939        T: std::convert::Into<wkt::BoolValue>,
18940    {
18941        self.database_replication_enabled = std::option::Option::Some(v.into());
18942        self
18943    }
18944
18945    /// Sets or clears the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
18946    ///
18947    /// # Example
18948    /// ```ignore,no_run
18949    /// # use google_cloud_sql_v1::model::Settings;
18950    /// use wkt::BoolValue;
18951    /// let x = Settings::new().set_or_clear_database_replication_enabled(Some(BoolValue::default()/* use setters */));
18952    /// let x = Settings::new().set_or_clear_database_replication_enabled(None::<BoolValue>);
18953    /// ```
18954    pub fn set_or_clear_database_replication_enabled<T>(mut self, v: std::option::Option<T>) -> Self
18955    where
18956        T: std::convert::Into<wkt::BoolValue>,
18957    {
18958        self.database_replication_enabled = v.map(|x| x.into());
18959        self
18960    }
18961
18962    /// Sets the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
18963    ///
18964    /// # Example
18965    /// ```ignore,no_run
18966    /// # use google_cloud_sql_v1::model::Settings;
18967    /// use wkt::BoolValue;
18968    /// let x = Settings::new().set_crash_safe_replication_enabled(BoolValue::default()/* use setters */);
18969    /// ```
18970    #[deprecated]
18971    pub fn set_crash_safe_replication_enabled<T>(mut self, v: T) -> Self
18972    where
18973        T: std::convert::Into<wkt::BoolValue>,
18974    {
18975        self.crash_safe_replication_enabled = std::option::Option::Some(v.into());
18976        self
18977    }
18978
18979    /// Sets or clears the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
18980    ///
18981    /// # Example
18982    /// ```ignore,no_run
18983    /// # use google_cloud_sql_v1::model::Settings;
18984    /// use wkt::BoolValue;
18985    /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(Some(BoolValue::default()/* use setters */));
18986    /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(None::<BoolValue>);
18987    /// ```
18988    #[deprecated]
18989    pub fn set_or_clear_crash_safe_replication_enabled<T>(
18990        mut self,
18991        v: std::option::Option<T>,
18992    ) -> Self
18993    where
18994        T: std::convert::Into<wkt::BoolValue>,
18995    {
18996        self.crash_safe_replication_enabled = v.map(|x| x.into());
18997        self
18998    }
18999
19000    /// Sets the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
19001    ///
19002    /// # Example
19003    /// ```ignore,no_run
19004    /// # use google_cloud_sql_v1::model::Settings;
19005    /// use wkt::Int64Value;
19006    /// let x = Settings::new().set_data_disk_size_gb(Int64Value::default()/* use setters */);
19007    /// ```
19008    pub fn set_data_disk_size_gb<T>(mut self, v: T) -> Self
19009    where
19010        T: std::convert::Into<wkt::Int64Value>,
19011    {
19012        self.data_disk_size_gb = std::option::Option::Some(v.into());
19013        self
19014    }
19015
19016    /// Sets or clears the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
19017    ///
19018    /// # Example
19019    /// ```ignore,no_run
19020    /// # use google_cloud_sql_v1::model::Settings;
19021    /// use wkt::Int64Value;
19022    /// let x = Settings::new().set_or_clear_data_disk_size_gb(Some(Int64Value::default()/* use setters */));
19023    /// let x = Settings::new().set_or_clear_data_disk_size_gb(None::<Int64Value>);
19024    /// ```
19025    pub fn set_or_clear_data_disk_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
19026    where
19027        T: std::convert::Into<wkt::Int64Value>,
19028    {
19029        self.data_disk_size_gb = v.map(|x| x.into());
19030        self
19031    }
19032
19033    /// Sets the value of [active_directory_config][crate::model::Settings::active_directory_config].
19034    ///
19035    /// # Example
19036    /// ```ignore,no_run
19037    /// # use google_cloud_sql_v1::model::Settings;
19038    /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
19039    /// let x = Settings::new().set_active_directory_config(SqlActiveDirectoryConfig::default()/* use setters */);
19040    /// ```
19041    pub fn set_active_directory_config<T>(mut self, v: T) -> Self
19042    where
19043        T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
19044    {
19045        self.active_directory_config = std::option::Option::Some(v.into());
19046        self
19047    }
19048
19049    /// Sets or clears the value of [active_directory_config][crate::model::Settings::active_directory_config].
19050    ///
19051    /// # Example
19052    /// ```ignore,no_run
19053    /// # use google_cloud_sql_v1::model::Settings;
19054    /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
19055    /// let x = Settings::new().set_or_clear_active_directory_config(Some(SqlActiveDirectoryConfig::default()/* use setters */));
19056    /// let x = Settings::new().set_or_clear_active_directory_config(None::<SqlActiveDirectoryConfig>);
19057    /// ```
19058    pub fn set_or_clear_active_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
19059    where
19060        T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
19061    {
19062        self.active_directory_config = v.map(|x| x.into());
19063        self
19064    }
19065
19066    /// Sets the value of [collation][crate::model::Settings::collation].
19067    ///
19068    /// # Example
19069    /// ```ignore,no_run
19070    /// # use google_cloud_sql_v1::model::Settings;
19071    /// let x = Settings::new().set_collation("example");
19072    /// ```
19073    pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19074        self.collation = v.into();
19075        self
19076    }
19077
19078    /// Sets the value of [deny_maintenance_periods][crate::model::Settings::deny_maintenance_periods].
19079    ///
19080    /// # Example
19081    /// ```ignore,no_run
19082    /// # use google_cloud_sql_v1::model::Settings;
19083    /// use google_cloud_sql_v1::model::DenyMaintenancePeriod;
19084    /// let x = Settings::new()
19085    ///     .set_deny_maintenance_periods([
19086    ///         DenyMaintenancePeriod::default()/* use setters */,
19087    ///         DenyMaintenancePeriod::default()/* use (different) setters */,
19088    ///     ]);
19089    /// ```
19090    pub fn set_deny_maintenance_periods<T, V>(mut self, v: T) -> Self
19091    where
19092        T: std::iter::IntoIterator<Item = V>,
19093        V: std::convert::Into<crate::model::DenyMaintenancePeriod>,
19094    {
19095        use std::iter::Iterator;
19096        self.deny_maintenance_periods = v.into_iter().map(|i| i.into()).collect();
19097        self
19098    }
19099
19100    /// Sets the value of [insights_config][crate::model::Settings::insights_config].
19101    ///
19102    /// # Example
19103    /// ```ignore,no_run
19104    /// # use google_cloud_sql_v1::model::Settings;
19105    /// use google_cloud_sql_v1::model::InsightsConfig;
19106    /// let x = Settings::new().set_insights_config(InsightsConfig::default()/* use setters */);
19107    /// ```
19108    pub fn set_insights_config<T>(mut self, v: T) -> Self
19109    where
19110        T: std::convert::Into<crate::model::InsightsConfig>,
19111    {
19112        self.insights_config = std::option::Option::Some(v.into());
19113        self
19114    }
19115
19116    /// Sets or clears the value of [insights_config][crate::model::Settings::insights_config].
19117    ///
19118    /// # Example
19119    /// ```ignore,no_run
19120    /// # use google_cloud_sql_v1::model::Settings;
19121    /// use google_cloud_sql_v1::model::InsightsConfig;
19122    /// let x = Settings::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
19123    /// let x = Settings::new().set_or_clear_insights_config(None::<InsightsConfig>);
19124    /// ```
19125    pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
19126    where
19127        T: std::convert::Into<crate::model::InsightsConfig>,
19128    {
19129        self.insights_config = v.map(|x| x.into());
19130        self
19131    }
19132
19133    /// Sets the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
19134    ///
19135    /// # Example
19136    /// ```ignore,no_run
19137    /// # use google_cloud_sql_v1::model::Settings;
19138    /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
19139    /// let x = Settings::new().set_password_validation_policy(PasswordValidationPolicy::default()/* use setters */);
19140    /// ```
19141    pub fn set_password_validation_policy<T>(mut self, v: T) -> Self
19142    where
19143        T: std::convert::Into<crate::model::PasswordValidationPolicy>,
19144    {
19145        self.password_validation_policy = std::option::Option::Some(v.into());
19146        self
19147    }
19148
19149    /// Sets or clears the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
19150    ///
19151    /// # Example
19152    /// ```ignore,no_run
19153    /// # use google_cloud_sql_v1::model::Settings;
19154    /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
19155    /// let x = Settings::new().set_or_clear_password_validation_policy(Some(PasswordValidationPolicy::default()/* use setters */));
19156    /// let x = Settings::new().set_or_clear_password_validation_policy(None::<PasswordValidationPolicy>);
19157    /// ```
19158    pub fn set_or_clear_password_validation_policy<T>(mut self, v: std::option::Option<T>) -> Self
19159    where
19160        T: std::convert::Into<crate::model::PasswordValidationPolicy>,
19161    {
19162        self.password_validation_policy = v.map(|x| x.into());
19163        self
19164    }
19165
19166    /// Sets the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
19167    ///
19168    /// # Example
19169    /// ```ignore,no_run
19170    /// # use google_cloud_sql_v1::model::Settings;
19171    /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
19172    /// let x = Settings::new().set_sql_server_audit_config(SqlServerAuditConfig::default()/* use setters */);
19173    /// ```
19174    pub fn set_sql_server_audit_config<T>(mut self, v: T) -> Self
19175    where
19176        T: std::convert::Into<crate::model::SqlServerAuditConfig>,
19177    {
19178        self.sql_server_audit_config = std::option::Option::Some(v.into());
19179        self
19180    }
19181
19182    /// Sets or clears the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
19183    ///
19184    /// # Example
19185    /// ```ignore,no_run
19186    /// # use google_cloud_sql_v1::model::Settings;
19187    /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
19188    /// let x = Settings::new().set_or_clear_sql_server_audit_config(Some(SqlServerAuditConfig::default()/* use setters */));
19189    /// let x = Settings::new().set_or_clear_sql_server_audit_config(None::<SqlServerAuditConfig>);
19190    /// ```
19191    pub fn set_or_clear_sql_server_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
19192    where
19193        T: std::convert::Into<crate::model::SqlServerAuditConfig>,
19194    {
19195        self.sql_server_audit_config = v.map(|x| x.into());
19196        self
19197    }
19198
19199    /// Sets the value of [edition][crate::model::Settings::edition].
19200    ///
19201    /// # Example
19202    /// ```ignore,no_run
19203    /// # use google_cloud_sql_v1::model::Settings;
19204    /// use google_cloud_sql_v1::model::settings::Edition;
19205    /// let x0 = Settings::new().set_edition(Edition::Enterprise);
19206    /// let x1 = Settings::new().set_edition(Edition::EnterprisePlus);
19207    /// ```
19208    pub fn set_edition<T: std::convert::Into<crate::model::settings::Edition>>(
19209        mut self,
19210        v: T,
19211    ) -> Self {
19212        self.edition = v.into();
19213        self
19214    }
19215
19216    /// Sets the value of [connector_enforcement][crate::model::Settings::connector_enforcement].
19217    ///
19218    /// # Example
19219    /// ```ignore,no_run
19220    /// # use google_cloud_sql_v1::model::Settings;
19221    /// use google_cloud_sql_v1::model::settings::ConnectorEnforcement;
19222    /// let x0 = Settings::new().set_connector_enforcement(ConnectorEnforcement::NotRequired);
19223    /// let x1 = Settings::new().set_connector_enforcement(ConnectorEnforcement::Required);
19224    /// ```
19225    pub fn set_connector_enforcement<
19226        T: std::convert::Into<crate::model::settings::ConnectorEnforcement>,
19227    >(
19228        mut self,
19229        v: T,
19230    ) -> Self {
19231        self.connector_enforcement = v.into();
19232        self
19233    }
19234
19235    /// Sets the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
19236    ///
19237    /// # Example
19238    /// ```ignore,no_run
19239    /// # use google_cloud_sql_v1::model::Settings;
19240    /// use wkt::BoolValue;
19241    /// let x = Settings::new().set_deletion_protection_enabled(BoolValue::default()/* use setters */);
19242    /// ```
19243    pub fn set_deletion_protection_enabled<T>(mut self, v: T) -> Self
19244    where
19245        T: std::convert::Into<wkt::BoolValue>,
19246    {
19247        self.deletion_protection_enabled = std::option::Option::Some(v.into());
19248        self
19249    }
19250
19251    /// Sets or clears the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
19252    ///
19253    /// # Example
19254    /// ```ignore,no_run
19255    /// # use google_cloud_sql_v1::model::Settings;
19256    /// use wkt::BoolValue;
19257    /// let x = Settings::new().set_or_clear_deletion_protection_enabled(Some(BoolValue::default()/* use setters */));
19258    /// let x = Settings::new().set_or_clear_deletion_protection_enabled(None::<BoolValue>);
19259    /// ```
19260    pub fn set_or_clear_deletion_protection_enabled<T>(mut self, v: std::option::Option<T>) -> Self
19261    where
19262        T: std::convert::Into<wkt::BoolValue>,
19263    {
19264        self.deletion_protection_enabled = v.map(|x| x.into());
19265        self
19266    }
19267
19268    /// Sets the value of [time_zone][crate::model::Settings::time_zone].
19269    ///
19270    /// # Example
19271    /// ```ignore,no_run
19272    /// # use google_cloud_sql_v1::model::Settings;
19273    /// let x = Settings::new().set_time_zone("example");
19274    /// ```
19275    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19276        self.time_zone = v.into();
19277        self
19278    }
19279
19280    /// Sets the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
19281    ///
19282    /// # Example
19283    /// ```ignore,no_run
19284    /// # use google_cloud_sql_v1::model::Settings;
19285    /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
19286    /// let x = Settings::new().set_advanced_machine_features(AdvancedMachineFeatures::default()/* use setters */);
19287    /// ```
19288    pub fn set_advanced_machine_features<T>(mut self, v: T) -> Self
19289    where
19290        T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
19291    {
19292        self.advanced_machine_features = std::option::Option::Some(v.into());
19293        self
19294    }
19295
19296    /// Sets or clears the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
19297    ///
19298    /// # Example
19299    /// ```ignore,no_run
19300    /// # use google_cloud_sql_v1::model::Settings;
19301    /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
19302    /// let x = Settings::new().set_or_clear_advanced_machine_features(Some(AdvancedMachineFeatures::default()/* use setters */));
19303    /// let x = Settings::new().set_or_clear_advanced_machine_features(None::<AdvancedMachineFeatures>);
19304    /// ```
19305    pub fn set_or_clear_advanced_machine_features<T>(mut self, v: std::option::Option<T>) -> Self
19306    where
19307        T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
19308    {
19309        self.advanced_machine_features = v.map(|x| x.into());
19310        self
19311    }
19312
19313    /// Sets the value of [data_cache_config][crate::model::Settings::data_cache_config].
19314    ///
19315    /// # Example
19316    /// ```ignore,no_run
19317    /// # use google_cloud_sql_v1::model::Settings;
19318    /// use google_cloud_sql_v1::model::DataCacheConfig;
19319    /// let x = Settings::new().set_data_cache_config(DataCacheConfig::default()/* use setters */);
19320    /// ```
19321    pub fn set_data_cache_config<T>(mut self, v: T) -> Self
19322    where
19323        T: std::convert::Into<crate::model::DataCacheConfig>,
19324    {
19325        self.data_cache_config = std::option::Option::Some(v.into());
19326        self
19327    }
19328
19329    /// Sets or clears the value of [data_cache_config][crate::model::Settings::data_cache_config].
19330    ///
19331    /// # Example
19332    /// ```ignore,no_run
19333    /// # use google_cloud_sql_v1::model::Settings;
19334    /// use google_cloud_sql_v1::model::DataCacheConfig;
19335    /// let x = Settings::new().set_or_clear_data_cache_config(Some(DataCacheConfig::default()/* use setters */));
19336    /// let x = Settings::new().set_or_clear_data_cache_config(None::<DataCacheConfig>);
19337    /// ```
19338    pub fn set_or_clear_data_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
19339    where
19340        T: std::convert::Into<crate::model::DataCacheConfig>,
19341    {
19342        self.data_cache_config = v.map(|x| x.into());
19343        self
19344    }
19345
19346    /// Sets the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
19347    ///
19348    /// # Example
19349    /// ```ignore,no_run
19350    /// # use google_cloud_sql_v1::model::Settings;
19351    /// use wkt::BoolValue;
19352    /// let x = Settings::new().set_enable_google_ml_integration(BoolValue::default()/* use setters */);
19353    /// ```
19354    pub fn set_enable_google_ml_integration<T>(mut self, v: T) -> Self
19355    where
19356        T: std::convert::Into<wkt::BoolValue>,
19357    {
19358        self.enable_google_ml_integration = std::option::Option::Some(v.into());
19359        self
19360    }
19361
19362    /// Sets or clears the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
19363    ///
19364    /// # Example
19365    /// ```ignore,no_run
19366    /// # use google_cloud_sql_v1::model::Settings;
19367    /// use wkt::BoolValue;
19368    /// let x = Settings::new().set_or_clear_enable_google_ml_integration(Some(BoolValue::default()/* use setters */));
19369    /// let x = Settings::new().set_or_clear_enable_google_ml_integration(None::<BoolValue>);
19370    /// ```
19371    pub fn set_or_clear_enable_google_ml_integration<T>(mut self, v: std::option::Option<T>) -> Self
19372    where
19373        T: std::convert::Into<wkt::BoolValue>,
19374    {
19375        self.enable_google_ml_integration = v.map(|x| x.into());
19376        self
19377    }
19378
19379    /// Sets the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
19380    ///
19381    /// # Example
19382    /// ```ignore,no_run
19383    /// # use google_cloud_sql_v1::model::Settings;
19384    /// use wkt::BoolValue;
19385    /// let x = Settings::new().set_enable_dataplex_integration(BoolValue::default()/* use setters */);
19386    /// ```
19387    pub fn set_enable_dataplex_integration<T>(mut self, v: T) -> Self
19388    where
19389        T: std::convert::Into<wkt::BoolValue>,
19390    {
19391        self.enable_dataplex_integration = std::option::Option::Some(v.into());
19392        self
19393    }
19394
19395    /// Sets or clears the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
19396    ///
19397    /// # Example
19398    /// ```ignore,no_run
19399    /// # use google_cloud_sql_v1::model::Settings;
19400    /// use wkt::BoolValue;
19401    /// let x = Settings::new().set_or_clear_enable_dataplex_integration(Some(BoolValue::default()/* use setters */));
19402    /// let x = Settings::new().set_or_clear_enable_dataplex_integration(None::<BoolValue>);
19403    /// ```
19404    pub fn set_or_clear_enable_dataplex_integration<T>(mut self, v: std::option::Option<T>) -> Self
19405    where
19406        T: std::convert::Into<wkt::BoolValue>,
19407    {
19408        self.enable_dataplex_integration = v.map(|x| x.into());
19409        self
19410    }
19411
19412    /// Sets the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
19413    ///
19414    /// # Example
19415    /// ```ignore,no_run
19416    /// # use google_cloud_sql_v1::model::Settings;
19417    /// let x = Settings::new().set_auto_upgrade_enabled(true);
19418    /// ```
19419    pub fn set_auto_upgrade_enabled<T>(mut self, v: T) -> Self
19420    where
19421        T: std::convert::Into<bool>,
19422    {
19423        self.auto_upgrade_enabled = std::option::Option::Some(v.into());
19424        self
19425    }
19426
19427    /// Sets or clears the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
19428    ///
19429    /// # Example
19430    /// ```ignore,no_run
19431    /// # use google_cloud_sql_v1::model::Settings;
19432    /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(Some(false));
19433    /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(None::<bool>);
19434    /// ```
19435    pub fn set_or_clear_auto_upgrade_enabled<T>(mut self, v: std::option::Option<T>) -> Self
19436    where
19437        T: std::convert::Into<bool>,
19438    {
19439        self.auto_upgrade_enabled = v.map(|x| x.into());
19440        self
19441    }
19442}
19443
19444impl wkt::message::Message for Settings {
19445    fn typename() -> &'static str {
19446        "type.googleapis.com/google.cloud.sql.v1.Settings"
19447    }
19448}
19449
19450/// Defines additional types related to [Settings].
19451pub mod settings {
19452    #[allow(unused_imports)]
19453    use super::*;
19454
19455    /// Specifies when the instance is activated.
19456    ///
19457    /// # Working with unknown values
19458    ///
19459    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19460    /// additional enum variants at any time. Adding new variants is not considered
19461    /// a breaking change. Applications should write their code in anticipation of:
19462    ///
19463    /// - New values appearing in future releases of the client library, **and**
19464    /// - New values received dynamically, without application changes.
19465    ///
19466    /// Please consult the [Working with enums] section in the user guide for some
19467    /// guidelines.
19468    ///
19469    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19470    #[derive(Clone, Debug, PartialEq)]
19471    #[non_exhaustive]
19472    pub enum SqlActivationPolicy {
19473        /// Unknown activation plan.
19474        Unspecified,
19475        /// The instance is always up and running.
19476        Always,
19477        /// The instance never starts.
19478        Never,
19479        /// The instance starts upon receiving requests.
19480        #[deprecated]
19481        OnDemand,
19482        /// If set, the enum was initialized with an unknown value.
19483        ///
19484        /// Applications can examine the value using [SqlActivationPolicy::value] or
19485        /// [SqlActivationPolicy::name].
19486        UnknownValue(sql_activation_policy::UnknownValue),
19487    }
19488
19489    #[doc(hidden)]
19490    pub mod sql_activation_policy {
19491        #[allow(unused_imports)]
19492        use super::*;
19493        #[derive(Clone, Debug, PartialEq)]
19494        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19495    }
19496
19497    impl SqlActivationPolicy {
19498        /// Gets the enum value.
19499        ///
19500        /// Returns `None` if the enum contains an unknown value deserialized from
19501        /// the string representation of enums.
19502        pub fn value(&self) -> std::option::Option<i32> {
19503            match self {
19504                Self::Unspecified => std::option::Option::Some(0),
19505                Self::Always => std::option::Option::Some(1),
19506                Self::Never => std::option::Option::Some(2),
19507                Self::OnDemand => std::option::Option::Some(3),
19508                Self::UnknownValue(u) => u.0.value(),
19509            }
19510        }
19511
19512        /// Gets the enum value as a string.
19513        ///
19514        /// Returns `None` if the enum contains an unknown value deserialized from
19515        /// the integer representation of enums.
19516        pub fn name(&self) -> std::option::Option<&str> {
19517            match self {
19518                Self::Unspecified => std::option::Option::Some("SQL_ACTIVATION_POLICY_UNSPECIFIED"),
19519                Self::Always => std::option::Option::Some("ALWAYS"),
19520                Self::Never => std::option::Option::Some("NEVER"),
19521                Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
19522                Self::UnknownValue(u) => u.0.name(),
19523            }
19524        }
19525    }
19526
19527    impl std::default::Default for SqlActivationPolicy {
19528        fn default() -> Self {
19529            use std::convert::From;
19530            Self::from(0)
19531        }
19532    }
19533
19534    impl std::fmt::Display for SqlActivationPolicy {
19535        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19536            wkt::internal::display_enum(f, self.name(), self.value())
19537        }
19538    }
19539
19540    impl std::convert::From<i32> for SqlActivationPolicy {
19541        fn from(value: i32) -> Self {
19542            match value {
19543                0 => Self::Unspecified,
19544                1 => Self::Always,
19545                2 => Self::Never,
19546                3 => Self::OnDemand,
19547                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
19548                    wkt::internal::UnknownEnumValue::Integer(value),
19549                )),
19550            }
19551        }
19552    }
19553
19554    impl std::convert::From<&str> for SqlActivationPolicy {
19555        fn from(value: &str) -> Self {
19556            use std::string::ToString;
19557            match value {
19558                "SQL_ACTIVATION_POLICY_UNSPECIFIED" => Self::Unspecified,
19559                "ALWAYS" => Self::Always,
19560                "NEVER" => Self::Never,
19561                "ON_DEMAND" => Self::OnDemand,
19562                _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
19563                    wkt::internal::UnknownEnumValue::String(value.to_string()),
19564                )),
19565            }
19566        }
19567    }
19568
19569    impl serde::ser::Serialize for SqlActivationPolicy {
19570        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19571        where
19572            S: serde::Serializer,
19573        {
19574            match self {
19575                Self::Unspecified => serializer.serialize_i32(0),
19576                Self::Always => serializer.serialize_i32(1),
19577                Self::Never => serializer.serialize_i32(2),
19578                Self::OnDemand => serializer.serialize_i32(3),
19579                Self::UnknownValue(u) => u.0.serialize(serializer),
19580            }
19581        }
19582    }
19583
19584    impl<'de> serde::de::Deserialize<'de> for SqlActivationPolicy {
19585        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19586        where
19587            D: serde::Deserializer<'de>,
19588        {
19589            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlActivationPolicy>::new(
19590                ".google.cloud.sql.v1.Settings.SqlActivationPolicy",
19591            ))
19592        }
19593    }
19594
19595    /// The edition of the instance, can be ENTERPRISE or ENTERPRISE_PLUS.
19596    ///
19597    /// # Working with unknown values
19598    ///
19599    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19600    /// additional enum variants at any time. Adding new variants is not considered
19601    /// a breaking change. Applications should write their code in anticipation of:
19602    ///
19603    /// - New values appearing in future releases of the client library, **and**
19604    /// - New values received dynamically, without application changes.
19605    ///
19606    /// Please consult the [Working with enums] section in the user guide for some
19607    /// guidelines.
19608    ///
19609    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19610    #[derive(Clone, Debug, PartialEq)]
19611    #[non_exhaustive]
19612    pub enum Edition {
19613        /// The instance did not specify the edition.
19614        Unspecified,
19615        /// The instance is an enterprise edition.
19616        Enterprise,
19617        /// The instance is an Enterprise Plus edition.
19618        EnterprisePlus,
19619        /// If set, the enum was initialized with an unknown value.
19620        ///
19621        /// Applications can examine the value using [Edition::value] or
19622        /// [Edition::name].
19623        UnknownValue(edition::UnknownValue),
19624    }
19625
19626    #[doc(hidden)]
19627    pub mod edition {
19628        #[allow(unused_imports)]
19629        use super::*;
19630        #[derive(Clone, Debug, PartialEq)]
19631        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19632    }
19633
19634    impl Edition {
19635        /// Gets the enum value.
19636        ///
19637        /// Returns `None` if the enum contains an unknown value deserialized from
19638        /// the string representation of enums.
19639        pub fn value(&self) -> std::option::Option<i32> {
19640            match self {
19641                Self::Unspecified => std::option::Option::Some(0),
19642                Self::Enterprise => std::option::Option::Some(2),
19643                Self::EnterprisePlus => std::option::Option::Some(3),
19644                Self::UnknownValue(u) => u.0.value(),
19645            }
19646        }
19647
19648        /// Gets the enum value as a string.
19649        ///
19650        /// Returns `None` if the enum contains an unknown value deserialized from
19651        /// the integer representation of enums.
19652        pub fn name(&self) -> std::option::Option<&str> {
19653            match self {
19654                Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
19655                Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
19656                Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
19657                Self::UnknownValue(u) => u.0.name(),
19658            }
19659        }
19660    }
19661
19662    impl std::default::Default for Edition {
19663        fn default() -> Self {
19664            use std::convert::From;
19665            Self::from(0)
19666        }
19667    }
19668
19669    impl std::fmt::Display for Edition {
19670        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19671            wkt::internal::display_enum(f, self.name(), self.value())
19672        }
19673    }
19674
19675    impl std::convert::From<i32> for Edition {
19676        fn from(value: i32) -> Self {
19677            match value {
19678                0 => Self::Unspecified,
19679                2 => Self::Enterprise,
19680                3 => Self::EnterprisePlus,
19681                _ => Self::UnknownValue(edition::UnknownValue(
19682                    wkt::internal::UnknownEnumValue::Integer(value),
19683                )),
19684            }
19685        }
19686    }
19687
19688    impl std::convert::From<&str> for Edition {
19689        fn from(value: &str) -> Self {
19690            use std::string::ToString;
19691            match value {
19692                "EDITION_UNSPECIFIED" => Self::Unspecified,
19693                "ENTERPRISE" => Self::Enterprise,
19694                "ENTERPRISE_PLUS" => Self::EnterprisePlus,
19695                _ => Self::UnknownValue(edition::UnknownValue(
19696                    wkt::internal::UnknownEnumValue::String(value.to_string()),
19697                )),
19698            }
19699        }
19700    }
19701
19702    impl serde::ser::Serialize for Edition {
19703        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19704        where
19705            S: serde::Serializer,
19706        {
19707            match self {
19708                Self::Unspecified => serializer.serialize_i32(0),
19709                Self::Enterprise => serializer.serialize_i32(2),
19710                Self::EnterprisePlus => serializer.serialize_i32(3),
19711                Self::UnknownValue(u) => u.0.serialize(serializer),
19712            }
19713        }
19714    }
19715
19716    impl<'de> serde::de::Deserialize<'de> for Edition {
19717        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19718        where
19719            D: serde::Deserializer<'de>,
19720        {
19721            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
19722                ".google.cloud.sql.v1.Settings.Edition",
19723            ))
19724        }
19725    }
19726
19727    /// The options for enforcing Cloud SQL connectors in the instance.
19728    ///
19729    /// # Working with unknown values
19730    ///
19731    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19732    /// additional enum variants at any time. Adding new variants is not considered
19733    /// a breaking change. Applications should write their code in anticipation of:
19734    ///
19735    /// - New values appearing in future releases of the client library, **and**
19736    /// - New values received dynamically, without application changes.
19737    ///
19738    /// Please consult the [Working with enums] section in the user guide for some
19739    /// guidelines.
19740    ///
19741    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19742    #[derive(Clone, Debug, PartialEq)]
19743    #[non_exhaustive]
19744    pub enum ConnectorEnforcement {
19745        /// The requirement for Cloud SQL connectors is unknown.
19746        Unspecified,
19747        /// Do not require Cloud SQL connectors.
19748        NotRequired,
19749        /// Require all connections to use Cloud SQL connectors, including the
19750        /// Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
19751        /// Note: This disables all existing authorized networks.
19752        Required,
19753        /// If set, the enum was initialized with an unknown value.
19754        ///
19755        /// Applications can examine the value using [ConnectorEnforcement::value] or
19756        /// [ConnectorEnforcement::name].
19757        UnknownValue(connector_enforcement::UnknownValue),
19758    }
19759
19760    #[doc(hidden)]
19761    pub mod connector_enforcement {
19762        #[allow(unused_imports)]
19763        use super::*;
19764        #[derive(Clone, Debug, PartialEq)]
19765        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19766    }
19767
19768    impl ConnectorEnforcement {
19769        /// Gets the enum value.
19770        ///
19771        /// Returns `None` if the enum contains an unknown value deserialized from
19772        /// the string representation of enums.
19773        pub fn value(&self) -> std::option::Option<i32> {
19774            match self {
19775                Self::Unspecified => std::option::Option::Some(0),
19776                Self::NotRequired => std::option::Option::Some(1),
19777                Self::Required => std::option::Option::Some(2),
19778                Self::UnknownValue(u) => u.0.value(),
19779            }
19780        }
19781
19782        /// Gets the enum value as a string.
19783        ///
19784        /// Returns `None` if the enum contains an unknown value deserialized from
19785        /// the integer representation of enums.
19786        pub fn name(&self) -> std::option::Option<&str> {
19787            match self {
19788                Self::Unspecified => std::option::Option::Some("CONNECTOR_ENFORCEMENT_UNSPECIFIED"),
19789                Self::NotRequired => std::option::Option::Some("NOT_REQUIRED"),
19790                Self::Required => std::option::Option::Some("REQUIRED"),
19791                Self::UnknownValue(u) => u.0.name(),
19792            }
19793        }
19794    }
19795
19796    impl std::default::Default for ConnectorEnforcement {
19797        fn default() -> Self {
19798            use std::convert::From;
19799            Self::from(0)
19800        }
19801    }
19802
19803    impl std::fmt::Display for ConnectorEnforcement {
19804        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19805            wkt::internal::display_enum(f, self.name(), self.value())
19806        }
19807    }
19808
19809    impl std::convert::From<i32> for ConnectorEnforcement {
19810        fn from(value: i32) -> Self {
19811            match value {
19812                0 => Self::Unspecified,
19813                1 => Self::NotRequired,
19814                2 => Self::Required,
19815                _ => Self::UnknownValue(connector_enforcement::UnknownValue(
19816                    wkt::internal::UnknownEnumValue::Integer(value),
19817                )),
19818            }
19819        }
19820    }
19821
19822    impl std::convert::From<&str> for ConnectorEnforcement {
19823        fn from(value: &str) -> Self {
19824            use std::string::ToString;
19825            match value {
19826                "CONNECTOR_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
19827                "NOT_REQUIRED" => Self::NotRequired,
19828                "REQUIRED" => Self::Required,
19829                _ => Self::UnknownValue(connector_enforcement::UnknownValue(
19830                    wkt::internal::UnknownEnumValue::String(value.to_string()),
19831                )),
19832            }
19833        }
19834    }
19835
19836    impl serde::ser::Serialize for ConnectorEnforcement {
19837        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19838        where
19839            S: serde::Serializer,
19840        {
19841            match self {
19842                Self::Unspecified => serializer.serialize_i32(0),
19843                Self::NotRequired => serializer.serialize_i32(1),
19844                Self::Required => serializer.serialize_i32(2),
19845                Self::UnknownValue(u) => u.0.serialize(serializer),
19846            }
19847        }
19848    }
19849
19850    impl<'de> serde::de::Deserialize<'de> for ConnectorEnforcement {
19851        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19852        where
19853            D: serde::Deserializer<'de>,
19854        {
19855            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectorEnforcement>::new(
19856                ".google.cloud.sql.v1.Settings.ConnectorEnforcement",
19857            ))
19858        }
19859    }
19860}
19861
19862/// Specifies options for controlling advanced machine features.
19863#[derive(Clone, Default, PartialEq)]
19864#[non_exhaustive]
19865pub struct AdvancedMachineFeatures {
19866    /// The number of threads per physical core.
19867    pub threads_per_core: i32,
19868
19869    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19870}
19871
19872impl AdvancedMachineFeatures {
19873    pub fn new() -> Self {
19874        std::default::Default::default()
19875    }
19876
19877    /// Sets the value of [threads_per_core][crate::model::AdvancedMachineFeatures::threads_per_core].
19878    ///
19879    /// # Example
19880    /// ```ignore,no_run
19881    /// # use google_cloud_sql_v1::model::AdvancedMachineFeatures;
19882    /// let x = AdvancedMachineFeatures::new().set_threads_per_core(42);
19883    /// ```
19884    pub fn set_threads_per_core<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19885        self.threads_per_core = v.into();
19886        self
19887    }
19888}
19889
19890impl wkt::message::Message for AdvancedMachineFeatures {
19891    fn typename() -> &'static str {
19892        "type.googleapis.com/google.cloud.sql.v1.AdvancedMachineFeatures"
19893    }
19894}
19895
19896/// SslCerts Resource
19897#[derive(Clone, Default, PartialEq)]
19898#[non_exhaustive]
19899pub struct SslCert {
19900    /// This is always `sql#sslCert`.
19901    pub kind: std::string::String,
19902
19903    /// Serial number, as extracted from the certificate.
19904    pub cert_serial_number: std::string::String,
19905
19906    /// PEM representation.
19907    pub cert: std::string::String,
19908
19909    /// The time when the certificate was created in [RFC
19910    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
19911    /// `2012-11-15T16:19:00.094Z`
19912    pub create_time: std::option::Option<wkt::Timestamp>,
19913
19914    /// User supplied name.  Constrained to [a-zA-Z.-_ ]+.
19915    pub common_name: std::string::String,
19916
19917    /// The time when the certificate expires in [RFC
19918    /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
19919    /// `2012-11-15T16:19:00.094Z`.
19920    pub expiration_time: std::option::Option<wkt::Timestamp>,
19921
19922    /// Sha1 Fingerprint.
19923    pub sha1_fingerprint: std::string::String,
19924
19925    /// Name of the database instance.
19926    pub instance: std::string::String,
19927
19928    /// The URI of this resource.
19929    pub self_link: std::string::String,
19930
19931    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19932}
19933
19934impl SslCert {
19935    pub fn new() -> Self {
19936        std::default::Default::default()
19937    }
19938
19939    /// Sets the value of [kind][crate::model::SslCert::kind].
19940    ///
19941    /// # Example
19942    /// ```ignore,no_run
19943    /// # use google_cloud_sql_v1::model::SslCert;
19944    /// let x = SslCert::new().set_kind("example");
19945    /// ```
19946    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19947        self.kind = v.into();
19948        self
19949    }
19950
19951    /// Sets the value of [cert_serial_number][crate::model::SslCert::cert_serial_number].
19952    ///
19953    /// # Example
19954    /// ```ignore,no_run
19955    /// # use google_cloud_sql_v1::model::SslCert;
19956    /// let x = SslCert::new().set_cert_serial_number("example");
19957    /// ```
19958    pub fn set_cert_serial_number<T: std::convert::Into<std::string::String>>(
19959        mut self,
19960        v: T,
19961    ) -> Self {
19962        self.cert_serial_number = v.into();
19963        self
19964    }
19965
19966    /// Sets the value of [cert][crate::model::SslCert::cert].
19967    ///
19968    /// # Example
19969    /// ```ignore,no_run
19970    /// # use google_cloud_sql_v1::model::SslCert;
19971    /// let x = SslCert::new().set_cert("example");
19972    /// ```
19973    pub fn set_cert<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19974        self.cert = v.into();
19975        self
19976    }
19977
19978    /// Sets the value of [create_time][crate::model::SslCert::create_time].
19979    ///
19980    /// # Example
19981    /// ```ignore,no_run
19982    /// # use google_cloud_sql_v1::model::SslCert;
19983    /// use wkt::Timestamp;
19984    /// let x = SslCert::new().set_create_time(Timestamp::default()/* use setters */);
19985    /// ```
19986    pub fn set_create_time<T>(mut self, v: T) -> Self
19987    where
19988        T: std::convert::Into<wkt::Timestamp>,
19989    {
19990        self.create_time = std::option::Option::Some(v.into());
19991        self
19992    }
19993
19994    /// Sets or clears the value of [create_time][crate::model::SslCert::create_time].
19995    ///
19996    /// # Example
19997    /// ```ignore,no_run
19998    /// # use google_cloud_sql_v1::model::SslCert;
19999    /// use wkt::Timestamp;
20000    /// let x = SslCert::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
20001    /// let x = SslCert::new().set_or_clear_create_time(None::<Timestamp>);
20002    /// ```
20003    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
20004    where
20005        T: std::convert::Into<wkt::Timestamp>,
20006    {
20007        self.create_time = v.map(|x| x.into());
20008        self
20009    }
20010
20011    /// Sets the value of [common_name][crate::model::SslCert::common_name].
20012    ///
20013    /// # Example
20014    /// ```ignore,no_run
20015    /// # use google_cloud_sql_v1::model::SslCert;
20016    /// let x = SslCert::new().set_common_name("example");
20017    /// ```
20018    pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20019        self.common_name = v.into();
20020        self
20021    }
20022
20023    /// Sets the value of [expiration_time][crate::model::SslCert::expiration_time].
20024    ///
20025    /// # Example
20026    /// ```ignore,no_run
20027    /// # use google_cloud_sql_v1::model::SslCert;
20028    /// use wkt::Timestamp;
20029    /// let x = SslCert::new().set_expiration_time(Timestamp::default()/* use setters */);
20030    /// ```
20031    pub fn set_expiration_time<T>(mut self, v: T) -> Self
20032    where
20033        T: std::convert::Into<wkt::Timestamp>,
20034    {
20035        self.expiration_time = std::option::Option::Some(v.into());
20036        self
20037    }
20038
20039    /// Sets or clears the value of [expiration_time][crate::model::SslCert::expiration_time].
20040    ///
20041    /// # Example
20042    /// ```ignore,no_run
20043    /// # use google_cloud_sql_v1::model::SslCert;
20044    /// use wkt::Timestamp;
20045    /// let x = SslCert::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
20046    /// let x = SslCert::new().set_or_clear_expiration_time(None::<Timestamp>);
20047    /// ```
20048    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
20049    where
20050        T: std::convert::Into<wkt::Timestamp>,
20051    {
20052        self.expiration_time = v.map(|x| x.into());
20053        self
20054    }
20055
20056    /// Sets the value of [sha1_fingerprint][crate::model::SslCert::sha1_fingerprint].
20057    ///
20058    /// # Example
20059    /// ```ignore,no_run
20060    /// # use google_cloud_sql_v1::model::SslCert;
20061    /// let x = SslCert::new().set_sha1_fingerprint("example");
20062    /// ```
20063    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
20064        mut self,
20065        v: T,
20066    ) -> Self {
20067        self.sha1_fingerprint = v.into();
20068        self
20069    }
20070
20071    /// Sets the value of [instance][crate::model::SslCert::instance].
20072    ///
20073    /// # Example
20074    /// ```ignore,no_run
20075    /// # use google_cloud_sql_v1::model::SslCert;
20076    /// let x = SslCert::new().set_instance("example");
20077    /// ```
20078    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20079        self.instance = v.into();
20080        self
20081    }
20082
20083    /// Sets the value of [self_link][crate::model::SslCert::self_link].
20084    ///
20085    /// # Example
20086    /// ```ignore,no_run
20087    /// # use google_cloud_sql_v1::model::SslCert;
20088    /// let x = SslCert::new().set_self_link("example");
20089    /// ```
20090    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20091        self.self_link = v.into();
20092        self
20093    }
20094}
20095
20096impl wkt::message::Message for SslCert {
20097    fn typename() -> &'static str {
20098        "type.googleapis.com/google.cloud.sql.v1.SslCert"
20099    }
20100}
20101
20102/// SslCertDetail.
20103#[derive(Clone, Default, PartialEq)]
20104#[non_exhaustive]
20105pub struct SslCertDetail {
20106    /// The public information about the cert.
20107    pub cert_info: std::option::Option<crate::model::SslCert>,
20108
20109    /// The private key for the client cert, in pem format.  Keep private in order
20110    /// to protect your security.
20111    pub cert_private_key: std::string::String,
20112
20113    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20114}
20115
20116impl SslCertDetail {
20117    pub fn new() -> Self {
20118        std::default::Default::default()
20119    }
20120
20121    /// Sets the value of [cert_info][crate::model::SslCertDetail::cert_info].
20122    ///
20123    /// # Example
20124    /// ```ignore,no_run
20125    /// # use google_cloud_sql_v1::model::SslCertDetail;
20126    /// use google_cloud_sql_v1::model::SslCert;
20127    /// let x = SslCertDetail::new().set_cert_info(SslCert::default()/* use setters */);
20128    /// ```
20129    pub fn set_cert_info<T>(mut self, v: T) -> Self
20130    where
20131        T: std::convert::Into<crate::model::SslCert>,
20132    {
20133        self.cert_info = std::option::Option::Some(v.into());
20134        self
20135    }
20136
20137    /// Sets or clears the value of [cert_info][crate::model::SslCertDetail::cert_info].
20138    ///
20139    /// # Example
20140    /// ```ignore,no_run
20141    /// # use google_cloud_sql_v1::model::SslCertDetail;
20142    /// use google_cloud_sql_v1::model::SslCert;
20143    /// let x = SslCertDetail::new().set_or_clear_cert_info(Some(SslCert::default()/* use setters */));
20144    /// let x = SslCertDetail::new().set_or_clear_cert_info(None::<SslCert>);
20145    /// ```
20146    pub fn set_or_clear_cert_info<T>(mut self, v: std::option::Option<T>) -> Self
20147    where
20148        T: std::convert::Into<crate::model::SslCert>,
20149    {
20150        self.cert_info = v.map(|x| x.into());
20151        self
20152    }
20153
20154    /// Sets the value of [cert_private_key][crate::model::SslCertDetail::cert_private_key].
20155    ///
20156    /// # Example
20157    /// ```ignore,no_run
20158    /// # use google_cloud_sql_v1::model::SslCertDetail;
20159    /// let x = SslCertDetail::new().set_cert_private_key("example");
20160    /// ```
20161    pub fn set_cert_private_key<T: std::convert::Into<std::string::String>>(
20162        mut self,
20163        v: T,
20164    ) -> Self {
20165        self.cert_private_key = v.into();
20166        self
20167    }
20168}
20169
20170impl wkt::message::Message for SslCertDetail {
20171    fn typename() -> &'static str {
20172        "type.googleapis.com/google.cloud.sql.v1.SslCertDetail"
20173    }
20174}
20175
20176/// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
20177#[derive(Clone, Default, PartialEq)]
20178#[non_exhaustive]
20179pub struct SqlActiveDirectoryConfig {
20180    /// This is always sql#activeDirectoryConfig.
20181    pub kind: std::string::String,
20182
20183    /// The name of the domain (e.g., mydomain.com).
20184    pub domain: std::string::String,
20185
20186    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20187}
20188
20189impl SqlActiveDirectoryConfig {
20190    pub fn new() -> Self {
20191        std::default::Default::default()
20192    }
20193
20194    /// Sets the value of [kind][crate::model::SqlActiveDirectoryConfig::kind].
20195    ///
20196    /// # Example
20197    /// ```ignore,no_run
20198    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
20199    /// let x = SqlActiveDirectoryConfig::new().set_kind("example");
20200    /// ```
20201    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20202        self.kind = v.into();
20203        self
20204    }
20205
20206    /// Sets the value of [domain][crate::model::SqlActiveDirectoryConfig::domain].
20207    ///
20208    /// # Example
20209    /// ```ignore,no_run
20210    /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
20211    /// let x = SqlActiveDirectoryConfig::new().set_domain("example");
20212    /// ```
20213    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20214        self.domain = v.into();
20215        self
20216    }
20217}
20218
20219impl wkt::message::Message for SqlActiveDirectoryConfig {
20220    fn typename() -> &'static str {
20221        "type.googleapis.com/google.cloud.sql.v1.SqlActiveDirectoryConfig"
20222    }
20223}
20224
20225/// SQL Server specific audit configuration.
20226#[derive(Clone, Default, PartialEq)]
20227#[non_exhaustive]
20228pub struct SqlServerAuditConfig {
20229    /// This is always sql#sqlServerAuditConfig
20230    pub kind: std::string::String,
20231
20232    /// The name of the destination bucket (e.g., gs://mybucket).
20233    pub bucket: std::string::String,
20234
20235    /// How long to keep generated audit files.
20236    pub retention_interval: std::option::Option<wkt::Duration>,
20237
20238    /// How often to upload generated audit files.
20239    pub upload_interval: std::option::Option<wkt::Duration>,
20240
20241    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20242}
20243
20244impl SqlServerAuditConfig {
20245    pub fn new() -> Self {
20246        std::default::Default::default()
20247    }
20248
20249    /// Sets the value of [kind][crate::model::SqlServerAuditConfig::kind].
20250    ///
20251    /// # Example
20252    /// ```ignore,no_run
20253    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
20254    /// let x = SqlServerAuditConfig::new().set_kind("example");
20255    /// ```
20256    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20257        self.kind = v.into();
20258        self
20259    }
20260
20261    /// Sets the value of [bucket][crate::model::SqlServerAuditConfig::bucket].
20262    ///
20263    /// # Example
20264    /// ```ignore,no_run
20265    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
20266    /// let x = SqlServerAuditConfig::new().set_bucket("example");
20267    /// ```
20268    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20269        self.bucket = v.into();
20270        self
20271    }
20272
20273    /// Sets the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
20274    ///
20275    /// # Example
20276    /// ```ignore,no_run
20277    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
20278    /// use wkt::Duration;
20279    /// let x = SqlServerAuditConfig::new().set_retention_interval(Duration::default()/* use setters */);
20280    /// ```
20281    pub fn set_retention_interval<T>(mut self, v: T) -> Self
20282    where
20283        T: std::convert::Into<wkt::Duration>,
20284    {
20285        self.retention_interval = std::option::Option::Some(v.into());
20286        self
20287    }
20288
20289    /// Sets or clears the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
20290    ///
20291    /// # Example
20292    /// ```ignore,no_run
20293    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
20294    /// use wkt::Duration;
20295    /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(Some(Duration::default()/* use setters */));
20296    /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(None::<Duration>);
20297    /// ```
20298    pub fn set_or_clear_retention_interval<T>(mut self, v: std::option::Option<T>) -> Self
20299    where
20300        T: std::convert::Into<wkt::Duration>,
20301    {
20302        self.retention_interval = v.map(|x| x.into());
20303        self
20304    }
20305
20306    /// Sets the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
20307    ///
20308    /// # Example
20309    /// ```ignore,no_run
20310    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
20311    /// use wkt::Duration;
20312    /// let x = SqlServerAuditConfig::new().set_upload_interval(Duration::default()/* use setters */);
20313    /// ```
20314    pub fn set_upload_interval<T>(mut self, v: T) -> Self
20315    where
20316        T: std::convert::Into<wkt::Duration>,
20317    {
20318        self.upload_interval = std::option::Option::Some(v.into());
20319        self
20320    }
20321
20322    /// Sets or clears the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
20323    ///
20324    /// # Example
20325    /// ```ignore,no_run
20326    /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
20327    /// use wkt::Duration;
20328    /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(Some(Duration::default()/* use setters */));
20329    /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(None::<Duration>);
20330    /// ```
20331    pub fn set_or_clear_upload_interval<T>(mut self, v: std::option::Option<T>) -> Self
20332    where
20333        T: std::convert::Into<wkt::Duration>,
20334    {
20335        self.upload_interval = v.map(|x| x.into());
20336        self
20337    }
20338}
20339
20340impl wkt::message::Message for SqlServerAuditConfig {
20341    fn typename() -> &'static str {
20342        "type.googleapis.com/google.cloud.sql.v1.SqlServerAuditConfig"
20343    }
20344}
20345
20346/// Acquire SSRS lease context.
20347#[derive(Clone, Default, PartialEq)]
20348#[non_exhaustive]
20349pub struct AcquireSsrsLeaseContext {
20350    /// The username to be used as the setup login to connect to the database
20351    /// server for SSRS setup.
20352    pub setup_login: std::option::Option<std::string::String>,
20353
20354    /// The username to be used as the service login to connect to the report
20355    /// database for SSRS setup.
20356    pub service_login: std::option::Option<std::string::String>,
20357
20358    /// The report database to be used for SSRS setup.
20359    pub report_database: std::option::Option<std::string::String>,
20360
20361    /// Lease duration needed for SSRS setup.
20362    pub duration: std::option::Option<wkt::Duration>,
20363
20364    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20365}
20366
20367impl AcquireSsrsLeaseContext {
20368    pub fn new() -> Self {
20369        std::default::Default::default()
20370    }
20371
20372    /// Sets the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
20373    ///
20374    /// # Example
20375    /// ```ignore,no_run
20376    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
20377    /// let x = AcquireSsrsLeaseContext::new().set_setup_login("example");
20378    /// ```
20379    pub fn set_setup_login<T>(mut self, v: T) -> Self
20380    where
20381        T: std::convert::Into<std::string::String>,
20382    {
20383        self.setup_login = std::option::Option::Some(v.into());
20384        self
20385    }
20386
20387    /// Sets or clears the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
20388    ///
20389    /// # Example
20390    /// ```ignore,no_run
20391    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
20392    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(Some("example"));
20393    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(None::<String>);
20394    /// ```
20395    pub fn set_or_clear_setup_login<T>(mut self, v: std::option::Option<T>) -> Self
20396    where
20397        T: std::convert::Into<std::string::String>,
20398    {
20399        self.setup_login = v.map(|x| x.into());
20400        self
20401    }
20402
20403    /// Sets the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
20404    ///
20405    /// # Example
20406    /// ```ignore,no_run
20407    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
20408    /// let x = AcquireSsrsLeaseContext::new().set_service_login("example");
20409    /// ```
20410    pub fn set_service_login<T>(mut self, v: T) -> Self
20411    where
20412        T: std::convert::Into<std::string::String>,
20413    {
20414        self.service_login = std::option::Option::Some(v.into());
20415        self
20416    }
20417
20418    /// Sets or clears the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
20419    ///
20420    /// # Example
20421    /// ```ignore,no_run
20422    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
20423    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(Some("example"));
20424    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(None::<String>);
20425    /// ```
20426    pub fn set_or_clear_service_login<T>(mut self, v: std::option::Option<T>) -> Self
20427    where
20428        T: std::convert::Into<std::string::String>,
20429    {
20430        self.service_login = v.map(|x| x.into());
20431        self
20432    }
20433
20434    /// Sets the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
20435    ///
20436    /// # Example
20437    /// ```ignore,no_run
20438    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
20439    /// let x = AcquireSsrsLeaseContext::new().set_report_database("example");
20440    /// ```
20441    pub fn set_report_database<T>(mut self, v: T) -> Self
20442    where
20443        T: std::convert::Into<std::string::String>,
20444    {
20445        self.report_database = std::option::Option::Some(v.into());
20446        self
20447    }
20448
20449    /// Sets or clears the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
20450    ///
20451    /// # Example
20452    /// ```ignore,no_run
20453    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
20454    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(Some("example"));
20455    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(None::<String>);
20456    /// ```
20457    pub fn set_or_clear_report_database<T>(mut self, v: std::option::Option<T>) -> Self
20458    where
20459        T: std::convert::Into<std::string::String>,
20460    {
20461        self.report_database = v.map(|x| x.into());
20462        self
20463    }
20464
20465    /// Sets the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
20466    ///
20467    /// # Example
20468    /// ```ignore,no_run
20469    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
20470    /// use wkt::Duration;
20471    /// let x = AcquireSsrsLeaseContext::new().set_duration(Duration::default()/* use setters */);
20472    /// ```
20473    pub fn set_duration<T>(mut self, v: T) -> Self
20474    where
20475        T: std::convert::Into<wkt::Duration>,
20476    {
20477        self.duration = std::option::Option::Some(v.into());
20478        self
20479    }
20480
20481    /// Sets or clears the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
20482    ///
20483    /// # Example
20484    /// ```ignore,no_run
20485    /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
20486    /// use wkt::Duration;
20487    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
20488    /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(None::<Duration>);
20489    /// ```
20490    pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
20491    where
20492        T: std::convert::Into<wkt::Duration>,
20493    {
20494        self.duration = v.map(|x| x.into());
20495        self
20496    }
20497}
20498
20499impl wkt::message::Message for AcquireSsrsLeaseContext {
20500    fn typename() -> &'static str {
20501        "type.googleapis.com/google.cloud.sql.v1.AcquireSsrsLeaseContext"
20502    }
20503}
20504
20505#[derive(Clone, Default, PartialEq)]
20506#[non_exhaustive]
20507pub struct SqlSslCertsDeleteRequest {
20508    /// Cloud SQL instance ID. This does not include the project ID.
20509    pub instance: std::string::String,
20510
20511    /// Project ID of the project that contains the instance.
20512    pub project: std::string::String,
20513
20514    /// Sha1 FingerPrint.
20515    pub sha1_fingerprint: std::string::String,
20516
20517    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20518}
20519
20520impl SqlSslCertsDeleteRequest {
20521    pub fn new() -> Self {
20522        std::default::Default::default()
20523    }
20524
20525    /// Sets the value of [instance][crate::model::SqlSslCertsDeleteRequest::instance].
20526    ///
20527    /// # Example
20528    /// ```ignore,no_run
20529    /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
20530    /// let x = SqlSslCertsDeleteRequest::new().set_instance("example");
20531    /// ```
20532    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20533        self.instance = v.into();
20534        self
20535    }
20536
20537    /// Sets the value of [project][crate::model::SqlSslCertsDeleteRequest::project].
20538    ///
20539    /// # Example
20540    /// ```ignore,no_run
20541    /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
20542    /// let x = SqlSslCertsDeleteRequest::new().set_project("example");
20543    /// ```
20544    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20545        self.project = v.into();
20546        self
20547    }
20548
20549    /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsDeleteRequest::sha1_fingerprint].
20550    ///
20551    /// # Example
20552    /// ```ignore,no_run
20553    /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
20554    /// let x = SqlSslCertsDeleteRequest::new().set_sha1_fingerprint("example");
20555    /// ```
20556    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
20557        mut self,
20558        v: T,
20559    ) -> Self {
20560        self.sha1_fingerprint = v.into();
20561        self
20562    }
20563}
20564
20565impl wkt::message::Message for SqlSslCertsDeleteRequest {
20566    fn typename() -> &'static str {
20567        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsDeleteRequest"
20568    }
20569}
20570
20571#[derive(Clone, Default, PartialEq)]
20572#[non_exhaustive]
20573pub struct SqlSslCertsGetRequest {
20574    /// Cloud SQL instance ID. This does not include the project ID.
20575    pub instance: std::string::String,
20576
20577    /// Project ID of the project that contains the instance.
20578    pub project: std::string::String,
20579
20580    /// Sha1 FingerPrint.
20581    pub sha1_fingerprint: std::string::String,
20582
20583    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20584}
20585
20586impl SqlSslCertsGetRequest {
20587    pub fn new() -> Self {
20588        std::default::Default::default()
20589    }
20590
20591    /// Sets the value of [instance][crate::model::SqlSslCertsGetRequest::instance].
20592    ///
20593    /// # Example
20594    /// ```ignore,no_run
20595    /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
20596    /// let x = SqlSslCertsGetRequest::new().set_instance("example");
20597    /// ```
20598    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20599        self.instance = v.into();
20600        self
20601    }
20602
20603    /// Sets the value of [project][crate::model::SqlSslCertsGetRequest::project].
20604    ///
20605    /// # Example
20606    /// ```ignore,no_run
20607    /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
20608    /// let x = SqlSslCertsGetRequest::new().set_project("example");
20609    /// ```
20610    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20611        self.project = v.into();
20612        self
20613    }
20614
20615    /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsGetRequest::sha1_fingerprint].
20616    ///
20617    /// # Example
20618    /// ```ignore,no_run
20619    /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
20620    /// let x = SqlSslCertsGetRequest::new().set_sha1_fingerprint("example");
20621    /// ```
20622    pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
20623        mut self,
20624        v: T,
20625    ) -> Self {
20626        self.sha1_fingerprint = v.into();
20627        self
20628    }
20629}
20630
20631impl wkt::message::Message for SqlSslCertsGetRequest {
20632    fn typename() -> &'static str {
20633        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsGetRequest"
20634    }
20635}
20636
20637#[derive(Clone, Default, PartialEq)]
20638#[non_exhaustive]
20639pub struct SqlSslCertsInsertRequest {
20640    /// Cloud SQL instance ID. This does not include the project ID.
20641    pub instance: std::string::String,
20642
20643    /// Project ID of the project that contains the instance.
20644    pub project: std::string::String,
20645
20646    pub body: std::option::Option<crate::model::SslCertsInsertRequest>,
20647
20648    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20649}
20650
20651impl SqlSslCertsInsertRequest {
20652    pub fn new() -> Self {
20653        std::default::Default::default()
20654    }
20655
20656    /// Sets the value of [instance][crate::model::SqlSslCertsInsertRequest::instance].
20657    ///
20658    /// # Example
20659    /// ```ignore,no_run
20660    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
20661    /// let x = SqlSslCertsInsertRequest::new().set_instance("example");
20662    /// ```
20663    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20664        self.instance = v.into();
20665        self
20666    }
20667
20668    /// Sets the value of [project][crate::model::SqlSslCertsInsertRequest::project].
20669    ///
20670    /// # Example
20671    /// ```ignore,no_run
20672    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
20673    /// let x = SqlSslCertsInsertRequest::new().set_project("example");
20674    /// ```
20675    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20676        self.project = v.into();
20677        self
20678    }
20679
20680    /// Sets the value of [body][crate::model::SqlSslCertsInsertRequest::body].
20681    ///
20682    /// # Example
20683    /// ```ignore,no_run
20684    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
20685    /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
20686    /// let x = SqlSslCertsInsertRequest::new().set_body(SslCertsInsertRequest::default()/* use setters */);
20687    /// ```
20688    pub fn set_body<T>(mut self, v: T) -> Self
20689    where
20690        T: std::convert::Into<crate::model::SslCertsInsertRequest>,
20691    {
20692        self.body = std::option::Option::Some(v.into());
20693        self
20694    }
20695
20696    /// Sets or clears the value of [body][crate::model::SqlSslCertsInsertRequest::body].
20697    ///
20698    /// # Example
20699    /// ```ignore,no_run
20700    /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
20701    /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
20702    /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(Some(SslCertsInsertRequest::default()/* use setters */));
20703    /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(None::<SslCertsInsertRequest>);
20704    /// ```
20705    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
20706    where
20707        T: std::convert::Into<crate::model::SslCertsInsertRequest>,
20708    {
20709        self.body = v.map(|x| x.into());
20710        self
20711    }
20712}
20713
20714impl wkt::message::Message for SqlSslCertsInsertRequest {
20715    fn typename() -> &'static str {
20716        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsInsertRequest"
20717    }
20718}
20719
20720#[derive(Clone, Default, PartialEq)]
20721#[non_exhaustive]
20722pub struct SqlSslCertsListRequest {
20723    /// Cloud SQL instance ID. This does not include the project ID.
20724    pub instance: std::string::String,
20725
20726    /// Project ID of the project that contains the instance.
20727    pub project: std::string::String,
20728
20729    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20730}
20731
20732impl SqlSslCertsListRequest {
20733    pub fn new() -> Self {
20734        std::default::Default::default()
20735    }
20736
20737    /// Sets the value of [instance][crate::model::SqlSslCertsListRequest::instance].
20738    ///
20739    /// # Example
20740    /// ```ignore,no_run
20741    /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
20742    /// let x = SqlSslCertsListRequest::new().set_instance("example");
20743    /// ```
20744    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20745        self.instance = v.into();
20746        self
20747    }
20748
20749    /// Sets the value of [project][crate::model::SqlSslCertsListRequest::project].
20750    ///
20751    /// # Example
20752    /// ```ignore,no_run
20753    /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
20754    /// let x = SqlSslCertsListRequest::new().set_project("example");
20755    /// ```
20756    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20757        self.project = v.into();
20758        self
20759    }
20760}
20761
20762impl wkt::message::Message for SqlSslCertsListRequest {
20763    fn typename() -> &'static str {
20764        "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsListRequest"
20765    }
20766}
20767
20768/// SslCerts insert request.
20769#[derive(Clone, Default, PartialEq)]
20770#[non_exhaustive]
20771pub struct SslCertsInsertRequest {
20772    /// User supplied name.  Must be a distinct name from the other certificates
20773    /// for this instance.
20774    pub common_name: std::string::String,
20775
20776    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20777}
20778
20779impl SslCertsInsertRequest {
20780    pub fn new() -> Self {
20781        std::default::Default::default()
20782    }
20783
20784    /// Sets the value of [common_name][crate::model::SslCertsInsertRequest::common_name].
20785    ///
20786    /// # Example
20787    /// ```ignore,no_run
20788    /// # use google_cloud_sql_v1::model::SslCertsInsertRequest;
20789    /// let x = SslCertsInsertRequest::new().set_common_name("example");
20790    /// ```
20791    pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20792        self.common_name = v.into();
20793        self
20794    }
20795}
20796
20797impl wkt::message::Message for SslCertsInsertRequest {
20798    fn typename() -> &'static str {
20799        "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertRequest"
20800    }
20801}
20802
20803/// SslCert insert response.
20804#[derive(Clone, Default, PartialEq)]
20805#[non_exhaustive]
20806pub struct SslCertsInsertResponse {
20807    /// This is always `sql#sslCertsInsert`.
20808    pub kind: std::string::String,
20809
20810    /// The operation to track the ssl certs insert request.
20811    pub operation: std::option::Option<crate::model::Operation>,
20812
20813    /// The server Certificate Authority's certificate.  If this is missing you can
20814    /// force a new one to be generated by calling resetSslConfig method on
20815    /// instances resource.
20816    pub server_ca_cert: std::option::Option<crate::model::SslCert>,
20817
20818    /// The new client certificate and private key.
20819    pub client_cert: std::option::Option<crate::model::SslCertDetail>,
20820
20821    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20822}
20823
20824impl SslCertsInsertResponse {
20825    pub fn new() -> Self {
20826        std::default::Default::default()
20827    }
20828
20829    /// Sets the value of [kind][crate::model::SslCertsInsertResponse::kind].
20830    ///
20831    /// # Example
20832    /// ```ignore,no_run
20833    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
20834    /// let x = SslCertsInsertResponse::new().set_kind("example");
20835    /// ```
20836    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20837        self.kind = v.into();
20838        self
20839    }
20840
20841    /// Sets the value of [operation][crate::model::SslCertsInsertResponse::operation].
20842    ///
20843    /// # Example
20844    /// ```ignore,no_run
20845    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
20846    /// use google_cloud_sql_v1::model::Operation;
20847    /// let x = SslCertsInsertResponse::new().set_operation(Operation::default()/* use setters */);
20848    /// ```
20849    pub fn set_operation<T>(mut self, v: T) -> Self
20850    where
20851        T: std::convert::Into<crate::model::Operation>,
20852    {
20853        self.operation = std::option::Option::Some(v.into());
20854        self
20855    }
20856
20857    /// Sets or clears the value of [operation][crate::model::SslCertsInsertResponse::operation].
20858    ///
20859    /// # Example
20860    /// ```ignore,no_run
20861    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
20862    /// use google_cloud_sql_v1::model::Operation;
20863    /// let x = SslCertsInsertResponse::new().set_or_clear_operation(Some(Operation::default()/* use setters */));
20864    /// let x = SslCertsInsertResponse::new().set_or_clear_operation(None::<Operation>);
20865    /// ```
20866    pub fn set_or_clear_operation<T>(mut self, v: std::option::Option<T>) -> Self
20867    where
20868        T: std::convert::Into<crate::model::Operation>,
20869    {
20870        self.operation = v.map(|x| x.into());
20871        self
20872    }
20873
20874    /// Sets the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
20875    ///
20876    /// # Example
20877    /// ```ignore,no_run
20878    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
20879    /// use google_cloud_sql_v1::model::SslCert;
20880    /// let x = SslCertsInsertResponse::new().set_server_ca_cert(SslCert::default()/* use setters */);
20881    /// ```
20882    pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
20883    where
20884        T: std::convert::Into<crate::model::SslCert>,
20885    {
20886        self.server_ca_cert = std::option::Option::Some(v.into());
20887        self
20888    }
20889
20890    /// Sets or clears the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
20891    ///
20892    /// # Example
20893    /// ```ignore,no_run
20894    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
20895    /// use google_cloud_sql_v1::model::SslCert;
20896    /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
20897    /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(None::<SslCert>);
20898    /// ```
20899    pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
20900    where
20901        T: std::convert::Into<crate::model::SslCert>,
20902    {
20903        self.server_ca_cert = v.map(|x| x.into());
20904        self
20905    }
20906
20907    /// Sets the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
20908    ///
20909    /// # Example
20910    /// ```ignore,no_run
20911    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
20912    /// use google_cloud_sql_v1::model::SslCertDetail;
20913    /// let x = SslCertsInsertResponse::new().set_client_cert(SslCertDetail::default()/* use setters */);
20914    /// ```
20915    pub fn set_client_cert<T>(mut self, v: T) -> Self
20916    where
20917        T: std::convert::Into<crate::model::SslCertDetail>,
20918    {
20919        self.client_cert = std::option::Option::Some(v.into());
20920        self
20921    }
20922
20923    /// Sets or clears the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
20924    ///
20925    /// # Example
20926    /// ```ignore,no_run
20927    /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
20928    /// use google_cloud_sql_v1::model::SslCertDetail;
20929    /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(Some(SslCertDetail::default()/* use setters */));
20930    /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(None::<SslCertDetail>);
20931    /// ```
20932    pub fn set_or_clear_client_cert<T>(mut self, v: std::option::Option<T>) -> Self
20933    where
20934        T: std::convert::Into<crate::model::SslCertDetail>,
20935    {
20936        self.client_cert = v.map(|x| x.into());
20937        self
20938    }
20939}
20940
20941impl wkt::message::Message for SslCertsInsertResponse {
20942    fn typename() -> &'static str {
20943        "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertResponse"
20944    }
20945}
20946
20947/// SslCerts list response.
20948#[derive(Clone, Default, PartialEq)]
20949#[non_exhaustive]
20950pub struct SslCertsListResponse {
20951    /// This is always `sql#sslCertsList`.
20952    pub kind: std::string::String,
20953
20954    /// List of client certificates for the instance.
20955    pub items: std::vec::Vec<crate::model::SslCert>,
20956
20957    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20958}
20959
20960impl SslCertsListResponse {
20961    pub fn new() -> Self {
20962        std::default::Default::default()
20963    }
20964
20965    /// Sets the value of [kind][crate::model::SslCertsListResponse::kind].
20966    ///
20967    /// # Example
20968    /// ```ignore,no_run
20969    /// # use google_cloud_sql_v1::model::SslCertsListResponse;
20970    /// let x = SslCertsListResponse::new().set_kind("example");
20971    /// ```
20972    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20973        self.kind = v.into();
20974        self
20975    }
20976
20977    /// Sets the value of [items][crate::model::SslCertsListResponse::items].
20978    ///
20979    /// # Example
20980    /// ```ignore,no_run
20981    /// # use google_cloud_sql_v1::model::SslCertsListResponse;
20982    /// use google_cloud_sql_v1::model::SslCert;
20983    /// let x = SslCertsListResponse::new()
20984    ///     .set_items([
20985    ///         SslCert::default()/* use setters */,
20986    ///         SslCert::default()/* use (different) setters */,
20987    ///     ]);
20988    /// ```
20989    pub fn set_items<T, V>(mut self, v: T) -> Self
20990    where
20991        T: std::iter::IntoIterator<Item = V>,
20992        V: std::convert::Into<crate::model::SslCert>,
20993    {
20994        use std::iter::Iterator;
20995        self.items = v.into_iter().map(|i| i.into()).collect();
20996        self
20997    }
20998}
20999
21000impl wkt::message::Message for SslCertsListResponse {
21001    fn typename() -> &'static str {
21002        "type.googleapis.com/google.cloud.sql.v1.SslCertsListResponse"
21003    }
21004}
21005
21006/// Tiers list request.
21007#[derive(Clone, Default, PartialEq)]
21008#[non_exhaustive]
21009pub struct SqlTiersListRequest {
21010    /// Project ID of the project for which to list tiers.
21011    pub project: std::string::String,
21012
21013    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21014}
21015
21016impl SqlTiersListRequest {
21017    pub fn new() -> Self {
21018        std::default::Default::default()
21019    }
21020
21021    /// Sets the value of [project][crate::model::SqlTiersListRequest::project].
21022    ///
21023    /// # Example
21024    /// ```ignore,no_run
21025    /// # use google_cloud_sql_v1::model::SqlTiersListRequest;
21026    /// let x = SqlTiersListRequest::new().set_project("example");
21027    /// ```
21028    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21029        self.project = v.into();
21030        self
21031    }
21032}
21033
21034impl wkt::message::Message for SqlTiersListRequest {
21035    fn typename() -> &'static str {
21036        "type.googleapis.com/google.cloud.sql.v1.SqlTiersListRequest"
21037    }
21038}
21039
21040/// Tiers list response.
21041#[derive(Clone, Default, PartialEq)]
21042#[non_exhaustive]
21043pub struct TiersListResponse {
21044    /// This is always `sql#tiersList`.
21045    pub kind: std::string::String,
21046
21047    /// List of tiers.
21048    pub items: std::vec::Vec<crate::model::Tier>,
21049
21050    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21051}
21052
21053impl TiersListResponse {
21054    pub fn new() -> Self {
21055        std::default::Default::default()
21056    }
21057
21058    /// Sets the value of [kind][crate::model::TiersListResponse::kind].
21059    ///
21060    /// # Example
21061    /// ```ignore,no_run
21062    /// # use google_cloud_sql_v1::model::TiersListResponse;
21063    /// let x = TiersListResponse::new().set_kind("example");
21064    /// ```
21065    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21066        self.kind = v.into();
21067        self
21068    }
21069
21070    /// Sets the value of [items][crate::model::TiersListResponse::items].
21071    ///
21072    /// # Example
21073    /// ```ignore,no_run
21074    /// # use google_cloud_sql_v1::model::TiersListResponse;
21075    /// use google_cloud_sql_v1::model::Tier;
21076    /// let x = TiersListResponse::new()
21077    ///     .set_items([
21078    ///         Tier::default()/* use setters */,
21079    ///         Tier::default()/* use (different) setters */,
21080    ///     ]);
21081    /// ```
21082    pub fn set_items<T, V>(mut self, v: T) -> Self
21083    where
21084        T: std::iter::IntoIterator<Item = V>,
21085        V: std::convert::Into<crate::model::Tier>,
21086    {
21087        use std::iter::Iterator;
21088        self.items = v.into_iter().map(|i| i.into()).collect();
21089        self
21090    }
21091}
21092
21093impl wkt::message::Message for TiersListResponse {
21094    fn typename() -> &'static str {
21095        "type.googleapis.com/google.cloud.sql.v1.TiersListResponse"
21096    }
21097}
21098
21099/// A Google Cloud SQL service tier resource.
21100#[derive(Clone, Default, PartialEq)]
21101#[non_exhaustive]
21102pub struct Tier {
21103    /// An identifier for the machine type, for example, `db-custom-1-3840`. For
21104    /// related information, see [Pricing](/sql/pricing).
21105    pub tier: std::string::String,
21106
21107    /// The maximum RAM usage of this tier in bytes.
21108    pub ram: i64,
21109
21110    /// This is always `sql#tier`.
21111    pub kind: std::string::String,
21112
21113    /// The maximum disk size of this tier in bytes.
21114    pub disk_quota: i64,
21115
21116    /// The applicable regions for this tier.
21117    pub region: std::vec::Vec<std::string::String>,
21118
21119    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21120}
21121
21122impl Tier {
21123    pub fn new() -> Self {
21124        std::default::Default::default()
21125    }
21126
21127    /// Sets the value of [tier][crate::model::Tier::tier].
21128    ///
21129    /// # Example
21130    /// ```ignore,no_run
21131    /// # use google_cloud_sql_v1::model::Tier;
21132    /// let x = Tier::new().set_tier("example");
21133    /// ```
21134    pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21135        self.tier = v.into();
21136        self
21137    }
21138
21139    /// Sets the value of [ram][crate::model::Tier::ram].
21140    ///
21141    /// # Example
21142    /// ```ignore,no_run
21143    /// # use google_cloud_sql_v1::model::Tier;
21144    /// let x = Tier::new().set_ram(42);
21145    /// ```
21146    pub fn set_ram<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21147        self.ram = v.into();
21148        self
21149    }
21150
21151    /// Sets the value of [kind][crate::model::Tier::kind].
21152    ///
21153    /// # Example
21154    /// ```ignore,no_run
21155    /// # use google_cloud_sql_v1::model::Tier;
21156    /// let x = Tier::new().set_kind("example");
21157    /// ```
21158    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21159        self.kind = v.into();
21160        self
21161    }
21162
21163    /// Sets the value of [disk_quota][crate::model::Tier::disk_quota].
21164    ///
21165    /// # Example
21166    /// ```ignore,no_run
21167    /// # use google_cloud_sql_v1::model::Tier;
21168    /// let x = Tier::new().set_disk_quota(42);
21169    /// ```
21170    pub fn set_disk_quota<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
21171        self.disk_quota = v.into();
21172        self
21173    }
21174
21175    /// Sets the value of [region][crate::model::Tier::region].
21176    ///
21177    /// # Example
21178    /// ```ignore,no_run
21179    /// # use google_cloud_sql_v1::model::Tier;
21180    /// let x = Tier::new().set_region(["a", "b", "c"]);
21181    /// ```
21182    pub fn set_region<T, V>(mut self, v: T) -> Self
21183    where
21184        T: std::iter::IntoIterator<Item = V>,
21185        V: std::convert::Into<std::string::String>,
21186    {
21187        use std::iter::Iterator;
21188        self.region = v.into_iter().map(|i| i.into()).collect();
21189        self
21190    }
21191}
21192
21193impl wkt::message::Message for Tier {
21194    fn typename() -> &'static str {
21195        "type.googleapis.com/google.cloud.sql.v1.Tier"
21196    }
21197}
21198
21199#[derive(Clone, Default, PartialEq)]
21200#[non_exhaustive]
21201pub struct SqlUsersDeleteRequest {
21202    /// Host of the user in the instance.
21203    pub host: std::string::String,
21204
21205    /// Database instance ID. This does not include the project ID.
21206    pub instance: std::string::String,
21207
21208    /// Name of the user in the instance.
21209    pub name: std::string::String,
21210
21211    /// Project ID of the project that contains the instance.
21212    pub project: std::string::String,
21213
21214    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21215}
21216
21217impl SqlUsersDeleteRequest {
21218    pub fn new() -> Self {
21219        std::default::Default::default()
21220    }
21221
21222    /// Sets the value of [host][crate::model::SqlUsersDeleteRequest::host].
21223    ///
21224    /// # Example
21225    /// ```ignore,no_run
21226    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
21227    /// let x = SqlUsersDeleteRequest::new().set_host("example");
21228    /// ```
21229    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21230        self.host = v.into();
21231        self
21232    }
21233
21234    /// Sets the value of [instance][crate::model::SqlUsersDeleteRequest::instance].
21235    ///
21236    /// # Example
21237    /// ```ignore,no_run
21238    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
21239    /// let x = SqlUsersDeleteRequest::new().set_instance("example");
21240    /// ```
21241    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21242        self.instance = v.into();
21243        self
21244    }
21245
21246    /// Sets the value of [name][crate::model::SqlUsersDeleteRequest::name].
21247    ///
21248    /// # Example
21249    /// ```ignore,no_run
21250    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
21251    /// let x = SqlUsersDeleteRequest::new().set_name("example");
21252    /// ```
21253    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21254        self.name = v.into();
21255        self
21256    }
21257
21258    /// Sets the value of [project][crate::model::SqlUsersDeleteRequest::project].
21259    ///
21260    /// # Example
21261    /// ```ignore,no_run
21262    /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
21263    /// let x = SqlUsersDeleteRequest::new().set_project("example");
21264    /// ```
21265    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21266        self.project = v.into();
21267        self
21268    }
21269}
21270
21271impl wkt::message::Message for SqlUsersDeleteRequest {
21272    fn typename() -> &'static str {
21273        "type.googleapis.com/google.cloud.sql.v1.SqlUsersDeleteRequest"
21274    }
21275}
21276
21277/// Request message for Users Get RPC
21278#[derive(Clone, Default, PartialEq)]
21279#[non_exhaustive]
21280pub struct SqlUsersGetRequest {
21281    /// Database instance ID. This does not include the project ID.
21282    pub instance: std::string::String,
21283
21284    /// User of the instance.
21285    pub name: std::string::String,
21286
21287    /// Project ID of the project that contains the instance.
21288    pub project: std::string::String,
21289
21290    /// Host of a user of the instance.
21291    pub host: std::string::String,
21292
21293    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21294}
21295
21296impl SqlUsersGetRequest {
21297    pub fn new() -> Self {
21298        std::default::Default::default()
21299    }
21300
21301    /// Sets the value of [instance][crate::model::SqlUsersGetRequest::instance].
21302    ///
21303    /// # Example
21304    /// ```ignore,no_run
21305    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
21306    /// let x = SqlUsersGetRequest::new().set_instance("example");
21307    /// ```
21308    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21309        self.instance = v.into();
21310        self
21311    }
21312
21313    /// Sets the value of [name][crate::model::SqlUsersGetRequest::name].
21314    ///
21315    /// # Example
21316    /// ```ignore,no_run
21317    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
21318    /// let x = SqlUsersGetRequest::new().set_name("example");
21319    /// ```
21320    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21321        self.name = v.into();
21322        self
21323    }
21324
21325    /// Sets the value of [project][crate::model::SqlUsersGetRequest::project].
21326    ///
21327    /// # Example
21328    /// ```ignore,no_run
21329    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
21330    /// let x = SqlUsersGetRequest::new().set_project("example");
21331    /// ```
21332    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21333        self.project = v.into();
21334        self
21335    }
21336
21337    /// Sets the value of [host][crate::model::SqlUsersGetRequest::host].
21338    ///
21339    /// # Example
21340    /// ```ignore,no_run
21341    /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
21342    /// let x = SqlUsersGetRequest::new().set_host("example");
21343    /// ```
21344    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21345        self.host = v.into();
21346        self
21347    }
21348}
21349
21350impl wkt::message::Message for SqlUsersGetRequest {
21351    fn typename() -> &'static str {
21352        "type.googleapis.com/google.cloud.sql.v1.SqlUsersGetRequest"
21353    }
21354}
21355
21356#[derive(Clone, Default, PartialEq)]
21357#[non_exhaustive]
21358pub struct SqlUsersInsertRequest {
21359    /// Database instance ID. This does not include the project ID.
21360    pub instance: std::string::String,
21361
21362    /// Project ID of the project that contains the instance.
21363    pub project: std::string::String,
21364
21365    pub body: std::option::Option<crate::model::User>,
21366
21367    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21368}
21369
21370impl SqlUsersInsertRequest {
21371    pub fn new() -> Self {
21372        std::default::Default::default()
21373    }
21374
21375    /// Sets the value of [instance][crate::model::SqlUsersInsertRequest::instance].
21376    ///
21377    /// # Example
21378    /// ```ignore,no_run
21379    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
21380    /// let x = SqlUsersInsertRequest::new().set_instance("example");
21381    /// ```
21382    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21383        self.instance = v.into();
21384        self
21385    }
21386
21387    /// Sets the value of [project][crate::model::SqlUsersInsertRequest::project].
21388    ///
21389    /// # Example
21390    /// ```ignore,no_run
21391    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
21392    /// let x = SqlUsersInsertRequest::new().set_project("example");
21393    /// ```
21394    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21395        self.project = v.into();
21396        self
21397    }
21398
21399    /// Sets the value of [body][crate::model::SqlUsersInsertRequest::body].
21400    ///
21401    /// # Example
21402    /// ```ignore,no_run
21403    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
21404    /// use google_cloud_sql_v1::model::User;
21405    /// let x = SqlUsersInsertRequest::new().set_body(User::default()/* use setters */);
21406    /// ```
21407    pub fn set_body<T>(mut self, v: T) -> Self
21408    where
21409        T: std::convert::Into<crate::model::User>,
21410    {
21411        self.body = std::option::Option::Some(v.into());
21412        self
21413    }
21414
21415    /// Sets or clears the value of [body][crate::model::SqlUsersInsertRequest::body].
21416    ///
21417    /// # Example
21418    /// ```ignore,no_run
21419    /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
21420    /// use google_cloud_sql_v1::model::User;
21421    /// let x = SqlUsersInsertRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
21422    /// let x = SqlUsersInsertRequest::new().set_or_clear_body(None::<User>);
21423    /// ```
21424    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
21425    where
21426        T: std::convert::Into<crate::model::User>,
21427    {
21428        self.body = v.map(|x| x.into());
21429        self
21430    }
21431}
21432
21433impl wkt::message::Message for SqlUsersInsertRequest {
21434    fn typename() -> &'static str {
21435        "type.googleapis.com/google.cloud.sql.v1.SqlUsersInsertRequest"
21436    }
21437}
21438
21439#[derive(Clone, Default, PartialEq)]
21440#[non_exhaustive]
21441pub struct SqlUsersListRequest {
21442    /// Database instance ID. This does not include the project ID.
21443    pub instance: std::string::String,
21444
21445    /// Project ID of the project that contains the instance.
21446    pub project: std::string::String,
21447
21448    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21449}
21450
21451impl SqlUsersListRequest {
21452    pub fn new() -> Self {
21453        std::default::Default::default()
21454    }
21455
21456    /// Sets the value of [instance][crate::model::SqlUsersListRequest::instance].
21457    ///
21458    /// # Example
21459    /// ```ignore,no_run
21460    /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
21461    /// let x = SqlUsersListRequest::new().set_instance("example");
21462    /// ```
21463    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21464        self.instance = v.into();
21465        self
21466    }
21467
21468    /// Sets the value of [project][crate::model::SqlUsersListRequest::project].
21469    ///
21470    /// # Example
21471    /// ```ignore,no_run
21472    /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
21473    /// let x = SqlUsersListRequest::new().set_project("example");
21474    /// ```
21475    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21476        self.project = v.into();
21477        self
21478    }
21479}
21480
21481impl wkt::message::Message for SqlUsersListRequest {
21482    fn typename() -> &'static str {
21483        "type.googleapis.com/google.cloud.sql.v1.SqlUsersListRequest"
21484    }
21485}
21486
21487#[derive(Clone, Default, PartialEq)]
21488#[non_exhaustive]
21489pub struct SqlUsersUpdateRequest {
21490    /// Optional. Host of the user in the instance.
21491    pub host: std::string::String,
21492
21493    /// Database instance ID. This does not include the project ID.
21494    pub instance: std::string::String,
21495
21496    /// Name of the user in the instance.
21497    pub name: std::string::String,
21498
21499    /// Project ID of the project that contains the instance.
21500    pub project: std::string::String,
21501
21502    pub body: std::option::Option<crate::model::User>,
21503
21504    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21505}
21506
21507impl SqlUsersUpdateRequest {
21508    pub fn new() -> Self {
21509        std::default::Default::default()
21510    }
21511
21512    /// Sets the value of [host][crate::model::SqlUsersUpdateRequest::host].
21513    ///
21514    /// # Example
21515    /// ```ignore,no_run
21516    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
21517    /// let x = SqlUsersUpdateRequest::new().set_host("example");
21518    /// ```
21519    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21520        self.host = v.into();
21521        self
21522    }
21523
21524    /// Sets the value of [instance][crate::model::SqlUsersUpdateRequest::instance].
21525    ///
21526    /// # Example
21527    /// ```ignore,no_run
21528    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
21529    /// let x = SqlUsersUpdateRequest::new().set_instance("example");
21530    /// ```
21531    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21532        self.instance = v.into();
21533        self
21534    }
21535
21536    /// Sets the value of [name][crate::model::SqlUsersUpdateRequest::name].
21537    ///
21538    /// # Example
21539    /// ```ignore,no_run
21540    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
21541    /// let x = SqlUsersUpdateRequest::new().set_name("example");
21542    /// ```
21543    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21544        self.name = v.into();
21545        self
21546    }
21547
21548    /// Sets the value of [project][crate::model::SqlUsersUpdateRequest::project].
21549    ///
21550    /// # Example
21551    /// ```ignore,no_run
21552    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
21553    /// let x = SqlUsersUpdateRequest::new().set_project("example");
21554    /// ```
21555    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21556        self.project = v.into();
21557        self
21558    }
21559
21560    /// Sets the value of [body][crate::model::SqlUsersUpdateRequest::body].
21561    ///
21562    /// # Example
21563    /// ```ignore,no_run
21564    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
21565    /// use google_cloud_sql_v1::model::User;
21566    /// let x = SqlUsersUpdateRequest::new().set_body(User::default()/* use setters */);
21567    /// ```
21568    pub fn set_body<T>(mut self, v: T) -> Self
21569    where
21570        T: std::convert::Into<crate::model::User>,
21571    {
21572        self.body = std::option::Option::Some(v.into());
21573        self
21574    }
21575
21576    /// Sets or clears the value of [body][crate::model::SqlUsersUpdateRequest::body].
21577    ///
21578    /// # Example
21579    /// ```ignore,no_run
21580    /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
21581    /// use google_cloud_sql_v1::model::User;
21582    /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
21583    /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(None::<User>);
21584    /// ```
21585    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
21586    where
21587        T: std::convert::Into<crate::model::User>,
21588    {
21589        self.body = v.map(|x| x.into());
21590        self
21591    }
21592}
21593
21594impl wkt::message::Message for SqlUsersUpdateRequest {
21595    fn typename() -> &'static str {
21596        "type.googleapis.com/google.cloud.sql.v1.SqlUsersUpdateRequest"
21597    }
21598}
21599
21600/// User level password validation policy.
21601#[derive(Clone, Default, PartialEq)]
21602#[non_exhaustive]
21603pub struct UserPasswordValidationPolicy {
21604    /// Number of failed login attempts allowed before user get locked.
21605    pub allowed_failed_attempts: i32,
21606
21607    /// Expiration duration after password is updated.
21608    pub password_expiration_duration: std::option::Option<wkt::Duration>,
21609
21610    /// If true, failed login attempts check will be enabled.
21611    pub enable_failed_attempts_check: bool,
21612
21613    /// Output only. Read-only password status.
21614    pub status: std::option::Option<crate::model::PasswordStatus>,
21615
21616    /// If true, the user must specify the current password before changing the
21617    /// password. This flag is supported only for MySQL.
21618    pub enable_password_verification: bool,
21619
21620    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21621}
21622
21623impl UserPasswordValidationPolicy {
21624    pub fn new() -> Self {
21625        std::default::Default::default()
21626    }
21627
21628    /// Sets the value of [allowed_failed_attempts][crate::model::UserPasswordValidationPolicy::allowed_failed_attempts].
21629    ///
21630    /// # Example
21631    /// ```ignore,no_run
21632    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
21633    /// let x = UserPasswordValidationPolicy::new().set_allowed_failed_attempts(42);
21634    /// ```
21635    pub fn set_allowed_failed_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
21636        self.allowed_failed_attempts = v.into();
21637        self
21638    }
21639
21640    /// Sets the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
21641    ///
21642    /// # Example
21643    /// ```ignore,no_run
21644    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
21645    /// use wkt::Duration;
21646    /// let x = UserPasswordValidationPolicy::new().set_password_expiration_duration(Duration::default()/* use setters */);
21647    /// ```
21648    pub fn set_password_expiration_duration<T>(mut self, v: T) -> Self
21649    where
21650        T: std::convert::Into<wkt::Duration>,
21651    {
21652        self.password_expiration_duration = std::option::Option::Some(v.into());
21653        self
21654    }
21655
21656    /// Sets or clears the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
21657    ///
21658    /// # Example
21659    /// ```ignore,no_run
21660    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
21661    /// use wkt::Duration;
21662    /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(Some(Duration::default()/* use setters */));
21663    /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(None::<Duration>);
21664    /// ```
21665    pub fn set_or_clear_password_expiration_duration<T>(mut self, v: std::option::Option<T>) -> Self
21666    where
21667        T: std::convert::Into<wkt::Duration>,
21668    {
21669        self.password_expiration_duration = v.map(|x| x.into());
21670        self
21671    }
21672
21673    /// Sets the value of [enable_failed_attempts_check][crate::model::UserPasswordValidationPolicy::enable_failed_attempts_check].
21674    ///
21675    /// # Example
21676    /// ```ignore,no_run
21677    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
21678    /// let x = UserPasswordValidationPolicy::new().set_enable_failed_attempts_check(true);
21679    /// ```
21680    pub fn set_enable_failed_attempts_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
21681        self.enable_failed_attempts_check = v.into();
21682        self
21683    }
21684
21685    /// Sets the value of [status][crate::model::UserPasswordValidationPolicy::status].
21686    ///
21687    /// # Example
21688    /// ```ignore,no_run
21689    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
21690    /// use google_cloud_sql_v1::model::PasswordStatus;
21691    /// let x = UserPasswordValidationPolicy::new().set_status(PasswordStatus::default()/* use setters */);
21692    /// ```
21693    pub fn set_status<T>(mut self, v: T) -> Self
21694    where
21695        T: std::convert::Into<crate::model::PasswordStatus>,
21696    {
21697        self.status = std::option::Option::Some(v.into());
21698        self
21699    }
21700
21701    /// Sets or clears the value of [status][crate::model::UserPasswordValidationPolicy::status].
21702    ///
21703    /// # Example
21704    /// ```ignore,no_run
21705    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
21706    /// use google_cloud_sql_v1::model::PasswordStatus;
21707    /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(Some(PasswordStatus::default()/* use setters */));
21708    /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(None::<PasswordStatus>);
21709    /// ```
21710    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
21711    where
21712        T: std::convert::Into<crate::model::PasswordStatus>,
21713    {
21714        self.status = v.map(|x| x.into());
21715        self
21716    }
21717
21718    /// Sets the value of [enable_password_verification][crate::model::UserPasswordValidationPolicy::enable_password_verification].
21719    ///
21720    /// # Example
21721    /// ```ignore,no_run
21722    /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
21723    /// let x = UserPasswordValidationPolicy::new().set_enable_password_verification(true);
21724    /// ```
21725    pub fn set_enable_password_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
21726        self.enable_password_verification = v.into();
21727        self
21728    }
21729}
21730
21731impl wkt::message::Message for UserPasswordValidationPolicy {
21732    fn typename() -> &'static str {
21733        "type.googleapis.com/google.cloud.sql.v1.UserPasswordValidationPolicy"
21734    }
21735}
21736
21737/// Read-only password status.
21738#[derive(Clone, Default, PartialEq)]
21739#[non_exhaustive]
21740pub struct PasswordStatus {
21741    /// If true, user does not have login privileges.
21742    pub locked: bool,
21743
21744    /// The expiration time of the current password.
21745    pub password_expiration_time: std::option::Option<wkt::Timestamp>,
21746
21747    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21748}
21749
21750impl PasswordStatus {
21751    pub fn new() -> Self {
21752        std::default::Default::default()
21753    }
21754
21755    /// Sets the value of [locked][crate::model::PasswordStatus::locked].
21756    ///
21757    /// # Example
21758    /// ```ignore,no_run
21759    /// # use google_cloud_sql_v1::model::PasswordStatus;
21760    /// let x = PasswordStatus::new().set_locked(true);
21761    /// ```
21762    pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
21763        self.locked = v.into();
21764        self
21765    }
21766
21767    /// Sets the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
21768    ///
21769    /// # Example
21770    /// ```ignore,no_run
21771    /// # use google_cloud_sql_v1::model::PasswordStatus;
21772    /// use wkt::Timestamp;
21773    /// let x = PasswordStatus::new().set_password_expiration_time(Timestamp::default()/* use setters */);
21774    /// ```
21775    pub fn set_password_expiration_time<T>(mut self, v: T) -> Self
21776    where
21777        T: std::convert::Into<wkt::Timestamp>,
21778    {
21779        self.password_expiration_time = std::option::Option::Some(v.into());
21780        self
21781    }
21782
21783    /// Sets or clears the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
21784    ///
21785    /// # Example
21786    /// ```ignore,no_run
21787    /// # use google_cloud_sql_v1::model::PasswordStatus;
21788    /// use wkt::Timestamp;
21789    /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(Some(Timestamp::default()/* use setters */));
21790    /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(None::<Timestamp>);
21791    /// ```
21792    pub fn set_or_clear_password_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
21793    where
21794        T: std::convert::Into<wkt::Timestamp>,
21795    {
21796        self.password_expiration_time = v.map(|x| x.into());
21797        self
21798    }
21799}
21800
21801impl wkt::message::Message for PasswordStatus {
21802    fn typename() -> &'static str {
21803        "type.googleapis.com/google.cloud.sql.v1.PasswordStatus"
21804    }
21805}
21806
21807/// A Cloud SQL user resource.
21808#[derive(Clone, Default, PartialEq)]
21809#[non_exhaustive]
21810pub struct User {
21811    /// This is always `sql#user`.
21812    pub kind: std::string::String,
21813
21814    /// The password for the user.
21815    pub password: std::string::String,
21816
21817    /// This field is deprecated and will be removed from a future version of the
21818    /// API.
21819    pub etag: std::string::String,
21820
21821    /// The name of the user in the Cloud SQL instance. Can be omitted for
21822    /// `update` because it is already specified in the URL.
21823    pub name: std::string::String,
21824
21825    /// Optional. The host from which the user can connect. For `insert`
21826    /// operations, host defaults to an empty string. For `update`
21827    /// operations, host is specified as part of the request URL. The host name
21828    /// cannot be updated after insertion.  For a MySQL instance, it's required;
21829    /// for a PostgreSQL or SQL Server instance, it's optional.
21830    pub host: std::string::String,
21831
21832    /// The name of the Cloud SQL instance. This does not include the project ID.
21833    /// Can be omitted for `update` because it is already specified on the
21834    /// URL.
21835    pub instance: std::string::String,
21836
21837    /// The project ID of the project containing the Cloud SQL database. The Google
21838    /// apps domain is prefixed if applicable. Can be omitted for `update` because
21839    /// it is already specified on the URL.
21840    pub project: std::string::String,
21841
21842    /// The user type. It determines the method to authenticate the user during
21843    /// login. The default is the database's built-in user type.
21844    pub r#type: crate::model::user::SqlUserType,
21845
21846    /// User level password validation policy.
21847    pub password_policy: std::option::Option<crate::model::UserPasswordValidationPolicy>,
21848
21849    /// Dual password status for the user.
21850    pub dual_password_type: std::option::Option<crate::model::user::DualPasswordType>,
21851
21852    /// User details for specific database type
21853    pub user_details: std::option::Option<crate::model::user::UserDetails>,
21854
21855    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21856}
21857
21858impl User {
21859    pub fn new() -> Self {
21860        std::default::Default::default()
21861    }
21862
21863    /// Sets the value of [kind][crate::model::User::kind].
21864    ///
21865    /// # Example
21866    /// ```ignore,no_run
21867    /// # use google_cloud_sql_v1::model::User;
21868    /// let x = User::new().set_kind("example");
21869    /// ```
21870    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21871        self.kind = v.into();
21872        self
21873    }
21874
21875    /// Sets the value of [password][crate::model::User::password].
21876    ///
21877    /// # Example
21878    /// ```ignore,no_run
21879    /// # use google_cloud_sql_v1::model::User;
21880    /// let x = User::new().set_password("example");
21881    /// ```
21882    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21883        self.password = v.into();
21884        self
21885    }
21886
21887    /// Sets the value of [etag][crate::model::User::etag].
21888    ///
21889    /// # Example
21890    /// ```ignore,no_run
21891    /// # use google_cloud_sql_v1::model::User;
21892    /// let x = User::new().set_etag("example");
21893    /// ```
21894    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21895        self.etag = v.into();
21896        self
21897    }
21898
21899    /// Sets the value of [name][crate::model::User::name].
21900    ///
21901    /// # Example
21902    /// ```ignore,no_run
21903    /// # use google_cloud_sql_v1::model::User;
21904    /// let x = User::new().set_name("example");
21905    /// ```
21906    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21907        self.name = v.into();
21908        self
21909    }
21910
21911    /// Sets the value of [host][crate::model::User::host].
21912    ///
21913    /// # Example
21914    /// ```ignore,no_run
21915    /// # use google_cloud_sql_v1::model::User;
21916    /// let x = User::new().set_host("example");
21917    /// ```
21918    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21919        self.host = v.into();
21920        self
21921    }
21922
21923    /// Sets the value of [instance][crate::model::User::instance].
21924    ///
21925    /// # Example
21926    /// ```ignore,no_run
21927    /// # use google_cloud_sql_v1::model::User;
21928    /// let x = User::new().set_instance("example");
21929    /// ```
21930    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21931        self.instance = v.into();
21932        self
21933    }
21934
21935    /// Sets the value of [project][crate::model::User::project].
21936    ///
21937    /// # Example
21938    /// ```ignore,no_run
21939    /// # use google_cloud_sql_v1::model::User;
21940    /// let x = User::new().set_project("example");
21941    /// ```
21942    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21943        self.project = v.into();
21944        self
21945    }
21946
21947    /// Sets the value of [r#type][crate::model::User::type].
21948    ///
21949    /// # Example
21950    /// ```ignore,no_run
21951    /// # use google_cloud_sql_v1::model::User;
21952    /// use google_cloud_sql_v1::model::user::SqlUserType;
21953    /// let x0 = User::new().set_type(SqlUserType::CloudIamUser);
21954    /// let x1 = User::new().set_type(SqlUserType::CloudIamServiceAccount);
21955    /// let x2 = User::new().set_type(SqlUserType::CloudIamGroup);
21956    /// ```
21957    pub fn set_type<T: std::convert::Into<crate::model::user::SqlUserType>>(
21958        mut self,
21959        v: T,
21960    ) -> Self {
21961        self.r#type = v.into();
21962        self
21963    }
21964
21965    /// Sets the value of [password_policy][crate::model::User::password_policy].
21966    ///
21967    /// # Example
21968    /// ```ignore,no_run
21969    /// # use google_cloud_sql_v1::model::User;
21970    /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
21971    /// let x = User::new().set_password_policy(UserPasswordValidationPolicy::default()/* use setters */);
21972    /// ```
21973    pub fn set_password_policy<T>(mut self, v: T) -> Self
21974    where
21975        T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
21976    {
21977        self.password_policy = std::option::Option::Some(v.into());
21978        self
21979    }
21980
21981    /// Sets or clears the value of [password_policy][crate::model::User::password_policy].
21982    ///
21983    /// # Example
21984    /// ```ignore,no_run
21985    /// # use google_cloud_sql_v1::model::User;
21986    /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
21987    /// let x = User::new().set_or_clear_password_policy(Some(UserPasswordValidationPolicy::default()/* use setters */));
21988    /// let x = User::new().set_or_clear_password_policy(None::<UserPasswordValidationPolicy>);
21989    /// ```
21990    pub fn set_or_clear_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
21991    where
21992        T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
21993    {
21994        self.password_policy = v.map(|x| x.into());
21995        self
21996    }
21997
21998    /// Sets the value of [dual_password_type][crate::model::User::dual_password_type].
21999    ///
22000    /// # Example
22001    /// ```ignore,no_run
22002    /// # use google_cloud_sql_v1::model::User;
22003    /// use google_cloud_sql_v1::model::user::DualPasswordType;
22004    /// let x0 = User::new().set_dual_password_type(DualPasswordType::NoModifyDualPassword);
22005    /// let x1 = User::new().set_dual_password_type(DualPasswordType::NoDualPassword);
22006    /// let x2 = User::new().set_dual_password_type(DualPasswordType::DualPassword);
22007    /// ```
22008    pub fn set_dual_password_type<T>(mut self, v: T) -> Self
22009    where
22010        T: std::convert::Into<crate::model::user::DualPasswordType>,
22011    {
22012        self.dual_password_type = std::option::Option::Some(v.into());
22013        self
22014    }
22015
22016    /// Sets or clears the value of [dual_password_type][crate::model::User::dual_password_type].
22017    ///
22018    /// # Example
22019    /// ```ignore,no_run
22020    /// # use google_cloud_sql_v1::model::User;
22021    /// use google_cloud_sql_v1::model::user::DualPasswordType;
22022    /// let x0 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoModifyDualPassword));
22023    /// let x1 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoDualPassword));
22024    /// let x2 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::DualPassword));
22025    /// let x_none = User::new().set_or_clear_dual_password_type(None::<DualPasswordType>);
22026    /// ```
22027    pub fn set_or_clear_dual_password_type<T>(mut self, v: std::option::Option<T>) -> Self
22028    where
22029        T: std::convert::Into<crate::model::user::DualPasswordType>,
22030    {
22031        self.dual_password_type = v.map(|x| x.into());
22032        self
22033    }
22034
22035    /// Sets the value of [user_details][crate::model::User::user_details].
22036    ///
22037    /// Note that all the setters affecting `user_details` are mutually
22038    /// exclusive.
22039    ///
22040    /// # Example
22041    /// ```ignore,no_run
22042    /// # use google_cloud_sql_v1::model::User;
22043    /// use google_cloud_sql_v1::model::SqlServerUserDetails;
22044    /// let x = User::new().set_user_details(Some(
22045    ///     google_cloud_sql_v1::model::user::UserDetails::SqlserverUserDetails(SqlServerUserDetails::default().into())));
22046    /// ```
22047    pub fn set_user_details<
22048        T: std::convert::Into<std::option::Option<crate::model::user::UserDetails>>,
22049    >(
22050        mut self,
22051        v: T,
22052    ) -> Self {
22053        self.user_details = v.into();
22054        self
22055    }
22056
22057    /// The value of [user_details][crate::model::User::user_details]
22058    /// if it holds a `SqlserverUserDetails`, `None` if the field is not set or
22059    /// holds a different branch.
22060    pub fn sqlserver_user_details(
22061        &self,
22062    ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerUserDetails>> {
22063        #[allow(unreachable_patterns)]
22064        self.user_details.as_ref().and_then(|v| match v {
22065            crate::model::user::UserDetails::SqlserverUserDetails(v) => {
22066                std::option::Option::Some(v)
22067            }
22068            _ => std::option::Option::None,
22069        })
22070    }
22071
22072    /// Sets the value of [user_details][crate::model::User::user_details]
22073    /// to hold a `SqlserverUserDetails`.
22074    ///
22075    /// Note that all the setters affecting `user_details` are
22076    /// mutually exclusive.
22077    ///
22078    /// # Example
22079    /// ```ignore,no_run
22080    /// # use google_cloud_sql_v1::model::User;
22081    /// use google_cloud_sql_v1::model::SqlServerUserDetails;
22082    /// let x = User::new().set_sqlserver_user_details(SqlServerUserDetails::default()/* use setters */);
22083    /// assert!(x.sqlserver_user_details().is_some());
22084    /// ```
22085    pub fn set_sqlserver_user_details<
22086        T: std::convert::Into<std::boxed::Box<crate::model::SqlServerUserDetails>>,
22087    >(
22088        mut self,
22089        v: T,
22090    ) -> Self {
22091        self.user_details = std::option::Option::Some(
22092            crate::model::user::UserDetails::SqlserverUserDetails(v.into()),
22093        );
22094        self
22095    }
22096}
22097
22098impl wkt::message::Message for User {
22099    fn typename() -> &'static str {
22100        "type.googleapis.com/google.cloud.sql.v1.User"
22101    }
22102}
22103
22104/// Defines additional types related to [User].
22105pub mod user {
22106    #[allow(unused_imports)]
22107    use super::*;
22108
22109    /// The user type.
22110    ///
22111    /// # Working with unknown values
22112    ///
22113    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22114    /// additional enum variants at any time. Adding new variants is not considered
22115    /// a breaking change. Applications should write their code in anticipation of:
22116    ///
22117    /// - New values appearing in future releases of the client library, **and**
22118    /// - New values received dynamically, without application changes.
22119    ///
22120    /// Please consult the [Working with enums] section in the user guide for some
22121    /// guidelines.
22122    ///
22123    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22124    #[derive(Clone, Debug, PartialEq)]
22125    #[non_exhaustive]
22126    pub enum SqlUserType {
22127        /// The database's built-in user type.
22128        BuiltIn,
22129        /// Cloud IAM user.
22130        CloudIamUser,
22131        /// Cloud IAM service account.
22132        CloudIamServiceAccount,
22133        /// Cloud IAM group non-login user.
22134        CloudIamGroup,
22135        /// Cloud IAM group login user.
22136        CloudIamGroupUser,
22137        /// Cloud IAM group login service account.
22138        CloudIamGroupServiceAccount,
22139        /// If set, the enum was initialized with an unknown value.
22140        ///
22141        /// Applications can examine the value using [SqlUserType::value] or
22142        /// [SqlUserType::name].
22143        UnknownValue(sql_user_type::UnknownValue),
22144    }
22145
22146    #[doc(hidden)]
22147    pub mod sql_user_type {
22148        #[allow(unused_imports)]
22149        use super::*;
22150        #[derive(Clone, Debug, PartialEq)]
22151        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22152    }
22153
22154    impl SqlUserType {
22155        /// Gets the enum value.
22156        ///
22157        /// Returns `None` if the enum contains an unknown value deserialized from
22158        /// the string representation of enums.
22159        pub fn value(&self) -> std::option::Option<i32> {
22160            match self {
22161                Self::BuiltIn => std::option::Option::Some(0),
22162                Self::CloudIamUser => std::option::Option::Some(1),
22163                Self::CloudIamServiceAccount => std::option::Option::Some(2),
22164                Self::CloudIamGroup => std::option::Option::Some(3),
22165                Self::CloudIamGroupUser => std::option::Option::Some(4),
22166                Self::CloudIamGroupServiceAccount => std::option::Option::Some(5),
22167                Self::UnknownValue(u) => u.0.value(),
22168            }
22169        }
22170
22171        /// Gets the enum value as a string.
22172        ///
22173        /// Returns `None` if the enum contains an unknown value deserialized from
22174        /// the integer representation of enums.
22175        pub fn name(&self) -> std::option::Option<&str> {
22176            match self {
22177                Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
22178                Self::CloudIamUser => std::option::Option::Some("CLOUD_IAM_USER"),
22179                Self::CloudIamServiceAccount => {
22180                    std::option::Option::Some("CLOUD_IAM_SERVICE_ACCOUNT")
22181                }
22182                Self::CloudIamGroup => std::option::Option::Some("CLOUD_IAM_GROUP"),
22183                Self::CloudIamGroupUser => std::option::Option::Some("CLOUD_IAM_GROUP_USER"),
22184                Self::CloudIamGroupServiceAccount => {
22185                    std::option::Option::Some("CLOUD_IAM_GROUP_SERVICE_ACCOUNT")
22186                }
22187                Self::UnknownValue(u) => u.0.name(),
22188            }
22189        }
22190    }
22191
22192    impl std::default::Default for SqlUserType {
22193        fn default() -> Self {
22194            use std::convert::From;
22195            Self::from(0)
22196        }
22197    }
22198
22199    impl std::fmt::Display for SqlUserType {
22200        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22201            wkt::internal::display_enum(f, self.name(), self.value())
22202        }
22203    }
22204
22205    impl std::convert::From<i32> for SqlUserType {
22206        fn from(value: i32) -> Self {
22207            match value {
22208                0 => Self::BuiltIn,
22209                1 => Self::CloudIamUser,
22210                2 => Self::CloudIamServiceAccount,
22211                3 => Self::CloudIamGroup,
22212                4 => Self::CloudIamGroupUser,
22213                5 => Self::CloudIamGroupServiceAccount,
22214                _ => Self::UnknownValue(sql_user_type::UnknownValue(
22215                    wkt::internal::UnknownEnumValue::Integer(value),
22216                )),
22217            }
22218        }
22219    }
22220
22221    impl std::convert::From<&str> for SqlUserType {
22222        fn from(value: &str) -> Self {
22223            use std::string::ToString;
22224            match value {
22225                "BUILT_IN" => Self::BuiltIn,
22226                "CLOUD_IAM_USER" => Self::CloudIamUser,
22227                "CLOUD_IAM_SERVICE_ACCOUNT" => Self::CloudIamServiceAccount,
22228                "CLOUD_IAM_GROUP" => Self::CloudIamGroup,
22229                "CLOUD_IAM_GROUP_USER" => Self::CloudIamGroupUser,
22230                "CLOUD_IAM_GROUP_SERVICE_ACCOUNT" => Self::CloudIamGroupServiceAccount,
22231                _ => Self::UnknownValue(sql_user_type::UnknownValue(
22232                    wkt::internal::UnknownEnumValue::String(value.to_string()),
22233                )),
22234            }
22235        }
22236    }
22237
22238    impl serde::ser::Serialize for SqlUserType {
22239        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22240        where
22241            S: serde::Serializer,
22242        {
22243            match self {
22244                Self::BuiltIn => serializer.serialize_i32(0),
22245                Self::CloudIamUser => serializer.serialize_i32(1),
22246                Self::CloudIamServiceAccount => serializer.serialize_i32(2),
22247                Self::CloudIamGroup => serializer.serialize_i32(3),
22248                Self::CloudIamGroupUser => serializer.serialize_i32(4),
22249                Self::CloudIamGroupServiceAccount => serializer.serialize_i32(5),
22250                Self::UnknownValue(u) => u.0.serialize(serializer),
22251            }
22252        }
22253    }
22254
22255    impl<'de> serde::de::Deserialize<'de> for SqlUserType {
22256        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22257        where
22258            D: serde::Deserializer<'de>,
22259        {
22260            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUserType>::new(
22261                ".google.cloud.sql.v1.User.SqlUserType",
22262            ))
22263        }
22264    }
22265
22266    /// The type of retained password.
22267    ///
22268    /// # Working with unknown values
22269    ///
22270    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22271    /// additional enum variants at any time. Adding new variants is not considered
22272    /// a breaking change. Applications should write their code in anticipation of:
22273    ///
22274    /// - New values appearing in future releases of the client library, **and**
22275    /// - New values received dynamically, without application changes.
22276    ///
22277    /// Please consult the [Working with enums] section in the user guide for some
22278    /// guidelines.
22279    ///
22280    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22281    #[derive(Clone, Debug, PartialEq)]
22282    #[non_exhaustive]
22283    pub enum DualPasswordType {
22284        /// The default value.
22285        Unspecified,
22286        /// Do not update the user's dual password status.
22287        NoModifyDualPassword,
22288        /// No dual password usable for connecting using this user.
22289        NoDualPassword,
22290        /// Dual password usable for connecting using this user.
22291        DualPassword,
22292        /// If set, the enum was initialized with an unknown value.
22293        ///
22294        /// Applications can examine the value using [DualPasswordType::value] or
22295        /// [DualPasswordType::name].
22296        UnknownValue(dual_password_type::UnknownValue),
22297    }
22298
22299    #[doc(hidden)]
22300    pub mod dual_password_type {
22301        #[allow(unused_imports)]
22302        use super::*;
22303        #[derive(Clone, Debug, PartialEq)]
22304        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22305    }
22306
22307    impl DualPasswordType {
22308        /// Gets the enum value.
22309        ///
22310        /// Returns `None` if the enum contains an unknown value deserialized from
22311        /// the string representation of enums.
22312        pub fn value(&self) -> std::option::Option<i32> {
22313            match self {
22314                Self::Unspecified => std::option::Option::Some(0),
22315                Self::NoModifyDualPassword => std::option::Option::Some(1),
22316                Self::NoDualPassword => std::option::Option::Some(2),
22317                Self::DualPassword => std::option::Option::Some(3),
22318                Self::UnknownValue(u) => u.0.value(),
22319            }
22320        }
22321
22322        /// Gets the enum value as a string.
22323        ///
22324        /// Returns `None` if the enum contains an unknown value deserialized from
22325        /// the integer representation of enums.
22326        pub fn name(&self) -> std::option::Option<&str> {
22327            match self {
22328                Self::Unspecified => std::option::Option::Some("DUAL_PASSWORD_TYPE_UNSPECIFIED"),
22329                Self::NoModifyDualPassword => std::option::Option::Some("NO_MODIFY_DUAL_PASSWORD"),
22330                Self::NoDualPassword => std::option::Option::Some("NO_DUAL_PASSWORD"),
22331                Self::DualPassword => std::option::Option::Some("DUAL_PASSWORD"),
22332                Self::UnknownValue(u) => u.0.name(),
22333            }
22334        }
22335    }
22336
22337    impl std::default::Default for DualPasswordType {
22338        fn default() -> Self {
22339            use std::convert::From;
22340            Self::from(0)
22341        }
22342    }
22343
22344    impl std::fmt::Display for DualPasswordType {
22345        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22346            wkt::internal::display_enum(f, self.name(), self.value())
22347        }
22348    }
22349
22350    impl std::convert::From<i32> for DualPasswordType {
22351        fn from(value: i32) -> Self {
22352            match value {
22353                0 => Self::Unspecified,
22354                1 => Self::NoModifyDualPassword,
22355                2 => Self::NoDualPassword,
22356                3 => Self::DualPassword,
22357                _ => Self::UnknownValue(dual_password_type::UnknownValue(
22358                    wkt::internal::UnknownEnumValue::Integer(value),
22359                )),
22360            }
22361        }
22362    }
22363
22364    impl std::convert::From<&str> for DualPasswordType {
22365        fn from(value: &str) -> Self {
22366            use std::string::ToString;
22367            match value {
22368                "DUAL_PASSWORD_TYPE_UNSPECIFIED" => Self::Unspecified,
22369                "NO_MODIFY_DUAL_PASSWORD" => Self::NoModifyDualPassword,
22370                "NO_DUAL_PASSWORD" => Self::NoDualPassword,
22371                "DUAL_PASSWORD" => Self::DualPassword,
22372                _ => Self::UnknownValue(dual_password_type::UnknownValue(
22373                    wkt::internal::UnknownEnumValue::String(value.to_string()),
22374                )),
22375            }
22376        }
22377    }
22378
22379    impl serde::ser::Serialize for DualPasswordType {
22380        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22381        where
22382            S: serde::Serializer,
22383        {
22384            match self {
22385                Self::Unspecified => serializer.serialize_i32(0),
22386                Self::NoModifyDualPassword => serializer.serialize_i32(1),
22387                Self::NoDualPassword => serializer.serialize_i32(2),
22388                Self::DualPassword => serializer.serialize_i32(3),
22389                Self::UnknownValue(u) => u.0.serialize(serializer),
22390            }
22391        }
22392    }
22393
22394    impl<'de> serde::de::Deserialize<'de> for DualPasswordType {
22395        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22396        where
22397            D: serde::Deserializer<'de>,
22398        {
22399            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DualPasswordType>::new(
22400                ".google.cloud.sql.v1.User.DualPasswordType",
22401            ))
22402        }
22403    }
22404
22405    /// User details for specific database type
22406    #[derive(Clone, Debug, PartialEq)]
22407    #[non_exhaustive]
22408    pub enum UserDetails {
22409        SqlserverUserDetails(std::boxed::Box<crate::model::SqlServerUserDetails>),
22410    }
22411}
22412
22413/// Represents a Sql Server user on the Cloud SQL instance.
22414#[derive(Clone, Default, PartialEq)]
22415#[non_exhaustive]
22416pub struct SqlServerUserDetails {
22417    /// If the user has been disabled
22418    pub disabled: bool,
22419
22420    /// The server roles for this user
22421    pub server_roles: std::vec::Vec<std::string::String>,
22422
22423    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22424}
22425
22426impl SqlServerUserDetails {
22427    pub fn new() -> Self {
22428        std::default::Default::default()
22429    }
22430
22431    /// Sets the value of [disabled][crate::model::SqlServerUserDetails::disabled].
22432    ///
22433    /// # Example
22434    /// ```ignore,no_run
22435    /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
22436    /// let x = SqlServerUserDetails::new().set_disabled(true);
22437    /// ```
22438    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22439        self.disabled = v.into();
22440        self
22441    }
22442
22443    /// Sets the value of [server_roles][crate::model::SqlServerUserDetails::server_roles].
22444    ///
22445    /// # Example
22446    /// ```ignore,no_run
22447    /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
22448    /// let x = SqlServerUserDetails::new().set_server_roles(["a", "b", "c"]);
22449    /// ```
22450    pub fn set_server_roles<T, V>(mut self, v: T) -> Self
22451    where
22452        T: std::iter::IntoIterator<Item = V>,
22453        V: std::convert::Into<std::string::String>,
22454    {
22455        use std::iter::Iterator;
22456        self.server_roles = v.into_iter().map(|i| i.into()).collect();
22457        self
22458    }
22459}
22460
22461impl wkt::message::Message for SqlServerUserDetails {
22462    fn typename() -> &'static str {
22463        "type.googleapis.com/google.cloud.sql.v1.SqlServerUserDetails"
22464    }
22465}
22466
22467/// User list response.
22468#[derive(Clone, Default, PartialEq)]
22469#[non_exhaustive]
22470pub struct UsersListResponse {
22471    /// This is always `sql#usersList`.
22472    pub kind: std::string::String,
22473
22474    /// List of user resources in the instance.
22475    pub items: std::vec::Vec<crate::model::User>,
22476
22477    /// Unused.
22478    #[deprecated]
22479    pub next_page_token: std::string::String,
22480
22481    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22482}
22483
22484impl UsersListResponse {
22485    pub fn new() -> Self {
22486        std::default::Default::default()
22487    }
22488
22489    /// Sets the value of [kind][crate::model::UsersListResponse::kind].
22490    ///
22491    /// # Example
22492    /// ```ignore,no_run
22493    /// # use google_cloud_sql_v1::model::UsersListResponse;
22494    /// let x = UsersListResponse::new().set_kind("example");
22495    /// ```
22496    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22497        self.kind = v.into();
22498        self
22499    }
22500
22501    /// Sets the value of [items][crate::model::UsersListResponse::items].
22502    ///
22503    /// # Example
22504    /// ```ignore,no_run
22505    /// # use google_cloud_sql_v1::model::UsersListResponse;
22506    /// use google_cloud_sql_v1::model::User;
22507    /// let x = UsersListResponse::new()
22508    ///     .set_items([
22509    ///         User::default()/* use setters */,
22510    ///         User::default()/* use (different) setters */,
22511    ///     ]);
22512    /// ```
22513    pub fn set_items<T, V>(mut self, v: T) -> Self
22514    where
22515        T: std::iter::IntoIterator<Item = V>,
22516        V: std::convert::Into<crate::model::User>,
22517    {
22518        use std::iter::Iterator;
22519        self.items = v.into_iter().map(|i| i.into()).collect();
22520        self
22521    }
22522
22523    /// Sets the value of [next_page_token][crate::model::UsersListResponse::next_page_token].
22524    ///
22525    /// # Example
22526    /// ```ignore,no_run
22527    /// # use google_cloud_sql_v1::model::UsersListResponse;
22528    /// let x = UsersListResponse::new().set_next_page_token("example");
22529    /// ```
22530    #[deprecated]
22531    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22532        self.next_page_token = v.into();
22533        self
22534    }
22535}
22536
22537impl wkt::message::Message for UsersListResponse {
22538    fn typename() -> &'static str {
22539        "type.googleapis.com/google.cloud.sql.v1.UsersListResponse"
22540    }
22541}
22542
22543/// The status of a backup run.
22544///
22545/// # Working with unknown values
22546///
22547/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22548/// additional enum variants at any time. Adding new variants is not considered
22549/// a breaking change. Applications should write their code in anticipation of:
22550///
22551/// - New values appearing in future releases of the client library, **and**
22552/// - New values received dynamically, without application changes.
22553///
22554/// Please consult the [Working with enums] section in the user guide for some
22555/// guidelines.
22556///
22557/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22558#[derive(Clone, Debug, PartialEq)]
22559#[non_exhaustive]
22560pub enum SqlBackupRunStatus {
22561    /// The status of the run is unknown.
22562    Unspecified,
22563    /// The backup operation was enqueued.
22564    Enqueued,
22565    /// The backup is overdue across a given backup window. Indicates a
22566    /// problem. Example: Long-running operation in progress during
22567    /// the whole window.
22568    Overdue,
22569    /// The backup is in progress.
22570    Running,
22571    /// The backup failed.
22572    Failed,
22573    /// The backup was successful.
22574    Successful,
22575    /// The backup was skipped (without problems) for a given backup
22576    /// window. Example: Instance was idle.
22577    Skipped,
22578    /// The backup is about to be deleted.
22579    DeletionPending,
22580    /// The backup deletion failed.
22581    DeletionFailed,
22582    /// The backup has been deleted.
22583    Deleted,
22584    /// If set, the enum was initialized with an unknown value.
22585    ///
22586    /// Applications can examine the value using [SqlBackupRunStatus::value] or
22587    /// [SqlBackupRunStatus::name].
22588    UnknownValue(sql_backup_run_status::UnknownValue),
22589}
22590
22591#[doc(hidden)]
22592pub mod sql_backup_run_status {
22593    #[allow(unused_imports)]
22594    use super::*;
22595    #[derive(Clone, Debug, PartialEq)]
22596    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22597}
22598
22599impl SqlBackupRunStatus {
22600    /// Gets the enum value.
22601    ///
22602    /// Returns `None` if the enum contains an unknown value deserialized from
22603    /// the string representation of enums.
22604    pub fn value(&self) -> std::option::Option<i32> {
22605        match self {
22606            Self::Unspecified => std::option::Option::Some(0),
22607            Self::Enqueued => std::option::Option::Some(1),
22608            Self::Overdue => std::option::Option::Some(2),
22609            Self::Running => std::option::Option::Some(3),
22610            Self::Failed => std::option::Option::Some(4),
22611            Self::Successful => std::option::Option::Some(5),
22612            Self::Skipped => std::option::Option::Some(6),
22613            Self::DeletionPending => std::option::Option::Some(7),
22614            Self::DeletionFailed => std::option::Option::Some(8),
22615            Self::Deleted => std::option::Option::Some(9),
22616            Self::UnknownValue(u) => u.0.value(),
22617        }
22618    }
22619
22620    /// Gets the enum value as a string.
22621    ///
22622    /// Returns `None` if the enum contains an unknown value deserialized from
22623    /// the integer representation of enums.
22624    pub fn name(&self) -> std::option::Option<&str> {
22625        match self {
22626            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_STATUS_UNSPECIFIED"),
22627            Self::Enqueued => std::option::Option::Some("ENQUEUED"),
22628            Self::Overdue => std::option::Option::Some("OVERDUE"),
22629            Self::Running => std::option::Option::Some("RUNNING"),
22630            Self::Failed => std::option::Option::Some("FAILED"),
22631            Self::Successful => std::option::Option::Some("SUCCESSFUL"),
22632            Self::Skipped => std::option::Option::Some("SKIPPED"),
22633            Self::DeletionPending => std::option::Option::Some("DELETION_PENDING"),
22634            Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
22635            Self::Deleted => std::option::Option::Some("DELETED"),
22636            Self::UnknownValue(u) => u.0.name(),
22637        }
22638    }
22639}
22640
22641impl std::default::Default for SqlBackupRunStatus {
22642    fn default() -> Self {
22643        use std::convert::From;
22644        Self::from(0)
22645    }
22646}
22647
22648impl std::fmt::Display for SqlBackupRunStatus {
22649    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22650        wkt::internal::display_enum(f, self.name(), self.value())
22651    }
22652}
22653
22654impl std::convert::From<i32> for SqlBackupRunStatus {
22655    fn from(value: i32) -> Self {
22656        match value {
22657            0 => Self::Unspecified,
22658            1 => Self::Enqueued,
22659            2 => Self::Overdue,
22660            3 => Self::Running,
22661            4 => Self::Failed,
22662            5 => Self::Successful,
22663            6 => Self::Skipped,
22664            7 => Self::DeletionPending,
22665            8 => Self::DeletionFailed,
22666            9 => Self::Deleted,
22667            _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
22668                wkt::internal::UnknownEnumValue::Integer(value),
22669            )),
22670        }
22671    }
22672}
22673
22674impl std::convert::From<&str> for SqlBackupRunStatus {
22675    fn from(value: &str) -> Self {
22676        use std::string::ToString;
22677        match value {
22678            "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" => Self::Unspecified,
22679            "ENQUEUED" => Self::Enqueued,
22680            "OVERDUE" => Self::Overdue,
22681            "RUNNING" => Self::Running,
22682            "FAILED" => Self::Failed,
22683            "SUCCESSFUL" => Self::Successful,
22684            "SKIPPED" => Self::Skipped,
22685            "DELETION_PENDING" => Self::DeletionPending,
22686            "DELETION_FAILED" => Self::DeletionFailed,
22687            "DELETED" => Self::Deleted,
22688            _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
22689                wkt::internal::UnknownEnumValue::String(value.to_string()),
22690            )),
22691        }
22692    }
22693}
22694
22695impl serde::ser::Serialize for SqlBackupRunStatus {
22696    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22697    where
22698        S: serde::Serializer,
22699    {
22700        match self {
22701            Self::Unspecified => serializer.serialize_i32(0),
22702            Self::Enqueued => serializer.serialize_i32(1),
22703            Self::Overdue => serializer.serialize_i32(2),
22704            Self::Running => serializer.serialize_i32(3),
22705            Self::Failed => serializer.serialize_i32(4),
22706            Self::Successful => serializer.serialize_i32(5),
22707            Self::Skipped => serializer.serialize_i32(6),
22708            Self::DeletionPending => serializer.serialize_i32(7),
22709            Self::DeletionFailed => serializer.serialize_i32(8),
22710            Self::Deleted => serializer.serialize_i32(9),
22711            Self::UnknownValue(u) => u.0.serialize(serializer),
22712        }
22713    }
22714}
22715
22716impl<'de> serde::de::Deserialize<'de> for SqlBackupRunStatus {
22717    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22718    where
22719        D: serde::Deserializer<'de>,
22720    {
22721        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunStatus>::new(
22722            ".google.cloud.sql.v1.SqlBackupRunStatus",
22723        ))
22724    }
22725}
22726
22727/// Defines the supported backup kinds.
22728///
22729/// # Working with unknown values
22730///
22731/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22732/// additional enum variants at any time. Adding new variants is not considered
22733/// a breaking change. Applications should write their code in anticipation of:
22734///
22735/// - New values appearing in future releases of the client library, **and**
22736/// - New values received dynamically, without application changes.
22737///
22738/// Please consult the [Working with enums] section in the user guide for some
22739/// guidelines.
22740///
22741/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22742#[derive(Clone, Debug, PartialEq)]
22743#[non_exhaustive]
22744pub enum SqlBackupKind {
22745    /// This is an unknown BackupKind.
22746    Unspecified,
22747    /// The snapshot based backups
22748    Snapshot,
22749    /// Physical backups
22750    Physical,
22751    /// If set, the enum was initialized with an unknown value.
22752    ///
22753    /// Applications can examine the value using [SqlBackupKind::value] or
22754    /// [SqlBackupKind::name].
22755    UnknownValue(sql_backup_kind::UnknownValue),
22756}
22757
22758#[doc(hidden)]
22759pub mod sql_backup_kind {
22760    #[allow(unused_imports)]
22761    use super::*;
22762    #[derive(Clone, Debug, PartialEq)]
22763    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22764}
22765
22766impl SqlBackupKind {
22767    /// Gets the enum value.
22768    ///
22769    /// Returns `None` if the enum contains an unknown value deserialized from
22770    /// the string representation of enums.
22771    pub fn value(&self) -> std::option::Option<i32> {
22772        match self {
22773            Self::Unspecified => std::option::Option::Some(0),
22774            Self::Snapshot => std::option::Option::Some(1),
22775            Self::Physical => std::option::Option::Some(2),
22776            Self::UnknownValue(u) => u.0.value(),
22777        }
22778    }
22779
22780    /// Gets the enum value as a string.
22781    ///
22782    /// Returns `None` if the enum contains an unknown value deserialized from
22783    /// the integer representation of enums.
22784    pub fn name(&self) -> std::option::Option<&str> {
22785        match self {
22786            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_KIND_UNSPECIFIED"),
22787            Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
22788            Self::Physical => std::option::Option::Some("PHYSICAL"),
22789            Self::UnknownValue(u) => u.0.name(),
22790        }
22791    }
22792}
22793
22794impl std::default::Default for SqlBackupKind {
22795    fn default() -> Self {
22796        use std::convert::From;
22797        Self::from(0)
22798    }
22799}
22800
22801impl std::fmt::Display for SqlBackupKind {
22802    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22803        wkt::internal::display_enum(f, self.name(), self.value())
22804    }
22805}
22806
22807impl std::convert::From<i32> for SqlBackupKind {
22808    fn from(value: i32) -> Self {
22809        match value {
22810            0 => Self::Unspecified,
22811            1 => Self::Snapshot,
22812            2 => Self::Physical,
22813            _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
22814                wkt::internal::UnknownEnumValue::Integer(value),
22815            )),
22816        }
22817    }
22818}
22819
22820impl std::convert::From<&str> for SqlBackupKind {
22821    fn from(value: &str) -> Self {
22822        use std::string::ToString;
22823        match value {
22824            "SQL_BACKUP_KIND_UNSPECIFIED" => Self::Unspecified,
22825            "SNAPSHOT" => Self::Snapshot,
22826            "PHYSICAL" => Self::Physical,
22827            _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
22828                wkt::internal::UnknownEnumValue::String(value.to_string()),
22829            )),
22830        }
22831    }
22832}
22833
22834impl serde::ser::Serialize for SqlBackupKind {
22835    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22836    where
22837        S: serde::Serializer,
22838    {
22839        match self {
22840            Self::Unspecified => serializer.serialize_i32(0),
22841            Self::Snapshot => serializer.serialize_i32(1),
22842            Self::Physical => serializer.serialize_i32(2),
22843            Self::UnknownValue(u) => u.0.serialize(serializer),
22844        }
22845    }
22846}
22847
22848impl<'de> serde::de::Deserialize<'de> for SqlBackupKind {
22849    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22850    where
22851        D: serde::Deserializer<'de>,
22852    {
22853        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupKind>::new(
22854            ".google.cloud.sql.v1.SqlBackupKind",
22855        ))
22856    }
22857}
22858
22859/// Type of backup (i.e. automated, on demand, etc).
22860///
22861/// # Working with unknown values
22862///
22863/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22864/// additional enum variants at any time. Adding new variants is not considered
22865/// a breaking change. Applications should write their code in anticipation of:
22866///
22867/// - New values appearing in future releases of the client library, **and**
22868/// - New values received dynamically, without application changes.
22869///
22870/// Please consult the [Working with enums] section in the user guide for some
22871/// guidelines.
22872///
22873/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22874#[derive(Clone, Debug, PartialEq)]
22875#[non_exhaustive]
22876pub enum SqlBackupRunType {
22877    /// This is an unknown BackupRun type.
22878    Unspecified,
22879    /// The backup schedule automatically triggers a backup.
22880    Automated,
22881    /// The user manually triggers a backup.
22882    OnDemand,
22883    /// If set, the enum was initialized with an unknown value.
22884    ///
22885    /// Applications can examine the value using [SqlBackupRunType::value] or
22886    /// [SqlBackupRunType::name].
22887    UnknownValue(sql_backup_run_type::UnknownValue),
22888}
22889
22890#[doc(hidden)]
22891pub mod sql_backup_run_type {
22892    #[allow(unused_imports)]
22893    use super::*;
22894    #[derive(Clone, Debug, PartialEq)]
22895    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22896}
22897
22898impl SqlBackupRunType {
22899    /// Gets the enum value.
22900    ///
22901    /// Returns `None` if the enum contains an unknown value deserialized from
22902    /// the string representation of enums.
22903    pub fn value(&self) -> std::option::Option<i32> {
22904        match self {
22905            Self::Unspecified => std::option::Option::Some(0),
22906            Self::Automated => std::option::Option::Some(1),
22907            Self::OnDemand => std::option::Option::Some(2),
22908            Self::UnknownValue(u) => u.0.value(),
22909        }
22910    }
22911
22912    /// Gets the enum value as a string.
22913    ///
22914    /// Returns `None` if the enum contains an unknown value deserialized from
22915    /// the integer representation of enums.
22916    pub fn name(&self) -> std::option::Option<&str> {
22917        match self {
22918            Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_TYPE_UNSPECIFIED"),
22919            Self::Automated => std::option::Option::Some("AUTOMATED"),
22920            Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
22921            Self::UnknownValue(u) => u.0.name(),
22922        }
22923    }
22924}
22925
22926impl std::default::Default for SqlBackupRunType {
22927    fn default() -> Self {
22928        use std::convert::From;
22929        Self::from(0)
22930    }
22931}
22932
22933impl std::fmt::Display for SqlBackupRunType {
22934    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22935        wkt::internal::display_enum(f, self.name(), self.value())
22936    }
22937}
22938
22939impl std::convert::From<i32> for SqlBackupRunType {
22940    fn from(value: i32) -> Self {
22941        match value {
22942            0 => Self::Unspecified,
22943            1 => Self::Automated,
22944            2 => Self::OnDemand,
22945            _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
22946                wkt::internal::UnknownEnumValue::Integer(value),
22947            )),
22948        }
22949    }
22950}
22951
22952impl std::convert::From<&str> for SqlBackupRunType {
22953    fn from(value: &str) -> Self {
22954        use std::string::ToString;
22955        match value {
22956            "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" => Self::Unspecified,
22957            "AUTOMATED" => Self::Automated,
22958            "ON_DEMAND" => Self::OnDemand,
22959            _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
22960                wkt::internal::UnknownEnumValue::String(value.to_string()),
22961            )),
22962        }
22963    }
22964}
22965
22966impl serde::ser::Serialize for SqlBackupRunType {
22967    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22968    where
22969        S: serde::Serializer,
22970    {
22971        match self {
22972            Self::Unspecified => serializer.serialize_i32(0),
22973            Self::Automated => serializer.serialize_i32(1),
22974            Self::OnDemand => serializer.serialize_i32(2),
22975            Self::UnknownValue(u) => u.0.serialize(serializer),
22976        }
22977    }
22978}
22979
22980impl<'de> serde::de::Deserialize<'de> for SqlBackupRunType {
22981    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22982    where
22983        D: serde::Deserializer<'de>,
22984    {
22985        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunType>::new(
22986            ".google.cloud.sql.v1.SqlBackupRunType",
22987        ))
22988    }
22989}
22990
22991///
22992/// # Working with unknown values
22993///
22994/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22995/// additional enum variants at any time. Adding new variants is not considered
22996/// a breaking change. Applications should write their code in anticipation of:
22997///
22998/// - New values appearing in future releases of the client library, **and**
22999/// - New values received dynamically, without application changes.
23000///
23001/// Please consult the [Working with enums] section in the user guide for some
23002/// guidelines.
23003///
23004/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23005#[derive(Clone, Debug, PartialEq)]
23006#[non_exhaustive]
23007pub enum SqlFlagType {
23008    /// This is an unknown flag type.
23009    Unspecified,
23010    /// Boolean type flag.
23011    Boolean,
23012    /// String type flag.
23013    String,
23014    /// Integer type flag.
23015    Integer,
23016    /// Flag type used for a server startup option.
23017    None,
23018    /// Type introduced specially for MySQL TimeZone offset. Accept a string value
23019    /// with the format [-12:59, 13:00].
23020    MysqlTimezoneOffset,
23021    /// Float type flag.
23022    Float,
23023    /// Comma-separated list of the strings in a SqlFlagType enum.
23024    RepeatedString,
23025    /// If set, the enum was initialized with an unknown value.
23026    ///
23027    /// Applications can examine the value using [SqlFlagType::value] or
23028    /// [SqlFlagType::name].
23029    UnknownValue(sql_flag_type::UnknownValue),
23030}
23031
23032#[doc(hidden)]
23033pub mod sql_flag_type {
23034    #[allow(unused_imports)]
23035    use super::*;
23036    #[derive(Clone, Debug, PartialEq)]
23037    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23038}
23039
23040impl SqlFlagType {
23041    /// Gets the enum value.
23042    ///
23043    /// Returns `None` if the enum contains an unknown value deserialized from
23044    /// the string representation of enums.
23045    pub fn value(&self) -> std::option::Option<i32> {
23046        match self {
23047            Self::Unspecified => std::option::Option::Some(0),
23048            Self::Boolean => std::option::Option::Some(1),
23049            Self::String => std::option::Option::Some(2),
23050            Self::Integer => std::option::Option::Some(3),
23051            Self::None => std::option::Option::Some(4),
23052            Self::MysqlTimezoneOffset => std::option::Option::Some(5),
23053            Self::Float => std::option::Option::Some(6),
23054            Self::RepeatedString => std::option::Option::Some(7),
23055            Self::UnknownValue(u) => u.0.value(),
23056        }
23057    }
23058
23059    /// Gets the enum value as a string.
23060    ///
23061    /// Returns `None` if the enum contains an unknown value deserialized from
23062    /// the integer representation of enums.
23063    pub fn name(&self) -> std::option::Option<&str> {
23064        match self {
23065            Self::Unspecified => std::option::Option::Some("SQL_FLAG_TYPE_UNSPECIFIED"),
23066            Self::Boolean => std::option::Option::Some("BOOLEAN"),
23067            Self::String => std::option::Option::Some("STRING"),
23068            Self::Integer => std::option::Option::Some("INTEGER"),
23069            Self::None => std::option::Option::Some("NONE"),
23070            Self::MysqlTimezoneOffset => std::option::Option::Some("MYSQL_TIMEZONE_OFFSET"),
23071            Self::Float => std::option::Option::Some("FLOAT"),
23072            Self::RepeatedString => std::option::Option::Some("REPEATED_STRING"),
23073            Self::UnknownValue(u) => u.0.name(),
23074        }
23075    }
23076}
23077
23078impl std::default::Default for SqlFlagType {
23079    fn default() -> Self {
23080        use std::convert::From;
23081        Self::from(0)
23082    }
23083}
23084
23085impl std::fmt::Display for SqlFlagType {
23086    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23087        wkt::internal::display_enum(f, self.name(), self.value())
23088    }
23089}
23090
23091impl std::convert::From<i32> for SqlFlagType {
23092    fn from(value: i32) -> Self {
23093        match value {
23094            0 => Self::Unspecified,
23095            1 => Self::Boolean,
23096            2 => Self::String,
23097            3 => Self::Integer,
23098            4 => Self::None,
23099            5 => Self::MysqlTimezoneOffset,
23100            6 => Self::Float,
23101            7 => Self::RepeatedString,
23102            _ => Self::UnknownValue(sql_flag_type::UnknownValue(
23103                wkt::internal::UnknownEnumValue::Integer(value),
23104            )),
23105        }
23106    }
23107}
23108
23109impl std::convert::From<&str> for SqlFlagType {
23110    fn from(value: &str) -> Self {
23111        use std::string::ToString;
23112        match value {
23113            "SQL_FLAG_TYPE_UNSPECIFIED" => Self::Unspecified,
23114            "BOOLEAN" => Self::Boolean,
23115            "STRING" => Self::String,
23116            "INTEGER" => Self::Integer,
23117            "NONE" => Self::None,
23118            "MYSQL_TIMEZONE_OFFSET" => Self::MysqlTimezoneOffset,
23119            "FLOAT" => Self::Float,
23120            "REPEATED_STRING" => Self::RepeatedString,
23121            _ => Self::UnknownValue(sql_flag_type::UnknownValue(
23122                wkt::internal::UnknownEnumValue::String(value.to_string()),
23123            )),
23124        }
23125    }
23126}
23127
23128impl serde::ser::Serialize for SqlFlagType {
23129    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23130    where
23131        S: serde::Serializer,
23132    {
23133        match self {
23134            Self::Unspecified => serializer.serialize_i32(0),
23135            Self::Boolean => serializer.serialize_i32(1),
23136            Self::String => serializer.serialize_i32(2),
23137            Self::Integer => serializer.serialize_i32(3),
23138            Self::None => serializer.serialize_i32(4),
23139            Self::MysqlTimezoneOffset => serializer.serialize_i32(5),
23140            Self::Float => serializer.serialize_i32(6),
23141            Self::RepeatedString => serializer.serialize_i32(7),
23142            Self::UnknownValue(u) => u.0.serialize(serializer),
23143        }
23144    }
23145}
23146
23147impl<'de> serde::de::Deserialize<'de> for SqlFlagType {
23148    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23149    where
23150        D: serde::Deserializer<'de>,
23151    {
23152        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagType>::new(
23153            ".google.cloud.sql.v1.SqlFlagType",
23154        ))
23155    }
23156}
23157
23158/// External Sync parallel level.
23159///
23160/// # Working with unknown values
23161///
23162/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23163/// additional enum variants at any time. Adding new variants is not considered
23164/// a breaking change. Applications should write their code in anticipation of:
23165///
23166/// - New values appearing in future releases of the client library, **and**
23167/// - New values received dynamically, without application changes.
23168///
23169/// Please consult the [Working with enums] section in the user guide for some
23170/// guidelines.
23171///
23172/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23173#[derive(Clone, Debug, PartialEq)]
23174#[non_exhaustive]
23175pub enum ExternalSyncParallelLevel {
23176    /// Unknown sync parallel level. Will be defaulted to OPTIMAL.
23177    Unspecified,
23178    /// Minimal parallel level.
23179    Min,
23180    /// Optimal parallel level.
23181    Optimal,
23182    /// Maximum parallel level.
23183    Max,
23184    /// If set, the enum was initialized with an unknown value.
23185    ///
23186    /// Applications can examine the value using [ExternalSyncParallelLevel::value] or
23187    /// [ExternalSyncParallelLevel::name].
23188    UnknownValue(external_sync_parallel_level::UnknownValue),
23189}
23190
23191#[doc(hidden)]
23192pub mod external_sync_parallel_level {
23193    #[allow(unused_imports)]
23194    use super::*;
23195    #[derive(Clone, Debug, PartialEq)]
23196    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23197}
23198
23199impl ExternalSyncParallelLevel {
23200    /// Gets the enum value.
23201    ///
23202    /// Returns `None` if the enum contains an unknown value deserialized from
23203    /// the string representation of enums.
23204    pub fn value(&self) -> std::option::Option<i32> {
23205        match self {
23206            Self::Unspecified => std::option::Option::Some(0),
23207            Self::Min => std::option::Option::Some(1),
23208            Self::Optimal => std::option::Option::Some(2),
23209            Self::Max => std::option::Option::Some(3),
23210            Self::UnknownValue(u) => u.0.value(),
23211        }
23212    }
23213
23214    /// Gets the enum value as a string.
23215    ///
23216    /// Returns `None` if the enum contains an unknown value deserialized from
23217    /// the integer representation of enums.
23218    pub fn name(&self) -> std::option::Option<&str> {
23219        match self {
23220            Self::Unspecified => {
23221                std::option::Option::Some("EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED")
23222            }
23223            Self::Min => std::option::Option::Some("MIN"),
23224            Self::Optimal => std::option::Option::Some("OPTIMAL"),
23225            Self::Max => std::option::Option::Some("MAX"),
23226            Self::UnknownValue(u) => u.0.name(),
23227        }
23228    }
23229}
23230
23231impl std::default::Default for ExternalSyncParallelLevel {
23232    fn default() -> Self {
23233        use std::convert::From;
23234        Self::from(0)
23235    }
23236}
23237
23238impl std::fmt::Display for ExternalSyncParallelLevel {
23239    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23240        wkt::internal::display_enum(f, self.name(), self.value())
23241    }
23242}
23243
23244impl std::convert::From<i32> for ExternalSyncParallelLevel {
23245    fn from(value: i32) -> Self {
23246        match value {
23247            0 => Self::Unspecified,
23248            1 => Self::Min,
23249            2 => Self::Optimal,
23250            3 => Self::Max,
23251            _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
23252                wkt::internal::UnknownEnumValue::Integer(value),
23253            )),
23254        }
23255    }
23256}
23257
23258impl std::convert::From<&str> for ExternalSyncParallelLevel {
23259    fn from(value: &str) -> Self {
23260        use std::string::ToString;
23261        match value {
23262            "EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
23263            "MIN" => Self::Min,
23264            "OPTIMAL" => Self::Optimal,
23265            "MAX" => Self::Max,
23266            _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
23267                wkt::internal::UnknownEnumValue::String(value.to_string()),
23268            )),
23269        }
23270    }
23271}
23272
23273impl serde::ser::Serialize for ExternalSyncParallelLevel {
23274    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23275    where
23276        S: serde::Serializer,
23277    {
23278        match self {
23279            Self::Unspecified => serializer.serialize_i32(0),
23280            Self::Min => serializer.serialize_i32(1),
23281            Self::Optimal => serializer.serialize_i32(2),
23282            Self::Max => serializer.serialize_i32(3),
23283            Self::UnknownValue(u) => u.0.serialize(serializer),
23284        }
23285    }
23286}
23287
23288impl<'de> serde::de::Deserialize<'de> for ExternalSyncParallelLevel {
23289    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23290    where
23291        D: serde::Deserializer<'de>,
23292    {
23293        deserializer.deserialize_any(
23294            wkt::internal::EnumVisitor::<ExternalSyncParallelLevel>::new(
23295                ".google.cloud.sql.v1.ExternalSyncParallelLevel",
23296            ),
23297        )
23298    }
23299}
23300
23301///
23302/// # Working with unknown values
23303///
23304/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23305/// additional enum variants at any time. Adding new variants is not considered
23306/// a breaking change. Applications should write their code in anticipation of:
23307///
23308/// - New values appearing in future releases of the client library, **and**
23309/// - New values received dynamically, without application changes.
23310///
23311/// Please consult the [Working with enums] section in the user guide for some
23312/// guidelines.
23313///
23314/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23315#[derive(Clone, Debug, PartialEq)]
23316#[non_exhaustive]
23317pub enum SqlInstanceType {
23318    /// This is an unknown Cloud SQL instance type.
23319    Unspecified,
23320    /// A regular Cloud SQL instance that is not replicating from a primary
23321    /// instance.
23322    CloudSqlInstance,
23323    /// An instance running on the customer's premises that is not managed by
23324    /// Cloud SQL.
23325    OnPremisesInstance,
23326    /// A Cloud SQL instance acting as a read-replica.
23327    ReadReplicaInstance,
23328    /// If set, the enum was initialized with an unknown value.
23329    ///
23330    /// Applications can examine the value using [SqlInstanceType::value] or
23331    /// [SqlInstanceType::name].
23332    UnknownValue(sql_instance_type::UnknownValue),
23333}
23334
23335#[doc(hidden)]
23336pub mod sql_instance_type {
23337    #[allow(unused_imports)]
23338    use super::*;
23339    #[derive(Clone, Debug, PartialEq)]
23340    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23341}
23342
23343impl SqlInstanceType {
23344    /// Gets the enum value.
23345    ///
23346    /// Returns `None` if the enum contains an unknown value deserialized from
23347    /// the string representation of enums.
23348    pub fn value(&self) -> std::option::Option<i32> {
23349        match self {
23350            Self::Unspecified => std::option::Option::Some(0),
23351            Self::CloudSqlInstance => std::option::Option::Some(1),
23352            Self::OnPremisesInstance => std::option::Option::Some(2),
23353            Self::ReadReplicaInstance => std::option::Option::Some(3),
23354            Self::UnknownValue(u) => u.0.value(),
23355        }
23356    }
23357
23358    /// Gets the enum value as a string.
23359    ///
23360    /// Returns `None` if the enum contains an unknown value deserialized from
23361    /// the integer representation of enums.
23362    pub fn name(&self) -> std::option::Option<&str> {
23363        match self {
23364            Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_TYPE_UNSPECIFIED"),
23365            Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
23366            Self::OnPremisesInstance => std::option::Option::Some("ON_PREMISES_INSTANCE"),
23367            Self::ReadReplicaInstance => std::option::Option::Some("READ_REPLICA_INSTANCE"),
23368            Self::UnknownValue(u) => u.0.name(),
23369        }
23370    }
23371}
23372
23373impl std::default::Default for SqlInstanceType {
23374    fn default() -> Self {
23375        use std::convert::From;
23376        Self::from(0)
23377    }
23378}
23379
23380impl std::fmt::Display for SqlInstanceType {
23381    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23382        wkt::internal::display_enum(f, self.name(), self.value())
23383    }
23384}
23385
23386impl std::convert::From<i32> for SqlInstanceType {
23387    fn from(value: i32) -> Self {
23388        match value {
23389            0 => Self::Unspecified,
23390            1 => Self::CloudSqlInstance,
23391            2 => Self::OnPremisesInstance,
23392            3 => Self::ReadReplicaInstance,
23393            _ => Self::UnknownValue(sql_instance_type::UnknownValue(
23394                wkt::internal::UnknownEnumValue::Integer(value),
23395            )),
23396        }
23397    }
23398}
23399
23400impl std::convert::From<&str> for SqlInstanceType {
23401    fn from(value: &str) -> Self {
23402        use std::string::ToString;
23403        match value {
23404            "SQL_INSTANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
23405            "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
23406            "ON_PREMISES_INSTANCE" => Self::OnPremisesInstance,
23407            "READ_REPLICA_INSTANCE" => Self::ReadReplicaInstance,
23408            _ => Self::UnknownValue(sql_instance_type::UnknownValue(
23409                wkt::internal::UnknownEnumValue::String(value.to_string()),
23410            )),
23411        }
23412    }
23413}
23414
23415impl serde::ser::Serialize for SqlInstanceType {
23416    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23417    where
23418        S: serde::Serializer,
23419    {
23420        match self {
23421            Self::Unspecified => serializer.serialize_i32(0),
23422            Self::CloudSqlInstance => serializer.serialize_i32(1),
23423            Self::OnPremisesInstance => serializer.serialize_i32(2),
23424            Self::ReadReplicaInstance => serializer.serialize_i32(3),
23425            Self::UnknownValue(u) => u.0.serialize(serializer),
23426        }
23427    }
23428}
23429
23430impl<'de> serde::de::Deserialize<'de> for SqlInstanceType {
23431    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23432    where
23433        D: serde::Deserializer<'de>,
23434    {
23435        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceType>::new(
23436            ".google.cloud.sql.v1.SqlInstanceType",
23437        ))
23438    }
23439}
23440
23441/// The suspension reason of the database instance if the state is SUSPENDED.
23442///
23443/// # Working with unknown values
23444///
23445/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23446/// additional enum variants at any time. Adding new variants is not considered
23447/// a breaking change. Applications should write their code in anticipation of:
23448///
23449/// - New values appearing in future releases of the client library, **and**
23450/// - New values received dynamically, without application changes.
23451///
23452/// Please consult the [Working with enums] section in the user guide for some
23453/// guidelines.
23454///
23455/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23456#[derive(Clone, Debug, PartialEq)]
23457#[non_exhaustive]
23458pub enum SqlSuspensionReason {
23459    /// This is an unknown suspension reason.
23460    Unspecified,
23461    /// The instance is suspended due to billing issues (for example:, GCP account
23462    /// issue)
23463    BillingIssue,
23464    /// The instance is suspended due to illegal content (for example:, child
23465    /// pornography, copyrighted material, etc.).
23466    LegalIssue,
23467    /// The instance is causing operational issues (for example:, causing the
23468    /// database to crash).
23469    OperationalIssue,
23470    /// The KMS key used by the instance is either revoked or denied access to
23471    KmsKeyIssue,
23472    /// If set, the enum was initialized with an unknown value.
23473    ///
23474    /// Applications can examine the value using [SqlSuspensionReason::value] or
23475    /// [SqlSuspensionReason::name].
23476    UnknownValue(sql_suspension_reason::UnknownValue),
23477}
23478
23479#[doc(hidden)]
23480pub mod sql_suspension_reason {
23481    #[allow(unused_imports)]
23482    use super::*;
23483    #[derive(Clone, Debug, PartialEq)]
23484    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23485}
23486
23487impl SqlSuspensionReason {
23488    /// Gets the enum value.
23489    ///
23490    /// Returns `None` if the enum contains an unknown value deserialized from
23491    /// the string representation of enums.
23492    pub fn value(&self) -> std::option::Option<i32> {
23493        match self {
23494            Self::Unspecified => std::option::Option::Some(0),
23495            Self::BillingIssue => std::option::Option::Some(2),
23496            Self::LegalIssue => std::option::Option::Some(3),
23497            Self::OperationalIssue => std::option::Option::Some(4),
23498            Self::KmsKeyIssue => std::option::Option::Some(5),
23499            Self::UnknownValue(u) => u.0.value(),
23500        }
23501    }
23502
23503    /// Gets the enum value as a string.
23504    ///
23505    /// Returns `None` if the enum contains an unknown value deserialized from
23506    /// the integer representation of enums.
23507    pub fn name(&self) -> std::option::Option<&str> {
23508        match self {
23509            Self::Unspecified => std::option::Option::Some("SQL_SUSPENSION_REASON_UNSPECIFIED"),
23510            Self::BillingIssue => std::option::Option::Some("BILLING_ISSUE"),
23511            Self::LegalIssue => std::option::Option::Some("LEGAL_ISSUE"),
23512            Self::OperationalIssue => std::option::Option::Some("OPERATIONAL_ISSUE"),
23513            Self::KmsKeyIssue => std::option::Option::Some("KMS_KEY_ISSUE"),
23514            Self::UnknownValue(u) => u.0.name(),
23515        }
23516    }
23517}
23518
23519impl std::default::Default for SqlSuspensionReason {
23520    fn default() -> Self {
23521        use std::convert::From;
23522        Self::from(0)
23523    }
23524}
23525
23526impl std::fmt::Display for SqlSuspensionReason {
23527    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23528        wkt::internal::display_enum(f, self.name(), self.value())
23529    }
23530}
23531
23532impl std::convert::From<i32> for SqlSuspensionReason {
23533    fn from(value: i32) -> Self {
23534        match value {
23535            0 => Self::Unspecified,
23536            2 => Self::BillingIssue,
23537            3 => Self::LegalIssue,
23538            4 => Self::OperationalIssue,
23539            5 => Self::KmsKeyIssue,
23540            _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
23541                wkt::internal::UnknownEnumValue::Integer(value),
23542            )),
23543        }
23544    }
23545}
23546
23547impl std::convert::From<&str> for SqlSuspensionReason {
23548    fn from(value: &str) -> Self {
23549        use std::string::ToString;
23550        match value {
23551            "SQL_SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
23552            "BILLING_ISSUE" => Self::BillingIssue,
23553            "LEGAL_ISSUE" => Self::LegalIssue,
23554            "OPERATIONAL_ISSUE" => Self::OperationalIssue,
23555            "KMS_KEY_ISSUE" => Self::KmsKeyIssue,
23556            _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
23557                wkt::internal::UnknownEnumValue::String(value.to_string()),
23558            )),
23559        }
23560    }
23561}
23562
23563impl serde::ser::Serialize for SqlSuspensionReason {
23564    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23565    where
23566        S: serde::Serializer,
23567    {
23568        match self {
23569            Self::Unspecified => serializer.serialize_i32(0),
23570            Self::BillingIssue => serializer.serialize_i32(2),
23571            Self::LegalIssue => serializer.serialize_i32(3),
23572            Self::OperationalIssue => serializer.serialize_i32(4),
23573            Self::KmsKeyIssue => serializer.serialize_i32(5),
23574            Self::UnknownValue(u) => u.0.serialize(serializer),
23575        }
23576    }
23577}
23578
23579impl<'de> serde::de::Deserialize<'de> for SqlSuspensionReason {
23580    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23581    where
23582        D: serde::Deserializer<'de>,
23583    {
23584        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlSuspensionReason>::new(
23585            ".google.cloud.sql.v1.SqlSuspensionReason",
23586        ))
23587    }
23588}
23589
23590///
23591/// # Working with unknown values
23592///
23593/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23594/// additional enum variants at any time. Adding new variants is not considered
23595/// a breaking change. Applications should write their code in anticipation of:
23596///
23597/// - New values appearing in future releases of the client library, **and**
23598/// - New values received dynamically, without application changes.
23599///
23600/// Please consult the [Working with enums] section in the user guide for some
23601/// guidelines.
23602///
23603/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23604#[derive(Clone, Debug, PartialEq)]
23605#[non_exhaustive]
23606pub enum SqlFileType {
23607    /// Unknown file type.
23608    Unspecified,
23609    /// File containing SQL statements.
23610    Sql,
23611    /// File in CSV format.
23612    Csv,
23613    Bak,
23614    /// If set, the enum was initialized with an unknown value.
23615    ///
23616    /// Applications can examine the value using [SqlFileType::value] or
23617    /// [SqlFileType::name].
23618    UnknownValue(sql_file_type::UnknownValue),
23619}
23620
23621#[doc(hidden)]
23622pub mod sql_file_type {
23623    #[allow(unused_imports)]
23624    use super::*;
23625    #[derive(Clone, Debug, PartialEq)]
23626    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23627}
23628
23629impl SqlFileType {
23630    /// Gets the enum value.
23631    ///
23632    /// Returns `None` if the enum contains an unknown value deserialized from
23633    /// the string representation of enums.
23634    pub fn value(&self) -> std::option::Option<i32> {
23635        match self {
23636            Self::Unspecified => std::option::Option::Some(0),
23637            Self::Sql => std::option::Option::Some(1),
23638            Self::Csv => std::option::Option::Some(2),
23639            Self::Bak => std::option::Option::Some(4),
23640            Self::UnknownValue(u) => u.0.value(),
23641        }
23642    }
23643
23644    /// Gets the enum value as a string.
23645    ///
23646    /// Returns `None` if the enum contains an unknown value deserialized from
23647    /// the integer representation of enums.
23648    pub fn name(&self) -> std::option::Option<&str> {
23649        match self {
23650            Self::Unspecified => std::option::Option::Some("SQL_FILE_TYPE_UNSPECIFIED"),
23651            Self::Sql => std::option::Option::Some("SQL"),
23652            Self::Csv => std::option::Option::Some("CSV"),
23653            Self::Bak => std::option::Option::Some("BAK"),
23654            Self::UnknownValue(u) => u.0.name(),
23655        }
23656    }
23657}
23658
23659impl std::default::Default for SqlFileType {
23660    fn default() -> Self {
23661        use std::convert::From;
23662        Self::from(0)
23663    }
23664}
23665
23666impl std::fmt::Display for SqlFileType {
23667    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23668        wkt::internal::display_enum(f, self.name(), self.value())
23669    }
23670}
23671
23672impl std::convert::From<i32> for SqlFileType {
23673    fn from(value: i32) -> Self {
23674        match value {
23675            0 => Self::Unspecified,
23676            1 => Self::Sql,
23677            2 => Self::Csv,
23678            4 => Self::Bak,
23679            _ => Self::UnknownValue(sql_file_type::UnknownValue(
23680                wkt::internal::UnknownEnumValue::Integer(value),
23681            )),
23682        }
23683    }
23684}
23685
23686impl std::convert::From<&str> for SqlFileType {
23687    fn from(value: &str) -> Self {
23688        use std::string::ToString;
23689        match value {
23690            "SQL_FILE_TYPE_UNSPECIFIED" => Self::Unspecified,
23691            "SQL" => Self::Sql,
23692            "CSV" => Self::Csv,
23693            "BAK" => Self::Bak,
23694            _ => Self::UnknownValue(sql_file_type::UnknownValue(
23695                wkt::internal::UnknownEnumValue::String(value.to_string()),
23696            )),
23697        }
23698    }
23699}
23700
23701impl serde::ser::Serialize for SqlFileType {
23702    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23703    where
23704        S: serde::Serializer,
23705    {
23706        match self {
23707            Self::Unspecified => serializer.serialize_i32(0),
23708            Self::Sql => serializer.serialize_i32(1),
23709            Self::Csv => serializer.serialize_i32(2),
23710            Self::Bak => serializer.serialize_i32(4),
23711            Self::UnknownValue(u) => u.0.serialize(serializer),
23712        }
23713    }
23714}
23715
23716impl<'de> serde::de::Deserialize<'de> for SqlFileType {
23717    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23718    where
23719        D: serde::Deserializer<'de>,
23720    {
23721        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFileType>::new(
23722            ".google.cloud.sql.v1.SqlFileType",
23723        ))
23724    }
23725}
23726
23727///
23728/// # Working with unknown values
23729///
23730/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23731/// additional enum variants at any time. Adding new variants is not considered
23732/// a breaking change. Applications should write their code in anticipation of:
23733///
23734/// - New values appearing in future releases of the client library, **and**
23735/// - New values received dynamically, without application changes.
23736///
23737/// Please consult the [Working with enums] section in the user guide for some
23738/// guidelines.
23739///
23740/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23741#[derive(Clone, Debug, PartialEq)]
23742#[non_exhaustive]
23743pub enum BakType {
23744    /// Default type.
23745    Unspecified,
23746    /// Full backup.
23747    Full,
23748    /// Differential backup.
23749    Diff,
23750    /// Transaction Log backup
23751    Tlog,
23752    /// If set, the enum was initialized with an unknown value.
23753    ///
23754    /// Applications can examine the value using [BakType::value] or
23755    /// [BakType::name].
23756    UnknownValue(bak_type::UnknownValue),
23757}
23758
23759#[doc(hidden)]
23760pub mod bak_type {
23761    #[allow(unused_imports)]
23762    use super::*;
23763    #[derive(Clone, Debug, PartialEq)]
23764    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23765}
23766
23767impl BakType {
23768    /// Gets the enum value.
23769    ///
23770    /// Returns `None` if the enum contains an unknown value deserialized from
23771    /// the string representation of enums.
23772    pub fn value(&self) -> std::option::Option<i32> {
23773        match self {
23774            Self::Unspecified => std::option::Option::Some(0),
23775            Self::Full => std::option::Option::Some(1),
23776            Self::Diff => std::option::Option::Some(2),
23777            Self::Tlog => std::option::Option::Some(3),
23778            Self::UnknownValue(u) => u.0.value(),
23779        }
23780    }
23781
23782    /// Gets the enum value as a string.
23783    ///
23784    /// Returns `None` if the enum contains an unknown value deserialized from
23785    /// the integer representation of enums.
23786    pub fn name(&self) -> std::option::Option<&str> {
23787        match self {
23788            Self::Unspecified => std::option::Option::Some("BAK_TYPE_UNSPECIFIED"),
23789            Self::Full => std::option::Option::Some("FULL"),
23790            Self::Diff => std::option::Option::Some("DIFF"),
23791            Self::Tlog => std::option::Option::Some("TLOG"),
23792            Self::UnknownValue(u) => u.0.name(),
23793        }
23794    }
23795}
23796
23797impl std::default::Default for BakType {
23798    fn default() -> Self {
23799        use std::convert::From;
23800        Self::from(0)
23801    }
23802}
23803
23804impl std::fmt::Display for BakType {
23805    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23806        wkt::internal::display_enum(f, self.name(), self.value())
23807    }
23808}
23809
23810impl std::convert::From<i32> for BakType {
23811    fn from(value: i32) -> Self {
23812        match value {
23813            0 => Self::Unspecified,
23814            1 => Self::Full,
23815            2 => Self::Diff,
23816            3 => Self::Tlog,
23817            _ => Self::UnknownValue(bak_type::UnknownValue(
23818                wkt::internal::UnknownEnumValue::Integer(value),
23819            )),
23820        }
23821    }
23822}
23823
23824impl std::convert::From<&str> for BakType {
23825    fn from(value: &str) -> Self {
23826        use std::string::ToString;
23827        match value {
23828            "BAK_TYPE_UNSPECIFIED" => Self::Unspecified,
23829            "FULL" => Self::Full,
23830            "DIFF" => Self::Diff,
23831            "TLOG" => Self::Tlog,
23832            _ => Self::UnknownValue(bak_type::UnknownValue(
23833                wkt::internal::UnknownEnumValue::String(value.to_string()),
23834            )),
23835        }
23836    }
23837}
23838
23839impl serde::ser::Serialize for BakType {
23840    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23841    where
23842        S: serde::Serializer,
23843    {
23844        match self {
23845            Self::Unspecified => serializer.serialize_i32(0),
23846            Self::Full => serializer.serialize_i32(1),
23847            Self::Diff => serializer.serialize_i32(2),
23848            Self::Tlog => serializer.serialize_i32(3),
23849            Self::UnknownValue(u) => u.0.serialize(serializer),
23850        }
23851    }
23852}
23853
23854impl<'de> serde::de::Deserialize<'de> for BakType {
23855    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23856    where
23857        D: serde::Deserializer<'de>,
23858    {
23859        deserializer.deserialize_any(wkt::internal::EnumVisitor::<BakType>::new(
23860            ".google.cloud.sql.v1.BakType",
23861        ))
23862    }
23863}
23864
23865///
23866/// # Working with unknown values
23867///
23868/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23869/// additional enum variants at any time. Adding new variants is not considered
23870/// a breaking change. Applications should write their code in anticipation of:
23871///
23872/// - New values appearing in future releases of the client library, **and**
23873/// - New values received dynamically, without application changes.
23874///
23875/// Please consult the [Working with enums] section in the user guide for some
23876/// guidelines.
23877///
23878/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23879#[derive(Clone, Debug, PartialEq)]
23880#[non_exhaustive]
23881pub enum SqlBackendType {
23882    /// This is an unknown backend type for instance.
23883    Unspecified,
23884    /// V1 speckle instance.
23885    #[deprecated]
23886    FirstGen,
23887    /// V2 speckle instance.
23888    SecondGen,
23889    /// On premises instance.
23890    External,
23891    /// If set, the enum was initialized with an unknown value.
23892    ///
23893    /// Applications can examine the value using [SqlBackendType::value] or
23894    /// [SqlBackendType::name].
23895    UnknownValue(sql_backend_type::UnknownValue),
23896}
23897
23898#[doc(hidden)]
23899pub mod sql_backend_type {
23900    #[allow(unused_imports)]
23901    use super::*;
23902    #[derive(Clone, Debug, PartialEq)]
23903    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23904}
23905
23906impl SqlBackendType {
23907    /// Gets the enum value.
23908    ///
23909    /// Returns `None` if the enum contains an unknown value deserialized from
23910    /// the string representation of enums.
23911    pub fn value(&self) -> std::option::Option<i32> {
23912        match self {
23913            Self::Unspecified => std::option::Option::Some(0),
23914            Self::FirstGen => std::option::Option::Some(1),
23915            Self::SecondGen => std::option::Option::Some(2),
23916            Self::External => std::option::Option::Some(3),
23917            Self::UnknownValue(u) => u.0.value(),
23918        }
23919    }
23920
23921    /// Gets the enum value as a string.
23922    ///
23923    /// Returns `None` if the enum contains an unknown value deserialized from
23924    /// the integer representation of enums.
23925    pub fn name(&self) -> std::option::Option<&str> {
23926        match self {
23927            Self::Unspecified => std::option::Option::Some("SQL_BACKEND_TYPE_UNSPECIFIED"),
23928            Self::FirstGen => std::option::Option::Some("FIRST_GEN"),
23929            Self::SecondGen => std::option::Option::Some("SECOND_GEN"),
23930            Self::External => std::option::Option::Some("EXTERNAL"),
23931            Self::UnknownValue(u) => u.0.name(),
23932        }
23933    }
23934}
23935
23936impl std::default::Default for SqlBackendType {
23937    fn default() -> Self {
23938        use std::convert::From;
23939        Self::from(0)
23940    }
23941}
23942
23943impl std::fmt::Display for SqlBackendType {
23944    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23945        wkt::internal::display_enum(f, self.name(), self.value())
23946    }
23947}
23948
23949impl std::convert::From<i32> for SqlBackendType {
23950    fn from(value: i32) -> Self {
23951        match value {
23952            0 => Self::Unspecified,
23953            1 => Self::FirstGen,
23954            2 => Self::SecondGen,
23955            3 => Self::External,
23956            _ => Self::UnknownValue(sql_backend_type::UnknownValue(
23957                wkt::internal::UnknownEnumValue::Integer(value),
23958            )),
23959        }
23960    }
23961}
23962
23963impl std::convert::From<&str> for SqlBackendType {
23964    fn from(value: &str) -> Self {
23965        use std::string::ToString;
23966        match value {
23967            "SQL_BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
23968            "FIRST_GEN" => Self::FirstGen,
23969            "SECOND_GEN" => Self::SecondGen,
23970            "EXTERNAL" => Self::External,
23971            _ => Self::UnknownValue(sql_backend_type::UnknownValue(
23972                wkt::internal::UnknownEnumValue::String(value.to_string()),
23973            )),
23974        }
23975    }
23976}
23977
23978impl serde::ser::Serialize for SqlBackendType {
23979    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23980    where
23981        S: serde::Serializer,
23982    {
23983        match self {
23984            Self::Unspecified => serializer.serialize_i32(0),
23985            Self::FirstGen => serializer.serialize_i32(1),
23986            Self::SecondGen => serializer.serialize_i32(2),
23987            Self::External => serializer.serialize_i32(3),
23988            Self::UnknownValue(u) => u.0.serialize(serializer),
23989        }
23990    }
23991}
23992
23993impl<'de> serde::de::Deserialize<'de> for SqlBackendType {
23994    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23995    where
23996        D: serde::Deserializer<'de>,
23997    {
23998        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackendType>::new(
23999            ".google.cloud.sql.v1.SqlBackendType",
24000        ))
24001    }
24002}
24003
24004///
24005/// # Working with unknown values
24006///
24007/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24008/// additional enum variants at any time. Adding new variants is not considered
24009/// a breaking change. Applications should write their code in anticipation of:
24010///
24011/// - New values appearing in future releases of the client library, **and**
24012/// - New values received dynamically, without application changes.
24013///
24014/// Please consult the [Working with enums] section in the user guide for some
24015/// guidelines.
24016///
24017/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24018#[derive(Clone, Debug, PartialEq)]
24019#[non_exhaustive]
24020pub enum SqlIpAddressType {
24021    /// This is an unknown IP address type.
24022    Unspecified,
24023    /// IP address the customer is supposed to connect to. Usually this is the
24024    /// load balancer's IP address
24025    Primary,
24026    /// Source IP address of the connection a read replica establishes to its
24027    /// external primary instance. This IP address can be allowlisted by the
24028    /// customer in case it has a firewall that filters incoming connection to its
24029    /// on premises primary instance.
24030    Outgoing,
24031    /// Private IP used when using private IPs and network peering.
24032    Private,
24033    /// V1 IP of a migrated instance. We want the user to
24034    /// decommission this IP as soon as the migration is complete.
24035    /// Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
24036    Migrated1StGen,
24037    /// If set, the enum was initialized with an unknown value.
24038    ///
24039    /// Applications can examine the value using [SqlIpAddressType::value] or
24040    /// [SqlIpAddressType::name].
24041    UnknownValue(sql_ip_address_type::UnknownValue),
24042}
24043
24044#[doc(hidden)]
24045pub mod sql_ip_address_type {
24046    #[allow(unused_imports)]
24047    use super::*;
24048    #[derive(Clone, Debug, PartialEq)]
24049    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24050}
24051
24052impl SqlIpAddressType {
24053    /// Gets the enum value.
24054    ///
24055    /// Returns `None` if the enum contains an unknown value deserialized from
24056    /// the string representation of enums.
24057    pub fn value(&self) -> std::option::Option<i32> {
24058        match self {
24059            Self::Unspecified => std::option::Option::Some(0),
24060            Self::Primary => std::option::Option::Some(1),
24061            Self::Outgoing => std::option::Option::Some(2),
24062            Self::Private => std::option::Option::Some(3),
24063            Self::Migrated1StGen => std::option::Option::Some(4),
24064            Self::UnknownValue(u) => u.0.value(),
24065        }
24066    }
24067
24068    /// Gets the enum value as a string.
24069    ///
24070    /// Returns `None` if the enum contains an unknown value deserialized from
24071    /// the integer representation of enums.
24072    pub fn name(&self) -> std::option::Option<&str> {
24073        match self {
24074            Self::Unspecified => std::option::Option::Some("SQL_IP_ADDRESS_TYPE_UNSPECIFIED"),
24075            Self::Primary => std::option::Option::Some("PRIMARY"),
24076            Self::Outgoing => std::option::Option::Some("OUTGOING"),
24077            Self::Private => std::option::Option::Some("PRIVATE"),
24078            Self::Migrated1StGen => std::option::Option::Some("MIGRATED_1ST_GEN"),
24079            Self::UnknownValue(u) => u.0.name(),
24080        }
24081    }
24082}
24083
24084impl std::default::Default for SqlIpAddressType {
24085    fn default() -> Self {
24086        use std::convert::From;
24087        Self::from(0)
24088    }
24089}
24090
24091impl std::fmt::Display for SqlIpAddressType {
24092    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24093        wkt::internal::display_enum(f, self.name(), self.value())
24094    }
24095}
24096
24097impl std::convert::From<i32> for SqlIpAddressType {
24098    fn from(value: i32) -> Self {
24099        match value {
24100            0 => Self::Unspecified,
24101            1 => Self::Primary,
24102            2 => Self::Outgoing,
24103            3 => Self::Private,
24104            4 => Self::Migrated1StGen,
24105            _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
24106                wkt::internal::UnknownEnumValue::Integer(value),
24107            )),
24108        }
24109    }
24110}
24111
24112impl std::convert::From<&str> for SqlIpAddressType {
24113    fn from(value: &str) -> Self {
24114        use std::string::ToString;
24115        match value {
24116            "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" => Self::Unspecified,
24117            "PRIMARY" => Self::Primary,
24118            "OUTGOING" => Self::Outgoing,
24119            "PRIVATE" => Self::Private,
24120            "MIGRATED_1ST_GEN" => Self::Migrated1StGen,
24121            _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
24122                wkt::internal::UnknownEnumValue::String(value.to_string()),
24123            )),
24124        }
24125    }
24126}
24127
24128impl serde::ser::Serialize for SqlIpAddressType {
24129    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24130    where
24131        S: serde::Serializer,
24132    {
24133        match self {
24134            Self::Unspecified => serializer.serialize_i32(0),
24135            Self::Primary => serializer.serialize_i32(1),
24136            Self::Outgoing => serializer.serialize_i32(2),
24137            Self::Private => serializer.serialize_i32(3),
24138            Self::Migrated1StGen => serializer.serialize_i32(4),
24139            Self::UnknownValue(u) => u.0.serialize(serializer),
24140        }
24141    }
24142}
24143
24144impl<'de> serde::de::Deserialize<'de> for SqlIpAddressType {
24145    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24146    where
24147        D: serde::Deserializer<'de>,
24148    {
24149        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlIpAddressType>::new(
24150            ".google.cloud.sql.v1.SqlIpAddressType",
24151        ))
24152    }
24153}
24154
24155/// The database engine type and version.
24156///
24157/// # Working with unknown values
24158///
24159/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24160/// additional enum variants at any time. Adding new variants is not considered
24161/// a breaking change. Applications should write their code in anticipation of:
24162///
24163/// - New values appearing in future releases of the client library, **and**
24164/// - New values received dynamically, without application changes.
24165///
24166/// Please consult the [Working with enums] section in the user guide for some
24167/// guidelines.
24168///
24169/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24170#[derive(Clone, Debug, PartialEq)]
24171#[non_exhaustive]
24172pub enum SqlDatabaseVersion {
24173    /// This is an unknown database version.
24174    Unspecified,
24175    /// The database version is MySQL 5.1.
24176    #[deprecated]
24177    Mysql51,
24178    /// The database version is MySQL 5.5.
24179    #[deprecated]
24180    Mysql55,
24181    /// The database version is MySQL 5.6.
24182    Mysql56,
24183    /// The database version is MySQL 5.7.
24184    Mysql57,
24185    /// The database version is SQL Server 2017 Standard.
24186    Sqlserver2017Standard,
24187    /// The database version is SQL Server 2017 Enterprise.
24188    Sqlserver2017Enterprise,
24189    /// The database version is SQL Server 2017 Express.
24190    Sqlserver2017Express,
24191    /// The database version is SQL Server 2017 Web.
24192    Sqlserver2017Web,
24193    /// The database version is PostgreSQL 9.6.
24194    Postgres96,
24195    /// The database version is PostgreSQL 10.
24196    Postgres10,
24197    /// The database version is PostgreSQL 11.
24198    Postgres11,
24199    /// The database version is PostgreSQL 12.
24200    Postgres12,
24201    /// The database version is PostgreSQL 13.
24202    Postgres13,
24203    /// The database version is PostgreSQL 14.
24204    Postgres14,
24205    /// The database version is PostgreSQL 15.
24206    Postgres15,
24207    /// The database version is PostgreSQL 16.
24208    Postgres16,
24209    /// The database version is PostgreSQL 17.
24210    Postgres17,
24211    /// The database version is PostgreSQL 18.
24212    Postgres18,
24213    /// The database version is MySQL 8.
24214    Mysql80,
24215    /// The database major version is MySQL 8.0 and the minor version is 18.
24216    Mysql8018,
24217    /// The database major version is MySQL 8.0 and the minor version is 26.
24218    Mysql8026,
24219    /// The database major version is MySQL 8.0 and the minor version is 27.
24220    Mysql8027,
24221    /// The database major version is MySQL 8.0 and the minor version is 28.
24222    Mysql8028,
24223    /// The database major version is MySQL 8.0 and the minor version is 29.
24224    #[deprecated]
24225    Mysql8029,
24226    /// The database major version is MySQL 8.0 and the minor version is 30.
24227    Mysql8030,
24228    /// The database major version is MySQL 8.0 and the minor version is 31.
24229    Mysql8031,
24230    /// The database major version is MySQL 8.0 and the minor version is 32.
24231    Mysql8032,
24232    /// The database major version is MySQL 8.0 and the minor version is 33.
24233    Mysql8033,
24234    /// The database major version is MySQL 8.0 and the minor version is 34.
24235    Mysql8034,
24236    /// The database major version is MySQL 8.0 and the minor version is 35.
24237    Mysql8035,
24238    /// The database major version is MySQL 8.0 and the minor version is 36.
24239    Mysql8036,
24240    /// The database major version is MySQL 8.0 and the minor version is 37.
24241    Mysql8037,
24242    /// The database major version is MySQL 8.0 and the minor version is 38.
24243    Mysql8038,
24244    /// The database major version is MySQL 8.0 and the minor version is 39.
24245    Mysql8039,
24246    /// The database major version is MySQL 8.0 and the minor version is 40.
24247    Mysql8040,
24248    /// The database version is MySQL 8.4.
24249    Mysql84,
24250    /// The database version is MySQL 8.4 and the patch version is 0.
24251    Mysql840,
24252    /// The database version is SQL Server 2019 Standard.
24253    Sqlserver2019Standard,
24254    /// The database version is SQL Server 2019 Enterprise.
24255    Sqlserver2019Enterprise,
24256    /// The database version is SQL Server 2019 Express.
24257    Sqlserver2019Express,
24258    /// The database version is SQL Server 2019 Web.
24259    Sqlserver2019Web,
24260    /// The database version is SQL Server 2022 Standard.
24261    Sqlserver2022Standard,
24262    /// The database version is SQL Server 2022 Enterprise.
24263    Sqlserver2022Enterprise,
24264    /// The database version is SQL Server 2022 Express.
24265    Sqlserver2022Express,
24266    /// The database version is SQL Server 2022 Web.
24267    Sqlserver2022Web,
24268    /// If set, the enum was initialized with an unknown value.
24269    ///
24270    /// Applications can examine the value using [SqlDatabaseVersion::value] or
24271    /// [SqlDatabaseVersion::name].
24272    UnknownValue(sql_database_version::UnknownValue),
24273}
24274
24275#[doc(hidden)]
24276pub mod sql_database_version {
24277    #[allow(unused_imports)]
24278    use super::*;
24279    #[derive(Clone, Debug, PartialEq)]
24280    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24281}
24282
24283impl SqlDatabaseVersion {
24284    /// Gets the enum value.
24285    ///
24286    /// Returns `None` if the enum contains an unknown value deserialized from
24287    /// the string representation of enums.
24288    pub fn value(&self) -> std::option::Option<i32> {
24289        match self {
24290            Self::Unspecified => std::option::Option::Some(0),
24291            Self::Mysql51 => std::option::Option::Some(2),
24292            Self::Mysql55 => std::option::Option::Some(3),
24293            Self::Mysql56 => std::option::Option::Some(5),
24294            Self::Mysql57 => std::option::Option::Some(6),
24295            Self::Sqlserver2017Standard => std::option::Option::Some(11),
24296            Self::Sqlserver2017Enterprise => std::option::Option::Some(14),
24297            Self::Sqlserver2017Express => std::option::Option::Some(15),
24298            Self::Sqlserver2017Web => std::option::Option::Some(16),
24299            Self::Postgres96 => std::option::Option::Some(9),
24300            Self::Postgres10 => std::option::Option::Some(18),
24301            Self::Postgres11 => std::option::Option::Some(10),
24302            Self::Postgres12 => std::option::Option::Some(19),
24303            Self::Postgres13 => std::option::Option::Some(23),
24304            Self::Postgres14 => std::option::Option::Some(110),
24305            Self::Postgres15 => std::option::Option::Some(172),
24306            Self::Postgres16 => std::option::Option::Some(272),
24307            Self::Postgres17 => std::option::Option::Some(408),
24308            Self::Postgres18 => std::option::Option::Some(557),
24309            Self::Mysql80 => std::option::Option::Some(20),
24310            Self::Mysql8018 => std::option::Option::Some(41),
24311            Self::Mysql8026 => std::option::Option::Some(85),
24312            Self::Mysql8027 => std::option::Option::Some(111),
24313            Self::Mysql8028 => std::option::Option::Some(132),
24314            Self::Mysql8029 => std::option::Option::Some(148),
24315            Self::Mysql8030 => std::option::Option::Some(174),
24316            Self::Mysql8031 => std::option::Option::Some(197),
24317            Self::Mysql8032 => std::option::Option::Some(213),
24318            Self::Mysql8033 => std::option::Option::Some(238),
24319            Self::Mysql8034 => std::option::Option::Some(239),
24320            Self::Mysql8035 => std::option::Option::Some(240),
24321            Self::Mysql8036 => std::option::Option::Some(241),
24322            Self::Mysql8037 => std::option::Option::Some(355),
24323            Self::Mysql8038 => std::option::Option::Some(356),
24324            Self::Mysql8039 => std::option::Option::Some(357),
24325            Self::Mysql8040 => std::option::Option::Some(358),
24326            Self::Mysql84 => std::option::Option::Some(398),
24327            Self::Mysql840 => std::option::Option::Some(399),
24328            Self::Sqlserver2019Standard => std::option::Option::Some(26),
24329            Self::Sqlserver2019Enterprise => std::option::Option::Some(27),
24330            Self::Sqlserver2019Express => std::option::Option::Some(28),
24331            Self::Sqlserver2019Web => std::option::Option::Some(29),
24332            Self::Sqlserver2022Standard => std::option::Option::Some(199),
24333            Self::Sqlserver2022Enterprise => std::option::Option::Some(200),
24334            Self::Sqlserver2022Express => std::option::Option::Some(201),
24335            Self::Sqlserver2022Web => std::option::Option::Some(202),
24336            Self::UnknownValue(u) => u.0.value(),
24337        }
24338    }
24339
24340    /// Gets the enum value as a string.
24341    ///
24342    /// Returns `None` if the enum contains an unknown value deserialized from
24343    /// the integer representation of enums.
24344    pub fn name(&self) -> std::option::Option<&str> {
24345        match self {
24346            Self::Unspecified => std::option::Option::Some("SQL_DATABASE_VERSION_UNSPECIFIED"),
24347            Self::Mysql51 => std::option::Option::Some("MYSQL_5_1"),
24348            Self::Mysql55 => std::option::Option::Some("MYSQL_5_5"),
24349            Self::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
24350            Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
24351            Self::Sqlserver2017Standard => std::option::Option::Some("SQLSERVER_2017_STANDARD"),
24352            Self::Sqlserver2017Enterprise => std::option::Option::Some("SQLSERVER_2017_ENTERPRISE"),
24353            Self::Sqlserver2017Express => std::option::Option::Some("SQLSERVER_2017_EXPRESS"),
24354            Self::Sqlserver2017Web => std::option::Option::Some("SQLSERVER_2017_WEB"),
24355            Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
24356            Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
24357            Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
24358            Self::Postgres12 => std::option::Option::Some("POSTGRES_12"),
24359            Self::Postgres13 => std::option::Option::Some("POSTGRES_13"),
24360            Self::Postgres14 => std::option::Option::Some("POSTGRES_14"),
24361            Self::Postgres15 => std::option::Option::Some("POSTGRES_15"),
24362            Self::Postgres16 => std::option::Option::Some("POSTGRES_16"),
24363            Self::Postgres17 => std::option::Option::Some("POSTGRES_17"),
24364            Self::Postgres18 => std::option::Option::Some("POSTGRES_18"),
24365            Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
24366            Self::Mysql8018 => std::option::Option::Some("MYSQL_8_0_18"),
24367            Self::Mysql8026 => std::option::Option::Some("MYSQL_8_0_26"),
24368            Self::Mysql8027 => std::option::Option::Some("MYSQL_8_0_27"),
24369            Self::Mysql8028 => std::option::Option::Some("MYSQL_8_0_28"),
24370            Self::Mysql8029 => std::option::Option::Some("MYSQL_8_0_29"),
24371            Self::Mysql8030 => std::option::Option::Some("MYSQL_8_0_30"),
24372            Self::Mysql8031 => std::option::Option::Some("MYSQL_8_0_31"),
24373            Self::Mysql8032 => std::option::Option::Some("MYSQL_8_0_32"),
24374            Self::Mysql8033 => std::option::Option::Some("MYSQL_8_0_33"),
24375            Self::Mysql8034 => std::option::Option::Some("MYSQL_8_0_34"),
24376            Self::Mysql8035 => std::option::Option::Some("MYSQL_8_0_35"),
24377            Self::Mysql8036 => std::option::Option::Some("MYSQL_8_0_36"),
24378            Self::Mysql8037 => std::option::Option::Some("MYSQL_8_0_37"),
24379            Self::Mysql8038 => std::option::Option::Some("MYSQL_8_0_38"),
24380            Self::Mysql8039 => std::option::Option::Some("MYSQL_8_0_39"),
24381            Self::Mysql8040 => std::option::Option::Some("MYSQL_8_0_40"),
24382            Self::Mysql84 => std::option::Option::Some("MYSQL_8_4"),
24383            Self::Mysql840 => std::option::Option::Some("MYSQL_8_4_0"),
24384            Self::Sqlserver2019Standard => std::option::Option::Some("SQLSERVER_2019_STANDARD"),
24385            Self::Sqlserver2019Enterprise => std::option::Option::Some("SQLSERVER_2019_ENTERPRISE"),
24386            Self::Sqlserver2019Express => std::option::Option::Some("SQLSERVER_2019_EXPRESS"),
24387            Self::Sqlserver2019Web => std::option::Option::Some("SQLSERVER_2019_WEB"),
24388            Self::Sqlserver2022Standard => std::option::Option::Some("SQLSERVER_2022_STANDARD"),
24389            Self::Sqlserver2022Enterprise => std::option::Option::Some("SQLSERVER_2022_ENTERPRISE"),
24390            Self::Sqlserver2022Express => std::option::Option::Some("SQLSERVER_2022_EXPRESS"),
24391            Self::Sqlserver2022Web => std::option::Option::Some("SQLSERVER_2022_WEB"),
24392            Self::UnknownValue(u) => u.0.name(),
24393        }
24394    }
24395}
24396
24397impl std::default::Default for SqlDatabaseVersion {
24398    fn default() -> Self {
24399        use std::convert::From;
24400        Self::from(0)
24401    }
24402}
24403
24404impl std::fmt::Display for SqlDatabaseVersion {
24405    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24406        wkt::internal::display_enum(f, self.name(), self.value())
24407    }
24408}
24409
24410impl std::convert::From<i32> for SqlDatabaseVersion {
24411    fn from(value: i32) -> Self {
24412        match value {
24413            0 => Self::Unspecified,
24414            2 => Self::Mysql51,
24415            3 => Self::Mysql55,
24416            5 => Self::Mysql56,
24417            6 => Self::Mysql57,
24418            9 => Self::Postgres96,
24419            10 => Self::Postgres11,
24420            11 => Self::Sqlserver2017Standard,
24421            14 => Self::Sqlserver2017Enterprise,
24422            15 => Self::Sqlserver2017Express,
24423            16 => Self::Sqlserver2017Web,
24424            18 => Self::Postgres10,
24425            19 => Self::Postgres12,
24426            20 => Self::Mysql80,
24427            23 => Self::Postgres13,
24428            26 => Self::Sqlserver2019Standard,
24429            27 => Self::Sqlserver2019Enterprise,
24430            28 => Self::Sqlserver2019Express,
24431            29 => Self::Sqlserver2019Web,
24432            41 => Self::Mysql8018,
24433            85 => Self::Mysql8026,
24434            110 => Self::Postgres14,
24435            111 => Self::Mysql8027,
24436            132 => Self::Mysql8028,
24437            148 => Self::Mysql8029,
24438            172 => Self::Postgres15,
24439            174 => Self::Mysql8030,
24440            197 => Self::Mysql8031,
24441            199 => Self::Sqlserver2022Standard,
24442            200 => Self::Sqlserver2022Enterprise,
24443            201 => Self::Sqlserver2022Express,
24444            202 => Self::Sqlserver2022Web,
24445            213 => Self::Mysql8032,
24446            238 => Self::Mysql8033,
24447            239 => Self::Mysql8034,
24448            240 => Self::Mysql8035,
24449            241 => Self::Mysql8036,
24450            272 => Self::Postgres16,
24451            355 => Self::Mysql8037,
24452            356 => Self::Mysql8038,
24453            357 => Self::Mysql8039,
24454            358 => Self::Mysql8040,
24455            398 => Self::Mysql84,
24456            399 => Self::Mysql840,
24457            408 => Self::Postgres17,
24458            557 => Self::Postgres18,
24459            _ => Self::UnknownValue(sql_database_version::UnknownValue(
24460                wkt::internal::UnknownEnumValue::Integer(value),
24461            )),
24462        }
24463    }
24464}
24465
24466impl std::convert::From<&str> for SqlDatabaseVersion {
24467    fn from(value: &str) -> Self {
24468        use std::string::ToString;
24469        match value {
24470            "SQL_DATABASE_VERSION_UNSPECIFIED" => Self::Unspecified,
24471            "MYSQL_5_1" => Self::Mysql51,
24472            "MYSQL_5_5" => Self::Mysql55,
24473            "MYSQL_5_6" => Self::Mysql56,
24474            "MYSQL_5_7" => Self::Mysql57,
24475            "SQLSERVER_2017_STANDARD" => Self::Sqlserver2017Standard,
24476            "SQLSERVER_2017_ENTERPRISE" => Self::Sqlserver2017Enterprise,
24477            "SQLSERVER_2017_EXPRESS" => Self::Sqlserver2017Express,
24478            "SQLSERVER_2017_WEB" => Self::Sqlserver2017Web,
24479            "POSTGRES_9_6" => Self::Postgres96,
24480            "POSTGRES_10" => Self::Postgres10,
24481            "POSTGRES_11" => Self::Postgres11,
24482            "POSTGRES_12" => Self::Postgres12,
24483            "POSTGRES_13" => Self::Postgres13,
24484            "POSTGRES_14" => Self::Postgres14,
24485            "POSTGRES_15" => Self::Postgres15,
24486            "POSTGRES_16" => Self::Postgres16,
24487            "POSTGRES_17" => Self::Postgres17,
24488            "POSTGRES_18" => Self::Postgres18,
24489            "MYSQL_8_0" => Self::Mysql80,
24490            "MYSQL_8_0_18" => Self::Mysql8018,
24491            "MYSQL_8_0_26" => Self::Mysql8026,
24492            "MYSQL_8_0_27" => Self::Mysql8027,
24493            "MYSQL_8_0_28" => Self::Mysql8028,
24494            "MYSQL_8_0_29" => Self::Mysql8029,
24495            "MYSQL_8_0_30" => Self::Mysql8030,
24496            "MYSQL_8_0_31" => Self::Mysql8031,
24497            "MYSQL_8_0_32" => Self::Mysql8032,
24498            "MYSQL_8_0_33" => Self::Mysql8033,
24499            "MYSQL_8_0_34" => Self::Mysql8034,
24500            "MYSQL_8_0_35" => Self::Mysql8035,
24501            "MYSQL_8_0_36" => Self::Mysql8036,
24502            "MYSQL_8_0_37" => Self::Mysql8037,
24503            "MYSQL_8_0_38" => Self::Mysql8038,
24504            "MYSQL_8_0_39" => Self::Mysql8039,
24505            "MYSQL_8_0_40" => Self::Mysql8040,
24506            "MYSQL_8_4" => Self::Mysql84,
24507            "MYSQL_8_4_0" => Self::Mysql840,
24508            "SQLSERVER_2019_STANDARD" => Self::Sqlserver2019Standard,
24509            "SQLSERVER_2019_ENTERPRISE" => Self::Sqlserver2019Enterprise,
24510            "SQLSERVER_2019_EXPRESS" => Self::Sqlserver2019Express,
24511            "SQLSERVER_2019_WEB" => Self::Sqlserver2019Web,
24512            "SQLSERVER_2022_STANDARD" => Self::Sqlserver2022Standard,
24513            "SQLSERVER_2022_ENTERPRISE" => Self::Sqlserver2022Enterprise,
24514            "SQLSERVER_2022_EXPRESS" => Self::Sqlserver2022Express,
24515            "SQLSERVER_2022_WEB" => Self::Sqlserver2022Web,
24516            _ => Self::UnknownValue(sql_database_version::UnknownValue(
24517                wkt::internal::UnknownEnumValue::String(value.to_string()),
24518            )),
24519        }
24520    }
24521}
24522
24523impl serde::ser::Serialize for SqlDatabaseVersion {
24524    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24525    where
24526        S: serde::Serializer,
24527    {
24528        match self {
24529            Self::Unspecified => serializer.serialize_i32(0),
24530            Self::Mysql51 => serializer.serialize_i32(2),
24531            Self::Mysql55 => serializer.serialize_i32(3),
24532            Self::Mysql56 => serializer.serialize_i32(5),
24533            Self::Mysql57 => serializer.serialize_i32(6),
24534            Self::Sqlserver2017Standard => serializer.serialize_i32(11),
24535            Self::Sqlserver2017Enterprise => serializer.serialize_i32(14),
24536            Self::Sqlserver2017Express => serializer.serialize_i32(15),
24537            Self::Sqlserver2017Web => serializer.serialize_i32(16),
24538            Self::Postgres96 => serializer.serialize_i32(9),
24539            Self::Postgres10 => serializer.serialize_i32(18),
24540            Self::Postgres11 => serializer.serialize_i32(10),
24541            Self::Postgres12 => serializer.serialize_i32(19),
24542            Self::Postgres13 => serializer.serialize_i32(23),
24543            Self::Postgres14 => serializer.serialize_i32(110),
24544            Self::Postgres15 => serializer.serialize_i32(172),
24545            Self::Postgres16 => serializer.serialize_i32(272),
24546            Self::Postgres17 => serializer.serialize_i32(408),
24547            Self::Postgres18 => serializer.serialize_i32(557),
24548            Self::Mysql80 => serializer.serialize_i32(20),
24549            Self::Mysql8018 => serializer.serialize_i32(41),
24550            Self::Mysql8026 => serializer.serialize_i32(85),
24551            Self::Mysql8027 => serializer.serialize_i32(111),
24552            Self::Mysql8028 => serializer.serialize_i32(132),
24553            Self::Mysql8029 => serializer.serialize_i32(148),
24554            Self::Mysql8030 => serializer.serialize_i32(174),
24555            Self::Mysql8031 => serializer.serialize_i32(197),
24556            Self::Mysql8032 => serializer.serialize_i32(213),
24557            Self::Mysql8033 => serializer.serialize_i32(238),
24558            Self::Mysql8034 => serializer.serialize_i32(239),
24559            Self::Mysql8035 => serializer.serialize_i32(240),
24560            Self::Mysql8036 => serializer.serialize_i32(241),
24561            Self::Mysql8037 => serializer.serialize_i32(355),
24562            Self::Mysql8038 => serializer.serialize_i32(356),
24563            Self::Mysql8039 => serializer.serialize_i32(357),
24564            Self::Mysql8040 => serializer.serialize_i32(358),
24565            Self::Mysql84 => serializer.serialize_i32(398),
24566            Self::Mysql840 => serializer.serialize_i32(399),
24567            Self::Sqlserver2019Standard => serializer.serialize_i32(26),
24568            Self::Sqlserver2019Enterprise => serializer.serialize_i32(27),
24569            Self::Sqlserver2019Express => serializer.serialize_i32(28),
24570            Self::Sqlserver2019Web => serializer.serialize_i32(29),
24571            Self::Sqlserver2022Standard => serializer.serialize_i32(199),
24572            Self::Sqlserver2022Enterprise => serializer.serialize_i32(200),
24573            Self::Sqlserver2022Express => serializer.serialize_i32(201),
24574            Self::Sqlserver2022Web => serializer.serialize_i32(202),
24575            Self::UnknownValue(u) => u.0.serialize(serializer),
24576        }
24577    }
24578}
24579
24580impl<'de> serde::de::Deserialize<'de> for SqlDatabaseVersion {
24581    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24582    where
24583        D: serde::Deserializer<'de>,
24584    {
24585        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDatabaseVersion>::new(
24586            ".google.cloud.sql.v1.SqlDatabaseVersion",
24587        ))
24588    }
24589}
24590
24591/// The pricing plan for this instance.
24592///
24593/// # Working with unknown values
24594///
24595/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24596/// additional enum variants at any time. Adding new variants is not considered
24597/// a breaking change. Applications should write their code in anticipation of:
24598///
24599/// - New values appearing in future releases of the client library, **and**
24600/// - New values received dynamically, without application changes.
24601///
24602/// Please consult the [Working with enums] section in the user guide for some
24603/// guidelines.
24604///
24605/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24606#[derive(Clone, Debug, PartialEq)]
24607#[non_exhaustive]
24608pub enum SqlPricingPlan {
24609    /// This is an unknown pricing plan for this instance.
24610    Unspecified,
24611    /// The instance is billed at a monthly flat rate.
24612    Package,
24613    /// The instance is billed per usage.
24614    PerUse,
24615    /// If set, the enum was initialized with an unknown value.
24616    ///
24617    /// Applications can examine the value using [SqlPricingPlan::value] or
24618    /// [SqlPricingPlan::name].
24619    UnknownValue(sql_pricing_plan::UnknownValue),
24620}
24621
24622#[doc(hidden)]
24623pub mod sql_pricing_plan {
24624    #[allow(unused_imports)]
24625    use super::*;
24626    #[derive(Clone, Debug, PartialEq)]
24627    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24628}
24629
24630impl SqlPricingPlan {
24631    /// Gets the enum value.
24632    ///
24633    /// Returns `None` if the enum contains an unknown value deserialized from
24634    /// the string representation of enums.
24635    pub fn value(&self) -> std::option::Option<i32> {
24636        match self {
24637            Self::Unspecified => std::option::Option::Some(0),
24638            Self::Package => std::option::Option::Some(1),
24639            Self::PerUse => std::option::Option::Some(2),
24640            Self::UnknownValue(u) => u.0.value(),
24641        }
24642    }
24643
24644    /// Gets the enum value as a string.
24645    ///
24646    /// Returns `None` if the enum contains an unknown value deserialized from
24647    /// the integer representation of enums.
24648    pub fn name(&self) -> std::option::Option<&str> {
24649        match self {
24650            Self::Unspecified => std::option::Option::Some("SQL_PRICING_PLAN_UNSPECIFIED"),
24651            Self::Package => std::option::Option::Some("PACKAGE"),
24652            Self::PerUse => std::option::Option::Some("PER_USE"),
24653            Self::UnknownValue(u) => u.0.name(),
24654        }
24655    }
24656}
24657
24658impl std::default::Default for SqlPricingPlan {
24659    fn default() -> Self {
24660        use std::convert::From;
24661        Self::from(0)
24662    }
24663}
24664
24665impl std::fmt::Display for SqlPricingPlan {
24666    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24667        wkt::internal::display_enum(f, self.name(), self.value())
24668    }
24669}
24670
24671impl std::convert::From<i32> for SqlPricingPlan {
24672    fn from(value: i32) -> Self {
24673        match value {
24674            0 => Self::Unspecified,
24675            1 => Self::Package,
24676            2 => Self::PerUse,
24677            _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
24678                wkt::internal::UnknownEnumValue::Integer(value),
24679            )),
24680        }
24681    }
24682}
24683
24684impl std::convert::From<&str> for SqlPricingPlan {
24685    fn from(value: &str) -> Self {
24686        use std::string::ToString;
24687        match value {
24688            "SQL_PRICING_PLAN_UNSPECIFIED" => Self::Unspecified,
24689            "PACKAGE" => Self::Package,
24690            "PER_USE" => Self::PerUse,
24691            _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
24692                wkt::internal::UnknownEnumValue::String(value.to_string()),
24693            )),
24694        }
24695    }
24696}
24697
24698impl serde::ser::Serialize for SqlPricingPlan {
24699    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24700    where
24701        S: serde::Serializer,
24702    {
24703        match self {
24704            Self::Unspecified => serializer.serialize_i32(0),
24705            Self::Package => serializer.serialize_i32(1),
24706            Self::PerUse => serializer.serialize_i32(2),
24707            Self::UnknownValue(u) => u.0.serialize(serializer),
24708        }
24709    }
24710}
24711
24712impl<'de> serde::de::Deserialize<'de> for SqlPricingPlan {
24713    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24714    where
24715        D: serde::Deserializer<'de>,
24716    {
24717        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlPricingPlan>::new(
24718            ".google.cloud.sql.v1.SqlPricingPlan",
24719        ))
24720    }
24721}
24722
24723///
24724/// # Working with unknown values
24725///
24726/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24727/// additional enum variants at any time. Adding new variants is not considered
24728/// a breaking change. Applications should write their code in anticipation of:
24729///
24730/// - New values appearing in future releases of the client library, **and**
24731/// - New values received dynamically, without application changes.
24732///
24733/// Please consult the [Working with enums] section in the user guide for some
24734/// guidelines.
24735///
24736/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24737#[derive(Clone, Debug, PartialEq)]
24738#[non_exhaustive]
24739pub enum SqlReplicationType {
24740    /// This is an unknown replication type for a Cloud SQL instance.
24741    Unspecified,
24742    /// The synchronous replication mode for First Generation instances. It is the
24743    /// default value.
24744    Synchronous,
24745    /// The asynchronous replication mode for First Generation instances. It
24746    /// provides a slight performance gain, but if an outage occurs while this
24747    /// option is set to asynchronous, you can lose up to a few seconds of updates
24748    /// to your data.
24749    Asynchronous,
24750    /// If set, the enum was initialized with an unknown value.
24751    ///
24752    /// Applications can examine the value using [SqlReplicationType::value] or
24753    /// [SqlReplicationType::name].
24754    UnknownValue(sql_replication_type::UnknownValue),
24755}
24756
24757#[doc(hidden)]
24758pub mod sql_replication_type {
24759    #[allow(unused_imports)]
24760    use super::*;
24761    #[derive(Clone, Debug, PartialEq)]
24762    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24763}
24764
24765impl SqlReplicationType {
24766    /// Gets the enum value.
24767    ///
24768    /// Returns `None` if the enum contains an unknown value deserialized from
24769    /// the string representation of enums.
24770    pub fn value(&self) -> std::option::Option<i32> {
24771        match self {
24772            Self::Unspecified => std::option::Option::Some(0),
24773            Self::Synchronous => std::option::Option::Some(1),
24774            Self::Asynchronous => std::option::Option::Some(2),
24775            Self::UnknownValue(u) => u.0.value(),
24776        }
24777    }
24778
24779    /// Gets the enum value as a string.
24780    ///
24781    /// Returns `None` if the enum contains an unknown value deserialized from
24782    /// the integer representation of enums.
24783    pub fn name(&self) -> std::option::Option<&str> {
24784        match self {
24785            Self::Unspecified => std::option::Option::Some("SQL_REPLICATION_TYPE_UNSPECIFIED"),
24786            Self::Synchronous => std::option::Option::Some("SYNCHRONOUS"),
24787            Self::Asynchronous => std::option::Option::Some("ASYNCHRONOUS"),
24788            Self::UnknownValue(u) => u.0.name(),
24789        }
24790    }
24791}
24792
24793impl std::default::Default for SqlReplicationType {
24794    fn default() -> Self {
24795        use std::convert::From;
24796        Self::from(0)
24797    }
24798}
24799
24800impl std::fmt::Display for SqlReplicationType {
24801    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24802        wkt::internal::display_enum(f, self.name(), self.value())
24803    }
24804}
24805
24806impl std::convert::From<i32> for SqlReplicationType {
24807    fn from(value: i32) -> Self {
24808        match value {
24809            0 => Self::Unspecified,
24810            1 => Self::Synchronous,
24811            2 => Self::Asynchronous,
24812            _ => Self::UnknownValue(sql_replication_type::UnknownValue(
24813                wkt::internal::UnknownEnumValue::Integer(value),
24814            )),
24815        }
24816    }
24817}
24818
24819impl std::convert::From<&str> for SqlReplicationType {
24820    fn from(value: &str) -> Self {
24821        use std::string::ToString;
24822        match value {
24823            "SQL_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
24824            "SYNCHRONOUS" => Self::Synchronous,
24825            "ASYNCHRONOUS" => Self::Asynchronous,
24826            _ => Self::UnknownValue(sql_replication_type::UnknownValue(
24827                wkt::internal::UnknownEnumValue::String(value.to_string()),
24828            )),
24829        }
24830    }
24831}
24832
24833impl serde::ser::Serialize for SqlReplicationType {
24834    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24835    where
24836        S: serde::Serializer,
24837    {
24838        match self {
24839            Self::Unspecified => serializer.serialize_i32(0),
24840            Self::Synchronous => serializer.serialize_i32(1),
24841            Self::Asynchronous => serializer.serialize_i32(2),
24842            Self::UnknownValue(u) => u.0.serialize(serializer),
24843        }
24844    }
24845}
24846
24847impl<'de> serde::de::Deserialize<'de> for SqlReplicationType {
24848    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24849    where
24850        D: serde::Deserializer<'de>,
24851    {
24852        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlReplicationType>::new(
24853            ".google.cloud.sql.v1.SqlReplicationType",
24854        ))
24855    }
24856}
24857
24858/// The type of disk that is used for a v2 instance to use.
24859///
24860/// # Working with unknown values
24861///
24862/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24863/// additional enum variants at any time. Adding new variants is not considered
24864/// a breaking change. Applications should write their code in anticipation of:
24865///
24866/// - New values appearing in future releases of the client library, **and**
24867/// - New values received dynamically, without application changes.
24868///
24869/// Please consult the [Working with enums] section in the user guide for some
24870/// guidelines.
24871///
24872/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24873#[derive(Clone, Debug, PartialEq)]
24874#[non_exhaustive]
24875pub enum SqlDataDiskType {
24876    /// This is an unknown data disk type.
24877    Unspecified,
24878    /// An SSD data disk.
24879    PdSsd,
24880    /// An HDD data disk.
24881    PdHdd,
24882    /// This field is deprecated and will be removed from a future version of the
24883    /// API.
24884    #[deprecated]
24885    ObsoleteLocalSsd,
24886    /// If set, the enum was initialized with an unknown value.
24887    ///
24888    /// Applications can examine the value using [SqlDataDiskType::value] or
24889    /// [SqlDataDiskType::name].
24890    UnknownValue(sql_data_disk_type::UnknownValue),
24891}
24892
24893#[doc(hidden)]
24894pub mod sql_data_disk_type {
24895    #[allow(unused_imports)]
24896    use super::*;
24897    #[derive(Clone, Debug, PartialEq)]
24898    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24899}
24900
24901impl SqlDataDiskType {
24902    /// Gets the enum value.
24903    ///
24904    /// Returns `None` if the enum contains an unknown value deserialized from
24905    /// the string representation of enums.
24906    pub fn value(&self) -> std::option::Option<i32> {
24907        match self {
24908            Self::Unspecified => std::option::Option::Some(0),
24909            Self::PdSsd => std::option::Option::Some(1),
24910            Self::PdHdd => std::option::Option::Some(2),
24911            Self::ObsoleteLocalSsd => std::option::Option::Some(3),
24912            Self::UnknownValue(u) => u.0.value(),
24913        }
24914    }
24915
24916    /// Gets the enum value as a string.
24917    ///
24918    /// Returns `None` if the enum contains an unknown value deserialized from
24919    /// the integer representation of enums.
24920    pub fn name(&self) -> std::option::Option<&str> {
24921        match self {
24922            Self::Unspecified => std::option::Option::Some("SQL_DATA_DISK_TYPE_UNSPECIFIED"),
24923            Self::PdSsd => std::option::Option::Some("PD_SSD"),
24924            Self::PdHdd => std::option::Option::Some("PD_HDD"),
24925            Self::ObsoleteLocalSsd => std::option::Option::Some("OBSOLETE_LOCAL_SSD"),
24926            Self::UnknownValue(u) => u.0.name(),
24927        }
24928    }
24929}
24930
24931impl std::default::Default for SqlDataDiskType {
24932    fn default() -> Self {
24933        use std::convert::From;
24934        Self::from(0)
24935    }
24936}
24937
24938impl std::fmt::Display for SqlDataDiskType {
24939    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24940        wkt::internal::display_enum(f, self.name(), self.value())
24941    }
24942}
24943
24944impl std::convert::From<i32> for SqlDataDiskType {
24945    fn from(value: i32) -> Self {
24946        match value {
24947            0 => Self::Unspecified,
24948            1 => Self::PdSsd,
24949            2 => Self::PdHdd,
24950            3 => Self::ObsoleteLocalSsd,
24951            _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
24952                wkt::internal::UnknownEnumValue::Integer(value),
24953            )),
24954        }
24955    }
24956}
24957
24958impl std::convert::From<&str> for SqlDataDiskType {
24959    fn from(value: &str) -> Self {
24960        use std::string::ToString;
24961        match value {
24962            "SQL_DATA_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
24963            "PD_SSD" => Self::PdSsd,
24964            "PD_HDD" => Self::PdHdd,
24965            "OBSOLETE_LOCAL_SSD" => Self::ObsoleteLocalSsd,
24966            _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
24967                wkt::internal::UnknownEnumValue::String(value.to_string()),
24968            )),
24969        }
24970    }
24971}
24972
24973impl serde::ser::Serialize for SqlDataDiskType {
24974    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24975    where
24976        S: serde::Serializer,
24977    {
24978        match self {
24979            Self::Unspecified => serializer.serialize_i32(0),
24980            Self::PdSsd => serializer.serialize_i32(1),
24981            Self::PdHdd => serializer.serialize_i32(2),
24982            Self::ObsoleteLocalSsd => serializer.serialize_i32(3),
24983            Self::UnknownValue(u) => u.0.serialize(serializer),
24984        }
24985    }
24986}
24987
24988impl<'de> serde::de::Deserialize<'de> for SqlDataDiskType {
24989    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24990    where
24991        D: serde::Deserializer<'de>,
24992    {
24993        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDataDiskType>::new(
24994            ".google.cloud.sql.v1.SqlDataDiskType",
24995        ))
24996    }
24997}
24998
24999/// The availability type of the given Cloud SQL instance.
25000///
25001/// # Working with unknown values
25002///
25003/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25004/// additional enum variants at any time. Adding new variants is not considered
25005/// a breaking change. Applications should write their code in anticipation of:
25006///
25007/// - New values appearing in future releases of the client library, **and**
25008/// - New values received dynamically, without application changes.
25009///
25010/// Please consult the [Working with enums] section in the user guide for some
25011/// guidelines.
25012///
25013/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
25014#[derive(Clone, Debug, PartialEq)]
25015#[non_exhaustive]
25016pub enum SqlAvailabilityType {
25017    /// This is an unknown Availability type.
25018    Unspecified,
25019    /// Zonal available instance.
25020    Zonal,
25021    /// Regional available instance.
25022    Regional,
25023    /// If set, the enum was initialized with an unknown value.
25024    ///
25025    /// Applications can examine the value using [SqlAvailabilityType::value] or
25026    /// [SqlAvailabilityType::name].
25027    UnknownValue(sql_availability_type::UnknownValue),
25028}
25029
25030#[doc(hidden)]
25031pub mod sql_availability_type {
25032    #[allow(unused_imports)]
25033    use super::*;
25034    #[derive(Clone, Debug, PartialEq)]
25035    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25036}
25037
25038impl SqlAvailabilityType {
25039    /// Gets the enum value.
25040    ///
25041    /// Returns `None` if the enum contains an unknown value deserialized from
25042    /// the string representation of enums.
25043    pub fn value(&self) -> std::option::Option<i32> {
25044        match self {
25045            Self::Unspecified => std::option::Option::Some(0),
25046            Self::Zonal => std::option::Option::Some(1),
25047            Self::Regional => std::option::Option::Some(2),
25048            Self::UnknownValue(u) => u.0.value(),
25049        }
25050    }
25051
25052    /// Gets the enum value as a string.
25053    ///
25054    /// Returns `None` if the enum contains an unknown value deserialized from
25055    /// the integer representation of enums.
25056    pub fn name(&self) -> std::option::Option<&str> {
25057        match self {
25058            Self::Unspecified => std::option::Option::Some("SQL_AVAILABILITY_TYPE_UNSPECIFIED"),
25059            Self::Zonal => std::option::Option::Some("ZONAL"),
25060            Self::Regional => std::option::Option::Some("REGIONAL"),
25061            Self::UnknownValue(u) => u.0.name(),
25062        }
25063    }
25064}
25065
25066impl std::default::Default for SqlAvailabilityType {
25067    fn default() -> Self {
25068        use std::convert::From;
25069        Self::from(0)
25070    }
25071}
25072
25073impl std::fmt::Display for SqlAvailabilityType {
25074    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25075        wkt::internal::display_enum(f, self.name(), self.value())
25076    }
25077}
25078
25079impl std::convert::From<i32> for SqlAvailabilityType {
25080    fn from(value: i32) -> Self {
25081        match value {
25082            0 => Self::Unspecified,
25083            1 => Self::Zonal,
25084            2 => Self::Regional,
25085            _ => Self::UnknownValue(sql_availability_type::UnknownValue(
25086                wkt::internal::UnknownEnumValue::Integer(value),
25087            )),
25088        }
25089    }
25090}
25091
25092impl std::convert::From<&str> for SqlAvailabilityType {
25093    fn from(value: &str) -> Self {
25094        use std::string::ToString;
25095        match value {
25096            "SQL_AVAILABILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
25097            "ZONAL" => Self::Zonal,
25098            "REGIONAL" => Self::Regional,
25099            _ => Self::UnknownValue(sql_availability_type::UnknownValue(
25100                wkt::internal::UnknownEnumValue::String(value.to_string()),
25101            )),
25102        }
25103    }
25104}
25105
25106impl serde::ser::Serialize for SqlAvailabilityType {
25107    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25108    where
25109        S: serde::Serializer,
25110    {
25111        match self {
25112            Self::Unspecified => serializer.serialize_i32(0),
25113            Self::Zonal => serializer.serialize_i32(1),
25114            Self::Regional => serializer.serialize_i32(2),
25115            Self::UnknownValue(u) => u.0.serialize(serializer),
25116        }
25117    }
25118}
25119
25120impl<'de> serde::de::Deserialize<'de> for SqlAvailabilityType {
25121    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25122    where
25123        D: serde::Deserializer<'de>,
25124    {
25125        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlAvailabilityType>::new(
25126            ".google.cloud.sql.v1.SqlAvailabilityType",
25127        ))
25128    }
25129}
25130
25131///
25132/// # Working with unknown values
25133///
25134/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25135/// additional enum variants at any time. Adding new variants is not considered
25136/// a breaking change. Applications should write their code in anticipation of:
25137///
25138/// - New values appearing in future releases of the client library, **and**
25139/// - New values received dynamically, without application changes.
25140///
25141/// Please consult the [Working with enums] section in the user guide for some
25142/// guidelines.
25143///
25144/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
25145#[derive(Clone, Debug, PartialEq)]
25146#[non_exhaustive]
25147pub enum SqlUpdateTrack {
25148    /// This is an unknown maintenance timing preference.
25149    Unspecified,
25150    /// For an instance with a scheduled maintenance window, this maintenance
25151    /// timing indicates that the maintenance update is scheduled 7 to 14 days
25152    /// after the notification is sent out. Also referred to as `Week 1` (Console)
25153    /// and `preview` (gcloud CLI).
25154    Canary,
25155    /// For an instance with a scheduled maintenance window, this maintenance
25156    /// timing indicates that the maintenance update is scheduled 15 to 21 days
25157    /// after the notification is sent out. Also referred to as `Week 2` (Console)
25158    /// and `production` (gcloud CLI).
25159    Stable,
25160    /// For instance with a scheduled maintenance window, this maintenance
25161    /// timing indicates that the maintenance update is scheduled 35 to 42 days
25162    /// after the notification is sent out.
25163    Week5,
25164    /// If set, the enum was initialized with an unknown value.
25165    ///
25166    /// Applications can examine the value using [SqlUpdateTrack::value] or
25167    /// [SqlUpdateTrack::name].
25168    UnknownValue(sql_update_track::UnknownValue),
25169}
25170
25171#[doc(hidden)]
25172pub mod sql_update_track {
25173    #[allow(unused_imports)]
25174    use super::*;
25175    #[derive(Clone, Debug, PartialEq)]
25176    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25177}
25178
25179impl SqlUpdateTrack {
25180    /// Gets the enum value.
25181    ///
25182    /// Returns `None` if the enum contains an unknown value deserialized from
25183    /// the string representation of enums.
25184    pub fn value(&self) -> std::option::Option<i32> {
25185        match self {
25186            Self::Unspecified => std::option::Option::Some(0),
25187            Self::Canary => std::option::Option::Some(1),
25188            Self::Stable => std::option::Option::Some(2),
25189            Self::Week5 => std::option::Option::Some(3),
25190            Self::UnknownValue(u) => u.0.value(),
25191        }
25192    }
25193
25194    /// Gets the enum value as a string.
25195    ///
25196    /// Returns `None` if the enum contains an unknown value deserialized from
25197    /// the integer representation of enums.
25198    pub fn name(&self) -> std::option::Option<&str> {
25199        match self {
25200            Self::Unspecified => std::option::Option::Some("SQL_UPDATE_TRACK_UNSPECIFIED"),
25201            Self::Canary => std::option::Option::Some("canary"),
25202            Self::Stable => std::option::Option::Some("stable"),
25203            Self::Week5 => std::option::Option::Some("week5"),
25204            Self::UnknownValue(u) => u.0.name(),
25205        }
25206    }
25207}
25208
25209impl std::default::Default for SqlUpdateTrack {
25210    fn default() -> Self {
25211        use std::convert::From;
25212        Self::from(0)
25213    }
25214}
25215
25216impl std::fmt::Display for SqlUpdateTrack {
25217    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25218        wkt::internal::display_enum(f, self.name(), self.value())
25219    }
25220}
25221
25222impl std::convert::From<i32> for SqlUpdateTrack {
25223    fn from(value: i32) -> Self {
25224        match value {
25225            0 => Self::Unspecified,
25226            1 => Self::Canary,
25227            2 => Self::Stable,
25228            3 => Self::Week5,
25229            _ => Self::UnknownValue(sql_update_track::UnknownValue(
25230                wkt::internal::UnknownEnumValue::Integer(value),
25231            )),
25232        }
25233    }
25234}
25235
25236impl std::convert::From<&str> for SqlUpdateTrack {
25237    fn from(value: &str) -> Self {
25238        use std::string::ToString;
25239        match value {
25240            "SQL_UPDATE_TRACK_UNSPECIFIED" => Self::Unspecified,
25241            "canary" => Self::Canary,
25242            "stable" => Self::Stable,
25243            "week5" => Self::Week5,
25244            _ => Self::UnknownValue(sql_update_track::UnknownValue(
25245                wkt::internal::UnknownEnumValue::String(value.to_string()),
25246            )),
25247        }
25248    }
25249}
25250
25251impl serde::ser::Serialize for SqlUpdateTrack {
25252    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25253    where
25254        S: serde::Serializer,
25255    {
25256        match self {
25257            Self::Unspecified => serializer.serialize_i32(0),
25258            Self::Canary => serializer.serialize_i32(1),
25259            Self::Stable => serializer.serialize_i32(2),
25260            Self::Week5 => serializer.serialize_i32(3),
25261            Self::UnknownValue(u) => u.0.serialize(serializer),
25262        }
25263    }
25264}
25265
25266impl<'de> serde::de::Deserialize<'de> for SqlUpdateTrack {
25267    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25268    where
25269        D: serde::Deserializer<'de>,
25270    {
25271        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUpdateTrack>::new(
25272            ".google.cloud.sql.v1.SqlUpdateTrack",
25273        ))
25274    }
25275}